| <%= 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/officers/index.html.erb b/app/views/admin/poll/officers/index.html.erb
index d6e11682b..fd9619167 100644
--- a/app/views/admin/poll/officers/index.html.erb
+++ b/app/views/admin/poll/officers/index.html.erb
@@ -12,40 +12,42 @@
<%= page_entries_info @officers, entry_name: t('admin.poll_officers.officer.entry_name') %>
-
-
-
- | <%= t('admin.poll_officers.officer.name') %> |
- <%= t('admin.poll_officers.officer.email') %> |
-
-
-
- <% @officers.each do |officer| %>
-
- |
- <%= officer.name %>
- |
-
- <%= officer.email %>
- |
-
- <% if officer.persisted? %>
- <%= link_to t('admin.poll_officers.officer.delete'),
- admin_officer_path(officer),
- method: :delete,
- class: "button hollow alert"
- %>
- <% else %>
- <%= link_to t('admin.poll_officers.officer.add'),
- { controller: "admin/poll/officers", action: :create,
- user_id: officer.user_id },
- method: :post,
- class: "button success" %>
- <% end %>
- |
-
- <% end %>
-
-
+<% if @officers.any? %>
+
+
+
+ | <%= t('admin.poll_officers.officer.name') %> |
+ <%= t('admin.poll_officers.officer.email') %> |
+
+
+
+ <% @officers.each do |officer| %>
+
+ |
+ <%= officer.name %>
+ |
+
+ <%= officer.email %>
+ |
+
+ <% if officer.persisted? %>
+ <%= link_to t('admin.poll_officers.officer.delete'),
+ admin_officer_path(officer),
+ method: :delete,
+ class: "button hollow alert"
+ %>
+ <% else %>
+ <%= link_to t('admin.poll_officers.officer.add'),
+ { controller: "admin/poll/officers", action: :create,
+ user_id: officer.user_id },
+ method: :post,
+ class: "button success" %>
+ <% end %>
+ |
+
+ <% end %>
+
+
-<%= paginate @officers %>
+ <%= paginate @officers %>
+<% end %>
\ No newline at end of file
diff --git a/app/views/admin/poll/officers/user_not_found.js.erb b/app/views/admin/poll/officers/user_not_found.js.erb
index 40b6caac5..a6444dc61 100644
--- a/app/views/admin/poll/officers/user_not_found.js.erb
+++ b/app/views/admin/poll/officers/user_not_found.js.erb
@@ -1 +1 @@
-$("#search-result").html("<%= j t('admin.poll_officers.search.user_not_found') %> ");
+$("#search-result").html("<%= j t('admin.poll_officers.search.user_not_found') %> ");
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 %>
-
+
- | <%= 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") %> |
<% @poll.booths.each do |booth| %>
@@ -22,7 +22,7 @@
<%= 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..a3c78c656 100644
--- a/app/views/admin/poll/polls/_officers.html.erb
+++ b/app/views/admin/poll/polls/_officers.html.erb
@@ -5,10 +5,10 @@
<%= t("admin.polls.show.no_officers") %>
<% else %>
-
+
- | <%= t("admin.polls.show.name") %> |
- <%= t("admin.polls.show.email") %> |
+ <%= t("admin.polls.show.table_name") %> |
+ <%= t("admin.polls.show.table_email") %> |
<% @poll.officers.each do |officer| %>
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.table_title') %> |
+ <%= t('admin.polls.show.table_assignment') %> |
+
+
<% @poll.questions.each do |question| %>
- | <%= 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 56d9cbb12..a02c9e6ec 100644
--- a/app/views/admin/poll/polls/_search_booths.html.erb
+++ b/app/views/admin/poll/polls/_search_booths.html.erb
@@ -1,14 +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| %>
+
+ <% 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.blank? ? t('admin.polls.show.no_search_results') : t('admin.polls.show.search_results') %> |
-
-
-
- <% @booths.each do |booth| %>
-
- |
- <%= 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 %>
-
-
\ 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? %>
+
+
+
+ | <%= t("admin.polls.show.table_name") %> |
+ <%= t("admin.polls.show.table_location") %> |
+ <%= t("admin.polls.show.table_assignment") %> |
+
+
+
+ <% @booths.each do |booth| %>
+
+ |
+ <%= 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 %>
+
+
+<% end %>
diff --git a/app/views/admin/poll/polls/_search_officers.html.erb b/app/views/admin/poll/polls/_search_officers.html.erb
index 45ce9bd8f..b26c98d0c 100644
--- a/app/views/admin/poll/polls/_search_officers.html.erb
+++ b/app/views/admin/poll/polls/_search_officers.html.erb
@@ -1,14 +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| %>
+
+ <% 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.blank? ? t('admin.polls.show.no_search_results') : t('admin.polls.show.search_results') %> |
-
-
-
- <% @officers.each do |user| %>
-
- |
- <%= 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 %>
-
-
\ 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? %>
+
+
+
+ | <%= t("admin.polls.show.table_name") %> |
+ <%= t("admin.polls.show.table_email") %> |
+ <%= t("admin.polls.show.table_assignment") %> |
+
+
+
+ <% @officers.each do |user| %>
+
+ |
+ <%= 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 %>
+
+
+<% end %>
diff --git a/app/views/admin/poll/polls/_search_questions.html.erb b/app/views/admin/poll/polls/_search_questions.html.erb
index 0a6123c1b..659cdcd37 100644
--- a/app/views/admin/poll/polls/_search_questions.html.erb
+++ b/app/views/admin/poll/polls/_search_questions.html.erb
@@ -1,14 +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" %>
-
-
- <%= submit_tag t("admin.shared.poll_questions_search.button"), class: "button" %>
-
+
+
+ <%= form_tag(search_questions_admin_poll_path(@poll), method: :get, remote: true) do |f| %>
+
+ <% 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.blank? ? t('admin.polls.show.no_search_results') : t('admin.polls.show.search_results') %> |
-
-
-
- <% @questions.each do |question| %>
-
- |
- <%= 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 %>
-
-
\ 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? %>
+
+
+
+ | <%= t("admin.polls.show.table_name") %> |
+ <%= t("admin.polls.show.table_summary") %> |
+ <%= t("admin.polls.show.table_assignment") %> |
+
+
+
+ <% @questions.each do |question| %>
+
+ |
+ <%= 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 %>
+
+
+<% end %>
diff --git a/app/views/admin/poll/polls/show.html.erb b/app/views/admin/poll/polls/show.html.erb
index e357bc7f4..fdc00b949 100644
--- a/app/views/admin/poll/polls/show.html.erb
+++ b/app/views/admin/poll/polls/show.html.erb
@@ -1,12 +1,15 @@
-
- <%= @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" %>
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"
diff --git a/spec/features/admin/poll/booth_assigments_spec.rb b/spec/features/admin/poll/booth_assigments_spec.rb
index ba7f3445a..3f21e0089 100644
--- a/spec/features/admin/poll/booth_assigments_spec.rb
+++ b/spec/features/admin/poll/booth_assigments_spec.rb
@@ -16,7 +16,7 @@ feature 'Admin booths assignments' do
click_link 'Booths (0)'
end
- expect(page).to have_content 'There are no booths in this poll'
+ expect(page).to have_content 'There are no booths assigned to this poll.'
fill_in 'search-booths', with: booth.name
click_button 'Search'
@@ -32,7 +32,7 @@ feature 'Admin booths assignments' do
click_link 'Booths (1)'
end
- expect(page).to_not have_content 'There are no booths in this poll'
+ expect(page).to_not have_content 'There are no booths assigned to this poll.'
expect(page).to have_content booth.name
end
@@ -46,7 +46,7 @@ feature 'Admin booths assignments' do
click_link 'Booths (1)'
end
- expect(page).to_not have_content 'There are no booths in this poll'
+ expect(page).to_not have_content 'There are no booths assigned to this poll.'
expect(page).to have_content booth.name
within("#booth_#{booth.id}") do
@@ -60,7 +60,7 @@ feature 'Admin booths assignments' do
click_link 'Booths (0)'
end
- expect(page).to have_content 'There are no booths in this poll'
+ expect(page).to have_content 'There are no booths assigned to this poll.'
expect(page).to_not have_content booth.name
end
end
\ No newline at end of file
diff --git a/spec/features/admin/poll/officers_spec.rb b/spec/features/admin/poll/officers_spec.rb
index 5eac71744..d9ea89638 100644
--- a/spec/features/admin/poll/officers_spec.rb
+++ b/spec/features/admin/poll/officers_spec.rb
@@ -30,9 +30,7 @@ feature 'Admin poll officers' do
scenario 'Delete' do
click_link 'Delete position'
- within("#officers") do
- expect(page).to_not have_content @officer.name
- end
+ expect(page).to_not have_css '#officers'
end
end
\ No newline at end of file
diff --git a/spec/features/admin/poll/polls_spec.rb b/spec/features/admin/poll/polls_spec.rb
index 31d7f6128..6f4f60a3d 100644
--- a/spec/features/admin/poll/polls_spec.rb
+++ b/spec/features/admin/poll/polls_spec.rb
@@ -103,7 +103,7 @@ feature 'Admin polls' do
visit admin_poll_path(poll)
click_link "Booths (0)"
- expect(page).to have_content "There are no booths in this poll."
+ expect(page).to have_content "There are no booths assigned to this poll."
end
scenario "Booth list", :js do
@@ -122,7 +122,7 @@ feature 'Admin polls' do
expect(page).to have_content booth.location
end
end
- expect(page).to_not have_content "There are no booths"
+ expect(page).to_not have_content "There are no booths assigned to this poll."
end
end
end
| |