Unifies styles and views for admin polls

This commit is contained in:
decabeza
2018-07-18 17:33:25 +02:00
parent 076f9dd474
commit 6f324c6931
16 changed files with 77 additions and 77 deletions

View File

@@ -1,16 +1,14 @@
<div class="row"> <div class="small-12 medium-6 margin-top">
<div class="small-12 medium-6 column"> <%= form_tag(search_booths_admin_poll_booth_assignments_path(@poll), method: :get, remote: true) do |f| %>
<%= form_tag(search_booths_admin_poll_booth_assignments_path(@poll), method: :get, remote: true) do |f| %> <div class="input-group">
<div class="input-group"> <%= text_field_tag :search,
<%= text_field_tag :search, @search,
@search, placeholder: t("admin.shared.booths_search.placeholder"), id: "search-booths" %>
placeholder: t("admin.shared.booths_search.placeholder"), id: "search-booths" %> <div class="input-group-button">
<div class="input-group-button"> <%= submit_tag t("admin.shared.booths_search.button"), class: "button" %>
<%= submit_tag t("admin.shared.booths_search.button"), class: "button" %>
</div>
</div> </div>
<% end %> </div>
</div> <% end %>
</div> </div>
<div id="search-booths-results"></div> <div id="search-booths-results"></div>

View File

@@ -4,7 +4,7 @@
<%= render "/admin/poll/polls/subnav" %> <%= render "/admin/poll/polls/subnav" %>
<%= render "search_booths" %> <%= render "search_booths" %>
<h3><%= t("admin.poll_booth_assignments.index.booths_title") %></h3> <h3 class="inline-block"><%= t("admin.poll_booth_assignments.index.booths_title") %></h3>
<%= link_to t("admin.booth_assignments.manage_assignments"), <%= link_to t("admin.booth_assignments.manage_assignments"),
manage_admin_poll_booth_assignments_path(@poll), manage_admin_poll_booth_assignments_path(@poll),

View File

@@ -1,16 +1,14 @@
<div class="row"> <div class="small-12 medium-6 margin-top">
<div class="small-12 medium-6 column"> <%= form_tag(search_officers_admin_poll_officer_assignments_path(@poll), method: :get, remote: true) do |f| %>
<%= form_tag(search_officers_admin_poll_officer_assignments_path(@poll), method: :get, remote: true) do |f| %> <div class="input-group">
<div class="input-group"> <%= text_field_tag :search,
<%= text_field_tag :search, @search,
@search, placeholder: t("admin.shared.poll_officers_search.placeholder"), id: "search-officers" %>
placeholder: t("admin.shared.poll_officers_search.placeholder"), id: "search-officers" %> <div class="input-group-button">
<div class="input-group-button"> <%= submit_tag t("admin.shared.poll_officers_search.button"), class: "button" %>
<%= submit_tag t("admin.shared.poll_officers_search.button"), class: "button" %>
</div>
</div> </div>
<% end %> </div>
</div> <% end %>
</div> </div>
<div id="search-officers-results"></div> <div id="search-officers-results"></div>

View File

@@ -1,11 +1,9 @@
<%= form_for [:admin, @poll] do |f| %> <%= form_for [:admin, @poll] do |f| %>
<div class="row"> <div class="small-12 medium-6 column">
<div class="small-12 medium-6 column"> <%= f.text_field :name %>
<%= f.text_field :name %>
</div>
</div> </div>
<div class="row"> <div class="clear">
<div class="small-12 medium-6 column"> <div class="small-12 medium-6 column">
<%= f.text_field :starts_at, <%= f.text_field :starts_at,
value: @poll.starts_at.present? ? l(@poll.starts_at.to_date) : nil, value: @poll.starts_at.present? ? l(@poll.starts_at.to_date) : nil,
@@ -19,25 +17,19 @@
</div> </div>
</div> </div>
<div class="row"> <div class="small-12 column">
<div class="small-12 column"> <%=f.text_area :summary, rows: 4%>
<%=f.text_area :summary, rows: 4%>
</div>
</div> </div>
<div class="row"> <div class="small-12 column">
<div class="small-12 column"> <%=f.text_area :description, rows: 8%>
<%=f.text_area :description, rows: 8%>
</div>
</div> </div>
<div class="row"> <div class="small-12 column">
<div class="small-12 column"> <%= render 'images/admin_image', imageable: @poll, f: f %>
<%= render 'images/admin_image', imageable: @poll, f: f %>
</div>
</div> </div>
<div class="row"> <div class="clear">
<div class="small-6 medium-6 column"> <div class="small-6 medium-6 column">
<%= f.check_box :geozone_restricted, data: { checkbox_toggle: "#geozones" } %> <%= f.check_box :geozone_restricted, data: { checkbox_toggle: "#geozones" } %>
</div> </div>
@@ -55,10 +47,10 @@
</div> </div>
</div> </div>
<div class="row"> <div class="clear">
<div class="small-12 medium-4 column"> <div class="small-12 medium-4 large-2 column">
<%= f.submit t("admin.polls.#{admin_submit_action(@poll)}.submit_button"), <%= f.submit t("admin.polls.#{admin_submit_action(@poll)}.submit_button"),
class: "button success expanded" %> class: "button success expanded margin-top" %>
</div> </div>
</div> </div>
<% end %> <% end %>

View File

@@ -8,11 +8,15 @@
<%= l poll.starts_at.to_date %> - <%= l poll.ends_at.to_date %> <%= l poll.starts_at.to_date %> - <%= l poll.ends_at.to_date %>
</td> </td>
<td class="text-right"> <td class="text-right">
<div class="small-6 column">
<%= link_to t("admin.actions.edit"), <%= link_to t("admin.actions.edit"),
edit_admin_poll_path(poll), edit_admin_poll_path(poll),
class: "button hollow" %> class: "button hollow expanded" %>
</div>
<div class="small-6 column">
<%= link_to t("admin.actions.configure"), <%= link_to t("admin.actions.configure"),
admin_poll_path(poll), admin_poll_path(poll),
class: "button hollow" %> class: "button hollow expanded" %>
</div>
</td> </td>
</tr> </tr>

View File

@@ -2,13 +2,13 @@
<% if @poll.questions.empty? %> <% if @poll.questions.empty? %>
<div class="callout primary margin-top"> <div class="callout primary margin-top">
<%= t('admin.polls.show.no_questions') %> <%= t("admin.polls.show.no_questions") %>
</div> </div>
<% else %> <% else %>
<table class="fixed margin"> <table class="fixed margin">
<thead> <thead>
<tr> <tr>
<th><%= t('admin.polls.show.table_title') %></th> <th><%= t("admin.polls.show.table_title") %></th>
</tr> </tr>
</thead> </thead>
<% @poll.questions.each do |question| %> <% @poll.questions.each do |question| %>

View File

@@ -2,14 +2,14 @@
<%= link_to t("admin.polls.index.create"), <%= link_to t("admin.polls.index.create"),
new_admin_poll_path, new_admin_poll_path,
class: "button success float-right" %> class: "button float-right" %>
<% if @polls.any? %> <% if @polls.any? %>
<table> <table>
<thead> <thead>
<th class="medium-6"><%= t("admin.polls.index.name") %></th> <th class="small-6"><%= t("admin.polls.index.name") %></th>
<th><%= t("admin.polls.index.dates") %></th> <th><%= t("admin.polls.index.dates") %></th>
<th class="text-right"><%= t("admin.actions.actions") %></th> <th><%= t("admin.actions.actions") %></th>
</thead> </thead>
<tbody> <tbody>
<%= render @polls %> <%= render @polls %>

View File

@@ -1,6 +1,8 @@
<%= back_link_to %> <div class="small-12 column">
<%= back_link_to %>
<h2><%= t("admin.polls.new.title") %></h2> <h2><%= t("admin.polls.new.title") %></h2>
</div>
<div class="polls-form"> <div class="polls-form">
<%= render "form" %> <%= render "form" %>

View File

@@ -14,8 +14,8 @@
<%= f.text_field :title %> <%= f.text_field :title %>
<div class="small-12 medium-6 large-4 margin-top"> <div class="small-12 medium-4 large-2 margin-top">
<%= f.submit(class: "button expanded", value: t("shared.save")) %> <%= f.submit(class: "button success expanded", value: t("shared.save")) %>
</div> </div>
</div> </div>

View File

@@ -4,23 +4,27 @@
<% if @questions.count == 0 %> <% if @questions.count == 0 %>
<div class="callout primary margin-top"> <div class="callout primary margin-top">
<%= t('admin.questions.index.no_questions') %> <%= t("admin.questions.index.no_questions") %>
</div> </div>
<% else %> <% else %>
<table class="fixed"> <table class="fixed">
<thead> <thead>
<tr> <tr>
<th><%= t('admin.questions.index.table_question') %></th> <th class="small-8"><%= t("admin.questions.index.table_question") %></th>
<th class="text-right"><%= t("admin.actions.actions") %></th> <th><%= t("admin.actions.actions") %></th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<% @questions.each do |question| %> <% @questions.each do |question| %>
<tr id="<%= dom_id(question) %>"> <tr id="<%= dom_id(question) %>">
<td><%= link_to question.title, admin_question_path(question) %></td> <td><%= link_to question.title, admin_question_path(question) %></td>
<td class="text-right"> <td>
<%= link_to t('shared.edit'), edit_admin_question_path(question), class: "button hollow" %> <div class="small-6 column">
<%= link_to t('shared.delete'), admin_question_path(question), class: "button hollow alert", method: :delete %> <%= link_to t("shared.edit"), edit_admin_question_path(question), class: "button hollow expanded" %>
</div>
<div class="small-6 column">
<%= link_to t("shared.delete"), admin_question_path(question), class: "button hollow alert expanded", method: :delete %>
<div class="small-6 column">
</td> </td>
</tr> </tr>
<% end %> <% end %>

View File

@@ -1,8 +1,8 @@
<table class="fixed"> <table class="fixed">
<thead> <thead>
<tr> <tr>
<th><%= t('admin.questions.index.table_proposal') %></th> <th class="small-9"><%= t("admin.questions.index.table_proposal") %></th>
<th class="text-right"><%= t("admin.actions.actions") %></th> <th><%= t("admin.actions.actions") %></th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@@ -15,7 +15,7 @@
<strong><%= proposal.question %></strong> <strong><%= proposal.question %></strong>
</p> </p>
</td> </td>
<td class="text-right"> <td>
<%= link_to t("admin.questions.index.create_question"), <%= link_to t("admin.questions.index.create_question"),
new_admin_question_path(proposal_id: proposal.id), new_admin_question_path(proposal_id: proposal.id),
class: "button hollow" %> class: "button hollow" %>

View File

@@ -12,8 +12,8 @@
ckeditor: { language: I18n.locale } %> ckeditor: { language: I18n.locale } %>
</div> </div>
<div class="small-12 medium-6 large-4 margin-top"> <div class="small-12 medium-4 large-2 margin-top">
<%= f.submit(class: "button expanded", value: t("shared.save")) %> <%= f.submit(class: "button success expanded", value: t("shared.save")) %>
</div> </div>
<% end %> <% end %>

View File

@@ -2,7 +2,7 @@
<ul class="breadcrumbs margin-top"> <ul class="breadcrumbs margin-top">
<li><%= @answer.title %></li> <li><%= @answer.title %></li>
<li><%= t('admin.answers.edit.title') %></li> <li><%= t("admin.answers.edit.title") %></li>
</ul> </ul>
<h2 class="margin-top"> <h2 class="margin-top">

View File

@@ -2,10 +2,10 @@
<ul class="breadcrumbs margin-top"> <ul class="breadcrumbs margin-top">
<li><%= @question.title %></li> <li><%= @question.title %></li>
<li><%= t('admin.answers.new.title') %></li> <li><%= t("admin.answers.new.title") %></li>
</ul> </ul>
<h2><%= t('admin.answers.new.title') %></h2> <h2><%= t("admin.answers.new.title") %></h2>
<div class="poll-question-answer-form"> <div class="poll-question-answer-form">
<%= render "form", form_url: admin_question_answers_path %> <%= render "form", form_url: admin_question_answers_path %>

View File

@@ -1,7 +1,7 @@
<h2 class="inline-block"><%= t('admin.questions.index.title') %></h2> <h2 class="inline-block"><%= t("admin.questions.index.title") %></h2>
<%= link_to t('admin.questions.index.create'), new_admin_question_path, <%= link_to t("admin.questions.index.create"), new_admin_question_path,
class: "button success float-right" %> class: "button float-right" %>
<div class="small-12 medium-6"> <div class="small-12 medium-6">
<%= render 'search' %> <%= render 'search' %>

View File

@@ -29,13 +29,15 @@
</div> </div>
</div> </div>
<div class="clear">
<%= link_to t("admin.questions.show.add_answer"), new_admin_question_answer_path(@question),
class: "button float-right" %>
</div>
<table class="margin-top"> <table class="margin-top">
<tr> <tr>
<th colspan="5" scope="col" class="with-button"> <th colspan="5" scope="col" class="with-button">
<%= t('admin.questions.show.valid_answers') %> <%= t('admin.questions.show.valid_answers') %>
<%= link_to t("admin.questions.show.add_answer"),
new_admin_question_answer_path(@question),
class: "button float-right" %>
</th> </th>
</tr> </tr>