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.
50 lines
2.2 KiB
Plaintext
50 lines
2.2 KiB
Plaintext
<%= link_to t("admin.dashboard.actions.index.create"),
|
|
new_admin_dashboard_action_path, class: "button success float-right" %>
|
|
|
|
<h2 class="inline-block">
|
|
<%= t("admin.dashboard.actions.index.title") %>
|
|
</h2>
|
|
|
|
<p><%= t("admin.dashboard.actions.index.description") %></p>
|
|
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th><%= t("admin.dashboard.actions.index.action_title") %></th>
|
|
<th><%= t("admin.dashboard.actions.index.action_type") %></th>
|
|
<th class="text-center"><%= t("admin.dashboard.actions.index.action_active") %></th>
|
|
<th class="text-center"><%= t("admin.dashboard.actions.index.published_proposal") %></th>
|
|
<th class="text-center"><%= t("admin.dashboard.actions.index.day_offset") %></th>
|
|
<th class="text-center"><%= t("admin.dashboard.actions.index.required_supports") %></th>
|
|
<th class="text-center"><%= t("admin.dashboard.actions.index.order") %></th>
|
|
<th class="text-right small-3"><%= t("admin.actions.actions") %></th>
|
|
</tr>
|
|
</thead>
|
|
|
|
<tbody>
|
|
<% @dashboard_actions.each do |action| %>
|
|
<tr id="<%= dom_id(action) %>">
|
|
<td><%= action.title %></td>
|
|
<td><%= Dashboard::Action.human_attribute_name("action_type_#{action.action_type}") %></td>
|
|
<td class="text-center"><%= active_human_readable(action.active) %></td>
|
|
<td class="text-center"><%= active_human_readable(action.published_proposal) %></td>
|
|
<td class="text-center"><%= number_with_delimiter(action.day_offset, delimiter: ".") %></td>
|
|
<td class="text-center"><%= number_with_delimiter(action.required_supports, delimiter: ".") %></td>
|
|
<td class="text-center"><%= action.order %></td>
|
|
<td class="text-right">
|
|
<%= link_to t("admin.dashboard.actions.index.edit"),
|
|
edit_admin_dashboard_action_path(action),
|
|
class: "button hollow" %>
|
|
<%= link_to t("admin.dashboard.actions.index.delete"),
|
|
admin_dashboard_action_path(action),
|
|
method: :delete,
|
|
class: "button hollow alert",
|
|
data: { confirm: t("admin.actions.confirm") } %>
|
|
</td>
|
|
</tr>
|
|
<% end %>
|
|
|
|
<%= render "default_actions" %>
|
|
</tbody>
|
|
</table>
|