From 07f74cf6e5339539164a76f92a611114b593b918 Mon Sep 17 00:00:00 2001 From: decabeza Date: Mon, 9 Oct 2017 19:40:16 +0200 Subject: [PATCH 1/6] improves layout for admin polls index --- app/views/admin/poll/polls/_poll.html.erb | 4 ++-- app/views/admin/poll/polls/index.html.erb | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/views/admin/poll/polls/_poll.html.erb b/app/views/admin/poll/polls/_poll.html.erb index b65ce3e71..5ec63b6b5 100644 --- a/app/views/admin/poll/polls/_poll.html.erb +++ b/app/views/admin/poll/polls/_poll.html.erb @@ -7,7 +7,7 @@ <%= 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" %> @@ -15,4 +15,4 @@ admin_poll_path(poll), class: "button hollow" %> - \ No newline at end of file + diff --git a/app/views/admin/poll/polls/index.html.erb b/app/views/admin/poll/polls/index.html.erb index 5bd310e54..791ec4876 100644 --- a/app/views/admin/poll/polls/index.html.erb +++ b/app/views/admin/poll/polls/index.html.erb @@ -5,11 +5,11 @@ class: "button success float-right" %> <% if @polls.any? %> - +
- + <%= render @polls %> @@ -19,4 +19,4 @@
<%= t("admin.polls.index.no_polls") %>
-<% end %> \ No newline at end of file +<% end %> From 80298a2746ff3c43d76cd0743cb2ff560bda58f5 Mon Sep 17 00:00:00 2001 From: decabeza Date: Mon, 9 Oct 2017 19:42:10 +0200 Subject: [PATCH 2/6] improves admin poll header --- app/assets/stylesheets/layout.scss | 4 +++ .../admin/poll/polls/_poll_header.html.erb | 30 ++++++++++++------- config/locales/en/admin.yml | 1 + config/locales/es/admin.yml | 1 + 4 files changed, 25 insertions(+), 11 deletions(-) diff --git a/app/assets/stylesheets/layout.scss b/app/assets/stylesheets/layout.scss index efa0454db..160819795 100644 --- a/app/assets/stylesheets/layout.scss +++ b/app/assets/stylesheets/layout.scss @@ -155,6 +155,10 @@ a { margin-bottom: $line-height; } +.margin-left { + margin-left: $line-height; +} + .margin-right { margin-right: $line-height; } diff --git a/app/views/admin/poll/polls/_poll_header.html.erb b/app/views/admin/poll/polls/_poll_header.html.erb index a88dd03ee..2b1ade5fb 100644 --- a/app/views/admin/poll/polls/_poll_header.html.erb +++ b/app/views/admin/poll/polls/_poll_header.html.erb @@ -1,17 +1,25 @@ -<%= link_to t("admin.actions.edit"), +<%= link_to t("admin.polls.edit.title"), edit_admin_poll_path(@poll), class: "button hollow float-right" %>

<%= @poll.name %>

-
- - (<%= l @poll.starts_at.to_date %> - <%= l @poll.ends_at.to_date %>) - -<% if @poll.geozone_restricted %> -  •  - - <%= @poll.geozones.pluck(:name).to_sentence %> - -<% end %> \ No newline at end of file + +
+ +
+
+ <%= t("admin.polls.index.dates") %> +
+ <%= l @poll.starts_at.to_date %> - <%= l @poll.ends_at.to_date %> +
+ + <% if @poll.geozone_restricted %> +
+ <%= t("admin.polls.index.geozone_restricted") %> +
+ <%= @poll.geozones.pluck(:name).to_sentence %> +
+ <% end %> +
diff --git a/config/locales/en/admin.yml b/config/locales/en/admin.yml index 442c93727..8c3b3c944 100644 --- a/config/locales/en/admin.yml +++ b/config/locales/en/admin.yml @@ -552,6 +552,7 @@ en: create: "Create poll" name: "Name" dates: "Dates" + geozone_restricted: "Restricted to districts" new: title: "New poll" submit_button: "Create poll" diff --git a/config/locales/es/admin.yml b/config/locales/es/admin.yml index 5b6393b1b..a4f400427 100644 --- a/config/locales/es/admin.yml +++ b/config/locales/es/admin.yml @@ -552,6 +552,7 @@ es: create: "Crear votación" name: "Nombre" dates: "Fechas" + geozone_restricted: "Restringida a los distritos" new: title: "Nueva votación" submit_button: "Crear votación" From 36d39503e8ff88754d38980b2732a0166f1171e6 Mon Sep 17 00:00:00 2001 From: decabeza Date: Mon, 9 Oct 2017 19:42:53 +0200 Subject: [PATCH 3/6] improves admin poll questions show --- app/views/admin/poll/questions/show.html.erb | 6 +++--- config/locales/en/admin.yml | 3 ++- config/locales/es/admin.yml | 3 ++- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/app/views/admin/poll/questions/show.html.erb b/app/views/admin/poll/questions/show.html.erb index 5baabeafe..52c4f3276 100644 --- a/app/views/admin/poll/questions/show.html.erb +++ b/app/views/admin/poll/questions/show.html.erb @@ -1,6 +1,6 @@ <%= back_link_to %> -<%= link_to t('shared.edit'), edit_admin_question_path(@question), +<%= link_to t('admin.questions.show.edit_question'), edit_admin_question_path(@question), class: "button hollow float-right" %>
@@ -8,7 +8,7 @@

- <%= t("admin.questions.show.title") %> + <%= t("admin.questions.show.question") %>
<%= @question.title %>

@@ -35,7 +35,7 @@ <%= t('admin.questions.show.valid_answers') %> <%= link_to t("admin.questions.show.add_answer"), new_admin_question_answer_path(@question), - class: "button hollow float-right" %> + class: "button float-right" %> diff --git a/config/locales/en/admin.yml b/config/locales/en/admin.yml index 8c3b3c944..6a30235e0 100644 --- a/config/locales/en/admin.yml +++ b/config/locales/en/admin.yml @@ -595,7 +595,8 @@ en: show: proposal: Original proposal author: Author - title: Title + question: Question + edit_question: Edit question valid_answers: Valid answers add_answer: Add answer video_url: External video diff --git a/config/locales/es/admin.yml b/config/locales/es/admin.yml index a4f400427..9d4af1e81 100644 --- a/config/locales/es/admin.yml +++ b/config/locales/es/admin.yml @@ -595,7 +595,8 @@ es: show: proposal: Propuesta ciudadana original author: Autor - title: Título + question: Pregunta + edit_question: Editar pregunta valid_answers: Respuestas válidas add_answer: Añadir respuesta video_url: Video externo From 9dc8a0fb344cb3112ddd87df48ad13d35439a055 Mon Sep 17 00:00:00 2001 From: decabeza Date: Mon, 9 Oct 2017 19:44:12 +0200 Subject: [PATCH 4/6] fixes questions table with long links on description --- app/views/admin/poll/questions/show.html.erb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/views/admin/poll/questions/show.html.erb b/app/views/admin/poll/questions/show.html.erb index 52c4f3276..697843d0d 100644 --- a/app/views/admin/poll/questions/show.html.erb +++ b/app/views/admin/poll/questions/show.html.erb @@ -49,21 +49,21 @@ <% @question.question_answers.each do |answer| %>
- - - + + - -
<%= t("admin.polls.index.name") %> <%= t("admin.polls.index.dates") %><%= t("admin.actions.actions") %><%= t("admin.actions.actions") %>
<%= link_to answer.title, admin_answer_path(answer) %><%= answer.description %> + <%= link_to answer.title, admin_answer_path(answer) %><%= answer.description %> (<%= answer.images.count %>)
<%= link_to t("admin.questions.show.answers.images_list"), admin_answer_images_path(answer) %>
+ (<%= answer.documents.count rescue 0 %>)
<%= link_to t("admin.questions.show.answers.documents_list"), admin_answer_documents_path(answer) %>
+ (<%= answer.videos.count %>)
<%= link_to t("admin.questions.show.answers.video_list"), From 471860ea415444f099abc8386283b9cbf1602d08 Mon Sep 17 00:00:00 2001 From: decabeza Date: Mon, 9 Oct 2017 19:44:58 +0200 Subject: [PATCH 5/6] puts content on a table for polls questions answers show --- .../poll/questions/answers/show.html.erb | 41 +++++++++---------- config/locales/en/admin.yml | 1 + config/locales/es/admin.yml | 1 + 3 files changed, 22 insertions(+), 21 deletions(-) diff --git a/app/views/admin/poll/questions/answers/show.html.erb b/app/views/admin/poll/questions/answers/show.html.erb index e6e0244a0..83249f606 100644 --- a/app/views/admin/poll/questions/answers/show.html.erb +++ b/app/views/admin/poll/questions/answers/show.html.erb @@ -1,6 +1,6 @@ <%= back_link_to %> -<%= link_to t('shared.edit'), edit_admin_answer_path(@answer), +<%= link_to t("admin.answers.show.edit"), edit_admin_answer_path(@answer), class: "button hollow float-right" %>