diff --git a/app/assets/stylesheets/admin.scss b/app/assets/stylesheets/admin.scss index 89bed6d21..8403568a9 100644 --- a/app/assets/stylesheets/admin.scss +++ b/app/assets/stylesheets/admin.scss @@ -44,11 +44,22 @@ body.admin { .button { margin-top: 0; + + &.margin-top { + margin-top: $line-height; + } } input[type="text"], textarea { width: 100%; } + + .fieldset { + + select { + height: $line-height*2; + } + } } table { @@ -59,6 +70,10 @@ body.admin { &.text-center { text-align: center; } + + &.text-right { + text-align: right; + } } tr { diff --git a/app/views/admin/poll/officer_assignments/index.html.erb b/app/views/admin/poll/officer_assignments/index.html.erb index 55e879858..81ac5aa61 100644 --- a/app/views/admin/poll/officer_assignments/index.html.erb +++ b/app/views/admin/poll/officer_assignments/index.html.erb @@ -1,4 +1,8 @@ -<%= link_to @poll.name, admin_poll_path(@poll, anchor: 'tab-officers') %> +<%= link_to admin_poll_path(@poll, anchor: 'tab-officers') do %> + + <%= @poll.name %> +<% end %> +

<%= @officer.name %> - <%= @officer.email %>

<%= form_tag(admin_officer_assignments_path, {id: "officer_assignment_form"}) do %> @@ -40,7 +44,8 @@ <%= t("admin.poll_officer_assignments.index.date") %> - <%= t("admin.poll_officer_assignments.index.booth") %> + <%= t("admin.poll_officer_assignments.index.booth") %> + <%= t("admin.poll_officer_assignments.index.assignment") %> @@ -48,7 +53,7 @@ <%= l officer_assignment.date.to_date %> <%= booth_name_with_location(officer_assignment.booth_assignment.booth) %> - + <%= link_to t("admin.poll_officer_assignments.index.remove_assignment"), admin_officer_assignment_path(officer_assignment), method: :delete, diff --git a/app/views/admin/poll/polls/_booths.html.erb b/app/views/admin/poll/polls/_booths.html.erb index e955565fd..dbd5de3e1 100644 --- a/app/views/admin/poll/polls/_booths.html.erb +++ b/app/views/admin/poll/polls/_booths.html.erb @@ -5,11 +5,11 @@ <%= t("admin.polls.show.no_booths") %> <% else %> - +
- - - + + + <% @poll.booths.each do |booth| %> @@ -22,7 +22,7 @@ -
<%= t("admin.polls.show.name") %><%= t("admin.polls.show.location") %> <%= t("admin.polls.show.table_name") %><%= t("admin.polls.show.table_location") %><%= t("admin.polls.show.table_assignment") %>
<%= booth.location %> + <%= link_to t("admin.polls.show.remove_booth"), admin_booth_assignment_path(poll: @poll, booth: booth), method: :delete, @@ -32,4 +32,4 @@ <% end %>
-<% end %> \ No newline at end of file +<% end %> diff --git a/app/views/admin/poll/polls/_officers.html.erb b/app/views/admin/poll/polls/_officers.html.erb index e95d90d24..5f1c1d9c0 100644 --- a/app/views/admin/poll/polls/_officers.html.erb +++ b/app/views/admin/poll/polls/_officers.html.erb @@ -5,7 +5,7 @@ <%= t("admin.polls.show.no_officers") %> <% else %> - +
diff --git a/app/views/admin/poll/polls/_questions.html.erb b/app/views/admin/poll/polls/_questions.html.erb index 8adf3596e..c4dadba49 100644 --- a/app/views/admin/poll/polls/_questions.html.erb +++ b/app/views/admin/poll/polls/_questions.html.erb @@ -5,11 +5,21 @@ <%= t('admin.polls.show.no_questions') %> <% else %> -
<%= t("admin.polls.show.name") %> <%= t("admin.polls.show.email") %>
+
+ + + + + + <% @poll.questions.each do |question| %> - - +
<%= t('admin.polls.show.table_title') %><%= t('admin.polls.show.table_assignment') %>
<%= link_to question.title, admin_question_path(question) %> + + + <%= link_to question.title, admin_question_path(question) %> + + <%= link_to t('admin.polls.show.remove_question'), remove_question_admin_poll_path(poll_id: @poll.id, question_id: question.id), class: "button hollow alert", diff --git a/app/views/admin/poll/polls/_search_booths.html.erb b/app/views/admin/poll/polls/_search_booths.html.erb index e4b038e3a..a02c9e6ec 100644 --- a/app/views/admin/poll/polls/_search_booths.html.erb +++ b/app/views/admin/poll/polls/_search_booths.html.erb @@ -1,12 +1,16 @@ -<%= form_tag(search_booths_admin_poll_path(@poll), method: :get, remote: true) do |f| %> -
- <%= text_field_tag :search, - @search, - placeholder: t("admin.shared.booths_search.placeholder"), id: "search-booths" %> -
- <%= submit_tag t("admin.shared.booths_search.button"), class: "button" %> -
+
+
+ <%= form_tag(search_booths_admin_poll_path(@poll), method: :get, remote: true) do |f| %> +
+ <%= text_field_tag :search, + @search, + placeholder: t("admin.shared.booths_search.placeholder"), id: "search-booths" %> +
+ <%= submit_tag t("admin.shared.booths_search.button"), class: "button" %> +
+
+ <% end %>
-<% end %> +
diff --git a/app/views/admin/poll/polls/_search_booths_results.html.erb b/app/views/admin/poll/polls/_search_booths_results.html.erb index 3de4ffca6..3768fa222 100644 --- a/app/views/admin/poll/polls/_search_booths_results.html.erb +++ b/app/views/admin/poll/polls/_search_booths_results.html.erb @@ -1,32 +1,44 @@ - - - - - - - - <% @booths.each do |booth| %> - - - - - - <% end %> - -
<%= @booths.blank? ? t('admin.polls.show.no_search_results') : t('admin.polls.show.search_results') %>
- <%= booth.name %> - - <%= booth.location %> - - <% if @poll.booth_ids.include?(booth.id) %> - <%= link_to t("admin.polls.show.remove_booth"), - admin_booth_assignment_path(poll: @poll, booth: booth), - method: :delete, - class: "button hollow alert" %> - <% else %> - <%= link_to t("admin.polls.show.add_booth"), - admin_booth_assignments_path(poll: @poll, booth: booth), - method: :post, - class: "button hollow" %> - <% end %> -
\ No newline at end of file +<% if @booths.blank? %> +
+ <%= t('admin.polls.show.no_search_results') %> +
+<% else %> +

<%= t('admin.polls.show.search_results') %>

+<% end %> + +<% if @booths.any? %> + + + + + + + + + + <% @booths.each do |booth| %> + + + + + + <% end %> + +
<%= t("admin.polls.show.table_name") %><%= t("admin.polls.show.table_location") %><%= t("admin.polls.show.table_assignment") %>
+ <%= booth.name %> + + <%= booth.location %> + + <% if @poll.booth_ids.include?(booth.id) %> + <%= link_to t("admin.polls.show.remove_booth"), + admin_booth_assignment_path(poll: @poll, booth: booth), + method: :delete, + class: "button hollow alert" %> + <% else %> + <%= link_to t("admin.polls.show.add_booth"), + admin_booth_assignments_path(poll: @poll, booth: booth), + method: :post, + class: "button hollow" %> + <% end %> +
+<% end %> diff --git a/app/views/admin/poll/polls/_search_officers.html.erb b/app/views/admin/poll/polls/_search_officers.html.erb index 53d7c1105..b26c98d0c 100644 --- a/app/views/admin/poll/polls/_search_officers.html.erb +++ b/app/views/admin/poll/polls/_search_officers.html.erb @@ -1,12 +1,16 @@ -<%= form_tag(search_officers_admin_poll_path(@poll), method: :get, remote: true) do |f| %> -
- <%= text_field_tag :search, - @search, - placeholder: t("admin.shared.poll_officers_search.placeholder"), id: "search-officers" %> -
- <%= submit_tag t("admin.shared.poll_officers_search.button"), class: "button" %> -
+
+
+ <%= form_tag(search_officers_admin_poll_path(@poll), method: :get, remote: true) do |f| %> +
+ <%= text_field_tag :search, + @search, + placeholder: t("admin.shared.poll_officers_search.placeholder"), id: "search-officers" %> +
+ <%= submit_tag t("admin.shared.poll_officers_search.button"), class: "button" %> +
+
+ <% end %>
-<% end %> +
diff --git a/app/views/admin/poll/polls/_search_officers_results.html.erb b/app/views/admin/poll/polls/_search_officers_results.html.erb index 6225ad9c5..818a7fa8d 100644 --- a/app/views/admin/poll/polls/_search_officers_results.html.erb +++ b/app/views/admin/poll/polls/_search_officers_results.html.erb @@ -1,30 +1,42 @@ - - - - - - - - <% @officers.each do |user| %> - - - - - - <% end %> - -
<%= @officers.blank? ? t('admin.polls.show.no_search_results') : t('admin.polls.show.search_results') %>
- <%= user.name %> - - <%= user.email %> - - <% if @poll.officer_ids.include?(user.poll_officer.id) %> - <%= link_to t("admin.polls.show.edit_officer_assignments"), - admin_officer_assignments_path(poll: @poll, officer: user.poll_officer), - class: "button hollow alert" %> - <% else %> - <%= link_to t("admin.polls.show.add_officer_assignments"), - admin_officer_assignments_path(poll: @poll, officer: user.poll_officer), - class: "button hollow" %> - <% end %> -
\ No newline at end of file +<% if @officers.blank? %> +
+ <%= t('admin.polls.show.no_search_results') %> +
+<% else %> +

<%= t('admin.polls.show.search_results') %>

+<% end %> + +<% if @officers.any? %> + + + + + + + + + + <% @officers.each do |user| %> + + + + + + <% end %> + +
<%= t("admin.polls.show.table_name") %><%= t("admin.polls.show.table_email") %><%= t("admin.polls.show.table_assignment") %>
+ <%= user.name %> + + <%= user.email %> + + <% if @poll.officer_ids.include?(user.poll_officer.id) %> + <%= link_to t("admin.polls.show.edit_officer_assignments"), + admin_officer_assignments_path(poll: @poll, officer: user.poll_officer), + class: "button hollow alert" %> + <% else %> + <%= link_to t("admin.polls.show.add_officer_assignments"), + admin_officer_assignments_path(poll: @poll, officer: user.poll_officer), + class: "button hollow" %> + <% end %> +
+<% end %> diff --git a/app/views/admin/poll/polls/_search_questions.html.erb b/app/views/admin/poll/polls/_search_questions.html.erb index 2f82d82cf..659cdcd37 100644 --- a/app/views/admin/poll/polls/_search_questions.html.erb +++ b/app/views/admin/poll/polls/_search_questions.html.erb @@ -1,13 +1,17 @@ -<%= form_tag(search_questions_admin_poll_path(@poll), method: :get, remote: true) do |f| %> -
- <%= text_field_tag :search, - @search, - placeholder: t("admin.shared.poll_questions_search.placeholder"), id: "search-questions" %> +
+
+ <%= form_tag(search_questions_admin_poll_path(@poll), method: :get, remote: true) do |f| %> +
+ <%= text_field_tag :search, + @search, + placeholder: t("admin.shared.poll_questions_search.placeholder"), id: "search-questions" %> -
- <%= submit_tag t("admin.shared.poll_questions_search.button"), class: "button" %> -
+
+ <%= submit_tag t("admin.shared.poll_questions_search.button"), class: "button" %> +
+
+ <% end %>
-<% end %> +
diff --git a/app/views/admin/poll/polls/_search_questions_results.html.erb b/app/views/admin/poll/polls/_search_questions_results.html.erb index e7012edd3..27dcbb652 100644 --- a/app/views/admin/poll/polls/_search_questions_results.html.erb +++ b/app/views/admin/poll/polls/_search_questions_results.html.erb @@ -1,25 +1,37 @@ - - - - - - - - <% @questions.each do |question| %> - - - - - - <% end %> - -
<%= @questions.blank? ? t('admin.polls.show.no_search_results') : t('admin.polls.show.search_results') %>
- <%= question.title %> - - <%= question.summary %> - - <%= link_to t("admin.polls.show.add_question"), - add_question_admin_poll_path(poll_id: @poll.id, question_id: question.id), - method: :patch, - class: "button hollow" %> -
\ No newline at end of file +<% if @questions.blank? %> +
+ <%= t('admin.polls.show.no_search_results') %> +
+<% else %> +

<%= t('admin.polls.show.search_results') %>

+<% end %> + +<% if @questions.any? %> + + + + + + + + + + <% @questions.each do |question| %> + + + + + + <% end %> + +
<%= t("admin.polls.show.table_name") %><%= t("admin.polls.show.table_summary") %><%= t("admin.polls.show.table_assignment") %>
+ <%= question.title %> + + <%= question.summary %> + + <%= link_to t("admin.polls.show.add_question"), + add_question_admin_poll_path(poll_id: @poll.id, question_id: question.id), + method: :patch, + class: "button hollow" %> +
+<% end %> diff --git a/app/views/admin/poll/polls/show.html.erb b/app/views/admin/poll/polls/show.html.erb index 5a59cfa9e..fdc00b949 100644 --- a/app/views/admin/poll/polls/show.html.erb +++ b/app/views/admin/poll/polls/show.html.erb @@ -1,39 +1,30 @@ -

- <%= @poll.name %> - <%= l @poll.starts_at.to_date %> - <%= l @poll.ends_at.to_date %> -

- <%= link_to t("admin.actions.edit"), edit_admin_poll_path(@poll), class: "button hollow float-right" %> +

+ <%= @poll.name %> +

+
+

+ (<%= l @poll.starts_at.to_date %> - <%= l @poll.ends_at.to_date %>) +

+
<%= render "filter_subnav" %>
-
-
- <%= render "search_questions" %> -
-
+ <%= render "search_questions" %> <%= render "questions" %>
-
-
- <%= render "search_booths" %> -
-
+ <%= render "search_booths" %> <%= render "booths" %>
-
-
- <%= render "search_officers" %> -
-
+ <%= render "search_officers" %> <%= render 'officers' %>
\ No newline at end of file diff --git a/app/views/admin/poll/questions/show.html.erb b/app/views/admin/poll/questions/show.html.erb index 1bf130359..91bf398af 100644 --- a/app/views/admin/poll/questions/show.html.erb +++ b/app/views/admin/poll/questions/show.html.erb @@ -7,14 +7,17 @@
- <% if @question.proposal.present? %> - <%= t("admin.questions.show.proposal") %> - <%= link_to @question.proposal.title, proposal_path(@question.proposal) %> - <% end %> - <%= t("admin.questions.show.title") %>

<%= @question.title %>

+ <% if @question.proposal.present? %> +

+ <%= t("admin.questions.show.proposal") %> +
+ <%= link_to @question.proposal.title, proposal_path(@question.proposal) %> +

+ <% end %> +

<%= t("admin.questions.show.author") %>
diff --git a/config/locales/admin.en.yml b/config/locales/admin.en.yml index 42613832b..310a9142e 100755 --- a/config/locales/admin.en.yml +++ b/config/locales/admin.en.yml @@ -173,12 +173,13 @@ en: new_assignment: "New shift" date: "Date" booth: "Booth" + assignment: "Assignment" select_date: "Select day" select_booth: "Select booth" add_assignment: "Add shift" remove_assignment: "Remove" assignments: "Officing shifts in this poll" - no_assignments: "This user has no officing shifts in this poll" + no_assignments: "This user has no officing shifts in this poll." polls: index: title: "List of polls" @@ -200,8 +201,8 @@ en: questions_tab: Questions booths_tab: Booths officers_tab: Officers - no_booths: "There are no booths in this poll." - no_questions: "There are no questions assigned to this poll yet." + no_booths: "There are no booths assigned to this poll." + no_questions: "There are no questions assigned to this poll." no_officers: "There are no officers assigned to this poll." remove_booth: "Remove booth from poll" booths_title: "List of booths" @@ -212,11 +213,14 @@ en: add_question: "Include question" add_officer_assignments: "Add shifts as officer" edit_officer_assignments: "Edit officing shifts" - name: "Name" - location: "Location" - email: "Email" search_results: "Search results" - no_search_results: "No results found" + no_search_results: "No results found." + table_title: "Title" + table_summary: "Summary" + table_assignment: "Assignment" + table_name: "Name" + table_location: "Location" + table_email: "Email" flash: question_added: "Question added to this poll" error_on_question_added: "Question could not be assigned to this poll" diff --git a/config/locales/admin.es.yml b/config/locales/admin.es.yml index 6394c6daa..a461d165e 100644 --- a/config/locales/admin.es.yml +++ b/config/locales/admin.es.yml @@ -173,12 +173,13 @@ es: new_assignment: "Nuevo turno" date: "Fecha" booth: "Urna" + assignment: "Asignación" select_date: "Seleccionar día" select_booth: "Seleccionar urna" add_assignment: "Añadir turno" remove_assignment: "Eliminar turno" assignments: "Turnos como presidente de mesa en esta votación" - no_assignments: "No tiene turnos como presidente de mesa en esta votación" + no_assignments: "No tiene turnos como presidente de mesa en esta votación." polls: index: title: "Listado de votaciones" @@ -200,9 +201,9 @@ es: questions_tab: Preguntas booths_tab: Urnas officers_tab: Presidentes de mesa - no_booths: "No hay urnas en esta votación." - no_questions: "No hay preguntas asignadas a esta votación todavía." - no_officers: "No hay presidentes de mesa asignados." + no_booths: "No hay urnas asignadas a esta votación." + no_questions: "No hay preguntas asignadas a esta votación." + no_officers: "No hay presidentes de mesa asignados a esta votación." remove_booth: "Desasignar urna" booths_title: "Listado de urnas asignadas" officers_title: "Listado de presidentes de mesa asignados" @@ -212,11 +213,14 @@ es: add_question: "Incluir pregunta" add_officer_assignments: "Añadir turnos como presidente de mesa" edit_officer_assignments: "Editar turnos" - name: "Nombre" - location: "Ubicación" - email: "Email" search_results: "Resultados de la búsqueda" - no_search_results: "No se han encontrado resultados" + no_search_results: "No se han encontrado resultados." + table_title: "Título" + table_summary: "Resumen" + table_assignment: "Asignación" + table_name: "Nombre" + table_location: "Ubicación" + table_email: "Email" flash: question_added: "Pregunta añadida a esta votación" error_on_question_added: "No se pudo asignar la pregunta"