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>
58 lines
2.5 KiB
ERB
58 lines
2.5 KiB
ERB
<% content_for :body_class, "admin-body" %>
|
|
|
|
<div class="admin-page-head">
|
|
<h2 class="admin-page-title"><%= t("admin.announcements.index.title") %></h2>
|
|
<p class="muted admin-page-sub"><%= t("admin.announcements.index.lead") %></p>
|
|
</div>
|
|
|
|
<div class="panel" style="margin-bottom:1.5rem">
|
|
<div class="admin-toolbar">
|
|
<%= link_to t("admin.announcements.index.new"), new_admin_announcement_path, class: "admin-btn admin-btn--primary" %>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="panel">
|
|
<h2><%= t("admin.announcements.index.table_title") %></h2>
|
|
<% if @announcements.any? %>
|
|
<div class="admin-table-wrap">
|
|
<table class="admin-table">
|
|
<thead>
|
|
<tr>
|
|
<th><%= t("admin.announcements.table.status") %></th>
|
|
<th><%= t("admin.announcements.table.kind") %></th>
|
|
<th><%= t("admin.announcements.table.title") %></th>
|
|
<th><%= t("admin.announcements.table.channels") %></th>
|
|
<th><%= t("admin.announcements.table.window") %></th>
|
|
<th></th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<% @announcements.each do |item| %>
|
|
<tr>
|
|
<td>
|
|
<span class="badge badge--<%= announcement_status_badge(item) %>"><%= t("admin.announcements.status.#{item.status}") %></span>
|
|
</td>
|
|
<td class="muted"><%= t("admin.announcements.kind.#{item.kind}") %></td>
|
|
<td>
|
|
<strong><%= item.title %></strong>
|
|
<div class="muted" style="font-size:0.85rem;margin-top:0.25rem"><%= truncate(item.body, length: 90) %></div>
|
|
<div class="muted" style="font-size:0.8rem;margin-top:0.2rem"><%= item.filled_locale_codes.map(&:upcase).join(" · ") %></div>
|
|
</td>
|
|
<td class="muted"><%= announcement_channels_label(item) %></td>
|
|
<td class="muted"><%= announcement_window_label(item) %></td>
|
|
<td class="admin-actions">
|
|
<%= link_to t("admin.announcements.actions.edit"), edit_admin_announcement_path(item), class: "admin-btn admin-btn--sm" %>
|
|
<%= button_to t("admin.announcements.actions.delete"), admin_announcement_path(item), method: :delete,
|
|
class: "admin-btn admin-btn--sm admin-btn--danger",
|
|
form: { data: { confirm: t("admin.announcements.actions.delete_confirm") } } %>
|
|
</td>
|
|
</tr>
|
|
<% end %>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<% else %>
|
|
<p class="empty"><%= t("admin.announcements.index.none") %></p>
|
|
<% end %>
|
|
</div>
|