From cbbc3ed1bef50c08dddb284cf28a16705de1ef3b Mon Sep 17 00:00:00 2001 From: Alberto Garcia Cabeza Date: Wed, 14 Dec 2016 17:58:21 +0100 Subject: [PATCH] improves styles for admin questions views --- app/assets/stylesheets/admin.scss | 13 ++++++++++--- app/views/admin/poll/questions/_filter.html.erb | 15 +++++++-------- app/views/admin/poll/questions/_form.html.erb | 14 +++++++++----- app/views/admin/poll/questions/_search.html.erb | 14 ++++++-------- app/views/admin/poll/questions/index.html.erb | 13 ++++++++++--- config/locales/admin.en.yml | 3 +++ config/locales/admin.es.yml | 5 ++++- 7 files changed, 49 insertions(+), 28 deletions(-) diff --git a/app/assets/stylesheets/admin.scss b/app/assets/stylesheets/admin.scss index 5c7aab0fc..adc166d96 100644 --- a/app/assets/stylesheets/admin.scss +++ b/app/assets/stylesheets/admin.scss @@ -84,6 +84,11 @@ body.admin { color: $admin-color; } + .tabs-panel { + padding-left: 0; + padding-right: 0; + } + #proposals { width: 100% !important; } @@ -155,9 +160,11 @@ body.admin { } } -.admin .tabs-panel { - padding-left: 0; - padding-right: 0; +.input-group { + + .input-group-button { + padding-bottom: rem-calc(16); + } } // 02. Sidebar diff --git a/app/views/admin/poll/questions/_filter.html.erb b/app/views/admin/poll/questions/_filter.html.erb index c12c62f2d..0fd800067 100644 --- a/app/views/admin/poll/questions/_filter.html.erb +++ b/app/views/admin/poll/questions/_filter.html.erb @@ -1,8 +1,7 @@ -
- <%= form_tag '', method: :get do %> - <%= select_tag "poll_id", - poll_select_options(true), - prompt: t("admin.questions.index.select_poll"), - class: "js-location-changer" %> - <% end %> -
\ No newline at end of file +<%= form_tag '', method: :get do %> + <%= label_tag :poll_id, t("admin.questions.index.filter_poll") %> + <%= select_tag "poll_id", + poll_select_options(true), + prompt: t("admin.questions.index.select_poll"), + class: "js-location-changer" %> +<% end %> diff --git a/app/views/admin/poll/questions/_form.html.erb b/app/views/admin/poll/questions/_form.html.erb index f9362995b..dbc8883e3 100644 --- a/app/views/admin/poll/questions/_form.html.erb +++ b/app/views/admin/poll/questions/_form.html.erb @@ -7,15 +7,19 @@
-
- <%= f.select :poll_id, - options_for_select(Poll.pluck(:name, :id)), - prompt: t("admin.questions.index.select_poll") %> +
+ <%= f.select :poll_id, + options_for_select(Poll.pluck(:name, :id)), + prompt: t("admin.questions.index.select_poll"), + label: t("admin.questions.new.poll_label") %>
<%= f.text_field :title, maxlength: Poll::Question.title_max_length %> - <%= f.text_field :valid_answers %> + <%= f.label :valid_answers %> +

<%= t("admin.questions.new.valid_answers_note") %>

+ <%= f.text_field :valid_answers, label: false %> + <%= f.text_area :summary, rows: 4, maxlength: 200 %> diff --git a/app/views/admin/poll/questions/_search.html.erb b/app/views/admin/poll/questions/_search.html.erb index 30cf0d6e5..7ee1308f7 100644 --- a/app/views/admin/poll/questions/_search.html.erb +++ b/app/views/admin/poll/questions/_search.html.erb @@ -1,12 +1,10 @@ <%= form_tag(admin_questions_path, method: :get) do |f| %> -
-
- <%= text_field_tag :search, - @search, - placeholder: t("admin.shared.spending_proposal_search.placeholder") %> -
-
+
+ <%= text_field_tag :search, + @search, + placeholder: t("admin.shared.spending_proposal_search.placeholder") %> +
<%= submit_tag t("admin.shared.spending_proposal_search.button"), class: "button" %>
-<% end %> \ No newline at end of file +<% end %> diff --git a/app/views/admin/poll/questions/index.html.erb b/app/views/admin/poll/questions/index.html.erb index 2aef2b6e5..77772fbf7 100644 --- a/app/views/admin/poll/questions/index.html.erb +++ b/app/views/admin/poll/questions/index.html.erb @@ -3,11 +3,18 @@ <%= link_to t('admin.questions.index.create'), new_admin_question_path, class: "button success float-right" %> -<%= render 'filter' %> -<%= render 'search' %> +
+
+ <%= render 'search' %> +
+
+ +
+ <%= render 'filter' %> +
<% if @questions.count == 0 %> -
+
<%= t('admin.questions.index.no_questions') %>
<% else %> diff --git a/config/locales/admin.en.yml b/config/locales/admin.en.yml index 4c498a280..09f5e16fb 100755 --- a/config/locales/admin.en.yml +++ b/config/locales/admin.en.yml @@ -194,11 +194,14 @@ en: title: "Questions" create: "Create question" no_questions: "There are no questions." + filter_poll: Filter by Poll select_poll: Select Poll edit: title: "Edit Question" new: title: "Create Question" + poll_label: "Poll" + valid_answers_note: "Enter the answers separated by commas (,)" show: proposal: Original proposal author: Author diff --git a/config/locales/admin.es.yml b/config/locales/admin.es.yml index 2e294147a..f96d2d815 100644 --- a/config/locales/admin.es.yml +++ b/config/locales/admin.es.yml @@ -194,11 +194,14 @@ es: title: "Preguntas ciudadanas" create: "Crear pregunta ciudadana" no_questions: "No hay ninguna pregunta ciudadana." - select_poll: Seleccionar votación + filter_poll: "Filtrar por votación" + select_poll: "Seleccionar votación" edit: title: "Editar pregunta ciudadana" new: title: "Crear pregunta ciudadana" + poll_label: "Votación" + valid_answers_note: "Escribe las respuestas separadas por comas (,)" show: proposal: Propuesta ciudadana original author: Autor