hides legislation empty tables, improves table styles

This commit is contained in:
decabeza
2017-05-24 13:34:37 +02:00
parent 5aa8017aa8
commit 02055bd09a
4 changed files with 106 additions and 83 deletions

View File

@@ -84,7 +84,7 @@
</div>
</div>
<div class="row primary-buttons">
<div class="row margin-top primary-buttons">
<div class="actions small-12 medium-3 column legislation-process-save">
<%= f.submit(class: "button expanded", value: t("admin.legislation.draft_versions.#{admin_submit_action(@draft_version)}.submit_button")) %>
</div>

View File

@@ -23,29 +23,44 @@
</div>
</div>
<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><%= t("admin.legislation.draft_versions.table.comments") %></th>
<th><%= 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><%= draft_version.status %> <%= link_to "(#{t('.preview')})", legislation_process_draft_version_path(@process, draft_version) if draft_version.status == 'draft' %></td>
<td><%= draft_version.total_comments %></td>
<td><%= draft_version.final_version %></td>
</tr>
<% end %>
</tbody>
</table>
<% 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><%= t("admin.legislation.draft_versions.table.comments") %></th>
<th><%= 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' %>
<%= t("admin.legislation.draft_versions.statuses.draft") %>
<%= link_to "(#{t('.preview')})", legislation_process_draft_version_path(@process, draft_version) %>
<% else %>
<%= t("admin.legislation.draft_versions.statuses.published") %>
<% end %>
</td>
<td><%= draft_version.total_comments %></td>
<td>
<% 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>