Files
MatchLiveTv/backend/app/views/admin/announcements/_locale_copy.html.erb
T
eminuxandCursor f02782d0f0 Aggiunge traduzioni it/en/fr/de/es agli avvisi e toglie gli override Android/iOS.
Un avviso ha un testo per lingua; per differenziare le piattaforme si creano due avvisi. L'app riceve già il copy risolto da Accept-Language.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-20 16:26:30 +02:00

45 lines
1.9 KiB
ERB

<% it = locale.to_s == I18n.default_locale.to_s %>
<% values = announcement.copy_values_for(locale) %>
<% name_base = "app_announcement[translations][#{locale}]" %>
<div>
<% if it %>
<%= f.label :title, t("admin.announcements.form.title") %>
<%= f.text_field :title, required: true, maxlength: 120, id: "ann_#{locale}_title" %>
<% else %>
<label for="ann_<%= locale %>_title"><%= t("admin.announcements.form.title") %></label>
<%= text_field_tag "#{name_base}[title]", values["title"], maxlength: 120, id: "ann_#{locale}_title" %>
<% end %>
</div>
<div>
<% if it %>
<%= f.label :body, t("admin.announcements.form.body") %>
<%= f.text_area :body, required: true, rows: 5, maxlength: 2000, id: "ann_#{locale}_body" %>
<% else %>
<label for="ann_<%= locale %>_body"><%= t("admin.announcements.form.body") %></label>
<%= text_area_tag "#{name_base}[body]", values["body"], rows: 5, maxlength: 2000, id: "ann_#{locale}_body" %>
<% end %>
</div>
<div>
<% if it %>
<%= f.label :action_url, t("admin.announcements.form.action_url") %>
<%= f.url_field :action_url, placeholder: "https://", id: "ann_#{locale}_action_url" %>
<% else %>
<label for="ann_<%= locale %>_action_url"><%= t("admin.announcements.form.action_url") %></label>
<%= url_field_tag "#{name_base}[action_url]", values["action_url"], placeholder: "https://", id: "ann_#{locale}_action_url" %>
<% end %>
</div>
<p class="muted admin-form-hint"><%= t("admin.announcements.form.action_url_hint") %></p>
<div>
<% if it %>
<%= f.label :action_label, t("admin.announcements.form.action_label") %>
<%= f.text_field :action_label, maxlength: 40, id: "ann_#{locale}_action_label" %>
<% else %>
<label for="ann_<%= locale %>_action_label"><%= t("admin.announcements.form.action_label") %></label>
<%= text_field_tag "#{name_base}[action_label]", values["action_label"], maxlength: 40, id: "ann_#{locale}_action_label" %>
<% end %>
</div>