Files
grecia/app/views/admin/legislation/draft_versions/index.html.erb
Javi Martín 6fa67b5e53 Use active record translations for labels
This way we can simplify the way we generate form fields. In some cases,
we also use the human attribute in table headers, which IMHO makes
sense.

I haven't moved all of them: for example, sometimes a label is
different depending on whether it's shown to administrators, valuators,
or users. And I haven't touched the ones related to devise, since I
wasn't sure about possible side effects.

Note I've also removed placeholders when they had the same text as their
labels, since they weren't helpful. On the contrary, the added redundant
text to the form, potentially distracting users.
2019-10-07 01:56:23 +02:00

61 lines
2.6 KiB
Plaintext

<% provide :title do %>
<%= t("admin.header.title") %> - <%= t("admin.menu.legislation") %> - <%= @process.title %> - <%= t("admin.legislation.draft_versions.index.title") %>
<% end %>
<div class="legislation-draft-versions-index">
<%= back_link_to admin_legislation_processes_path, t("admin.legislation.processes.edit.back") %>
<h2><%= @process.title %></h2>
<%= render "admin/legislation/processes/subnav", process: @process, active: "draft_versions" %>
<div class="small-12 column">
<h4 class="inline-block"><%= t("admin.legislation.draft_versions.index.title") %></h4>
<div class="float-right">
<%= link_to t("admin.legislation.draft_versions.index.create"), new_admin_legislation_process_draft_version_path, class: "button" %>
</div>
<% if @process.draft_versions.any? %>
<table class="stack">
<thead>
<tr>
<th><%= t("admin.legislation.draft_versions.table.title") %></th>
<th><%= t("admin.legislation.draft_versions.table.created_at") %></th>
<th><%= t("admin.legislation.draft_versions.table.status") %></th>
<th class="text-center"><%= t("admin.legislation.draft_versions.table.comments") %></th>
<th class="text-center"><%= t("admin.legislation.draft_versions.table.final_version") %></th>
</tr>
</thead>
<tbody>
<% @process.draft_versions.each do |draft_version| %>
<tr id="<%= dom_id(draft_version) %>">
<td>
<%= link_to draft_version.title, edit_admin_legislation_process_draft_version_path(@process, draft_version) %>
</td>
<td><%= draft_version.created_at.to_date %></td>
<td>
<% if draft_version.status == "draft" %>
<%= Legislation::DraftVersion.human_attribute_name(:status_draft) %>
<%= link_to "(#{t(".preview")})", legislation_process_draft_version_path(@process, draft_version) %>
<% else %>
<%= Legislation::DraftVersion.human_attribute_name(:status_published) %>
<% end %>
</td>
<td class="text-center"><%= draft_version.total_comments %></td>
<td class="text-center">
<% if draft_version.final_version %>
<span class="icon-check" title="<%= draft_version.final_version %>"></span>
<% else %>
<span class="icon-x delete" title="<%= draft_version.final_version %>"></span>
<% end %>
</td>
</tr>
<% end %>
</tbody>
</table>
<% end %>
</div>
</div>