diff options
| author | erdgeist <erdgeist@erdgeist.org> | 2026-07-28 00:04:54 +0200 |
|---|---|---|
| committer | erdgeist <erdgeist@erdgeist.org> | 2026-07-28 00:04:54 +0200 |
| commit | dd0d3bdc5935026af2d76bd437c2446be8657665 (patch) | |
| tree | e9d44c97baf6f8fc7d222198df4dbe6dfbd02daf | |
| parent | eca95f90de3de7c6507fc529e00e1e36f136a234 (diff) | |
add partial for menu_item titles in both locales
| -rw-r--r-- | app/views/menu_items/_title_fields.html.erb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/app/views/menu_items/_title_fields.html.erb b/app/views/menu_items/_title_fields.html.erb new file mode 100644 index 00000000..81ec4ad6 --- /dev/null +++ b/app/views/menu_items/_title_fields.html.erb | |||
| @@ -0,0 +1,10 @@ | |||
| 1 | <% (I18n.available_locales - [:root]).each do |locale| %> | ||
| 2 | <div class="layout_row_label"> | ||
| 3 | <%= MenuItem.human_attribute_name(:title) %> <%= locale.to_s.upcase %> | ||
| 4 | </div> | ||
| 5 | <div class="layout_row_content"> | ||
| 6 | <%= text_field_tag "menu_item[titles][#{locale}]", | ||
| 7 | menu_item.translations.find_by(:locale => locale)&.title, | ||
| 8 | :placeholder => (locale == I18n.default_locale ? nil : t(".falls_back")) %> | ||
| 9 | </div> | ||
| 10 | <% end %> | ||
