From 0ddf7a003c1c7545d7cde0a5f3f19898c868d503 Mon Sep 17 00:00:00 2001 From: Alberto Garcia Cabeza Date: Fri, 16 Dec 2016 14:02:03 +0100 Subject: [PATCH 1/7] adds dates on polls index --- app/views/admin/poll/polls/_poll.html.erb | 3 +-- app/views/admin/poll/polls/index.html.erb | 2 +- config/locales/admin.en.yml | 2 +- config/locales/admin.es.yml | 2 +- 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/app/views/admin/poll/polls/_poll.html.erb b/app/views/admin/poll/polls/_poll.html.erb index 4128ad222..e02a80a7a 100644 --- a/app/views/admin/poll/polls/_poll.html.erb +++ b/app/views/admin/poll/polls/_poll.html.erb @@ -5,8 +5,7 @@ - Próximamente -
(15/12/2016 - 15/02/2017) + <%= l poll.starts_at.to_date %> - <%= l poll.ends_at.to_date %> <%= link_to t("admin.actions.edit"), diff --git a/app/views/admin/poll/polls/index.html.erb b/app/views/admin/poll/polls/index.html.erb index b4c18d21b..75b52affa 100644 --- a/app/views/admin/poll/polls/index.html.erb +++ b/app/views/admin/poll/polls/index.html.erb @@ -8,7 +8,7 @@ - + diff --git a/config/locales/admin.en.yml b/config/locales/admin.en.yml index fa5fb528f..a99f0d969 100755 --- a/config/locales/admin.en.yml +++ b/config/locales/admin.en.yml @@ -167,7 +167,7 @@ en: no_polls: "There are no polls." create: "Create poll" name: "Name" - status: "Status" + dates: "Dates" new: title: "New poll" submit_button: "Create poll" diff --git a/config/locales/admin.es.yml b/config/locales/admin.es.yml index 11cfe8d2a..d58fa4230 100644 --- a/config/locales/admin.es.yml +++ b/config/locales/admin.es.yml @@ -167,7 +167,7 @@ es: no_polls: "No hay ninguna votación." create: "Crear votación" name: "Nombre" - status: "Estado" + dates: "Fechas" new: title: "Nueva votación" submit_button: "Crear votación" From 30a56d21f7f03459e8c6077f15e9165fbb710ec7 Mon Sep 17 00:00:00 2001 From: Alberto Garcia Cabeza Date: Fri, 16 Dec 2016 14:09:04 +0100 Subject: [PATCH 2/7] changes text to remove questions on polls questions list --- app/views/admin/poll/polls/_questions.html.erb | 5 +---- config/locales/admin.en.yml | 1 + config/locales/admin.es.yml | 3 ++- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/app/views/admin/poll/polls/_questions.html.erb b/app/views/admin/poll/polls/_questions.html.erb index 08b094ddf..1cd8597bb 100644 --- a/app/views/admin/poll/polls/_questions.html.erb +++ b/app/views/admin/poll/polls/_questions.html.erb @@ -10,10 +10,7 @@
<%= t("admin.polls.index.name") %><%= t("admin.polls.index.status") %><%= t("admin.polls.index.dates") %>  
<%= link_to question.title, admin_question_path(question) %> - <%= link_to t('shared.edit'), - edit_admin_question_path(question), - class: "button hollow" %> - <%= link_to t('shared.delete'), + <%= link_to t('admin.polls.show.remove_question'), admin_question_path(question), class: "button hollow alert", method: :delete %> diff --git a/config/locales/admin.en.yml b/config/locales/admin.en.yml index a99f0d969..edba441f8 100755 --- a/config/locales/admin.en.yml +++ b/config/locales/admin.en.yml @@ -189,6 +189,7 @@ en: booths_title: "List of booths" officers_title: "List of officers" questions_title: "List of questions" + remove_question: "Remove question from poll" name: "Name" location: "Location" email: "Email" diff --git a/config/locales/admin.es.yml b/config/locales/admin.es.yml index d58fa4230..fedb0a4e3 100644 --- a/config/locales/admin.es.yml +++ b/config/locales/admin.es.yml @@ -185,10 +185,11 @@ es: 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." - remove_booth: "Deasignar urna" + remove_booth: "Desasignar urna" booths_title: "Listado de urnas" officers_title: "Listado de presidentes de mesa" questions_title: "Listado de preguntas" + remove_question: "Desasignar pregunta" name: "Nombre" location: "Ubicación" email: "Email" From 71fa9afab8c45038a7982c3a4e522ffa903bd7e7 Mon Sep 17 00:00:00 2001 From: Alberto Garcia Cabeza Date: Fri, 16 Dec 2016 14:09:22 +0100 Subject: [PATCH 3/7] adds edit button on questions show --- app/views/admin/poll/questions/show.html.erb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/views/admin/poll/questions/show.html.erb b/app/views/admin/poll/questions/show.html.erb index ba5b6497b..1bf130359 100644 --- a/app/views/admin/poll/questions/show.html.erb +++ b/app/views/admin/poll/questions/show.html.erb @@ -1,8 +1,11 @@ <%= render "shared/back_link" %> +<%= link_to t('shared.edit'), edit_admin_question_path(@question), + class: "button hollow float-right" %> +
-
+
<% if @question.proposal.present? %> <%= t("admin.questions.show.proposal") %> From d45442deed37c3e6e86fb709ff2ba5eb30973b5e Mon Sep 17 00:00:00 2001 From: Alberto Garcia Cabeza Date: Fri, 16 Dec 2016 14:27:55 +0100 Subject: [PATCH 4/7] changes text on delete position officers --- config/locales/admin.en.yml | 2 +- config/locales/admin.es.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/config/locales/admin.en.yml b/config/locales/admin.en.yml index edba441f8..87a8cc75f 100755 --- a/config/locales/admin.en.yml +++ b/config/locales/admin.en.yml @@ -153,7 +153,7 @@ en: title: Poll officers officer: add: Add - delete: Delete + delete: Delete position name: Name email: Email entry_name: officer diff --git a/config/locales/admin.es.yml b/config/locales/admin.es.yml index fedb0a4e3..183597625 100644 --- a/config/locales/admin.es.yml +++ b/config/locales/admin.es.yml @@ -153,7 +153,7 @@ es: title: Presidentes de mesa officer: add: Añadir como Presidente de mesa - delete: Borrar + delete: Eliminar cargo name: Nombre email: Email entry_name: presidente de mesa From 772f8ea4addda07d1bf90c33faf4d0e6eb1a8666 Mon Sep 17 00:00:00 2001 From: Alberto Garcia Cabeza Date: Fri, 16 Dec 2016 14:29:28 +0100 Subject: [PATCH 5/7] removes booth name link on booths index --- app/views/admin/poll/booths/_booth.html.erb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/app/views/admin/poll/booths/_booth.html.erb b/app/views/admin/poll/booths/_booth.html.erb index 5bccfa9c6..5732400a8 100644 --- a/app/views/admin/poll/booths/_booth.html.erb +++ b/app/views/admin/poll/booths/_booth.html.erb @@ -1,8 +1,6 @@
- - <%= link_to booth.name, admin_booth_path(booth) %> - + <%= booth.name %> <%= booth.location %> From 10c44a077b71897c8cee623e0a47ae10f4396b1d Mon Sep 17 00:00:00 2001 From: Alberto Garcia Cabeza Date: Fri, 16 Dec 2016 15:19:04 +0100 Subject: [PATCH 6/7] updates specs --- spec/features/admin/poll/booths_spec.rb | 1 - spec/features/admin/poll/officers_spec.rb | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/spec/features/admin/poll/booths_spec.rb b/spec/features/admin/poll/booths_spec.rb index a5fc9e6c0..b84e32b74 100644 --- a/spec/features/admin/poll/booths_spec.rb +++ b/spec/features/admin/poll/booths_spec.rb @@ -40,7 +40,6 @@ feature 'Admin booths' do booth = create(:poll_booth) visit admin_booths_path - click_link booth.name expect(page).to have_content booth.name expect(page).to have_content booth.location diff --git a/spec/features/admin/poll/officers_spec.rb b/spec/features/admin/poll/officers_spec.rb index 932bec212..5eac71744 100644 --- a/spec/features/admin/poll/officers_spec.rb +++ b/spec/features/admin/poll/officers_spec.rb @@ -28,7 +28,7 @@ feature 'Admin poll officers' do end scenario 'Delete' do - click_link 'Delete' + click_link 'Delete position' within("#officers") do expect(page).to_not have_content @officer.name From 9c78b60ddc95e5c853ad8ef2ce2a3f56283891e1 Mon Sep 17 00:00:00 2001 From: Alberto Garcia Cabeza Date: Fri, 16 Dec 2016 18:59:15 +0100 Subject: [PATCH 7/7] adds provisional content on booths show and officers assign --- app/assets/stylesheets/admin.scss | 10 +++ app/views/admin/poll/booths/show.html.erb | 87 ++++++++++++++++++- app/views/admin/poll/polls/_officers.html.erb | 62 +++++++++++++ 3 files changed, 155 insertions(+), 4 deletions(-) diff --git a/app/assets/stylesheets/admin.scss b/app/assets/stylesheets/admin.scss index adc166d96..89bed6d21 100644 --- a/app/assets/stylesheets/admin.scss +++ b/app/assets/stylesheets/admin.scss @@ -5,6 +5,7 @@ // 03. List elements // 04. Stats // 05. Management +// 06. Polls // // 01. Global styles @@ -474,3 +475,12 @@ table.investment-projects-summary { background: #e0e0e0; } } + +// 06. Polls +// ----------------- + +.count-error { + background: $alert-bg !important; + color: $color-alert; + font-weight: bold; +} diff --git a/app/views/admin/poll/booths/show.html.erb b/app/views/admin/poll/booths/show.html.erb index 4d21f32e3..c72fd525d 100644 --- a/app/views/admin/poll/booths/show.html.erb +++ b/app/views/admin/poll/booths/show.html.erb @@ -3,13 +3,92 @@

- <%= @booth.name %> + Poll 3: <%= @booth.name %>

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

<%= t("admin.booths.show.location") %>: <%= @booth.location %>

+ +
+
    +
  • + <%= link_to "#tab-officers" do %> + Presidentes de mesa + <% end %> +
  • +
  • + <%= link_to "#tab-count" do %> + Recuentos + <% end %> +
  • +
+ +
+

Lista de presidentes de mesa

+ +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
FechaPresidente de mesaEmail
13/02/2016Clemente Padilla Oterouser5@consul.dev
13/02/2016Ana Luisa Ceja Benítezuser7@consul.dev
14/02/2016Clemente Padilla Oterouser5@consul.dev
+
+ +
+

Lista de recuentos

+ + + + + + + + + + + + + + + + + + + + + + + + + +
FechaVotos (Presidente de mesa)Votos (Admin)
13/02/2016320320
14/02/2016160140
15/02/2016226226
+
+
diff --git a/app/views/admin/poll/polls/_officers.html.erb b/app/views/admin/poll/polls/_officers.html.erb index 11b4cce50..106bff526 100644 --- a/app/views/admin/poll/polls/_officers.html.erb +++ b/app/views/admin/poll/polls/_officers.html.erb @@ -26,3 +26,65 @@
<% end %> + + +

Clemente padilla Otero

+

user2@consul.dev

+ + +
+ Nuevo turno +
+ + +
+ +
+ + +
+ +
+ +
+
+ +Añadir nuevo turno + +

Turnos asignados

+ + + + + + + + + + + + + + + + + + + + + + + + +
FechaUrna
13/02/2016Urna Moncloa + <%= link_to "Eliminar turno", "#", class: "button hollow alert" %> +
14/02/2016Urna Moncloa + <%= link_to "Eliminar turno", "#", class: "button hollow alert" %> +
15/02/2016Urna Chamartín + <%= link_to "Eliminar turno", "#", class: "button hollow alert" %> +
+