improves styles for admin polls views

This commit is contained in:
Alberto Garcia Cabeza
2016-12-14 13:52:18 +01:00
parent e7327860e4
commit 6498d1c34d
5 changed files with 105 additions and 125 deletions

View File

@@ -155,6 +155,11 @@ body.admin {
}
}
.admin .tabs-panel {
padding-left: 0;
padding-right: 0;
}
// 02. Sidebar
// -----------

View File

@@ -1,39 +1,34 @@
<div class="row">
<div class="small-12 column">
<% if @poll.booths.empty? %>
<div class="callout primary text-center">
<%= t("admin.polls.show.no_booths") %>
</div>
<% else %>
<h3><%= t("admin.polls.show.booths_title") %></h3>
<h2><%= t("admin.polls.show.booths_title") %></h2>
<table>
<thead>
<th><%= t("admin.polls.show.name") %></th>
<th><%= t("admin.polls.show.location") %></th>
<th>&nbsp;</th>
</thead>
<tbody>
<% @poll.booths.each do |booth| %>
<tr id="booth_<%= booth.id %>" class="booth">
<td>
<strong>
<%= link_to booth.name, admin_booth_path(booth) %>
</strong>
</td>
<td>
<%= booth.location %>
</td>
<td class="text-right">
<%= link_to t("admin.polls.show.remove_booth"),
"#",
class: "button hollow alert" %>
</td>
</tr>
<% end %>
</tbody>
</table>
<% end %>
<% if @poll.booths.empty? %>
<div class="callout primary margin-top">
<%= t("admin.polls.show.no_booths") %>
</div>
</div>
<% else %>
<table>
<thead>
<th><%= t("admin.polls.show.name") %></th>
<th><%= t("admin.polls.show.location") %></th>
<th>&nbsp;</th>
</thead>
<tbody>
<% @poll.booths.each do |booth| %>
<tr id="booth_<%= booth.id %>" class="booth">
<td>
<strong>
<%= link_to booth.name, admin_booth_path(booth) %>
</strong>
</td>
<td>
<%= booth.location %>
</td>
<td class="text-right">
<%= link_to t("admin.polls.show.remove_booth"),
"#",
class: "button hollow alert" %>
</td>
</tr>
<% end %>
</tbody>
</table>
<% end %>

View File

@@ -1,30 +1,20 @@
<div class="row">
<div class="small-12 column">
<ul class="tabs" data-tabs id="example-tabs">
<li class="tabs-title is-active">
<%= link_to "#tab-questions" do %>
<h2>
<%= t("admin.polls.show.questions_tab") %>
<span class="js-comments-count">(<%= @poll.questions.count %>)</span>
</h2>
<% end %>
</li>
<li class="tabs-title">
<%= link_to "#tab-booths" do %>
<h2>
<%= t("admin.polls.show.booths_tab") %>
(<%= @poll.booths.count %>)
</h2>
<% end %>
</li>
<li class="tabs-title">
<%= link_to "#tab-officers" do %>
<h2>
<%= t("admin.polls.show.officers_tab") %>
(<%= @poll.officers.count %>)
</h2>
<% end %>
</li>
</ul>
</div>
</div>
<ul class="tabs" data-tabs id="example-tabs">
<li class="tabs-title is-active">
<%= link_to "#tab-questions" do %>
<%= t("admin.polls.show.questions_tab") %>
<span class="js-comments-count">(<%= @poll.questions.count %>)</span>
<% end %>
</li>
<li class="tabs-title">
<%= link_to "#tab-booths" do %>
<%= t("admin.polls.show.booths_tab") %>
(<%= @poll.booths.count %>)
<% end %>
</li>
<li class="tabs-title">
<%= link_to "#tab-officers" do %>
<%= t("admin.polls.show.officers_tab") %>
(<%= @poll.officers.count %>)
<% end %>
</li>
</ul>

View File

@@ -1,33 +1,28 @@
<div class="row">
<div class="small-12 column">
<% if @poll.officers.empty? %>
<div class="callout primary text-center">
<%= t("admin.polls.show.no_officers") %>
</div>
<% else %>
<h3><%= t("admin.polls.show.officers_title") %></h3>
<h2><%= t("admin.polls.show.officers_title") %></h2>
<table>
<thead>
<th><%= t("admin.polls.show.name") %></th>
<th><%= t("admin.polls.show.email") %></th>
</thead>
<tbody>
<% @poll.officers.each do |officer| %>
<tr id="officer_<%= officer.id %>" class="officer">
<td>
<strong>
<%= officer.name %>
</strong>
</td>
<td>
<%= officer.email %>
</td>
</tr>
<% end %>
</tbody>
</table>
<% end %>
<% if @poll.officers.empty? %>
<div class="callout primary margin-top">
<%= t("admin.polls.show.no_officers") %>
</div>
</div>
<% else %>
<table>
<thead>
<th><%= t("admin.polls.show.name") %></th>
<th><%= t("admin.polls.show.email") %></th>
</thead>
<tbody>
<% @poll.officers.each do |officer| %>
<tr id="officer_<%= officer.id %>" class="officer">
<td>
<strong>
<%= officer.name %>
</strong>
</td>
<td>
<%= officer.email %>
</td>
</tr>
<% end %>
</tbody>
</table>
<% end %>

View File

@@ -1,29 +1,24 @@
<div class="row">
<div class="small-12 column">
<% if @poll.questions.empty? %>
<div class="callout primary text-center">
<%= t('admin.polls.show.no_questions') %>
</div>
<% else %>
<h3><%= t("admin.polls.show.questions_title") %></h3>
<h2><%= t("admin.polls.show.questions_title") %></h2>
<table>
<% @poll.questions.each do |question| %>
<tr id="<%= dom_id(question) %>">
<td><%= link_to question.title, admin_question_path(question) %></td>
<td class="text-right">
<%= link_to t('shared.edit'),
edit_admin_question_path(question),
class: "button hollow" %>
<%= link_to t('shared.delete'),
admin_question_path(question),
class: "button hollow alert",
method: :delete %>
</td>
</tr>
<% end %>
</table>
<% end %>
<% if @poll.questions.empty? %>
<div class="callout primary margin-top">
<%= t('admin.polls.show.no_questions') %>
</div>
</div>
<% else %>
<table class="margin-top">
<% @poll.questions.each do |question| %>
<tr id="<%= dom_id(question) %>">
<td><%= link_to question.title, admin_question_path(question) %></td>
<td class="text-right">
<%= link_to t('shared.edit'),
edit_admin_question_path(question),
class: "button hollow" %>
<%= link_to t('shared.delete'),
admin_question_path(question),
class: "button hollow alert",
method: :delete %>
</td>
</tr>
<% end %>
</table>
<% end %>