improves admin banners index page

This commit is contained in:
Alberto Garcia Cabeza
2017-04-28 12:44:38 +02:00
parent 2e649d78ff
commit 80279ca638
3 changed files with 44 additions and 30 deletions

View File

@@ -7,36 +7,48 @@
<h3><%= page_entries_info @banners %></h3>
<table>
<% @banners.each do |banner| %>
<tr id="<%= dom_id(banner) %>">
<td class="small-12 medium-9">
<small>
<%= t("admin.banners.banner.post_started_at")%> <strong><%= banner.post_started_at %></strong>
&nbsp;|&nbsp;
<%= t("admin.banners.banner.post_ended_at")%> <strong><%= banner.post_ended_at%></strong>
</small>
<div class="<%= banner.style %>">
<div class="<%= banner.image %>">
<%= link_to banner.target_url do %>
<h2><%= banner.title %></h2>
<h3><%= banner.description %></h3>
<% end %>
<% @banners.each do |banner| %>
<table>
<thead>
<tr id="<%= dom_id(banner) %>">
<th scope="col"><%= t("admin.banners.banner.post_started_at")%></th>
<th scope="col"><%= t("admin.banners.banner.post_ended_at")%></th>
<th scope="col" class="text-center"><%= t("admin.actions.actions")%></th>
</tr>
</thead>
<tbody>
<tr>
<td><%= banner.post_started_at %></td>
<td><%= banner.post_ended_at %></td>
<td class="text-right">
<div class="small-12 medium-6 column">
<%= link_to t("admin.banners.index.edit"), edit_admin_banner_path(banner),
class: 'button hollow expanded' %>
</div>
</div>
</td>
<td class="text-right">
<%= link_to t("admin.banners.index.edit"), edit_admin_banner_path(banner),
class: 'edit-banner button hollow' %>
<%= link_to t("admin.banners.index.delete"), admin_banner_path(banner),
method: :delete,
class: 'button hollow alert' %>
</td>
</tr>
<% end %>
</table>
<div class="small-12 medium-6 column">
<%= link_to t("admin.banners.index.delete"), admin_banner_path(banner),
method: :delete,
class: 'button hollow alert expanded' %>
</div>
</td>
</tr>
<tr>
<th colspan="3" scope="col" class="text-center"><%= t("admin.banners.index.preview") %></th>
</tr>
<tr>
<td colspan="3">
<div class="<%= banner.style %>">
<div class="<%= banner.image %>">
<%= link_to banner.target_url do %>
<h2><%= banner.title %></h2>
<h3><%= banner.description %></h3>
<% end %>
</div>
</div>
</td>
</tr>
</tbody>
</table>
<% end %>
<%= paginate @banners %>