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.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/_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/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 %> 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" %>
<%= t("admin.polls.index.name") %> <%= t("admin.polls.index.dates") %><%= t("admin.actions.actions") %><%= t("admin.actions.actions") %>
+ + + + + + + + + + + + + + +
<%= t("admin.answers.show.title") %><%= t("admin.answers.show.description") %><%= t("admin.answers.show.images") %>
<%= @answer.title %><%= @answer.description %> + (<%= @answer.images.count %>)
+ <%= link_to t("admin.answers.show.images_list"), admin_answer_images_path(@answer) %> +
diff --git a/app/views/admin/poll/questions/show.html.erb b/app/views/admin/poll/questions/show.html.erb index 205b707fb..fa56bfac4 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" %> @@ -50,21 +50,21 @@ <% @question.question_answers.each do |answer| %> - <%= 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"), diff --git a/config/locales/en/admin.yml b/config/locales/en/admin.yml index 69f388887..dfe92305d 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" @@ -594,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 @@ -617,6 +619,7 @@ en: description: Description images: Images images_list: Images list + edit: Edit answer edit: title: Edit answer videos: diff --git a/config/locales/es/admin.yml b/config/locales/es/admin.yml index dca6c123f..289546bab 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" @@ -594,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 @@ -619,6 +621,7 @@ es: description: Descripción images: Imágenes images_list: Lista de imágenes + edit: Editar respuesta edit: title: Editar respuesta videos: diff --git a/spec/features/admin/poll/polls_spec.rb b/spec/features/admin/poll/polls_spec.rb index d69e7ad75..a9a33447f 100644 --- a/spec/features/admin/poll/polls_spec.rb +++ b/spec/features/admin/poll/polls_spec.rb @@ -73,7 +73,7 @@ feature 'Admin polls' do create(:image, imageable: poll) visit admin_poll_path(poll) - click_link "Edit" + click_link "Edit poll" end_date = 1.year.from_now diff --git a/spec/features/admin/poll/questions/answers/answers_spec.rb b/spec/features/admin/poll/questions/answers/answers_spec.rb index 8514f2f26..e8af5ff79 100644 --- a/spec/features/admin/poll/questions/answers/answers_spec.rb +++ b/spec/features/admin/poll/questions/answers/answers_spec.rb @@ -48,7 +48,7 @@ feature 'Answers' do visit admin_answer_path(answer) - click_link 'Edit' + click_link 'Edit answer' old_title = answer.title new_title = 'Ex Machina'