A modern, responsive admin framework for Ruby on Rails
LGPL-3.0 License
Bot releases are hidden (Show)
Published by spohlenz almost 2 years ago
Trestle.configure do |config|
config.helper -> { CustomHelper }
config.form_field :custom, -> { CustomFormField }
end
Published by spohlenz over 2 years ago
enum
columns as radio buttons within automatic forms (#379)config.persistent_params
Trestle.resource(..., register_model: false)
to disable model lookup registrationclass
option to be passed to avatar
helperavatar-sm
and avatar-lg
CSS classes for small and large avatarssidebar
helperCONTRIBUTING.md
guideHousekeeping:
master
branch has been renamed to main
across all TrestleAdmin repositoriesPublished by spohlenz over 3 years ago
scopes do
scope :first, group: "Group Name"
scope :second, group: "Group Name"
scope :third, group: "Another Group"
end
# Default layout is :row. Scope groups will automatically stack for mobile devices.
scopes layout: :columns do ...
# Disable grouping regardless of scope definitions
scopes group: false do ...
# Specify custom classes on the scopes container div
scopes class: "scope-tags" do ...
menu do
group :configuration, collapse: true do
item ...
end
end
Published by spohlenz almost 4 years ago
current_user
) from within scope blocksoptions[:disabled]
is setoptions[:wrapper]
is falsePublished by spohlenz over 4 years ago
#save_or_dismiss
resource toolbar builder methodselectable_column
checkbox JS and custom checkbox stylingconfig.reload
option (admins will now always reload in development mode)has_many
/ has_and_belongs_to_many
fields (ending in _ids
)col
helper to not add bare col
class when explicit column count is givenPublished by spohlenz over 4 years ago
--singular
option to trestle:resource
generator for generating a singular resource:rails generate trestle:resource account --singular
form dialog: true
#new
, #save
, #delete
and #dismiss
button shortcuts for resource toolbarstitle
and toolbar
helpers to be called from within controller actionsstatic_field
to automatically infer value rather than require it to be explicitly setadmin.<admin-name>.breadcrumbs.index
)count(:all)
instead of count
in ActiveRecord adapter to fix ambiguous column errors in joined queriesen
locale is not availablePublished by spohlenz almost 5 years ago
Published by spohlenz almost 5 years ago
🎉🎉🎉
After many months in development, this release finally incorporates the new build process from #195!
**If you have written a lot of custom code that depends on Bootstrap 3, this may be a breaking update. Please review your admin application code before pushing to production.**
**If you are using trestle-auth or trestle-search, please also ensure you also update to trestle-auth >= 0.3.0 and trestle-search >= 0.4.0**
The main features of this update are:
sass-rails
or sassc-rails
) is no longer a required dependency unless you are doing custom theme compilation.app/assets/stylesheets/trestle/_theme.scss
(rather than _variables.scss
). The trestle:install
generator has been updated to create this new file. However your current _variables.scss
should continue to work for supported variables.Other updates and fixes include:
col
helper now accepts an integer for the default (mobile breakpoint) columns. Old usage should continue to work:# New
col(4) { ... }
col(6, lg: 3) { ... }
# Old
col(xs: 4) { ... }
col(xs: 6, lg: 3) { ... }
card
helper to replace panel
helperpanel
and well
helperscheck_box
/radio_button
controls (default) as well as switch check_boxes
check_box :published, switch: true
tab
blocksPublished by spohlenz about 5 years ago
controller do
def show
super do |format|
format.js
end
end
end
routes
block to be called multiple timesselectable_column
This will likely be the last release before #195 is merged in (which will then be released as 0.9.0).
Published by spohlenz over 5 years ago
toolbar(:primary).clear!
# or
toolbar(:primary, clear: true) do |t|
t.button ...
end
toolbar(:primary) do |t|
# Buttons and links render a split button dropdown (primary button plus toggle)
t.button "Button" do |d|
d.header "Dropdown Header"
d.link "Dropdown Link", "#"
d.divider
end
t.link "Button link", "#" do |d|
d.link "Dropdown Link", "#"
end
# Dropdowns render an integrated button dropdown (primary button triggers the dropdown)
t.dropdown "Dropdown" do |d|
d.link "Dropdown Link", "#"
end
end
scopes do
Tag.all do |tag|
scope tag.name, -> { Post.tagged(tag) }
end
end
menu
blocks to access controller methodsconfig.favicon
to set favicon within adminid
and data
attributes to be passed to panel
helper:en
locale is unavailablePublished by spohlenz about 6 years ago
current_user
, request
, etc)header: false
option to disable table header:if
/:unless
options to be passed to table columnshelp: { text: "message", float: true }
#delete_instance
and #save_instance
adapter methodsPublished by spohlenz about 6 years ago
toolbar(:secondary) do |t|
t.group do
t.button "Approve", style: :success, icon: "fa fa-thumbs-up"
t.button "Reject", style: :danger, icon: "fa fa-ban"
end
t.link "More Info", "...", style: :info
end
content_for(:primary_toolbar) do
timestamp
and datestamp
helpers:header
option:if
/:unless
options for hooksconfig.timestamp_precision
option defaulting to :minutes
config.root
option to set title and root breadcrumb link targetsview.title
hook for overriding sidebar headerresource.index.header
and resource.index.footer
hooksdata-toggle="confirm"
:append!
/:prepend!
optionstrestle_form_for
to override defaultsPublished by spohlenz over 6 years ago
avatar
helper to div tagPublished by spohlenz over 6 years ago
Trestle.resource(:name, singular: true) do ...
)config.reload
option to customize admin reloading strategy (:always
or :on_update
)Trestle::Resource#instance_path(instance, options)
methodadmin_for(instance)
helperbreadcrumb false
form_group
helper behavior within templateswill_paginate
gem (must set custom Kaminari.config.page_method_name
)Published by spohlenz over 6 years ago
data-dialog-class
link attribute:if
and :unless
(Proc) options to navigation item builderh1
..h6
helpers for headings within formsunscoped
adapter methodfinalize_collection
adapter methodscope
blockspaginate per: X
return_to { :back }
to redirect to previous page after actionPublished by spohlenz almost 7 years ago
form dialog: true do...
)remove_action
resource builder method to disable default actionsreturn_to
resource builder method to customize create/update/delete return locationbreadcrumb
admin builder method to override breadcrumbautolink: false
table option to disable automatic row linkingTrestle.init
JS callback for scoped element initializationTrestle.cookie.get
~> 1.1.0
Published by spohlenz about 7 years ago
Trestle.cookie
)options[:label]
option to navigation items to explicitly set labelTrestle::Options
hash merging in edge RailsPublished by spohlenz about 7 years ago
format: :tags
admin_link_to
and admin_url_for
no longer fall back to the current adminTrestle::Adapters::SequelAdapter
)#build_instance
and #update_instance
Adapter methods#human_attribute_name
Adapter methodAdapter#default_attributes
into #default_form_attributes
and #default_table_attributes
railties
rather than rails
coffee-rails
Published by spohlenz about 7 years ago
rails generate trestle:admin NAME
)config.helper
configuration optionconfig.before_action
, config.after_action
and config.around_action
configuration optionsbefore_action
, after_action
and around_action
sort_column
resource method for defining custom column sorts