lib/trestle/configuration.rb in trestle-0.8.9 vs lib/trestle/configuration.rb in trestle-0.8.10
- old
+ new
@@ -14,11 +14,14 @@
option :site_logo_small
# Text shown in the admin page footer
option :footer, -> { I18n.t("trestle.footer", default: "Powered by Trestle") }
+ # Default timestamp precision
+ option :timestamp_precision, :minutes
+
## Mounting Options
# Path at which to mount the Trestle admin
option :path, "/admin"
@@ -26,12 +29,15 @@
option :automount, true
## Navigation Options
+ # Path to consider the application root (for title links and breadcrumbs)
+ option :root, -> { Trestle.config.path }
+
# Initial breadcrumbs to display in the breadcrumb trail
- option :root_breadcrumbs, -> { [Trestle::Breadcrumb.new(I18n.t("admin.breadcrumbs.home", default: "Home"), Trestle.config.path)] }
+ option :root_breadcrumbs, -> { [Trestle::Breadcrumb.new(I18n.t("admin.breadcrumbs.home", default: "Home"), Trestle.config.root)] }
# Default icon class to use when it is not explicitly provided
option :default_navigation_icon, "fa fa-arrow-circle-o-right"
# [Internal] List of navigation menu blocks
@@ -76,11 +82,11 @@
# [Internal] List of registered hooks
option :hooks, Hash.new { |h, k| h[k] = [] }
# Register an extension hook
- def hook(name, &block)
- hooks[name.to_s] << block
+ def hook(name, options={}, &block)
+ hooks[name.to_s] << Hook.new(name.to_s, options, &block)
end
# List of i18n keys to pass into the Trestle.i18n JavaScript object
option :javascript_i18n_keys, [
"trestle.confirmation.title", "trestle.confirmation.delete", "trestle.confirmation.cancel", "trestle.dialog.error",