diff options
| author | erdgeist <erdgeist@erdgeist.org> | 2026-08-17 02:22:04 +0200 |
|---|---|---|
| committer | erdgeist <erdgeist@erdgeist.org> | 2026-08-17 02:22:04 +0200 |
| commit | 8570051876b86c08d4b72288f8598f0e0d2335e1 (patch) | |
| tree | 647fce9e040fe2e2910c7ae9a1a3fbff47f0f9df /app/helpers/admin_helper.rb | |
| parent | bbd10eec6b8b46a7173d3be4dd7e05de212f8038 (diff) | |
Bridge Rails values into JavaScript through a JSON element
Diffstat (limited to 'app/helpers/admin_helper.rb')
| -rw-r--r-- | app/helpers/admin_helper.rb | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/app/helpers/admin_helper.rb b/app/helpers/admin_helper.rb index 5a1a42a3..be20eb8b 100644 --- a/app/helpers/admin_helper.rb +++ b/app/helpers/admin_helper.rb | |||
| @@ -14,4 +14,28 @@ module AdminHelper | |||
| 14 | :role => "img", :class => classes, | 14 | :role => "img", :class => classes, |
| 15 | :title => hint, "aria-label" => hint) | 15 | :title => hint, "aria-label" => hint) |
| 16 | end | 16 | end |
| 17 | |||
| 18 | def admin_bridge | ||
| 19 | { | ||
| 20 | :urls => { | ||
| 21 | :search => admin_search_path, | ||
| 22 | :menu_search => admin_menu_search_path, | ||
| 23 | :dashboard_search => admin_dashboard_search_path, | ||
| 24 | :parameterize_preview => parameterize_preview_nodes_path | ||
| 25 | }, | ||
| 26 | :strings => { | ||
| 27 | :lock_lost_prefix => t("layouts.admin.lock_lost_prefix"), | ||
| 28 | :lock_lost_link => t("layouts.admin.lock_lost_link"), | ||
| 29 | :insert_image => t("layouts.admin.insert_image"), | ||
| 30 | :insert_image_tooltip => t("layouts.admin.insert_image_tooltip"), | ||
| 31 | :copied => t("layouts.admin.copied"), | ||
| 32 | :needs_redaktion => t("layouts.admin.needs_redaktion"), | ||
| 33 | :import_markdown => t("layouts.admin.import_markdown"), | ||
| 34 | :import_markdown_tooltip => t("layouts.admin.import_markdown_tooltip"), | ||
| 35 | :import_markdown_placeholder => t("layouts.admin.import_markdown_placeholder"), | ||
| 36 | :cancel => t("admin.common.cancel"), | ||
| 37 | :insert => t("layouts.admin.insert") | ||
| 38 | } | ||
| 39 | }.to_json | ||
| 40 | end | ||
| 17 | end | 41 | end |
