Trestle

适用于 Ruby on Rails 的现代响应式管理框架。『A modern, responsive admin framework for Ruby on Rails』

Github星跟蹤圖

Trestle

RubyGem
Travis
Coveralls
Code Climate

Demo Site, Demo Source Code

A modern, responsive admin framework for Ruby on Rails

Getting Started

To start using Trestle, first add it to your application's Gemfile:

gem 'trestle'

Run bundle install, and then run the install generator to create the initial configuration file and customization hooks:

$ rails generate trestle:install

Then create your first admin resource:

$ rails generate trestle:resource Article

After restarting your Rails server, visit http://localhost:3000/admin to view your newly created admin. You will find the admin definition in app/admin/articles_admin.rb ready to customize.

Example

Trestle.resource(:posts) do
  # Add a link to this admin in the main navigation
  menu do
    group :blog_management, priority: :first do
      item :posts, icon: "fa fa-file-text-o"
    end
  end

  # Define custom scopes for the index view
  scopes do
    scope :all, default: true
    scope :published
    scope :drafts, -> { Post.unpublished }
  end

  # Define the index view table listing
  table do
    column :title, link: true
    column :author, ->(post) { post.author.name }
    column :published, align: :center do, post, status_tag(icon("fa fa-check"), :success) if post.published?
    end
    column :updated_at, header: "Last Updated", align: :center
    actions
  end

  # Define the form structure for the new & edit actions
  form do
    # Organize fields into tabs and sidebars
    tab :post do
      text_field :title

      # Define custom form fields for easy re-use
      editor :body
    end

    tab :metadata do
      # Layout fields based on a 12-column grid
      row do
        col(sm: 6) { select :author, User.all }
        col(sm: 6) { tag_select :tags }
      end
    end

    sidebar do
      # Render a custom partial: app/views/admin/posts/_sidebar.html.erb
      render "sidebar"
    end
  end
end

Plugins

The following plugins are currently available:, Name, Description, Links, ---, ---, ---, trestle-auth, User authentication plugin, GitHub , RubyGems, trestle-search, Search plugin, GitHub , RubyGems, trestle-tinymce, TinyMCE (WYSIWYG editor) integration, GitHub , RubyGems, trestle-simplemde, SimpleMDE (Markdown editor) integration, GitHub , RubyGems, trestle-sidekiq, Sidekiq integration, GitHub , RubyGems, trestle-active_storage, Active Storage integration, GitHub , RubyGems, trestle-mobility, Mobility integration, GitHub , RubyGems, ## License

The gem is available as open source under the terms of the LGPLv3 License.

主要指標

概覽
名稱與所有者TrestleAdmin/trestle
主編程語言Ruby
編程語言Ruby (語言數: 6)
平台
許可證GNU Lesser General Public License v3.0
所有者活动
創建於2016-09-11 23:36:22
推送於2025-01-09 02:15:57
最后一次提交
發布數28
最新版本名稱v0.10.1 (發布於 2024-09-27 04:15:37)
第一版名稱v0.8.0 (發布於 )
用户参与
星數2k
關注者數53
派生數181
提交數1.4k
已啟用問題?
問題數392
打開的問題數111
拉請求數92
打開的拉請求數8
關閉的拉請求數51
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?