From 076f9dd474d6954040fe97ca125bb4ccabb1116e Mon Sep 17 00:00:00 2001 From: decabeza Date: Wed, 18 Jul 2018 17:30:52 +0200 Subject: [PATCH 01/15] Moves back link to root path from dashboard to header --- app/assets/stylesheets/admin.scss | 4 ++++ app/views/admin/dashboard/index.html.erb | 6 ------ app/views/layouts/_admin_header.html.erb | 4 ++++ 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/app/assets/stylesheets/admin.scss b/app/assets/stylesheets/admin.scss index a8d81a12d..a202613f9 100644 --- a/app/assets/stylesheets/admin.scss +++ b/app/assets/stylesheets/admin.scss @@ -46,6 +46,10 @@ $sidebar-active: #f4fcd0; .top-links { background: #000; + + a { + line-height: rem-calc($line-height * 1.5); + } } .admin-top-bar { diff --git a/app/views/admin/dashboard/index.html.erb b/app/views/admin/dashboard/index.html.erb index ca64da28d..afd94e993 100644 --- a/app/views/admin/dashboard/index.html.erb +++ b/app/views/admin/dashboard/index.html.erb @@ -1,9 +1,3 @@ -
- <%= link_to root_path do %> - <%= t("admin.dashboard.index.back", org: setting['org_name']) %> - <% end %> -
-

<%= t("admin.dashboard.index.title") %>

<%= t("admin.dashboard.index.description", org: setting['org_name']) %>

diff --git a/app/views/layouts/_admin_header.html.erb b/app/views/layouts/_admin_header.html.erb index b3d8c3e5c..3daf43938 100644 --- a/app/views/layouts/_admin_header.html.erb +++ b/app/views/layouts/_admin_header.html.erb @@ -2,6 +2,10 @@ From 6f324c6931fa761a5f77d8b2d8a2a942800e5934 Mon Sep 17 00:00:00 2001 From: decabeza Date: Wed, 18 Jul 2018 17:33:25 +0200 Subject: [PATCH 02/15] Unifies styles and views for admin polls --- .../booth_assignments/_search_booths.html.erb | 22 ++++++------ .../poll/booth_assignments/index.html.erb | 2 +- .../_search_officers.html.erb | 22 ++++++------ app/views/admin/poll/polls/_form.html.erb | 34 +++++++------------ app/views/admin/poll/polls/_poll.html.erb | 8 +++-- .../admin/poll/polls/_questions.html.erb | 4 +-- app/views/admin/poll/polls/index.html.erb | 6 ++-- app/views/admin/poll/polls/new.html.erb | 6 ++-- app/views/admin/poll/questions/_form.html.erb | 4 +-- .../admin/poll/questions/_questions.html.erb | 16 +++++---- .../questions/_successful_proposals.html.erb | 6 ++-- .../poll/questions/answers/_form.html.erb | 4 +-- .../poll/questions/answers/edit.html.erb | 2 +- .../admin/poll/questions/answers/new.html.erb | 4 +-- app/views/admin/poll/questions/index.html.erb | 6 ++-- app/views/admin/poll/questions/show.html.erb | 8 +++-- 16 files changed, 77 insertions(+), 77 deletions(-) diff --git a/app/views/admin/poll/booth_assignments/_search_booths.html.erb b/app/views/admin/poll/booth_assignments/_search_booths.html.erb index e96e334c7..b8f5d7c80 100644 --- a/app/views/admin/poll/booth_assignments/_search_booths.html.erb +++ b/app/views/admin/poll/booth_assignments/_search_booths.html.erb @@ -1,16 +1,14 @@ -
-
- <%= form_tag(search_booths_admin_poll_booth_assignments_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_booth_assignments_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" %>
- <% end %> -
+
+ <% end %>
diff --git a/app/views/admin/poll/booth_assignments/index.html.erb b/app/views/admin/poll/booth_assignments/index.html.erb index 75cbe889f..9e99e3179 100644 --- a/app/views/admin/poll/booth_assignments/index.html.erb +++ b/app/views/admin/poll/booth_assignments/index.html.erb @@ -4,7 +4,7 @@ <%= render "/admin/poll/polls/subnav" %> <%= render "search_booths" %> -

<%= t("admin.poll_booth_assignments.index.booths_title") %>

+

<%= t("admin.poll_booth_assignments.index.booths_title") %>

<%= link_to t("admin.booth_assignments.manage_assignments"), manage_admin_poll_booth_assignments_path(@poll), diff --git a/app/views/admin/poll/officer_assignments/_search_officers.html.erb b/app/views/admin/poll/officer_assignments/_search_officers.html.erb index 7ed39f10d..2e994fe8a 100644 --- a/app/views/admin/poll/officer_assignments/_search_officers.html.erb +++ b/app/views/admin/poll/officer_assignments/_search_officers.html.erb @@ -1,16 +1,14 @@ -
-
- <%= form_tag(search_officers_admin_poll_officer_assignments_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_officer_assignments_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" %>
- <% end %> -
+
+ <% end %>
diff --git a/app/views/admin/poll/polls/_form.html.erb b/app/views/admin/poll/polls/_form.html.erb index 1a45b8097..8a91d614a 100644 --- a/app/views/admin/poll/polls/_form.html.erb +++ b/app/views/admin/poll/polls/_form.html.erb @@ -1,11 +1,9 @@ <%= form_for [:admin, @poll] do |f| %> -
-
- <%= f.text_field :name %> -
+
+ <%= f.text_field :name %>
-
+
<%= f.text_field :starts_at, value: @poll.starts_at.present? ? l(@poll.starts_at.to_date) : nil, @@ -19,25 +17,19 @@
-
-
- <%=f.text_area :summary, rows: 4%> -
+
+ <%=f.text_area :summary, rows: 4%>
-
-
- <%=f.text_area :description, rows: 8%> -
+
+ <%=f.text_area :description, rows: 8%>
-
-
- <%= render 'images/admin_image', imageable: @poll, f: f %> -
+
+ <%= render 'images/admin_image', imageable: @poll, f: f %>
-
+
<%= f.check_box :geozone_restricted, data: { checkbox_toggle: "#geozones" } %>
@@ -55,10 +47,10 @@
-
-
+
+
<%= f.submit t("admin.polls.#{admin_submit_action(@poll)}.submit_button"), - class: "button success expanded" %> + class: "button success expanded margin-top" %>
<% end %> diff --git a/app/views/admin/poll/polls/_poll.html.erb b/app/views/admin/poll/polls/_poll.html.erb index 5ec63b6b5..712a411bd 100644 --- a/app/views/admin/poll/polls/_poll.html.erb +++ b/app/views/admin/poll/polls/_poll.html.erb @@ -8,11 +8,15 @@ <%= 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" %> + class: "button hollow expanded" %> +
+
<%= link_to t("admin.actions.configure"), admin_poll_path(poll), - class: "button hollow" %> + class: "button hollow expanded" %> +
diff --git a/app/views/admin/poll/polls/_questions.html.erb b/app/views/admin/poll/polls/_questions.html.erb index fb92a4e43..f1dd818e8 100644 --- a/app/views/admin/poll/polls/_questions.html.erb +++ b/app/views/admin/poll/polls/_questions.html.erb @@ -2,13 +2,13 @@ <% if @poll.questions.empty? %>
- <%= t('admin.polls.show.no_questions') %> + <%= t("admin.polls.show.no_questions") %>
<% else %> - + <% @poll.questions.each do |question| %> diff --git a/app/views/admin/poll/polls/index.html.erb b/app/views/admin/poll/polls/index.html.erb index 487f0fa54..ece32decb 100644 --- a/app/views/admin/poll/polls/index.html.erb +++ b/app/views/admin/poll/polls/index.html.erb @@ -2,14 +2,14 @@ <%= link_to t("admin.polls.index.create"), new_admin_poll_path, - class: "button success float-right" %> + class: "button float-right" %> <% if @polls.any? %>
<%= t('admin.polls.show.table_title') %><%= t("admin.polls.show.table_title") %>
- + - + <%= render @polls %> diff --git a/app/views/admin/poll/polls/new.html.erb b/app/views/admin/poll/polls/new.html.erb index ac3ba5a4d..6cc6c0d8f 100644 --- a/app/views/admin/poll/polls/new.html.erb +++ b/app/views/admin/poll/polls/new.html.erb @@ -1,6 +1,8 @@ -<%= back_link_to %> +
+ <%= back_link_to %> -

<%= t("admin.polls.new.title") %>

+

<%= t("admin.polls.new.title") %>

+
<%= render "form" %> diff --git a/app/views/admin/poll/questions/_form.html.erb b/app/views/admin/poll/questions/_form.html.erb index eeb38a405..5ffdc6573 100644 --- a/app/views/admin/poll/questions/_form.html.erb +++ b/app/views/admin/poll/questions/_form.html.erb @@ -14,8 +14,8 @@ <%= f.text_field :title %> -
- <%= f.submit(class: "button expanded", value: t("shared.save")) %> +
+ <%= f.submit(class: "button success expanded", value: t("shared.save")) %>
diff --git a/app/views/admin/poll/questions/_questions.html.erb b/app/views/admin/poll/questions/_questions.html.erb index c142ad084..c108ad6a3 100644 --- a/app/views/admin/poll/questions/_questions.html.erb +++ b/app/views/admin/poll/questions/_questions.html.erb @@ -4,23 +4,27 @@ <% if @questions.count == 0 %>
- <%= t('admin.questions.index.no_questions') %> + <%= t("admin.questions.index.no_questions") %>
<% else %>
<%= t("admin.polls.index.name") %><%= t("admin.polls.index.name") %> <%= t("admin.polls.index.dates") %><%= t("admin.actions.actions") %><%= t("admin.actions.actions") %>
- - + + <% @questions.each do |question| %> - <% end %> diff --git a/app/views/admin/poll/questions/_successful_proposals.html.erb b/app/views/admin/poll/questions/_successful_proposals.html.erb index 2b192bccd..4f3fda4d5 100644 --- a/app/views/admin/poll/questions/_successful_proposals.html.erb +++ b/app/views/admin/poll/questions/_successful_proposals.html.erb @@ -1,8 +1,8 @@
<%= t('admin.questions.index.table_question') %><%= t("admin.actions.actions") %><%= t("admin.questions.index.table_question") %><%= t("admin.actions.actions") %>
<%= 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'), admin_question_path(question), class: "button hollow alert", method: :delete %> + +
+ <%= link_to t("shared.edit"), edit_admin_question_path(question), class: "button hollow expanded" %> +
+
+ <%= link_to t("shared.delete"), admin_question_path(question), class: "button hollow alert expanded", method: :delete %> +
- - + + @@ -15,7 +15,7 @@ <%= proposal.question %>

- + + + + + + <% end %> +
<%= t('admin.questions.index.table_proposal') %><%= t("admin.actions.actions") %><%= t("admin.questions.index.table_proposal") %><%= t("admin.actions.actions") %>
+ <%= link_to t("admin.questions.index.create_question"), new_admin_question_path(proposal_id: proposal.id), class: "button hollow" %> diff --git a/app/views/admin/poll/questions/answers/_form.html.erb b/app/views/admin/poll/questions/answers/_form.html.erb index 3bb2ebe39..cbc450813 100644 --- a/app/views/admin/poll/questions/answers/_form.html.erb +++ b/app/views/admin/poll/questions/answers/_form.html.erb @@ -12,8 +12,8 @@ ckeditor: { language: I18n.locale } %> -
- <%= f.submit(class: "button expanded", value: t("shared.save")) %> +
+ <%= f.submit(class: "button success expanded", value: t("shared.save")) %>
<% end %> diff --git a/app/views/admin/poll/questions/answers/edit.html.erb b/app/views/admin/poll/questions/answers/edit.html.erb index 48fb4ad5d..46a8784cc 100644 --- a/app/views/admin/poll/questions/answers/edit.html.erb +++ b/app/views/admin/poll/questions/answers/edit.html.erb @@ -2,7 +2,7 @@

diff --git a/app/views/admin/poll/questions/answers/new.html.erb b/app/views/admin/poll/questions/answers/new.html.erb index 1400bf765..c3af00be6 100644 --- a/app/views/admin/poll/questions/answers/new.html.erb +++ b/app/views/admin/poll/questions/answers/new.html.erb @@ -2,10 +2,10 @@ -

<%= t('admin.answers.new.title') %>

+

<%= t("admin.answers.new.title") %>

<%= render "form", form_url: admin_question_answers_path %> diff --git a/app/views/admin/poll/questions/index.html.erb b/app/views/admin/poll/questions/index.html.erb index 5a326d8f4..fcb232ecd 100644 --- a/app/views/admin/poll/questions/index.html.erb +++ b/app/views/admin/poll/questions/index.html.erb @@ -1,7 +1,7 @@ -

<%= t('admin.questions.index.title') %>

+

<%= t("admin.questions.index.title") %>

-<%= link_to t('admin.questions.index.create'), new_admin_question_path, - class: "button success float-right" %> +<%= link_to t("admin.questions.index.create"), new_admin_question_path, + class: "button float-right" %>
<%= render 'search' %> diff --git a/app/views/admin/poll/questions/show.html.erb b/app/views/admin/poll/questions/show.html.erb index fa56bfac4..094ebff83 100644 --- a/app/views/admin/poll/questions/show.html.erb +++ b/app/views/admin/poll/questions/show.html.erb @@ -29,13 +29,15 @@
+
+ <%= link_to t("admin.questions.show.add_answer"), new_admin_question_answer_path(@question), + class: "button float-right" %> +
+ From f8707a73cd304ed8654211a4d1badb975d8f2a9d Mon Sep 17 00:00:00 2001 From: decabeza Date: Wed, 18 Jul 2018 18:43:29 +0200 Subject: [PATCH 03/15] Unifies styles and views for admin legislation processes --- .../legislation/draft_versions/_form.html.erb | 116 +++--- .../legislation/draft_versions/edit.html.erb | 21 +- .../legislation/draft_versions/index.html.erb | 35 +- .../legislation/draft_versions/new.html.erb | 10 +- .../legislation/processes/_form.html.erb | 375 ++++++++---------- .../admin/legislation/processes/edit.html.erb | 15 +- .../legislation/processes/index.html.erb | 12 +- .../admin/legislation/processes/new.html.erb | 13 +- .../legislation/proposals/_form.html.erb | 26 +- .../legislation/proposals/index.html.erb | 14 +- .../legislation/questions/_form.html.erb | 8 +- .../_question_option_fields.html.erb | 12 +- .../admin/legislation/questions/edit.html.erb | 13 +- .../legislation/questions/index.html.erb | 34 +- .../admin/legislation/questions/new.html.erb | 27 +- 15 files changed, 324 insertions(+), 407 deletions(-) diff --git a/app/views/admin/legislation/draft_versions/_form.html.erb b/app/views/admin/legislation/draft_versions/_form.html.erb index 5dfd86e33..45c04f3a6 100644 --- a/app/views/admin/legislation/draft_versions/_form.html.erb +++ b/app/views/admin/legislation/draft_versions/_form.html.erb @@ -13,80 +13,66 @@ <% end %> -
-
- <%= f.label :title %> -
-
- <%= f.text_field :title, label: false, placeholder: t('admin.legislation.draft_versions.form.title_placeholder') %> -
+
+ <%= f.label :title %> + <%= f.text_field :title, label: false, placeholder: t("admin.legislation.draft_versions.form.title_placeholder") %>
-
-
- <%= f.label :changelog %> - <%= t('admin.legislation.draft_versions.form.use_markdown') %> -
-
- <%= f.text_area :changelog, label: false, rows: 5, placeholder: t('admin.legislation.draft_versions.form.changelog_placeholder') %> -
+
+ <%= f.label :changelog %> + <%= t("admin.legislation.draft_versions.form.use_markdown") %> + <%= f.text_area :changelog, label: false, rows: 5, placeholder: t("admin.legislation.draft_versions.form.changelog_placeholder") %>
-
-
- <%= f.label :status %> -
-
- <% ::Legislation::DraftVersion::VALID_STATUSES.each do |status| %> - <%= f.radio_button :status, status, label: false %> - <%= f.label "status_#{status}", t("admin.legislation.draft_versions.statuses.#{status}") %> - <%= t("admin.legislation.draft_versions.form.hints.status.#{status}") %> -
+
+ <%= f.label :status %> + <% ::Legislation::DraftVersion::VALID_STATUSES.each do |status| %> + <%= f.radio_button :status, status, label: false %> + <%= f.label "status_#{status}", t("admin.legislation.draft_versions.statuses.#{status}") %> + <%= t("admin.legislation.draft_versions.form.hints.status.#{status}") %> +
+ <% end %> +
+ +
+ <%= f.label :final_version %> + <%= f.check_box :final_version, label: false %> + <%= t("admin.legislation.draft_versions.form.hints.final_version") %> +
+ +
+ <%= f.label :body %> + <%= t("admin.legislation.draft_versions.form.use_markdown") %> +
+ +
+
+
+ <%= t("admin.legislation.draft_versions.form.title_html", + draft_version_title: @draft_version.title, + process_title: @process.title ) %> +
+ +
+ <%= f.submit(class: "button", value: t("admin.legislation.draft_versions.#{admin_submit_action(@draft_version)}.submit_button")) %> +
+ + <%= link_to "#", class: 'fullscreen-toggle' do %> + " + data-open-text="<%= t("admin.legislation.draft_versions.form.close_text_editor")%>"> + <%= t("admin.legislation.draft_versions.form.launch_text_editor")%> + <% end %>
-
- -
-
- <%= f.label :final_version %> +
+ <%= f.text_area :body, label: false, placeholder: t("admin.legislation.draft_versions.form.body_placeholder") %>
-
- <%= f.check_box :final_version, label: false %> - <%= t("admin.legislation.draft_versions.form.hints.final_version") %> + +
-
-
- <%= f.label :body %> - <%= t('admin.legislation.draft_versions.form.use_markdown') %> -
-
-
-
<%= t('admin.legislation.draft_versions.form.title_html', draft_version_title: @draft_version.title, process_title: @process.title ) %>
- -
- <%= f.submit(class: "button", value: t("admin.legislation.draft_versions.#{admin_submit_action(@draft_version)}.submit_button")) %> -
- - <%= link_to "#", class: 'fullscreen-toggle' do %> - " - data-open-text="<%= t("admin.legislation.draft_versions.form.close_text_editor")%>"> - <%= t("admin.legislation.draft_versions.form.launch_text_editor")%> - - <% end %> -
-
- <%= f.text_area :body, label: false, placeholder: t('admin.legislation.draft_versions.form.body_placeholder') %> -
-
-
-
-
- -
-
- <%= f.submit(class: "button expanded", value: t("admin.legislation.draft_versions.#{admin_submit_action(@draft_version)}.submit_button")) %> -
+
+ <%= f.submit(class: "button success expanded", value: t("admin.legislation.draft_versions.#{admin_submit_action(@draft_version)}.submit_button")) %>
<% end %> diff --git a/app/views/admin/legislation/draft_versions/edit.html.erb b/app/views/admin/legislation/draft_versions/edit.html.erb index 9a1d959f1..b81723d2b 100644 --- a/app/views/admin/legislation/draft_versions/edit.html.erb +++ b/app/views/admin/legislation/draft_versions/edit.html.erb @@ -1,8 +1,8 @@ <% provide :title do %> - Admin - <%= t("admin.menu.legislation") %> - <%= @process.title %> - <%= t("admin.legislation.draft_versions.index.title") %> - <%= @draft_version.title %> + <%= t("admin.header.title") %> - <%= t("admin.menu.legislation") %> - <%= @process.title %> - <%= t("admin.legislation.draft_versions.index.title") %> - <%= @draft_version.title %> <% end %> -
+
<%= back_link_to admin_legislation_process_draft_versions_path(@process), t("admin.legislation.draft_versions.edit.back") %> @@ -11,17 +11,16 @@ <%= render 'admin/legislation/processes/subnav', process: @process, active: 'draft_versions' %> -
-
- +
+ +
-
-

<%= @draft_version.title %>

-
-
+
+

<%= @draft_version.title %>

+ +
<%= link_to t("admin.legislation.draft_versions.index.delete"), admin_legislation_process_draft_version_path(@process, @draft_version), method: :delete, diff --git a/app/views/admin/legislation/draft_versions/index.html.erb b/app/views/admin/legislation/draft_versions/index.html.erb index 26310b19e..f3701d880 100644 --- a/app/views/admin/legislation/draft_versions/index.html.erb +++ b/app/views/admin/legislation/draft_versions/index.html.erb @@ -1,23 +1,20 @@ <% provide :title do %> - Admin - <%= t("admin.menu.legislation") %> - <%= @process.title %> - <%= t("admin.legislation.draft_versions.index.title") %> + <%= t("admin.header.title") %> - <%= t("admin.menu.legislation") %> - <%= @process.title %> - <%= t("admin.legislation.draft_versions.index.title") %> <% end %> -
+
+ + <%= back_link_to admin_legislation_processes_path, t("admin.legislation.processes.edit.back") %> + +

<%= @process.title %>

+ + <%= render 'admin/legislation/processes/subnav', process: @process, active: 'draft_versions' %> +
- <%= back_link_to admin_legislation_processes_path, t("admin.legislation.processes.edit.back") %> +

<%= t("admin.legislation.draft_versions.index.title") %>

-

<%= @process.title %>

- - <%= render 'admin/legislation/processes/subnav', process: @process, active: 'draft_versions' %> - -
-
-

<%= t("admin.legislation.draft_versions.index.title") %>

-
- -
- <%= link_to t("admin.legislation.draft_versions.index.create"), new_admin_legislation_process_draft_version_path, class: "button" %> -
+
+ <%= link_to t("admin.legislation.draft_versions.index.create"), new_admin_legislation_process_draft_version_path, class: "button" %>
<% if @process.draft_versions.any? %> @@ -27,8 +24,8 @@
- - + + @@ -46,8 +43,8 @@ <%= t("admin.legislation.draft_versions.statuses.published") %> <% end %> - - + - + @@ -26,16 +26,16 @@ <% @processes.each do |process| %> - - + <% end %> diff --git a/app/views/admin/legislation/processes/new.html.erb b/app/views/admin/legislation/processes/new.html.erb index 8acb724db..3efb091f6 100644 --- a/app/views/admin/legislation/processes/new.html.erb +++ b/app/views/admin/legislation/processes/new.html.erb @@ -1,14 +1,11 @@ <% provide :title do %> - Admin - <%= t("admin.menu.legislation") %> - <%= t("admin.legislation.processes.new.title") %> + <%= t("admin.header.title") %> - <%= t("admin.menu.legislation") %> - <%= t("admin.legislation.processes.new.title") %> <% end %> -
+
+ <%= back_link_to admin_legislation_processes_path, t("admin.legislation.processes.new.back") %> -
- <%= back_link_to admin_legislation_processes_path, t("admin.legislation.processes.new.back") %> +

<%= t("admin.legislation.processes.new.title") %>

-

<%= t("admin.legislation.processes.new.title") %>

- - <%= render "form" %> -
+ <%= render "form" %>
diff --git a/app/views/admin/legislation/proposals/_form.html.erb b/app/views/admin/legislation/proposals/_form.html.erb index cca190440..94e94d157 100644 --- a/app/views/admin/legislation/proposals/_form.html.erb +++ b/app/views/admin/legislation/proposals/_form.html.erb @@ -15,23 +15,17 @@ <% end %> -
-
- <%= label_tag t('admin.legislation.proposals.form.custom_categories') %> - <%= t('admin.legislation.proposals.form.custom_categories_description') %> -
-
- <%= f.text_field :custom_list, value: @process.tag_list_on(:customs).to_s, - label: false, - placeholder: t("proposals.form.tags_placeholder"), - class: 'js-tag-list', - aria: {describedby: "tag-list-help-text"} %> -
+
+ <%= f.label :custom_list, t("admin.legislation.proposals.form.custom_categories") %> + <%= t("admin.legislation.proposals.form.custom_categories_description") %> + <%= f.text_field :custom_list, value: @process.tag_list_on(:customs).to_s, + label: false, + placeholder: t("admin.legislation.proposals.form.custom_categories_placeholder"), + class: 'js-tag-list', + aria: {describedby: "tag-list-help-text"} %>
-
-
- <%= f.submit(class: "button expanded", value: t("admin.legislation.processes.#{admin_submit_action(@process)}.submit_button")) %> -
+
+ <%= f.submit(class: "button expanded", value: t("admin.legislation.processes.#{admin_submit_action(@process)}.submit_button")) %>
<% end %> diff --git a/app/views/admin/legislation/proposals/index.html.erb b/app/views/admin/legislation/proposals/index.html.erb index 162f3c8dd..aae66e008 100644 --- a/app/views/admin/legislation/proposals/index.html.erb +++ b/app/views/admin/legislation/proposals/index.html.erb @@ -1,16 +1,14 @@ <% provide :title do %> - Admin - <%= t("admin.menu.legislation") %> - <%= @process.title %> - <%= t("admin.legislation.proposals.index.title") %> + <%= t("admin.header.title") %> - <%= t("admin.menu.legislation") %> - <%= @process.title %> - <%= t("admin.legislation.proposals.index.title") %> <% end %> -
-
- <%= back_link_to admin_legislation_processes_path, t("admin.legislation.proposals.index.back") %> +
-

<%= @process.title %>

+ <%= back_link_to admin_legislation_processes_path, t("admin.legislation.proposals.index.back") %> - <%= render 'admin/legislation/processes/subnav', process: @process, active: 'proposals' %> +

<%= @process.title %>

- <%= render "form" %> + <%= render 'admin/legislation/processes/subnav', process: @process, active: 'proposals' %> -
+ <%= render 'form' %>
diff --git a/app/views/admin/legislation/questions/_form.html.erb b/app/views/admin/legislation/questions/_form.html.erb index c0b321eed..f31e5a61d 100644 --- a/app/views/admin/legislation/questions/_form.html.erb +++ b/app/views/admin/legislation/questions/_form.html.erb @@ -30,12 +30,12 @@ <% end %>
-
+
<%= link_to_add_association t("admin.legislation.questions.form.add_option"), - f, :question_options, class: "button hollow medium" %> + f, :question_options, class: "button hollow" %>
-
- <%= f.submit(class: "button expanded", value: t("admin.legislation.questions.#{admin_submit_action(@question)}.submit_button")) %> +
+ <%= f.submit(class: "button success expanded", value: t("admin.legislation.questions.#{admin_submit_action(@question)}.submit_button")) %>
<% end %> diff --git a/app/views/admin/legislation/questions/_question_option_fields.html.erb b/app/views/admin/legislation/questions/_question_option_fields.html.erb index 6afdfecad..6da8dbd4c 100644 --- a/app/views/admin/legislation/questions/_question_option_fields.html.erb +++ b/app/views/admin/legislation/questions/_question_option_fields.html.erb @@ -1,12 +1,10 @@
-
-
- <%= f.text_field :value, label: false, placeholder: t("admin.legislation.questions.form.value_placeholder") %> -
-
- <%= link_to_remove_association " #{t(".remove_option")}".html_safe, f %> -
+
+ <%= f.text_field :value, label: false, placeholder: t("admin.legislation.questions.form.value_placeholder") %> +
+
+ <%= link_to_remove_association t("admin.legislation.questions.question_option_fields.remove_option"), f, class: "delete"%>
diff --git a/app/views/admin/legislation/questions/edit.html.erb b/app/views/admin/legislation/questions/edit.html.erb index f2293b6c3..e9e98b076 100644 --- a/app/views/admin/legislation/questions/edit.html.erb +++ b/app/views/admin/legislation/questions/edit.html.erb @@ -1,8 +1,8 @@ <% provide :title do %> - Admin - <%= t("admin.menu.legislation") %> - <%= @process.title %> - <%= t("admin.legislation.questions.index.title") %> - <%= @question.title %> + <%= t("admin.header.title") %> - <%= t("admin.menu.legislation") %> - <%= @process.title %> - <%= t("admin.legislation.questions.index.title") %> - <%= @question.title %> <% end %> -
+
<%= back_link_to admin_legislation_process_questions_path(@process), t("admin.legislation.questions.edit.back") %> @@ -10,11 +10,10 @@ <%= render 'admin/legislation/processes/subnav', process: @process, active: 'questions' %> -
-
-

<%= t("admin.legislation.questions.edit.title", question_title: @question.title) %>

-
-
+
+

<%= t("admin.legislation.questions.edit.title", question_title: @question.title) %>

+ +
<%= link_to t("admin.legislation.questions.index.delete"), admin_legislation_process_question_path(@process, @question), method: :delete, class: 'button hollow alert' %> diff --git a/app/views/admin/legislation/questions/index.html.erb b/app/views/admin/legislation/questions/index.html.erb index fbbb7c93b..120ade4ca 100644 --- a/app/views/admin/legislation/questions/index.html.erb +++ b/app/views/admin/legislation/questions/index.html.erb @@ -1,23 +1,19 @@ <% provide :title do %> - Admin - <%= t("admin.menu.legislation") %> - <%= @process.title %> - <%= t("admin.legislation.questions.index.title") %> + <%= t("admin.header.title") %> - <%= t("admin.menu.legislation") %> - <%= @process.title %> - <%= t("admin.legislation.questions.index.title") %> <% end %> -
+
+ <%= back_link_to admin_legislation_processes_path, t("admin.legislation.questions.index.back") %> + +

<%= @process.title %>

+ + <%= render 'admin/legislation/processes/subnav', process: @process, active: 'questions' %> +
- <%= back_link_to admin_legislation_processes_path, t("admin.legislation.questions.index.back") %> +

<%= t("admin.legislation.questions.index.title") %>

-

<%= @process.title %>

- - <%= render 'admin/legislation/processes/subnav', process: @process, active: 'questions' %> - -
-
-

<%= t("admin.legislation.questions.index.title") %>

-
- -
- <%= link_to t("admin.legislation.questions.index.create"), new_admin_legislation_process_question_path, class: "button" %> -
+
+ <%= link_to t("admin.legislation.questions.index.create"), new_admin_legislation_process_question_path, class: "button" %>
<% if @process.questions.any? %> @@ -26,8 +22,8 @@
- - + + @@ -45,8 +41,8 @@ <% end %> <% end %> - - + + <% end %> diff --git a/app/views/admin/legislation/questions/new.html.erb b/app/views/admin/legislation/questions/new.html.erb index 877c70eb5..68c003ee2 100644 --- a/app/views/admin/legislation/questions/new.html.erb +++ b/app/views/admin/legislation/questions/new.html.erb @@ -1,21 +1,18 @@ <% provide :title do %> - Admin - <%= t("admin.menu.legislation") %> - <%= @process.title %> - <%= t("admin.legislation.questions.index.title") %> - <%= t("admin.legislation.questions.new.title") %> + <%= t("admin.header.title") %> - <%= t("admin.menu.legislation") %> - <%= @process.title %> - <%= t("admin.legislation.questions.index.title") %> - <%= t("admin.legislation.questions.new.title") %> <% end %> -
+
+ + <%= back_link_to admin_legislation_process_questions_path(@process), t("admin.legislation.questions.new.back") %> + +

<%= @process.title %>

+ + <%= render 'admin/legislation/processes/subnav', process: @process, active: 'questions' %> +
- <%= back_link_to admin_legislation_process_questions_path(@process), t("admin.legislation.questions.new.back") %> - -

<%= @process.title %>

- - <%= render 'admin/legislation/processes/subnav', process: @process, active: 'questions' %> - -
-
-

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

-
-
- - <%= render 'form', url: admin_legislation_process_questions_path(@process) %> +

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

+ + <%= render 'form', url: admin_legislation_process_questions_path(@process) %>
From a72eb380a2315551ebaff22a9ca21e8e214f3512 Mon Sep 17 00:00:00 2001 From: decabeza Date: Wed, 18 Jul 2018 19:15:38 +0200 Subject: [PATCH 04/15] Unifies styles and views for admin budgets --- .../budget_investments/_search_form.html.erb | 98 +++++++-------- app/views/admin/budget_phases/_form.html.erb | 118 ++++++++---------- app/views/admin/budget_phases/edit.html.erb | 4 +- app/views/admin/budgets/_form.html.erb | 96 +++++++------- .../budgets/_max_headings_label.html.erb | 5 +- app/views/admin/budgets/edit.html.erb | 4 +- app/views/admin/budgets/index.html.erb | 2 +- app/views/admin/budgets/new.html.erb | 10 +- 8 files changed, 168 insertions(+), 169 deletions(-) diff --git a/app/views/admin/budget_investments/_search_form.html.erb b/app/views/admin/budget_investments/_search_form.html.erb index dc3269443..94ae8fc0b 100644 --- a/app/views/admin/budget_investments/_search_form.html.erb +++ b/app/views/admin/budget_investments/_search_form.html.erb @@ -1,61 +1,61 @@ <% init_advanced_menu %> <%= form_tag(admin_budget_budget_investments_path(budget: @budget), method: :get, enforce_utf8: false) do %> -
-
- <%= link_to "#advanced_filters_content", - data: {toggle: "advanced_filters"}, - class: "advanced-filters float-right clear" do %> - <%= t("admin.budget_investments.index.advanced_filters") %> - <% end %> -
+
+ <%= link_to "#advanced_filters_content", + data: {toggle: "advanced_filters"}, + class: "advanced-filters float-right clear" do %> + <%= t("admin.budget_investments.index.advanced_filters") %> + <% end %>
-
-
- <% ["feasible", "selected", "undecided", "unfeasible"].each do |option| %> + +
+
+
+ <% ["feasible", "selected", "undecided", "unfeasible"].each do |option| %> +
+ <%= check_box_tag "advanced_filters[]", option, params[:advanced_filters].index(option), id: "advanced_filters_#{option}" %> + <%= t("admin.budget_investments.index.filters.#{option}") %> +
+ <% end %>
- <%= check_box_tag "advanced_filters[]", option, params[:advanced_filters].index(option), id: "advanced_filters_#{option}" %> - <%= t("admin.budget_investments.index.filters.#{option}") %> + <%= text_field_tag :min_total_supports, params["min_total_supports"], placeholder: t("admin.budget_investments.index.filters.min_total_supports") %>
- <% end %> -
- <%= text_field_tag :min_total_supports, params["min_total_supports"], placeholder: t("admin.budget_investments.index.filters.min_total_supports") %>
-
-
- <%= select_tag :administrator_id, - options_for_select(admin_select_options, params[:administrator_id]), - { prompt: t("admin.budget_investments.index.administrator_filter_all"), - label: false} %> -
-
- <%= select_tag :valuator_or_group_id, - options_for_select(valuator_or_group_select_options, params[:valuator_or_group_id]), - { prompt: t("admin.budget_investments.index.valuator_filter_all"), - label: false} %> -
-
- <%= select_tag :heading_id, - options_for_select(budget_heading_select_options(@budget), params[:heading_id]), - { prompt: t("admin.budget_investments.index.heading_filter_all"), - label: false} %> -
-
- <%= select_tag :tag_name, - options_for_select(investment_tags_select_options(@budget), params[:tag_name]), - { prompt: t("admin.budget_investments.index.tags_filter_all"), - label: false} %> + +
+ <%= select_tag :administrator_id, + options_for_select(admin_select_options, params[:administrator_id]), + { prompt: t("admin.budget_investments.index.administrator_filter_all"), + label: false} %> +
+
+ <%= select_tag :valuator_or_group_id, + options_for_select(valuator_or_group_select_options, params[:valuator_or_group_id]), + { prompt: t("admin.budget_investments.index.valuator_filter_all"), + label: false} %> +
+
+ <%= select_tag :heading_id, + options_for_select(budget_heading_select_options(@budget), params[:heading_id]), + { prompt: t("admin.budget_investments.index.heading_filter_all"), + label: false} %> +
+
+ <%= select_tag :tag_name, + options_for_select(investment_tags_select_options(@budget), params[:tag_name]), + { prompt: t("admin.budget_investments.index.tags_filter_all"), + label: false} %> +
+ +
+
+ <%= text_field_tag :title_or_id, params["title_or_id"], placeholder: t("admin.budget_investments.index.placeholder") %>
-
-
-
- <%= text_field_tag :title_or_id, params["title_or_id"], placeholder: t("admin.budget_investments.index.placeholder") %> -
-
-
- <%= submit_tag t("admin.budget_investments.index.buttons.filter"), class: "button expanded" %> -
+ +
+ <%= submit_tag t("admin.budget_investments.index.buttons.filter"), class: "button expanded" %>
<% end %> diff --git a/app/views/admin/budget_phases/_form.html.erb b/app/views/admin/budget_phases/_form.html.erb index 3119ba3f1..a962353af 100644 --- a/app/views/admin/budget_phases/_form.html.erb +++ b/app/views/admin/budget_phases/_form.html.erb @@ -1,67 +1,59 @@ <%= form_for [:admin, @phase.budget, @phase] do |f| %> -
-
-
- <%= f.label :starts_at, t("admin.budget_phases.edit.start_date") %> - <%= f.text_field :starts_at, - value: format_date_for_calendar_form(@phase.starts_at), - class: "js-calendar-full", - id: "start_date", - label: false %> -
-
- <%= f.label :ends_at, t("admin.budget_phases.edit.end_date") %> - <%= f.text_field :ends_at, - value: format_date_for_calendar_form(@phase.ends_at), - class: "js-calendar-full", - id: "end_date", - label: false %> -
-
- -
-
- <%= f.label :description, t("admin.budget_phases.edit.description") %> - -

- <%= t("admin.budget_phases.edit.description_help_text") %> -

- - <%= f.cktext_area :description, - maxlength: Budget::Phase::DESCRIPTION_MAX_LENGTH, - ckeditor: { language: I18n.locale }, - label: false %> -
-
- -
-
- <%= f.label :summary, t("admin.budget_phases.edit.summary") %> - -

- <%= t("admin.budget_phases.edit.summary_help_text") %> -

- - <%= f.cktext_area :summary, - maxlength: Budget::Phase::SUMMARY_MAX_LENGTH, - ckeditor: { language: I18n.locale }, - label: false %> -
-
- -
-
- <%= f.check_box :enabled, label: t("admin.budget_phases.edit.enabled") %> - -

- <%= t("admin.budget_phases.edit.enabled_help_text") %> -

-
-
- -
- <%= f.submit t("admin.budget_phases.edit.save_changes"), class: "button success" %> -
+
+ <%= f.label :starts_at, t("admin.budget_phases.edit.start_date") %> + <%= f.text_field :starts_at, + value: format_date_for_calendar_form(@phase.starts_at), + class: "js-calendar-full", + id: "start_date", + label: false %>
+
+ <%= f.label :ends_at, t("admin.budget_phases.edit.end_date") %> + <%= f.text_field :ends_at, + value: format_date_for_calendar_form(@phase.ends_at), + class: "js-calendar-full", + id: "end_date", + label: false %> +
+ +
+ <%= f.label :description, t("admin.budget_phases.edit.description") %> + + + <%= t("admin.budget_phases.edit.description_help_text") %> + + + <%= f.cktext_area :description, + maxlength: Budget::Phase::DESCRIPTION_MAX_LENGTH, + ckeditor: { language: I18n.locale }, + label: false %> +
+ +
+ <%= f.label :summary, t("admin.budget_phases.edit.summary") %> + + + <%= t("admin.budget_phases.edit.summary_help_text") %> + + + <%= f.cktext_area :summary, + maxlength: Budget::Phase::SUMMARY_MAX_LENGTH, + ckeditor: { language: I18n.locale }, + label: false %> +
+ + +
+ <%= f.check_box :enabled, label: t("admin.budget_phases.edit.enabled") %> + + + <%= t("admin.budget_phases.edit.enabled_help_text") %> + +
+ +
+ <%= f.submit t("admin.budget_phases.edit.save_changes"), class: "button success expanded" %> +
+ <% end %> diff --git a/app/views/admin/budget_phases/edit.html.erb b/app/views/admin/budget_phases/edit.html.erb index 2d9659c7b..634f10c9f 100644 --- a/app/views/admin/budget_phases/edit.html.erb +++ b/app/views/admin/budget_phases/edit.html.erb @@ -1,5 +1,7 @@ <%= back_link_to edit_admin_budget_path(@phase.budget) %> -

<%= t("admin.budgets.edit.title") %> - <%= t("budgets.phase.#{@phase.kind}") %>

+
+

<%= t("admin.budgets.edit.title") %> - <%= t("budgets.phase.#{@phase.kind}") %>

+
<%= render '/admin/budget_phases/form' %> diff --git a/app/views/admin/budgets/_form.html.erb b/app/views/admin/budgets/_form.html.erb index 8de6deae0..9a31c6cd2 100644 --- a/app/views/admin/budgets/_form.html.erb +++ b/app/views/admin/budgets/_form.html.erb @@ -1,59 +1,65 @@ <%= form_for [:admin, @budget] do |f| %> - <%= f.text_field :name, maxlength: Budget.title_max_length %> +
+ <%= f.text_field :name, maxlength: Budget.title_max_length %> +
-
-
+
+
<%= f.select :phase, budget_phases_select_options, selected: "drafting" %>
-
+
<%= f.select :currency_symbol, budget_currency_symbol_select_options %>
<% if @budget.phases.present? %> -
<%= t('admin.questions.show.valid_answers') %> - <%= link_to t("admin.questions.show.add_answer"), - new_admin_question_answer_path(@question), - class: "button float-right" %>
<%= t("admin.legislation.draft_versions.table.title") %> <%= t("admin.legislation.draft_versions.table.created_at") %> <%= t("admin.legislation.draft_versions.table.status") %><%= t("admin.legislation.draft_versions.table.comments") %><%= t("admin.legislation.draft_versions.table.final_version") %><%= t("admin.legislation.draft_versions.table.comments") %><%= t("admin.legislation.draft_versions.table.final_version") %>
<%= draft_version.total_comments %> + <%= draft_version.total_comments %> <% if draft_version.final_version %> <% else %> diff --git a/app/views/admin/legislation/draft_versions/new.html.erb b/app/views/admin/legislation/draft_versions/new.html.erb index 63ab6f8e7..fb80d4344 100644 --- a/app/views/admin/legislation/draft_versions/new.html.erb +++ b/app/views/admin/legislation/draft_versions/new.html.erb @@ -1,8 +1,8 @@ <% provide :title do %> - Admin - <%= t("admin.menu.legislation") %> - <%= @process.title %> - <%= t("admin.legislation.draft_versions.index.title") %> - <%= t("admin.legislation.draft_versions.new.title") %> + <%= t("admin.header.title") %> - <%= t("admin.menu.legislation") %> - <%= @process.title %> - <%= t("admin.legislation.draft_versions.index.title") %> - <%= t("admin.legislation.draft_versions.new.title") %> <% end %> -
+
<%= back_link_to admin_legislation_process_draft_versions_path(@process), t("admin.legislation.draft_versions.new.back") %> @@ -11,10 +11,8 @@ <%= render 'admin/legislation/processes/subnav', process: @process, active: 'draft_versions' %> -
-
-

<%= t("admin.legislation.draft_versions.new.title") %>

-
+
+

<%= t("admin.legislation.draft_versions.new.title") %>

<%= render 'form', url: admin_legislation_process_draft_versions_path(@process) %> diff --git a/app/views/admin/legislation/processes/_form.html.erb b/app/views/admin/legislation/processes/_form.html.erb index 5a0aa668d..a0010c8ba 100644 --- a/app/views/admin/legislation/processes/_form.html.erb +++ b/app/views/admin/legislation/processes/_form.html.erb @@ -15,236 +15,197 @@ <% end %> -
-
- -
-
- <%= t('admin.legislation.processes.form.start') %> -
-
- <%= f.text_field :start_date, - label: false, - value: format_date_for_calendar_form(@process.start_date), - class: "js-calendar-full", - id: "start_date" %> -
-
- <%= t('admin.legislation.processes.form.end') %> -
-
- <%= f.text_field :end_date, - label: false, - value: format_date_for_calendar_form(@process.end_date), - class: "js-calendar-full", - id: "end_date" %> -
-
- <%= f.check_box :published, checked: @process.published?, label: t('admin.legislation.processes.form.enabled') %> -
- -
-
-
+
+
-
-
- -
-
- <%= t('admin.legislation.processes.form.start') %> -
-
- <%= f.text_field :debate_start_date, - label: false, - value: format_date_for_calendar_form(@process.debate_start_date), - class: "js-calendar-full", - id: "debate_start_date" %> -
-
- <%= t('admin.legislation.processes.form.end') %> -
-
- <%= f.text_field :debate_end_date, - label: false, - value: format_date_for_calendar_form(@process.debate_end_date), - class: "js-calendar-full", - id: "debate_end_date" %> -
-
- <%= f.check_box :debate_phase_enabled, checked: @process.debate_phase.enabled?, label: t('admin.legislation.processes.form.enabled') %> -
- -
-
-
+
+ <%= f.label :start_date, t("admin.legislation.processes.form.start") %> + <%= f.text_field :start_date, + label: false, + value: format_date_for_calendar_form(@process.start_date), + class: "js-calendar-full", + id: "start_date" %>
-
-
- -
-
- <%= t('admin.legislation.processes.form.start') %> -
-
- <%= f.text_field :proposals_phase_start_date, - label: false, - value: format_date_for_calendar_form(@process.proposals_phase_start_date), - class: "js-calendar-full", - id: "proposals_phase_start_date" %> -
-
- <%= t('admin.legislation.processes.form.end') %> -
-
- <%= f.text_field :proposals_phase_end_date, - label: false, - value: format_date_for_calendar_form(@process.proposals_phase_end_date), - class: "js-calendar-full", - id: "proposals_phase_end_date" %> -
-
- <%= f.check_box :proposals_phase_enabled, checked: @process.proposals_phase.enabled?, label: t('admin.legislation.processes.form.enabled') %> -
- -
-
-
+
+ <%= f.label :end_date, t("admin.legislation.processes.form.end") %> + <%= f.text_field :end_date, + label: false, + value: format_date_for_calendar_form(@process.end_date), + class: "js-calendar-full", + id: "end_date" %> +
+
+ <%= f.check_box :published, checked: @process.published?, label: t("admin.legislation.processes.form.enabled") %>
-
-
- -
-
- <%= t('admin.legislation.processes.form.start') %> -
-
- <%= f.text_field :allegations_start_date, - label: false, - value: format_date_for_calendar_form(@process.allegations_start_date), - class: "js-calendar-full", - id: "allegations_start_date" %> -
-
- <%= t('admin.legislation.processes.form.end') %> -
-
- <%= f.text_field :allegations_end_date, - label: false, - value: format_date_for_calendar_form(@process.allegations_end_date), - class: "js-calendar-full", - id: "allegations_end_date" %> -
-
- <%= f.check_box :allegations_phase_enabled, checked: @process.allegations_phase.enabled?, label: t('admin.legislation.processes.form.enabled') %> -
- -
-
-
+
+
-
-
- <%= f.label :draft_publication_date %> -
-
- <%= f.text_field :draft_publication_date, - label: false, - value: format_date_for_calendar_form(@process.draft_publication_date), - class: "js-calendar-full", - id: "draft_publication_date" %> -
-
- <%= f.check_box :draft_publication_enabled, checked: @process.draft_publication.enabled?, label: t('admin.legislation.processes.form.enabled') %> -
-
-
-
+
+
-
-
- <%= f.label :result_publication_date %> -
-
- <%= f.text_field :result_publication_date, - label: false, - value: format_date_for_calendar_form(@process.result_publication_date), - class: "js-calendar-full", - id: "result_publication_date" %> -
-
- <%= f.check_box :result_publication_enabled, checked: @process.result_publication.enabled?, label: t('admin.legislation.processes.form.enabled') %> -
-
-
-
+
+ <%= f.label :debate_start_date, t("admin.legislation.processes.form.start") %> + <%= f.text_field :debate_start_date, + label: false, + value: format_date_for_calendar_form(@process.debate_start_date), + class: "js-calendar-full", + id: "debate_start_date" %> +
+ +
+ <%= f.label :debate_end_date, t("admin.legislation.processes.form.end") %> + <%= f.text_field :debate_end_date, + label: false, + value: format_date_for_calendar_form(@process.debate_end_date), + class: "js-calendar-full", + id: "debate_end_date" %> +
+
+ <%= f.check_box :debate_phase_enabled, checked: @process.debate_phase.enabled?, label: t("admin.legislation.processes.form.enabled") %> +
+ +
+
+
+ +
+ +
+ +
+ <%= f.label :proposals_phase_start_date, t("admin.legislation.processes.form.start") %> + <%= f.text_field :proposals_phase_start_date, + label: false, + value: format_date_for_calendar_form(@process.proposals_phase_start_date), + class: "js-calendar-full", + id: "proposals_phase_start_date" %> +
+ +
+ <%= f.label :proposals_phase_end_date, t("admin.legislation.processes.form.end") %> + <%= f.text_field :proposals_phase_end_date, + label: false, + value: format_date_for_calendar_form(@process.proposals_phase_end_date), + class: "js-calendar-full", + id: "proposals_phase_end_date" %> +
+
+ <%= f.check_box :proposals_phase_enabled, checked: @process.proposals_phase.enabled?, label: t("admin.legislation.processes.form.enabled") %> +
+ +
+
+
+ +
+ +
+ +
+ <%= f.label :allegations_start_date, t("admin.legislation.processes.form.start") %> + <%= f.text_field :allegations_start_date, + label: false, + value: format_date_for_calendar_form(@process.allegations_start_date), + class: "js-calendar-full", + id: "allegations_start_date" %> +
+ +
+ <%= f.label :allegations_end_date, t("admin.legislation.processes.form.end") %> + <%= f.text_field :allegations_end_date, + label: false, + value: format_date_for_calendar_form(@process.allegations_end_date), + class: "js-calendar-full", + id: "allegations_end_date" %> +
+
+ <%= f.check_box :allegations_phase_enabled, checked: @process.allegations_phase.enabled?, label: t("admin.legislation.processes.form.enabled") %> +
+ +
+
+
+ +
+ <%= f.label :draft_publication_date %> + <%= f.text_field :draft_publication_date, + label: false, + value: format_date_for_calendar_form(@process.draft_publication_date), + class: "js-calendar-full", + id: "draft_publication_date" %> +
+
+ <%= f.check_box :draft_publication_enabled, checked: @process.draft_publication.enabled?, label: t("admin.legislation.processes.form.enabled") %> +
+ +
+
+
+ +
+ <%= f.label :result_publication_date %> + <%= f.text_field :result_publication_date, + label: false, + value: format_date_for_calendar_form(@process.result_publication_date), + class: "js-calendar-full", + id: "result_publication_date" %> +
+
+ <%= f.check_box :result_publication_enabled, checked: @process.result_publication.enabled?, label: t("admin.legislation.processes.form.enabled") %> +
+ +
+
<%= render 'documents/nested_documents', documentable: @process, f: f %> -
-
-
-
-
- <%= f.label :title %> -
-
- <%= f.text_field :title, - label: false, - placeholder: t('admin.legislation.processes.form.title_placeholder') %> -
+
+
-
-
- <%= f.label :summary %> - <%= t('admin.legislation.processes.form.use_markdown') %> -
-
- <%= f.text_area :summary, - label: false, - rows: 2, - placeholder: t('admin.legislation.processes.form.summary_placeholder') %> -
+
+ <%= f.label :title %> + <%= f.text_field :title, + label: false, + placeholder: t("admin.legislation.processes.form.title_placeholder") %>
-
-
- <%= f.label :description %> - <%= t('admin.legislation.processes.form.use_markdown') %> -
-
- <%= f.text_area :description, - label: false, - rows: 5, - placeholder: t('admin.legislation.processes.form.description_placeholder') %> -
+
+ <%= f.label :summary %> + <%= t("admin.legislation.processes.form.use_markdown") %> + <%= f.text_area :summary, + label: false, + rows: 2, + placeholder: t("admin.legislation.processes.form.summary_placeholder") %>
-
-
- <%= f.label :additional_info %> - <%= t('admin.legislation.processes.form.use_markdown') %> -
-
- <%= f.text_area :additional_info, - label: false, - rows: 10, - placeholder: t('admin.legislation.processes.form.additional_info_placeholder') %> -
+
+ <%= f.label :description %> + <%= t("admin.legislation.processes.form.use_markdown") %> + <%= f.text_area :description, + label: false, + rows: 5, + placeholder: t("admin.legislation.processes.form.description_placeholder") %>
-
-
- <%= f.submit(class: "button expanded", value: t("admin.legislation.processes.#{admin_submit_action(@process)}.submit_button")) %> -
+
+ <%= f.label :additional_info %> + <%= t("admin.legislation.processes.form.use_markdown") %> + <%= f.text_area :additional_info, + label: false, + rows: 10, + placeholder: t("admin.legislation.processes.form.additional_info_placeholder") %> +
+ +
+ <%= f.submit(class: "button success expanded", value: t("admin.legislation.processes.#{admin_submit_action(@process)}.submit_button")) %>
<% end %> diff --git a/app/views/admin/legislation/processes/edit.html.erb b/app/views/admin/legislation/processes/edit.html.erb index 5d2c1aa8a..c6a5e1c2f 100644 --- a/app/views/admin/legislation/processes/edit.html.erb +++ b/app/views/admin/legislation/processes/edit.html.erb @@ -1,16 +1,13 @@ <% provide :title do %> - Admin - <%= t("admin.menu.legislation") %> - <%= @process.title %> + <%= t("admin.header.title") %> - <%= t("admin.menu.legislation") %> - <%= @process.title %> <% end %> -
+
+ <%= back_link_to admin_legislation_processes_path, t("admin.legislation.processes.edit.back") %> -
- <%= back_link_to admin_legislation_processes_path, t("admin.legislation.processes.edit.back") %> +

<%= @process.title %>

-

<%= @process.title %>

+ <%= render 'subnav', process: @process, active: 'info' %> - <%= render 'subnav', process: @process, active: 'info' %> - - <%= render "form" %> -
+ <%= render 'form' %>
diff --git a/app/views/admin/legislation/processes/index.html.erb b/app/views/admin/legislation/processes/index.html.erb index 165865326..c01aeb645 100644 --- a/app/views/admin/legislation/processes/index.html.erb +++ b/app/views/admin/legislation/processes/index.html.erb @@ -1,11 +1,11 @@ <% provide :title do %> - Admin - <%= t("admin.menu.legislation") %> - <%= t("admin.legislation.processes.index.filters.#{@current_filter}") %> + <%= t("admin.header.title") %> - <%= t("admin.menu.legislation") %> - <%= t("admin.legislation.processes.index.filters.#{@current_filter}") %> <% end %>

<%= t("admin.legislation.processes.index.title") %>

<%= link_to t("admin.legislation.processes.index.create"), new_admin_legislation_process_path, - class: "button success float-right" %> + class: "button float-right" %> <%= render 'shared/filter_subnav', i18n_namespace: "admin.legislation.processes.index" %> @@ -18,7 +18,7 @@
<%= t("admin.legislation.processes.process.title") %> <%= t("admin.legislation.processes.process.status") %> <%= t("admin.legislation.processes.process.creation_date") %><%= t("admin.legislation.processes.process.comments") %><%= t("admin.legislation.processes.process.comments") %> <%= t("admin.actions.actions") %>
+ <%= link_to process.title, edit_admin_legislation_process_path(process) %> <%= t("admin.legislation.processes.process.status_#{process.status}") %> <%= I18n.l process.created_at.to_date %><%= process.total_comments %><%= process.total_comments %> <%= link_to t("admin.legislation.processes.index.delete"), admin_legislation_process_path(process), method: :delete, - class: 'button hollow alert' %> + class: 'button hollow alert expanded' %>
<%= t("admin.legislation.questions.table.title") %> <%= t("admin.legislation.questions.table.question_options") %><%= t("admin.legislation.questions.table.answers_count") %><%= t("admin.legislation.questions.table.comments_count") %><%= t("admin.legislation.questions.table.answers_count") %><%= t("admin.legislation.questions.table.comments_count") %>
<%= question.answers_count %><%= link_to question.comments.count, legislation_process_question_path(@process, question, anchor: 'comments') %><%= question.answers_count %><%= link_to question.comments.count, legislation_process_question_path(@process, question, anchor: 'comments') %>
- - - - - - - - +
+
<%= t("admin.budgets.edit.phase") %><%= t("admin.budgets.edit.dates") %><%= t("admin.budgets.edit.enabled") %><%= t("admin.budgets.edit.actions") %>
+ + + + + + + + - <% @budget.phases.order(:id).each do |phase| %> - - - - - - - <% end %> -
<%= t("admin.budgets.edit.phase") %><%= t("admin.budgets.edit.dates") %><%= t("admin.budgets.edit.enabled") %><%= t("admin.budgets.edit.actions") %>
- <%= t("budgets.phase.#{phase.kind}") %> - <% if @budget.current_phase == phase %> - <%= t("admin.budgets.edit.active") %> - <% end %> - - <% if phase.starts_at.present? || phase.ends_at.present? %> - <%= l(phase.starts_at.to_date) if phase.starts_at.present? %> - - - <%= l(phase.ends_at.to_date) if phase.ends_at.present? %> - <% else %> - <%= t("admin.budgets.edit.blank_dates") %> - <% end %> - - - - <%= link_to t("admin.budgets.edit.edit_phase"), - edit_admin_budget_budget_phase_path(@budget, phase), - method: :get, class: "button hollow" %> -
+ <% @budget.phases.order(:id).each do |phase| %> +
+ <%= t("budgets.phase.#{phase.kind}") %> + <% if @budget.current_phase == phase %> + <%= t("admin.budgets.edit.active") %> + <% end %> + + <% if phase.starts_at.present? || phase.ends_at.present? %> + <%= l(phase.starts_at.to_date) if phase.starts_at.present? %> + - + <%= l(phase.ends_at.to_date) if phase.ends_at.present? %> + <% else %> + <%= t("admin.budgets.edit.blank_dates") %> + <% end %> + + + + <%= link_to t("admin.budgets.edit.edit_phase"), + edit_admin_budget_budget_phase_path(@budget, phase), + method: :get, class: "button hollow expanded" %> +
+
<% end %> -
- <%= f.submit nil, class: "button success" %> +
+
+ <%= f.submit nil, class: "button success" %> +
<% if @budget.balloting_process? %> @@ -72,9 +78,9 @@ <%= link_to t("admin.budgets.edit.delete"), admin_budget_path(@budget), method: :delete, - class: "button hollow alert float-right margin-left" %> + class: "delete float-right margin-left" %> <% end %>
-
+ <% end %> diff --git a/app/views/admin/budgets/_max_headings_label.html.erb b/app/views/admin/budgets/_max_headings_label.html.erb index 61bf98dc7..0bf1cbcbb 100644 --- a/app/views/admin/budgets/_max_headings_label.html.erb +++ b/app/views/admin/budgets/_max_headings_label.html.erb @@ -1,5 +1,4 @@ <%= t("admin.budgets.form.max_votable_headings")%> <%= content_tag(:strong, - t('admin.budgets.form.current_of_max_headings', current: current, max: max ), - class:"current-of-max-headings") %> - + t("admin.budgets.form.current_of_max_headings", current: current, max: max), + class: "current-of-max-headings") %> diff --git a/app/views/admin/budgets/edit.html.erb b/app/views/admin/budgets/edit.html.erb index 6c54cc75b..a4a9c2729 100644 --- a/app/views/admin/budgets/edit.html.erb +++ b/app/views/admin/budgets/edit.html.erb @@ -1,5 +1,7 @@ <%= back_link_to admin_budgets_path %> -

<%= t("admin.budgets.edit.title") %>

+
+

<%= t("admin.budgets.edit.title") %>

+
<%= render '/admin/budgets/form' %> diff --git a/app/views/admin/budgets/index.html.erb b/app/views/admin/budgets/index.html.erb index d585a9891..b93a65103 100644 --- a/app/views/admin/budgets/index.html.erb +++ b/app/views/admin/budgets/index.html.erb @@ -2,7 +2,7 @@ <%= link_to t("admin.budgets.index.new_link"), new_admin_budget_path, - class: "button float-right margin-right" %> + class: "button float-right" %> <%= render 'shared/filter_subnav', i18n_namespace: "admin.budgets.index" %> diff --git a/app/views/admin/budgets/new.html.erb b/app/views/admin/budgets/new.html.erb index 3fa0fac89..efe1a47e2 100644 --- a/app/views/admin/budgets/new.html.erb +++ b/app/views/admin/budgets/new.html.erb @@ -1,7 +1,5 @@ -
-
-

<%= t("admin.budgets.new.title") %>

- - <%= render '/admin/budgets/form' %> -
+
+

<%= t("admin.budgets.new.title") %>

+ +<%= render '/admin/budgets/form' %> From dd98375c672a983bdd4b6603ff6e861a6a5c01d6 Mon Sep 17 00:00:00 2001 From: decabeza Date: Thu, 19 Jul 2018 17:29:43 +0200 Subject: [PATCH 05/15] Unifies styles and views for admin sending of emails section --- .../admin/admin_notifications/index.html.erb | 36 +++-- .../admin/admin_notifications/show.html.erb | 130 +++++++++--------- .../admin/emails_download/index.html.erb | 8 +- app/views/admin/newsletters/index.html.erb | 18 ++- app/views/admin/newsletters/show.html.erb | 56 ++++---- app/views/admin/system_emails/index.html.erb | 28 ++-- 6 files changed, 145 insertions(+), 131 deletions(-) diff --git a/app/views/admin/admin_notifications/index.html.erb b/app/views/admin/admin_notifications/index.html.erb index d16ee476e..986f1c077 100644 --- a/app/views/admin/admin_notifications/index.html.erb +++ b/app/views/admin/admin_notifications/index.html.erb @@ -9,7 +9,7 @@ <%= t("admin.admin_notifications.index.title") %> <%= t("admin.admin_notifications.index.segment_recipient") %> <%= t("admin.admin_notifications.index.sent") %> - <%= t("admin.admin_notifications.index.actions") %> + <%= t("admin.admin_notifications.index.actions") %> @@ -28,21 +28,29 @@ <%= l admin_notification.sent_at.to_date %> <% end %> - + <% if admin_notification.draft? %> - <%= link_to t("admin.admin_notifications.index.edit"), - edit_admin_admin_notification_path(admin_notification), - method: :get, class: "button hollow" %> - <%= link_to t("admin.admin_notifications.index.delete"), - admin_admin_notification_path(admin_notification), - method: :delete, class: "button hollow alert" %> - <%= link_to t("admin.admin_notifications.index.preview"), - admin_admin_notification_path(admin_notification), - class: "button" %> +
+ <%= link_to t("admin.admin_notifications.index.edit"), + edit_admin_admin_notification_path(admin_notification), + method: :get, class: "button expanded hollow" %> +
+
+ <%= link_to t("admin.admin_notifications.index.delete"), + admin_admin_notification_path(admin_notification), + method: :delete, class: "button expanded hollow alert" %> +
+
+ <%= link_to t("admin.admin_notifications.index.preview"), + admin_admin_notification_path(admin_notification), + class: "button expanded" %> +
<% else %> - <%= link_to t("admin.admin_notifications.index.view"), - admin_admin_notification_path(admin_notification), - class: "button" %> +
+ <%= link_to t("admin.admin_notifications.index.view"), + admin_admin_notification_path(admin_notification), + class: "button expanded" %> +
<% end %> diff --git a/app/views/admin/admin_notifications/show.html.erb b/app/views/admin/admin_notifications/show.html.erb index 92c0e37fc..77296e3ed 100644 --- a/app/views/admin/admin_notifications/show.html.erb +++ b/app/views/admin/admin_notifications/show.html.erb @@ -2,76 +2,74 @@

<%= t("admin.admin_notifications.show.section_title") %>

-
-
-
-
- <%= t("admin.admin_notifications.show.sent_at") %>
- <% if @admin_notification.draft? %> - <%= t("admin.admin_notifications.index.draft") %> - <% else %> - <%= l(@admin_notification.sent_at.to_date) %> - <% end %> -
-
- <%= t("admin.admin_notifications.show.title") %>
- <%= @admin_notification.title %> -
-
-
- -
- <%= t("admin.admin_notifications.show.body") %>
- <%= @admin_notification.body %> -
-
- <%= t("admin.admin_notifications.show.link") %>
- <%= @admin_notification.link %> -
-
-
-
- <%= t("admin.admin_notifications.show.segment_recipient") %>
- <%= segment_name(@admin_notification.segment_recipient) %> - <% if @admin_notification.draft? %> - <%= t("admin.admin_notifications.show.will_get_notified", - n: @admin_notification.list_of_recipients_count) %> - <% else %> - <%= t("admin.admin_notifications.show.got_notified", - n: @admin_notification.recipients_count) %> - <% end %> -
-
-
- -

+

+
+ <%= t("admin.admin_notifications.show.sent_at") %>
<% if @admin_notification.draft? %> - <%= t("admin.admin_notifications.show.preview_guide") %> + <%= t("admin.admin_notifications.index.draft") %> <% else %> - <%= t("admin.admin_notifications.show.sent_guide") %> + <%= l(@admin_notification.sent_at.to_date) %> + <% end %> +
+ +
+ <%= t("admin.admin_notifications.show.title") %>
+ <%= @admin_notification.title %> +
+ +
+ <%= t("admin.admin_notifications.show.body") %>
+ <%= @admin_notification.body %> +
+ +
+ <%= t("admin.admin_notifications.show.link") %>
+ <%= @admin_notification.link %> +
+ +
+ <%= t("admin.admin_notifications.show.segment_recipient") %>
+ <%= segment_name(@admin_notification.segment_recipient) %> + <% if @admin_notification.draft? %> + <%= t("admin.admin_notifications.show.will_get_notified", + n: @admin_notification.list_of_recipients_count) %> + <% else %> + <%= t("admin.admin_notifications.show.got_notified", + n: @admin_notification.recipients_count) %> <% end %> -

-
-
-
    -
  • - <% locals = { notification: nil, - title: @admin_notification.title, - body: @admin_notification.body, - timestamp: Time.current } %> - <% link_text = render partial: '/notifications/notification_body', locals: locals %> - <%= link_to_if @admin_notification.link.present?, link_text, @admin_notification.link %> -
  • -
-
+ +

+ <% if @admin_notification.draft? %> + <%= t("admin.admin_notifications.show.preview_guide") %> + <% else %> + <%= t("admin.admin_notifications.show.sent_guide") %> + <% end %> +

+
+
+
    +
  • + <% locals = { notification: nil, + title: @admin_notification.title, + body: @admin_notification.body, + timestamp: Time.current } %> + <% link_text = render partial: '/notifications/notification_body', locals: locals %> + <%= link_to_if @admin_notification.link.present?, link_text, @admin_notification.link %> +
  • +
+
+
+ <% if @admin_notification.draft? && @admin_notification.valid_segment_recipient? %> - <%= link_to t("admin.admin_notifications.show.send"), - deliver_admin_admin_notification_path(@admin_notification), - "data-alert": t("admin.admin_notifications.show.send_alert", - n: @admin_notification.list_of_recipients_count), - method: :post, - id: "js-send-admin_notification-alert", - class: "button success" %> +
+ <%= link_to t("admin.admin_notifications.show.send"), + deliver_admin_admin_notification_path(@admin_notification), + "data-alert": t("admin.admin_notifications.show.send_alert", + n: @admin_notification.list_of_recipients_count), + method: :post, + id: "js-send-admin_notification-alert", + class: "button success expanded" %> +
<% end %> diff --git a/app/views/admin/emails_download/index.html.erb b/app/views/admin/emails_download/index.html.erb index 7c82a6844..a8283bbc2 100644 --- a/app/views/admin/emails_download/index.html.erb +++ b/app/views/admin/emails_download/index.html.erb @@ -5,15 +5,13 @@ method: :get, id: "admin_download_emails" do %> - +

- <%= t('admin.emails_download.index.download_segment_help_text') %> + <%= t("admin.emails_download.index.download_segment_help_text") %>

<%= select_tag :users_segment, options_for_select(user_segments_options) %> -
- <%= submit_tag t('admin.emails_download.index.download_emails_button'), class: "button" %> -
+ <%= submit_tag t("admin.emails_download.index.download_emails_button"), class: "button" %> <% end %>
diff --git a/app/views/admin/newsletters/index.html.erb b/app/views/admin/newsletters/index.html.erb index 00a94e336..5fcd2d967 100644 --- a/app/views/admin/newsletters/index.html.erb +++ b/app/views/admin/newsletters/index.html.erb @@ -6,10 +6,10 @@ - + - + @@ -28,13 +28,19 @@ <%= l newsletter.sent_at.to_date %> <% end %> - <% end %> diff --git a/app/views/admin/newsletters/show.html.erb b/app/views/admin/newsletters/show.html.erb index 64b1d7725..c6b043c12 100644 --- a/app/views/admin/newsletters/show.html.erb +++ b/app/views/admin/newsletters/show.html.erb @@ -4,39 +4,37 @@ <% recipients_count = @newsletter.valid_segment_recipient? ? @newsletter.list_of_recipient_emails.count : 0 %> -
-
-
-
- <%= t("admin.newsletters.show.sent_at") %>
- <% if @newsletter.draft? %> - <%= t("admin.newsletters.index.draft") %> - <% else %> - <%= l @newsletter.sent_at.to_date %> - <% end %> -
-
- <%= t("admin.newsletters.show.from") %>
- <%= @newsletter.from %> -
-
- <%= t("admin.newsletters.show.subject") %>
- <%= @newsletter.subject %> -
+
+
+ <%= t("admin.newsletters.show.sent_at") %>
+ <% if @newsletter.draft? %> + <%= t("admin.newsletters.index.draft") %> + <% else %> + <%= l @newsletter.sent_at.to_date %> + <% end %>
-
-
- <%= t("admin.newsletters.show.segment_recipient") %>
- <%= segment_name(@newsletter.segment_recipient) %> - <%= t("admin.newsletters.show.affected_users", n: recipients_count) %> -
+
+ <%= t("admin.newsletters.show.from") %>
+ <%= @newsletter.from %> +
+
+ <%= t("admin.newsletters.show.subject") %>
+ <%= @newsletter.subject %> +
+
+ <%= t("admin.newsletters.show.segment_recipient") %>
+ <%= segment_name(@newsletter.segment_recipient) %> + <%= t("admin.newsletters.show.affected_users", n: recipients_count) %>
- <%= t("admin.newsletters.show.body") %> -

- <%= t("admin.newsletters.show.body_help_text") %> -

+
+ <%= t("admin.newsletters.show.body") %> +

+ <%= t("admin.newsletters.show.body_help_text") %> +

+
+
- + @@ -17,20 +17,26 @@ - <% end %> From 6727583c0e4ccbf87c5fcfddb52a9b3533abfe13 Mon Sep 17 00:00:00 2001 From: decabeza Date: Thu, 19 Jul 2018 17:56:36 +0200 Subject: [PATCH 06/15] Unifies styles and views for admin site content section --- app/views/admin/banners/index.html.erb | 10 ++-- .../site_customization/pages/_form.html.erb | 52 +++++++++---------- .../site_customization/pages/edit.html.erb | 13 +++-- .../site_customization/pages/index.html.erb | 30 ++++++----- .../site_customization/pages/new.html.erb | 11 ++-- 5 files changed, 57 insertions(+), 59 deletions(-) diff --git a/app/views/admin/banners/index.html.erb b/app/views/admin/banners/index.html.erb index bc1cec4e8..f25841420 100644 --- a/app/views/admin/banners/index.html.erb +++ b/app/views/admin/banners/index.html.erb @@ -1,5 +1,5 @@ <%= link_to t("admin.banners.index.create"), - new_admin_banner_path, class: "button success float-right" %> + new_admin_banner_path, class: "button float-right" %>

<%= t("admin.banners.index.title") %>

@@ -13,14 +13,14 @@
- + - - - - - + @@ -29,17 +29,21 @@ - - <% end %> diff --git a/app/views/admin/site_customization/pages/new.html.erb b/app/views/admin/site_customization/pages/new.html.erb index 2d555c5b8..a059f0eb5 100644 --- a/app/views/admin/site_customization/pages/new.html.erb +++ b/app/views/admin/site_customization/pages/new.html.erb @@ -1,12 +1,11 @@ <% provide :title do %> - Admin - <%= t("admin.menu.site_customization.pages") %> - <%= t("admin.site_customization.pages.new.title") %> + <%= t("admin.header.title") %> - <%= t("admin.menu.site_customization.pages") %> - <%= t("admin.site_customization.pages.new.title") %> <% end %> <%= back_link_to admin_site_customization_pages_path %> -
-
-

<%= t("admin.site_customization.pages.new.title") %>

- <%= render 'form' %> -
+
+

<%= t("admin.site_customization.pages.new.title") %>

+ +<%= render 'form' %> From ee16900d1b1e7f506a60833041a81f5042ad652b Mon Sep 17 00:00:00 2001 From: decabeza Date: Thu, 19 Jul 2018 18:24:16 +0200 Subject: [PATCH 07/15] Unifies styles and views for admin voting booths section --- .../_booth_assignment.html.erb | 14 ++++---- .../poll/booth_assignments/manage.html.erb | 9 ++---- app/views/admin/poll/booths/_form.html.erb | 32 ++++++++----------- app/views/admin/poll/booths/edit.html.erb | 4 ++- app/views/admin/poll/booths/index.html.erb | 2 +- app/views/admin/poll/booths/new.html.erb | 4 ++- .../admin/poll/officers/_officer.html.erb | 15 +++++---- app/views/admin/poll/officers/index.html.erb | 23 +++++++------ .../poll/shifts/_search_officers.html.erb | 28 ++++++++-------- app/views/admin/poll/shifts/_shifts.html.erb | 6 ++-- 10 files changed, 67 insertions(+), 70 deletions(-) diff --git a/app/views/admin/poll/booth_assignments/_booth_assignment.html.erb b/app/views/admin/poll/booth_assignments/_booth_assignment.html.erb index d7896446f..57cc8eaf0 100644 --- a/app/views/admin/poll/booth_assignments/_booth_assignment.html.erb +++ b/app/views/admin/poll/booth_assignments/_booth_assignment.html.erb @@ -6,27 +6,29 @@ <% if booth_assignment.present? %>
- <% else %> - <% end %> diff --git a/app/views/admin/poll/booth_assignments/manage.html.erb b/app/views/admin/poll/booth_assignments/manage.html.erb index b7d619c71..449037b9e 100644 --- a/app/views/admin/poll/booth_assignments/manage.html.erb +++ b/app/views/admin/poll/booth_assignments/manage.html.erb @@ -1,9 +1,6 @@ -<%= link_to booth_assignments_admin_polls_path do %> - <%= t("shared.back") %> -<% end %> -
+<%= back_link_to booth_assignments_admin_polls_path %> -

<%= t("admin.booth_assignments.manage.assignments_list", poll: @poll.name) %>

+

<%= t("admin.booth_assignments.manage.assignments_list", poll: @poll.name) %>

<% if @booths.empty? %>
@@ -15,7 +12,7 @@
- + <% @booths.each do |booth| %> diff --git a/app/views/admin/poll/booths/_form.html.erb b/app/views/admin/poll/booths/_form.html.erb index 31d60c0f0..5445144af 100644 --- a/app/views/admin/poll/booths/_form.html.erb +++ b/app/views/admin/poll/booths/_form.html.erb @@ -1,20 +1,16 @@ -
-
- <%= f.text_field :name, - placeholder: t('admin.booths.new.name'), - label: t("admin.booths.new.name") %> -
- -
- <%= f.text_field :location, - placeholder: t("admin.booths.new.location"), - label: t("admin.booths.new.location") %> -
+
+ <%= f.text_field :name, + placeholder: t('admin.booths.new.name'), + label: t("admin.booths.new.name") %>
-
-
- <%= f.submit t("admin.booths.#{admin_submit_action(@booth)}.submit_button"), - class: "button success expanded" %> -
-
\ No newline at end of file +
+ <%= f.text_field :location, + placeholder: t("admin.booths.new.location"), + label: t("admin.booths.new.location") %> +
+ +
+ <%= f.submit t("admin.booths.#{admin_submit_action(@booth)}.submit_button"), + class: "button success expanded" %> +
diff --git a/app/views/admin/poll/booths/edit.html.erb b/app/views/admin/poll/booths/edit.html.erb index 66bfa8355..7ed55dd21 100644 --- a/app/views/admin/poll/booths/edit.html.erb +++ b/app/views/admin/poll/booths/edit.html.erb @@ -1,6 +1,8 @@ <%= back_link_to admin_booths_path %> -

<%= t("admin.booths.edit.title") %>

+
+

<%= t("admin.booths.edit.title") %>

+
<%= form_for @booth, url: admin_booth_path(@booth) do |f| %> <%= render "form", f: f %> diff --git a/app/views/admin/poll/booths/index.html.erb b/app/views/admin/poll/booths/index.html.erb index 95b248b3f..f1a21d06e 100644 --- a/app/views/admin/poll/booths/index.html.erb +++ b/app/views/admin/poll/booths/index.html.erb @@ -1,7 +1,7 @@

<%= t("admin.booths.index.title") %>

<% if controller_name == "booths" && action_name != "available" %> - <%= link_to t("admin.booths.index.add_booth"), new_admin_booth_path, class: "button success float-right" %> + <%= link_to t("admin.booths.index.add_booth"), new_admin_booth_path, class: "button float-right" %> <% end %> <% if @booths.empty? %> diff --git a/app/views/admin/poll/booths/new.html.erb b/app/views/admin/poll/booths/new.html.erb index cf9581fa3..54e64c907 100644 --- a/app/views/admin/poll/booths/new.html.erb +++ b/app/views/admin/poll/booths/new.html.erb @@ -1,6 +1,8 @@ <%= back_link_to admin_booths_path %> -

<%= t("admin.booths.new.title") %>

+
+

<%= t("admin.booths.new.title") %>

+
<%= form_for @booth, url: admin_booths_path(@booth) do |f| %> <%= render "form", f: f %> diff --git a/app/views/admin/poll/officers/_officer.html.erb b/app/views/admin/poll/officers/_officer.html.erb index 3562b4a90..21a5bbdbc 100644 --- a/app/views/admin/poll/officers/_officer.html.erb +++ b/app/views/admin/poll/officers/_officer.html.erb @@ -1,8 +1,9 @@
<%= t("admin.newsletters.index.subject") %><%= t("admin.newsletters.index.subject") %> <%= t("admin.newsletters.index.segment_recipient") %> <%= t("admin.newsletters.index.sent") %><%= t("admin.newsletters.index.actions") %><%= t("admin.newsletters.index.actions") %>
+ +
<%= link_to t("admin.newsletters.index.edit"), edit_admin_newsletter_path(newsletter), - method: :get, class: "button hollow" %> + method: :get, class: "button hollow expanded" %> +
+
<%= link_to t("admin.newsletters.index.delete"), admin_newsletter_path(newsletter), - method: :delete, class: "button hollow alert" %> + method: :delete, class: "button hollow alert expanded" %> +
+
<%= link_to t("admin.newsletters.index.preview"), admin_newsletter_path(newsletter), - class: "button" %> + class: "button expanded" %> +
<%= t("admin.shared.title") %> <%= t("admin.shared.description") %><%= t("admin.shared.actions") %><%= t("admin.shared.actions") %>
<%= t("admin.system_emails.#{system_email_title}.description") %> + <% if system_email_actions.include?('view') %> - <%= link_to t("admin.shared.view"), admin_system_email_view_path(system_email_title), - class: "button hollow" %> +
+ <%= link_to t("admin.shared.view"), admin_system_email_view_path(system_email_title), + class: "button hollow expanded" %> +
<% end %> <% if system_email_actions.include?('preview_pending') %> - <%= link_to t("admin.system_emails.preview_pending.action"), - admin_system_email_preview_pending_path(system_email_title), - class: "button" %> +
+ <%= link_to t("admin.system_emails.preview_pending.action"), + admin_system_email_preview_pending_path(system_email_title), + class: "button expanded" %> +
<% end %> - <%= link_to t("admin.system_emails.preview_pending.send_pending"), - admin_system_email_send_pending_path(system_email_title), - class: "button", - method: :put %> +
+ <%= link_to t("admin.system_emails.preview_pending.send_pending"), + admin_system_email_send_pending_path(system_email_title), + class: "button success expanded", + method: :put %> +
<%= t("admin.banners.banner.post_started_at")%> <%= t("admin.banners.banner.post_ended_at")%><%= t("admin.actions.actions")%><%= t("admin.actions.actions")%>
<%= banner.post_started_at %> <%= banner.post_ended_at %> +
<%= link_to t("admin.banners.index.edit"), edit_admin_banner_path(banner), class: 'button hollow expanded' %> @@ -32,11 +32,9 @@
<%= t("admin.banners.index.preview") %>
+ <%= t("admin.banners.index.preview") %> <% end %> -
-
-
-
-
-

<%= t("admin.site_customization.pages.form.options") %>

- <%= f.check_box :more_info_flag, class: "small" %> - <%= f.check_box :print_content_flag %> -
-
- <%= f.label :status %> - <% ::SiteCustomization::Page::VALID_STATUSES.each do |status| %> - <%= f.radio_button :status, status, label: false %> - <%= f.label "status_#{status}", t("admin.site_customization.pages.page.status_#{status}") %> -
- <% end %> -
-
- <%= f.label :locale %> - <%= f.select :locale, I18n.available_locales.map { |l| [name_for_locale(l), l.to_s] }, { include_blank: true, label: false } %> -
-
- <%= f.label :slug %> - <%= f.text_field :slug, label: false, size: 80, maxlength: 80 %> -
+
+
+
+ +
+

<%= t("admin.site_customization.pages.form.options") %>

+ <%= f.check_box :more_info_flag, class: "small" %> + <%= f.check_box :print_content_flag %> +
+
+ <%= f.label :status %> + <% ::SiteCustomization::Page::VALID_STATUSES.each do |status| %> + <%= f.radio_button :status, status, label: false %> + <%= f.label "status_#{status}", t("admin.site_customization.pages.page.status_#{status}") %> +
+ <% end %> +
+
+ <%= f.label :locale %> + <%= f.select :locale, I18n.available_locales.map { |l| [name_for_locale(l), l.to_s] }, { include_blank: true, label: false } %> +
+
+ <%= f.label :slug %> + <%= f.text_field :slug, label: false, size: 80, maxlength: 80 %>
-

@@ -55,7 +53,7 @@ <%= f.cktext_area :content, label: false, cols: 80, rows: 10, ckeditor: { language: I18n.locale } %>
-
+
<%= f.submit class: "button success expanded" %>
diff --git a/app/views/admin/site_customization/pages/edit.html.erb b/app/views/admin/site_customization/pages/edit.html.erb index 9a2fc92ab..fed4b2b33 100644 --- a/app/views/admin/site_customization/pages/edit.html.erb +++ b/app/views/admin/site_customization/pages/edit.html.erb @@ -1,14 +1,13 @@ <% provide :title do %> - Admin - <%= t("admin.menu.site_customization.pages") %> - <%= @page.title %> + <%= t("admin.header.title") %> - <%= t("admin.menu.site_customization.pages") %> - <%= @page.title %> <% end %> <%= back_link_to admin_site_customization_pages_path %> -<%= button_to t("admin.site_customization.pages.index.delete"), admin_site_customization_page_path(@page), method: :delete, class: "button hollow alert small float-right" %> +
+

<%= t("admin.site_customization.pages.edit.title", page_title: @page.title) %>

-
-
-

<%= t("admin.site_customization.pages.edit.title", page_title: @page.title) %>

- <%= render 'form' %> -
+ <%= link_to t("admin.site_customization.pages.index.delete"), admin_site_customization_page_path(@page), method: :delete, class: "delete float-right" %>
+ +<%= render 'form' %> diff --git a/app/views/admin/site_customization/pages/index.html.erb b/app/views/admin/site_customization/pages/index.html.erb index 897549caf..ab442d351 100644 --- a/app/views/admin/site_customization/pages/index.html.erb +++ b/app/views/admin/site_customization/pages/index.html.erb @@ -1,5 +1,5 @@ <% provide :title do %> - Admin - <%= t("admin.menu.site_customization.pages") %> + <%= t("admin.header.title") %> - <%= t("admin.menu.site_customization.pages") %> <% end %> <%= link_to t("admin.site_customization.pages.index.create"), new_admin_site_customization_page_path, class: "button float-right" %> @@ -16,7 +16,7 @@
<%= t("admin.site_customization.pages.page.updated_at") %> <%= t("admin.site_customization.pages.page.status") %> <%= t("admin.site_customization.pages.page.locale") %><%= t("admin.actions.actions") %><%= t("admin.actions.actions") %>
<%= I18n.l page.created_at, format: :short %> <%= t("admin.site_customization.pages.page.status_#{page.status}") %> <%= name_for_locale(page.locale) %> - - <% if page.status == "published" %> - <%= link_to t("admin.site_customization.pages.index.see_page"), page.url, target: "_blank" %> - <% else %> - <%= t("admin.site_customization.pages.index.see_page") %> - <% end %> - - - <%= link_to t("admin.site_customization.pages.index.delete"), admin_site_customization_page_path(page), method: :delete, class: "delete" %> + +
+ <% if page.status == "published" %> + <%= link_to t("admin.site_customization.pages.index.see_page"), + page.url, + target: "_blank", + class: "button hollow expanded" %> + <% end %> +
+
+ <%= link_to t("admin.site_customization.pages.index.delete"), + admin_site_customization_page_path(page), + method: :delete, + class: "button hollow alert expanded" %> +
- <%= t("admin.booth_assignments.manage.status.assigned") %> + + <%= t("admin.booth_assignments.manage.status.assigned") %> + + <%= link_to t("admin.booth_assignments.manage.actions.unassign"), admin_poll_booth_assignment_path(@poll, booth_assignment, booth_id: booth.id), method: :delete, remote: true, title: t("admin.booth_assignments.manage.actions.unassign"), - class: "button hollow alert", + class: "button hollow alert expanded", data: (booth_assignment.shifts? ? {confirm: "#{t("admin.poll_booth_assignments.alert.shifts")}"} : nil) if !@poll.expired? %> - <%= t("admin.booth_assignments.manage.status.unassigned") %> + <%= t("admin.booth_assignments.manage.status.unassigned") %> + <%= link_to t("admin.booth_assignments.manage.actions.assign"), admin_poll_booth_assignments_path(@poll, booth_id: booth.id), method: :post, remote: true, title: t("admin.booth_assignments.manage.actions.assign"), - class: "button" if !@poll.expired? %> + class: "button hollow expanded" if !@poll.expired? %> <%= t("admin.booths.index.name") %> <%= t("admin.booths.index.location") %> <%= t("admin.booth_assignments.manage.status.assign_status") %><%= t("admin.actions.actions") %><%= t("admin.actions.actions") %>
- - + + + @@ -13,16 +14,16 @@ - diff --git a/app/views/admin/poll/officers/index.html.erb b/app/views/admin/poll/officers/index.html.erb index fd9619167..433d0fdbf 100644 --- a/app/views/admin/poll/officers/index.html.erb +++ b/app/views/admin/poll/officers/index.html.erb @@ -1,23 +1,22 @@

<%= t("admin.poll_officers.index.title") %>

-
-
- <%= render 'search' %> -
+
+ <%= render 'search' %>

- <%= page_entries_info @officers, entry_name: t('admin.poll_officers.officer.entry_name') %> + <%= page_entries_info @officers, entry_name: t("admin.poll_officers.officer.entry_name") %>

<% if @officers.any? %>
<%= t('admin.poll_officers.officer.name') %><%= t('admin.poll_officers.officer.email') %><%= t("admin.poll_officers.officer.name") %><%= t("admin.poll_officers.officer.email") %><%= t("admin.actions.actions") %>
<%= officer.email %> + <% if officer.persisted? %> - <%= link_to t('admin.poll_officers.officer.delete'), + <%= link_to t("admin.poll_officers.officer.delete"), admin_officer_path(officer), method: :delete, - class: "button hollow alert" %> + class: "button hollow alert expanded" %> <% else %> - <%= link_to t('admin.poll_officers.officer.add'),{ controller: "admin/poll/officers", action: :create, user_id: officer.user_id }, + <%= link_to t("admin.poll_officers.officer.add"),{ controller: "admin/poll/officers", action: :create, user_id: officer.user_id }, method: :post, - class: "button success" %> + class: "button success expanded" %> <% end %>
- - + + + @@ -29,19 +28,19 @@ - diff --git a/app/views/admin/poll/shifts/_search_officers.html.erb b/app/views/admin/poll/shifts/_search_officers.html.erb index e63d09d41..e95090f9c 100644 --- a/app/views/admin/poll/shifts/_search_officers.html.erb +++ b/app/views/admin/poll/shifts/_search_officers.html.erb @@ -1,19 +1,17 @@ -
-
- <%= form_tag search_officers_admin_booth_shifts_path, - method: :get, remote: true do |f| %> -
- <%= text_field_tag :search, - @search, - placeholder: t("admin.poll_shifts.new.search_officer_placeholder"), - id: "search-officers" %> -
- <%= submit_tag t("admin.poll_shifts.new.search_officer_button"), - class: "button" %> -
+
+ <%= form_tag search_officers_admin_booth_shifts_path, + method: :get, remote: true do |f| %> +
+ <%= text_field_tag :search, + @search, + placeholder: t("admin.poll_shifts.new.search_officer_placeholder"), + id: "search-officers" %> +
+ <%= submit_tag t("admin.poll_shifts.new.search_officer_button"), + class: "button" %>
- <% end %> -
+
+ <% end %>
diff --git a/app/views/admin/poll/shifts/_shifts.html.erb b/app/views/admin/poll/shifts/_shifts.html.erb index 63cbe0690..66d64ed22 100644 --- a/app/views/admin/poll/shifts/_shifts.html.erb +++ b/app/views/admin/poll/shifts/_shifts.html.erb @@ -5,7 +5,7 @@
- + @@ -14,11 +14,11 @@ - <% end %> From f77327e93c65d7ad8424de2870886e35302030df Mon Sep 17 00:00:00 2001 From: decabeza Date: Thu, 19 Jul 2018 18:32:26 +0200 Subject: [PATCH 08/15] Unifies styles and views for admin site customization content blocks --- .../content_blocks/_form.html.erb | 28 +++++++++---------- .../content_blocks/edit.html.erb | 16 ++++++----- .../content_blocks/index.html.erb | 2 +- .../content_blocks/new.html.erb | 11 ++++---- 4 files changed, 28 insertions(+), 29 deletions(-) diff --git a/app/views/admin/site_customization/content_blocks/_form.html.erb b/app/views/admin/site_customization/content_blocks/_form.html.erb index ca89b8781..29face918 100644 --- a/app/views/admin/site_customization/content_blocks/_form.html.erb +++ b/app/views/admin/site_customization/content_blocks/_form.html.erb @@ -14,22 +14,20 @@ <% end %> -
-
- <%= f.label :name %> - <%= f.select :name, SiteCustomization::ContentBlock::VALID_BLOCKS, label: false %> -
-
- <%= f.label :locale %> - <%= f.select :locale, I18n.available_locales, label: false %> -
+
+ <%= f.label :name %> + <%= f.select :name, SiteCustomization::ContentBlock::VALID_BLOCKS, label: false %> +
+
+ <%= f.label :locale %> + <%= f.select :locale, I18n.available_locales, label: false %> +
-
- <%= f.label :body %> - <%= f.text_area :body, label: false, rows: 10 %> -
- <%= f.submit class: "button success expanded" %> -
+
+ <%= f.label :body %> + <%= f.text_area :body, label: false, rows: 10 %> +
+ <%= f.submit class: "button success expanded" %>
diff --git a/app/views/admin/site_customization/content_blocks/edit.html.erb b/app/views/admin/site_customization/content_blocks/edit.html.erb index 9c2694449..d01e4a01b 100644 --- a/app/views/admin/site_customization/content_blocks/edit.html.erb +++ b/app/views/admin/site_customization/content_blocks/edit.html.erb @@ -1,14 +1,16 @@ <% provide :title do %> - Admin - <%= t("admin.menu.site_customization.content_blocks") %> - <%= @content_block.name %> (<%= @content_block.locale %>) + <%= t("admin.header.title") %> - <%= t("admin.menu.site_customization.content_blocks") %> - <%= @content_block.name %> (<%= @content_block.locale %>) <% end %> <%= back_link_to admin_site_customization_content_blocks_path %> -<%= button_to t("admin.site_customization.content_blocks.index.delete"), admin_site_customization_content_block_path(@content_block), method: :delete, class: "button hollow alert float-right small" %> +<%= link_to t("admin.site_customization.content_blocks.index.delete"), + admin_site_customization_content_block_path(@content_block), + method: :delete, + class: "delete float-right" %> -
-
-

<%= t("admin.site_customization.content_blocks.edit.title") %>

- <%= render 'form' %> -
+
+

<%= t("admin.site_customization.content_blocks.edit.title") %>

+ +<%= render 'form' %> diff --git a/app/views/admin/site_customization/content_blocks/index.html.erb b/app/views/admin/site_customization/content_blocks/index.html.erb index fc762c1fd..62094684d 100644 --- a/app/views/admin/site_customization/content_blocks/index.html.erb +++ b/app/views/admin/site_customization/content_blocks/index.html.erb @@ -1,5 +1,5 @@ <% provide :title do %> - Admin - <%= t("admin.menu.site_customization.content_blocks") %> + <%= t("admin.header.title") %> - <%= t("admin.menu.site_customization.content_blocks") %> <% end %> <%= link_to t("admin.site_customization.content_blocks.index.create"), new_admin_site_customization_content_block_path, class: "button float-right" %> diff --git a/app/views/admin/site_customization/content_blocks/new.html.erb b/app/views/admin/site_customization/content_blocks/new.html.erb index 6a5a1e0b3..b1bf7cf92 100644 --- a/app/views/admin/site_customization/content_blocks/new.html.erb +++ b/app/views/admin/site_customization/content_blocks/new.html.erb @@ -1,12 +1,11 @@ <% provide :title do %> - Admin - <%= t("admin.menu.site_customization.content_blocks") %> - <%= t("admin.site_customization.content_blocks.new.title") %> + <%= t("admin.header.title") %> - <%= t("admin.menu.site_customization.content_blocks") %> - <%= t("admin.site_customization.content_blocks.new.title") %> <% end %> <%= back_link_to admin_site_customization_content_blocks_path %> -
-
-

<%= t("admin.site_customization.content_blocks.new.title") %>

- <%= render 'form' %> -
+
+

<%= t("admin.site_customization.content_blocks.new.title") %>

+ +<%= render 'form' %> From defc04a5dc999d84fcb34ef3908a9ecec15cbc22 Mon Sep 17 00:00:00 2001 From: decabeza Date: Thu, 19 Jul 2018 18:36:02 +0200 Subject: [PATCH 09/15] Unifies styles and views for admin geozones --- app/views/admin/geozones/_errors.html.erb | 1 - app/views/admin/geozones/_form.html.erb | 38 ++++++++++------------- app/views/admin/geozones/edit.html.erb | 12 +++---- app/views/admin/geozones/index.html.erb | 19 ++++++++---- app/views/admin/geozones/new.html.erb | 12 +++---- 5 files changed, 40 insertions(+), 42 deletions(-) diff --git a/app/views/admin/geozones/_errors.html.erb b/app/views/admin/geozones/_errors.html.erb index d0f3b849f..f7f57756c 100644 --- a/app/views/admin/geozones/_errors.html.erb +++ b/app/views/admin/geozones/_errors.html.erb @@ -1,4 +1,3 @@ - <% if @geozone.errors.any? %>
diff --git a/app/views/admin/geozones/_form.html.erb b/app/views/admin/geozones/_form.html.erb index e92b98c0b..0d1dea166 100644 --- a/app/views/admin/geozones/_form.html.erb +++ b/app/views/admin/geozones/_form.html.erb @@ -2,28 +2,24 @@ <%= render 'errors' %> -
-
- <%= f.label :name, t("admin.geozones.geozone.name") %> - <%= f.text_field :name, label: false %> -
-
- <%= f.label :html_map_coordinates, t("admin.geozones.geozone.coordinates") %> - <%= f.text_field :html_map_coordinates, label: false %> -
-
- <%= f.label :external_code, t("admin.geozones.geozone.external_code") %> - <%= f.text_field :external_code, label: false %> -
-
- <%= f.label :census_code, t("admin.geozones.geozone.census_code") %> - <%= f.text_field :census_code, label: false %> -
+
+ <%= f.label :name, t("admin.geozones.geozone.name") %> + <%= f.text_field :name, label: false %> +
+
+ <%= f.label :html_map_coordinates, t("admin.geozones.geozone.coordinates") %> + <%= f.text_field :html_map_coordinates, label: false %> +
+
+ <%= f.label :external_code, t("admin.geozones.geozone.external_code") %> + <%= f.text_field :external_code, label: false %> +
+
+ <%= f.label :census_code, t("admin.geozones.geozone.census_code") %> + <%= f.text_field :census_code, label: false %>
-
-
- <%= f.submit(class: "button expanded", value: t("admin.geozones.edit.form.submit_button")) %> -
+
+ <%= f.submit(class: "button success expanded", value: t("admin.geozones.edit.form.submit_button")) %>
<% end %> diff --git a/app/views/admin/geozones/edit.html.erb b/app/views/admin/geozones/edit.html.erb index 554d82e98..45e037994 100644 --- a/app/views/admin/geozones/edit.html.erb +++ b/app/views/admin/geozones/edit.html.erb @@ -1,9 +1,7 @@ -
-
- <%= back_link_to admin_geozones_path, t("admin.geozones.edit.back") %> +<%= back_link_to admin_geozones_path, t("admin.geozones.edit.back") %> -

<%= t("admin.geozones.edit.editing") %>

- - <%= render "form" %> -
+
+

<%= t("admin.geozones.edit.editing") %>

+ +<%= render 'form' %> diff --git a/app/views/admin/geozones/index.html.erb b/app/views/admin/geozones/index.html.erb index 555d00ebe..05a175411 100644 --- a/app/views/admin/geozones/index.html.erb +++ b/app/views/admin/geozones/index.html.erb @@ -1,5 +1,5 @@ <%= link_to t("admin.geozones.index.create"), - new_admin_geozone_path, class: "button success float-right" %> + new_admin_geozone_path, class: "button float-right" %>

<%= t("admin.geozones.index.title") %>

@@ -10,7 +10,7 @@
- + @@ -22,10 +22,17 @@ - <% end %> diff --git a/app/views/admin/geozones/new.html.erb b/app/views/admin/geozones/new.html.erb index 14e43e34e..0b1df5268 100644 --- a/app/views/admin/geozones/new.html.erb +++ b/app/views/admin/geozones/new.html.erb @@ -1,9 +1,7 @@ -
-
- <%= back_link_to admin_geozones_path, t("admin.geozones.new.back") %> +<%= back_link_to admin_geozones_path, t("admin.geozones.new.back") %> -

<%= t("admin.geozones.new.creating") %>

- - <%= render "form" %> -
+
+

<%= t("admin.geozones.new.creating") %>

+ +<%= render 'form' %> From 92f4c26fa4216d890ee8ba5cc7e5e8dc1434766c Mon Sep 17 00:00:00 2001 From: decabeza Date: Thu, 19 Jul 2018 18:36:33 +0200 Subject: [PATCH 10/15] Updates styles for admin tables --- app/assets/stylesheets/admin.scss | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/app/assets/stylesheets/admin.scss b/app/assets/stylesheets/admin.scss index a202613f9..7b74b2697 100644 --- a/app/assets/stylesheets/admin.scss +++ b/app/assets/stylesheets/admin.scss @@ -194,6 +194,11 @@ $sidebar-active: #f4fcd0; &.with-button { line-height: $line-height * 2; + + .button { + background: #fff; + color: $brand; + } } } @@ -208,6 +213,19 @@ $sidebar-active: #f4fcd0; table { + thead { + color: #fff; + } + + th { + background: $brand; + color: #fff; + + label { + color: #fff; + } + } + .break { word-break: break-word; } @@ -224,7 +242,6 @@ $sidebar-active: #f4fcd0; @include breakpoint(medium) { margin-left: $line-height / 2; - margin-right: $line-height / 2; margin-top: 0; } } @@ -339,6 +356,14 @@ $sidebar-active: #f4fcd0; margin-bottom: 0 !important; } +.enabled { + color: $color-success; +} + +.disabled { + color: $text-medium; +} + // 02. Sidebar // ----------- From bb05f86156b67823474fe879fc2e241bf1975868 Mon Sep 17 00:00:00 2001 From: decabeza Date: Thu, 19 Jul 2018 18:37:08 +0200 Subject: [PATCH 11/15] Updates admin legislation specs --- spec/features/admin/legislation/draft_versions_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/features/admin/legislation/draft_versions_spec.rb b/spec/features/admin/legislation/draft_versions_spec.rb index d2fd922e4..9bb07f9a3 100644 --- a/spec/features/admin/legislation/draft_versions_spec.rb +++ b/spec/features/admin/legislation/draft_versions_spec.rb @@ -57,7 +57,7 @@ feature 'Admin legislation draft versions' do fill_in 'legislation_draft_version_changelog', with: 'Version 3 changes' fill_in 'legislation_draft_version_body', with: 'Version 3 body' - within('.primary-buttons') do + within('.end') do click_button 'Create version' end From 3fee56e8feb3d296cfc19ed001b6e1c6940301f8 Mon Sep 17 00:00:00 2001 From: decabeza Date: Thu, 19 Jul 2018 20:09:42 +0200 Subject: [PATCH 12/15] Updates admin site customization specs --- .../admin/site_customization/content_blocks/index.html.erb | 2 +- spec/features/admin/site_customization/content_blocks_spec.rb | 4 ++-- spec/features/admin/site_customization/pages_spec.rb | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/views/admin/site_customization/content_blocks/index.html.erb b/app/views/admin/site_customization/content_blocks/index.html.erb index 62094684d..66cf5f241 100644 --- a/app/views/admin/site_customization/content_blocks/index.html.erb +++ b/app/views/admin/site_customization/content_blocks/index.html.erb @@ -32,7 +32,7 @@
diff --git a/spec/features/admin/site_customization/content_blocks_spec.rb b/spec/features/admin/site_customization/content_blocks_spec.rb index eb6098ed4..476ff8d8d 100644 --- a/spec/features/admin/site_customization/content_blocks_spec.rb +++ b/spec/features/admin/site_customization/content_blocks_spec.rb @@ -88,7 +88,7 @@ feature "Admin custom content blocks" do expect(page).to have_content("#{block.name} (#{block.locale})") expect(page).to have_content(block.body) - click_button "Delete block" + click_link "Delete block" expect(page).not_to have_content("#{block.name} (#{block.locale})") expect(page).not_to have_content(block.body) @@ -98,7 +98,7 @@ feature "Admin custom content blocks" do block = create(:site_customization_content_block) visit edit_admin_site_customization_content_block_path(block) - click_button "Delete block" + click_link "Delete block" expect(page).not_to have_content("#{block.name} (#{block.locale})") expect(page).not_to have_content(block.body) diff --git a/spec/features/admin/site_customization/pages_spec.rb b/spec/features/admin/site_customization/pages_spec.rb index 7b586c042..552d4985d 100644 --- a/spec/features/admin/site_customization/pages_spec.rb +++ b/spec/features/admin/site_customization/pages_spec.rb @@ -63,7 +63,7 @@ feature "Admin custom pages" do custom_page = create(:site_customization_page, title: "An example custom page") visit edit_admin_site_customization_page_path(custom_page) - click_button "Delete page" + click_link "Delete page" expect(page).not_to have_content("An example custom page") end From 108e458678d841d61fcd6413f88e44e670d7c7a3 Mon Sep 17 00:00:00 2001 From: decabeza Date: Mon, 23 Jul 2018 19:58:49 +0200 Subject: [PATCH 13/15] Adds description to all admin settings --- .../admin/settings/_configuration.html.erb | 14 +- .../admin/settings/_feature_flags.html.erb | 25 +++- config/locales/en/admin.yml | 9 +- config/locales/en/settings.yml | 132 ++++++++++++----- config/locales/es/admin.yml | 11 +- config/locales/es/settings.yml | 134 +++++++++++++----- 6 files changed, 241 insertions(+), 84 deletions(-) diff --git a/app/views/admin/settings/_configuration.html.erb b/app/views/admin/settings/_configuration.html.erb index edadbb604..f2d5a7605 100644 --- a/app/views/admin/settings/_configuration.html.erb +++ b/app/views/admin/settings/_configuration.html.erb @@ -1,13 +1,23 @@

<%= t("admin.settings.index.title") %>

<%= t('admin.poll_officers.officer.name') %><%= t('admin.poll_officers.officer.email') %><%= t("admin.poll_officers.officer.name") %><%= t("admin.poll_officers.officer.email") %><%= t("admin.actions.actions") %>
<%= officer.email %> + <% if officer.persisted? %> - <%= link_to t('admin.poll_officers.officer.delete'), + <%= link_to t("admin.poll_officers.officer.delete"), admin_officer_path(officer), method: :delete, - class: "button hollow alert" + class: "button hollow alert expanded" %> <% else %> - <%= link_to t('admin.poll_officers.officer.add'), + <%= link_to t("admin.poll_officers.officer.add"), { controller: "admin/poll/officers", action: :create, user_id: officer.user_id }, method: :post, - class: "button success" %> + class: "button success expanded" %> <% end %>
<%= t("admin.poll_shifts.new.date") %> <%= t("admin.poll_shifts.new.officer") %> <%= t("admin.poll_shifts.new.task") %><%= t("admin.poll_shifts.new.shift") %><%= t("admin.poll_shifts.new.shift") %>
<%= l(shift.date.to_date, format: :long) %> <%= shift.officer_name %> <%= t("admin.poll_shifts.#{shift.task}") %> + <%= link_to t("admin.poll_shifts.new.remove_shift"), admin_booth_shift_path(@booth, shift), method: :delete, - class: "button hollow alert" %> + class: "button hollow alert expanded" %>
<%= t("admin.geozones.geozone.external_code") %> <%= t("admin.geozones.geozone.census_code") %> <%= t("admin.geozones.geozone.coordinates") %><%= t("admin.actions.actions") %>
<%= geozone.census_code %> <%= geozone.html_map_coordinates %> - <%= link_to t("admin.geozones.index.edit"), edit_admin_geozone_path(geozone), class: 'edit-banner button hollow' %> - - <%= link_to t("admin.geozones.index.delete"), admin_geozone_path(geozone), method: :delete, class: 'button hollow alert' %> +
+ <%= link_to t("admin.geozones.index.edit"), + edit_admin_geozone_path(geozone), + class: "button hollow expanded" %> +
+
+ <%= link_to t("admin.geozones.index.delete"), + admin_geozone_path(geozone), + method: :delete, + class: "button hollow alert expanded" %> +
<%= link_to "#{content_block.name} (#{content_block.locale})", edit_admin_site_customization_content_block_path(content_block) %> <%= content_block.body.html_safe %> - <%= button_to t("admin.site_customization.content_blocks.index.delete"), + <%= link_to t("admin.site_customization.content_blocks.index.delete"), admin_site_customization_content_block_path(content_block), method: :delete, class: "button hollow alert" %>
+ + + + + + <% @settings.each do |setting| %> - -
<%= t("admin.settings.setting_name") %><%= t("admin.settings.setting_value") %>
+ <%= t("settings.#{setting.key}") %> +
+ + <%= t("settings.#{setting.key}_description", default: t("admin.settings.no_description")) %> +
+ <%= form_for(setting, url: admin_setting_path(setting), html: { id: "edit_#{dom_id(setting)}"}) do |f| %>
<%= f.text_area :value, label: false, id: dom_id(setting), lines: 1 %> diff --git a/app/views/admin/settings/_feature_flags.html.erb b/app/views/admin/settings/_feature_flags.html.erb index 5c3660065..493c89873 100644 --- a/app/views/admin/settings/_feature_flags.html.erb +++ b/app/views/admin/settings/_feature_flags.html.erb @@ -1,15 +1,36 @@

<%= t("admin.settings.index.feature_flags") %>

+ + + + + + + <% @feature_flags.each do |feature_flag| %> -
<%= t("admin.settings.setting") %><%= t("admin.settings.setting_status") %><%= t("admin.settings.setting_actions") %>
+ <%= t("settings.#{feature_flag.key}") %> +
+ + <%= t("settings.#{feature_flag.key}_description", default: t("admin.settings.no_description")) %> +
- <%= feature_flag.enabled? ? t("admin.settings.index.features.enabled") : t("admin.settings.index.features.disabled") %> + <% if feature_flag.enabled? %> + + + <%= t ("admin.settings.index.features.enabled") %> + + + <% else %> + + <%= t("admin.settings.index.features.disabled") %> + + <% end %> diff --git a/config/locales/en/admin.yml b/config/locales/en/admin.yml index a1f692fc2..065d506d2 100644 --- a/config/locales/en/admin.yml +++ b/config/locales/en/admin.yml @@ -416,6 +416,7 @@ en: form: custom_categories: Categories custom_categories_description: Categories that users can select creating the proposal. + custom_categories_placeholder: Enter the tags you would like to use, separated by commas (,) and between quotes ("") draft_versions: create: notice: 'Draft created successfully. Click to visit' @@ -663,7 +664,7 @@ en: section_title: Edit notification show: section_title: Notification preview - send: Send + send: Send notification will_get_notified: (%{n} users will be notified) got_notified: (%{n} users got notified) sent_at: Sent at @@ -1055,6 +1056,12 @@ en: update: Map configuration updated succesfully. form: submit: Update + setting: Feature + setting_actions: Actions + setting_name: Setting + setting_status: Status + setting_value: Value + no_description: "No description" shared: booths_search: button: Search diff --git a/config/locales/en/settings.yml b/config/locales/en/settings.yml index 1d2bb819a..435255987 100644 --- a/config/locales/en/settings.yml +++ b/config/locales/en/settings.yml @@ -1,65 +1,121 @@ en: settings: comments_body_max_length: "Comments body max length" + comments_body_max_length_description: "In number of characters" official_level_1_name: "Level 1 public official" + official_level_1_name_description: "Tag that will appear on users marked as Level 1 official position" official_level_2_name: "Level 2 public official" + official_level_2_name_description: "Tag that will appear on users marked as Level 2 official position" official_level_3_name: "Level 3 public official" + official_level_3_name_description: "Tag that will appear on users marked as Level 3 official position" official_level_4_name: "Level 4 public official" + official_level_4_name_description: "Tag that will appear on users marked as Level 4 official position" official_level_5_name: "Level 5 public official" + official_level_5_name_description: "Tag that will appear on users marked as Level 5 official position" max_ratio_anon_votes_on_debates: "Maximum ratio of anonymous votes per Debate" + max_ratio_anon_votes_on_debates_description: "Anonymous votes are by registered users with an unverified account" max_votes_for_proposal_edit: "Number of votes from which a Proposal can no longer be edited" + max_votes_for_proposal_edit_description: "From this number of supports the author of a Proposal can no longer edit it" max_votes_for_debate_edit: "Number of votes from which a Debate can no longer be edited" + max_votes_for_debate_edit_description: "From this number of votes the author of a Debate can no longer edit it" proposal_code_prefix: "Prefix for Proposal codes" + proposal_code_prefix_description: "This prefix will appear in the Proposals before the creation date and its ID" votes_for_proposal_success: "Number of votes necessary for approval of a Proposal" + votes_for_proposal_success_description: "When a proposal reaches this number of supports it will no longer be able to receive more supports and is considered successful" months_to_archive_proposals: "Months to archive Proposals" + months_to_archive_proposals_description: After this number of months the Proposals will be archived and will no longer be able to receive supports" email_domain_for_officials: "Email domain for public officials" + email_domain_for_officials_description: "All users registered with this domain will have their account verified at registration" per_page_code_head: "Code to be included on every page ()" + per_page_code_head_description: "This code will appear inside the label. Useful for entering custom scripts, analitycs..." per_page_code_body: "Code to be included on every page ()" + per_page_code_body_description: "This code will appear inside the label. Useful for entering custom scripts, analitycs..." twitter_handle: "Twitter handle" + twitter_handle_description: "If filled in it will appear in the footer" twitter_hashtag: "Twitter hashtag" + twitter_hashtag_description: "Hashtag that will appear when sharing content on Twitter" facebook_handle: "Facebook handle" + facebook_handle_description: "If filled in it will appear in the footer" youtube_handle: "Youtube handle" + youtube_handle_description: "If filled in it will appear in the footer" telegram_handle: "Telegram handle" + telegram_handle_description: "If filled in it will appear in the footer" instagram_handle: "Instagram handle" + instagram_handle_description: "If filled in it will appear in the footer" + url: "Main URL" + url_description: "Main URL of your website" + org_name: "Organization" + org_name_description: "Name of your organization" + place_name: "Place" + place_name_description: "Name of your city" + related_content_score_threshold: "Related content score threshold" + related_content_score_threshold_description: "Hides content that users mark as unrelated" + map_latitude: "Latitude" + map_latitude_description: "Latitude to show the map position" + map_longitude: "Longitude" + map_longitude_description: "Longitude to show the position of the map" + map_zoom: "Zoom" + map_zoom_description: "Zoom to show the map position" + mailer_from_name: "Sender email name" + mailer_from_name_description: "This name will appear in emails sent from the application" + mailer_from_address: "Sender email address" + mailer_from_address_description: "This email address will appear in emails sent from the application" + meta_title: "Site title (SEO)" + meta_title_description: "Title for the site , used to improve SEO" + meta_description: "Site description (SEO)" + meta_description_description: 'Site description <meta name="description">, used to improve SEO' + meta_keywords: "Keywords (SEO)" + meta_keywords_description: 'Keywords <meta name="keywords">, used to improve SEO' + min_age_to_participate: Minimum age needed to participate + min_age_to_participate_description: "Users over this age can participate in all processes" + analytics_url: "Analytics URL" blog_url: "Blog URL" transparency_url: "Transparency URL" opendata_url: "Open Data URL" - url: "Main URL" - org_name: "Organization" - place_name: "Place" - feature: - budgets: Participatory budgeting - twitter_login: Twitter login - facebook_login: Facebook login - google_login: Google login - proposals: Proposals - debates: Debates - polls: Polls - signature_sheets: Signature sheets - spending_proposals: Investment projects - spending_proposal_features: - voting_allowed: Voting on investment projects - legislation: Legislation - user: - recommendations: Recommendations - skip_verification: Skip user verification - recommendations_on_debates: Recommendations on debates - recommendations_on_proposals: Recommendations on proposals - community: Community on proposals and investments - map: Proposals and budget investments geolocation - allow_images: Allow upload and show images - allow_attached_documents: Allow upload and show of attached documents - guides: Guides to create proposals or investment projects - public_stats: Public stats - related_content_score_threshold: Related content score threshold - map_latitude: Latitude - map_longitude: Longitude - map_zoom: Zoom - mailer_from_name: Origin email name - mailer_from_address: Origin email address - meta_title: "Site title (SEO)" - meta_description: "Site description (SEO)" - meta_keywords: "Keywords (SEO)" verification_offices_url: Verification offices URL - min_age_to_participate: Minimum age needed to participate - proposal_improvement_path: Proposal improvement info internal link \ No newline at end of file + proposal_improvement_path: Proposal improvement info internal link + feature: + budgets: "Participatory budgeting" + budgets_description: "With participatory budgets, citizens decide which projects presented by their neighbours will receive a part of the municipal budget" + twitter_login: "Twitter login" + twitter_login_description: "Allow users to sign up with their Twitter account" + facebook_login: "Facebook login" + facebook_login_description: "Allow users to sign up with their Facebook account" + google_login: "Google login" + google_login_description: "Allow users to sign up with their Google Account" + proposals: "Proposals" + proposals_description: "Citizens' proposals are an opportunity for neighbours and collectives to decide directly how they want their city to be, after getting sufficient support and submitting to a citizens' vote" + debates: "Debates" + debates_description: "The citizens' debate space is aimed at anyone who can present issues that concern them and about which they want to share their views with others" + polls: "Polls" + polls_description: "Citizens' polls are a participatory mechanism by which citizens with voting rights can make direct decisions" + signature_sheets: "Signature sheets" + signature_sheets_description: "It allows ading from the Administration panel signatures collected on-site to Proposals and investment projects of the Participative Budgets" + legislation: "Legislation" + legislation_description: "In participatory processes, citizens are offered the opportunity to participate in the drafting and modification of regulations that affect the city and to give their opinion on certain actions that are planned to be carried out" + spending_proposals: "Spending proposals" + spending_proposals_description: "⚠️ NOTE: This functionality has been replaced by Participatory Budgeting and will disappear in new versions" + spending_proposal_features: + voting_allowed: Voting on investment projects - Preselection phase + voting_allowed_description: "⚠️ NOTE: This functionality has been replaced by Participatory Budgeting and will disappear in new versions" + user: + recommendations: "Recommendations" + recommendations_description: "Shows users recommendations on the homepage based on the tags of the following items" + skip_verification: "Skip user verification" + skip_verification_description: "This will disable user verification and all registered users will be able to participate in all processes" + recommendations_on_debates: "Recommendations on debates" + recommendations_on_debates_description: "Shows users recommendations to users on the debates page based on the tags of the items followed" + recommendations_on_proposals: "Recommendations on proposals" + recommendations_on_proposals_description: "Displays recommendations to users on the proposals page based on the tags of the items followed" + community: "Community on proposals and investments" + community_description: "Enables the community section in the proposals and investment projects of the Participatory Budgets" + map: "Proposals and budget investments geolocation" + map_description: "Enables geolocation of proposals and investment projects" + allow_images: "Allow upload and show images" + allow_images_description: "Allows users to upload images when creating proposals and investment projects from Participatory Budgets" + allow_attached_documents: "Allow upload and show of attached documents" + allow_attached_documents_description: "Allows users to upload documents when creating proposals and investment projects from Participatory Budgets" + guides: "Guides to create proposals or investment projects" + guides_description: "Displays a guide to differences between proposals and investment projects if there is an active participatory budget" + public_stats: "Public stats" + public_stats_description: "Display public stats in the Administration panel" diff --git a/config/locales/es/admin.yml b/config/locales/es/admin.yml index 22a328823..cc1561ffa 100644 --- a/config/locales/es/admin.yml +++ b/config/locales/es/admin.yml @@ -417,6 +417,7 @@ es: form: custom_categories: Categorías custom_categories_description: Categorías que el usuario puede seleccionar al crear la propuesta. + custom_categories_placeholder: Escribe las etiquetas que desees separadas por una coma (,) y entrecomilladas ("") draft_versions: create: notice: 'Borrador creado correctamente. <a href="%{link}">Haz click para verlo</a>' @@ -481,7 +482,7 @@ es: form: error: Error form: - add_option: +Añadir respuesta cerrada + add_option: Añadir respuesta cerrada title: Pregunta title_placeholder: Escribe un título a la pregunta value_placeholder: Escribe una respuesta cerrada @@ -664,7 +665,7 @@ es: section_title: Editar notificación show: section_title: Vista previa de notificación - send: Enviar + send: Enviar notificación will_get_notified: (%{n} usuarios serán notificados) got_notified: (%{n} usuarios fueron notificados) sent_at: Enviado @@ -1056,6 +1057,12 @@ es: update: La configuración del mapa se ha guardado correctamente. form: submit: Actualizar + setting: Funcionalidad + setting_actions: Acciones + setting_name: Configuración + setting_status: Estado + setting_value: Valor + no_description: Sin descripción shared: booths_search: button: Buscar diff --git a/config/locales/es/settings.yml b/config/locales/es/settings.yml index 90f785580..c57bac1f7 100644 --- a/config/locales/es/settings.yml +++ b/config/locales/es/settings.yml @@ -1,65 +1,121 @@ es: settings: comments_body_max_length: "Longitud máxima de los comentarios" + comments_body_max_length_description: "En número de caracteres" official_level_1_name: "Cargos públicos de nivel 1" + official_level_1_name_description: "Etiqueta que aparecerá en los usuarios marcados como Nivel 1 de cargo público" official_level_2_name: "Cargos públicos de nivel 2" + official_level_2_name_description: "Etiqueta que aparecerá en los usuarios marcados como Nivel 2 de cargo público" official_level_3_name: "Cargos públicos de nivel 3" + official_level_3_name_description: "Etiqueta que aparecerá en los usuarios marcados como Nivel 3 de cargo público" official_level_4_name: "Cargos públicos de nivel 4" + official_level_4_name_description: "Etiqueta que aparecerá en los usuarios marcados como Nivel 4 de cargo público" official_level_5_name: "Cargos públicos de nivel 5" + official_level_5_name_description: "Etiqueta que aparecerá en los usuarios marcados como Nivel 5 de cargo público" max_ratio_anon_votes_on_debates: "Porcentaje máximo de votos anónimos por Debate" - max_votes_for_proposal_edit: "Número de votos en que una Propuesta deja de poderse editar" + max_ratio_anon_votes_on_debates_description: "Se consideran votos anónimos los realizados por usuarios registrados con una cuenta sin verificar" + max_votes_for_proposal_edit: "Número de apoyos en que una Propuesta deja de poderse editar" + max_votes_for_proposal_edit_description: "A partir de este número de apoyos el autor de una Propuesta ya no podrá editarla" max_votes_for_debate_edit: "Número de votos en que un Debate deja de poderse editar" + max_votes_for_debate_edit_description: "A partir de este número de votos el autor de un Debate ya no podrá editarlo" proposal_code_prefix: "Prefijo para los códigos de Propuestas" - votes_for_proposal_success: "Número de votos necesarios para aprobar una Propuesta" + proposal_code_prefix_description: "Este prefijo aparecerá en las Propuestas delante de la fecha de creación y su ID" + votes_for_proposal_success: "Número de apoyos necesarios para aprobar una Propuesta" + votes_for_proposal_success_description: "Cuando una propuesta alcance este número de apoyos ya no podrá recibir más y se considera exitosa" months_to_archive_proposals: "Meses para archivar las Propuestas" + months_to_archive_proposals_description: "Pasado este número de meses las Propuestas se archivarán y ya no podrán recoger apoyos" email_domain_for_officials: "Dominio de email para cargos públicos" + email_domain_for_officials_description: "Todos los usuarios registrados con este dominio tendrán su cuenta verificada al registrarse" per_page_code_head: "Código a incluir en cada página (<head>)" + per_page_code_head_description: "Esté código aparecerá dentro de la etiqueta <head>. Útil para introducir scripts personalizados, analitycs..." per_page_code_body: "Código a incluir en cada página (<body>)" + per_page_code_body_description: "Esté código aparecerá dentro de la etiqueta <body>. Útil para introducir scripts personalizados, analitycs..." twitter_handle: "Usuario de Twitter" + twitter_handle_description: "Si está rellenado aparecerá en el pie de página" twitter_hashtag: "Hashtag para Twitter" + twitter_hashtag_description: "Hashtag que aparecerá al compartir contenido por Twitter" facebook_handle: "Identificador de Facebook" + facebook_handle_description: "Si está rellenado aparecerá en el pie de página" youtube_handle: "Usuario de Youtube" + youtube_handle_description: "Si está rellenado aparecerá en el pie de página" telegram_handle: "Usuario de Telegram" + telegram_handle_description: "Si está rellenado aparecerá en el pie de página" instagram_handle: "Usuario de Instagram" + instagram_handle_description: "Si está rellenado aparecerá en el pie de página" + url: "URL general de la web" + url_description: "URL principal de tu web" + org_name: "Nombre de la organización" + org_name_description: "Nombre de tu organización" + place_name: "Nombre del lugar" + place_name_description: "Nombre de tu ciudad" + related_content_score_threshold: Umbral de puntuación de contenido relacionado + related_content_score_threshold_description: Oculta el contenido que los usuarios marquen como no relacionado + map_latitude: "Latitud" + map_latitude_description: "Latitud para mostrar la posición del mapa" + map_longitude: "Longitud" + map_longitude_description: "Longitud para mostrar la posición del mapa" + map_zoom: "Zoom" + map_zoom_description: "Zoom para mostrar la posición del mapa" + mailer_from_name: "Nombre email remitente" + mailer_from_name_description: "Este nombre aparecerá en los emails enviados desde la aplicación" + mailer_from_address: "Dirección email remitente" + mailer_from_address_description: "Esta dirección de email aparecerá en los emails enviados desde la aplicación" + meta_title: "Título del sitio" + meta_title_description: "Título para el sitio <title>, utilizado para mejorar el SEO" + meta_description: "Descripción del sitio" + meta_description_description: 'Descripción del sitio <meta name="description">, utilizada para mejorar el SEO' + meta_keywords: "Palabras clave" + meta_keywords_description: 'Palabras clave <meta name="keywords">, utilizadas para mejorar el SEO' + min_age_to_participate: "Edad mínima para participar" + min_age_to_participate_description: "Los usuarios mayores de esta edad podrán participar en todos los procesos" + analytics_url: "URL de estadísticas externas" blog_url: "URL del blog" transparency_url: "URL de transparencia" opendata_url: "URL de open data" - url: "URL general de la web" - org_name: "Nombre de la organización" - place_name: "Nombre del lugar" - feature: - budgets: Presupuestos participativos - twitter_login: Registro con Twitter - facebook_login: Registro con Facebook - google_login: Registro con Google - proposals: Propuestas - debates: Debates - polls: Votaciones - signature_sheets: Hojas de firmas - spending_proposals: Propuestas de inversión - spending_proposal_features: - voting_allowed: Votaciones sobre propuestas de inversión - legislation: Legislación - user: - recommendations: Recomendaciones - skip_verification: Omitir verificación de usuarios - recommendations_on_debates: Recomendaciones en debates - recommendations_on_proposals: Recomendaciones en propuestas - community: Comunidad en propuestas y proyectos de gasto - map: Geolocalización de propuestas y proyectos de gasto - allow_images: Permitir subir y mostrar imágenes - allow_attached_documents: Permitir creación de documentos adjuntos - guides: Guías para crear propuestas o proyectos de inversión - public_stats: Estadísticas públicas - related_content_score_threshold: Umbral de puntuación de contenido relacionado - map_latitude: Latitud - map_longitude: Longitud - map_zoom: Zoom - mailer_from_name: Nombre email remitente - mailer_from_address: Dirección email remitente - meta_title: "Título del sitio (SEO)" - meta_description: "Descripción del sitio (SEO)" - meta_keywords: "Palabras clave (SEO)" verification_offices_url: URL oficinas verificación - min_age_to_participate: Edad mínima para participar proposal_improvement_path: Link a información para mejorar propuestas + feature: + budgets: "Presupuestos participativos" + budgets_description: "Con los presupuestos participativos la ciudadanía decide a qué proyectos presentados por los vecinos y vecinas va destinada una parte del presupuesto municipal" + twitter_login: "Registro con Twitter" + twitter_login_description: "Permitir que los usuarios se registren con su cuenta de Twitter" + facebook_login: "Registro con Facebook" + facebook_login_description: "Permitir que los usuarios se registren con su cuenta de Facebook" + google_login: "Registro con Google" + google_login_description: "Permitir que los usuarios se registren con su cuenta de Google" + proposals: "Propuestas" + proposals_description: "Las propuestas ciudadanas son una oportunidad para que los vecinos y colectivos decidan directamente cómo quieren que sea su ciudad, después de conseguir los apoyos suficientes y de someterse a votación ciudadana" + debates: "Debates" + debates_description: "El espacio de debates ciudadanos está dirigido a que cualquier persona pueda exponer temas que le preocupan y sobre los que quiera compartir puntos de vista con otras personas" + polls: "Votaciones" + polls_description: "Las votaciones ciudadanas son un mecanismo de participación por el que la ciudadanía con derecho a voto puede tomar decisiones de forma directa" + signature_sheets: "Hojas de firmas" + signature_sheets_description: "Permite añadir desde el panel de Administración firmas recogidas de forma presencial a Propuestas y proyectos de gasto de los Presupuestos participativos" + legislation: "Legislación colaborativa" + legislation_description: "En los procesos participativos se ofrece a la ciudadanía la oportunidad de participar en la elaboración y modificación de normativa que afecta a la ciudad y de dar su opinión sobre ciertas actuaciones que se tiene previsto llevar a cabo" + spending_proposals: "Propuestas de inversión" + spending_proposals_description: "⚠️ NOTA: Esta funcionalidad ha sido sustituida por Pesupuestos Participativos y desaparecerá en nuevas versiones" + spending_proposal_features: + voting_allowed: "Votaciones de preselección sobre propuestas de inversión." + voting_allowed_description: "⚠️ NOTA: Esta funcionalidad ha sido sustituida por Pesupuestos Participativos y desaparecerá en nuevas versiones" + user: + recommendations: "Recomendaciones" + recommendations_description: "Muestra a los usuarios recomendaciones en la homepage basado en las etiquetas de los elementos que sigue" + skip_verification: "Omitir verificación de usuarios" + skip_verification_description: "Esto deshabilitará la verificación de usuarios y todos los usuarios registrados podrán participar en todos los procesos" + recommendations_on_debates: "Recomendaciones en debates" + recommendations_on_debates_description: "Muestra a los usuarios recomendaciones en la página de debates basado en las etiquetas de los elementos que sigue" + recommendations_on_proposals: "Recomendaciones en propuestas" + recommendations_on_proposals_description: "Muestra a los usuarios recomendaciones en la página de propuestas basado en las etiquetas de los elementos que sigue" + community: "Comunidad en propuestas y proyectos de gasto" + community_description: "Activa la sección de comunidad en las propuestas y en los proyectos de gasto de los Presupuestos participativos" + map: "Geolocalización de propuestas y proyectos de gasto" + map_description: "Activa la geolocalización de propuestas y proyectos de gasto" + allow_images: "Permitir subir y mostrar imágenes" + allow_images_description: "Permite que los usuarios suban imágenes al crear propuestas y proyectos de gasto de los Presupuestos participativos" + allow_attached_documents: "Permitir creación de documentos adjuntos" + allow_attached_documents_description: "Permite que los usuarios suban documentos al crear propuestas y proyectos de gasto de los Presupuestos participativos" + guides: "Guías para crear propuestas o proyectos de gasto" + guides_description: "Muestra una guía de diferencias entre las propuestas y los proyectos de gasto si hay un presupuesto participativo activo" + public_stats: "Estadísticas públicas" + public_stats_description: "Muestra las estadísticas públicas en el panel de Administración" From b69d6292f16ff83b6392ad38acc3fb47428b208d Mon Sep 17 00:00:00 2001 From: decabeza <alberto@decabeza.es> Date: Mon, 23 Jul 2018 20:01:43 +0200 Subject: [PATCH 14/15] Adds data deep link on admin settings filter subnav --- app/views/admin/settings/_filter_subnav.html.erb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/views/admin/settings/_filter_subnav.html.erb b/app/views/admin/settings/_filter_subnav.html.erb index c7d81e0a5..635a80758 100644 --- a/app/views/admin/settings/_filter_subnav.html.erb +++ b/app/views/admin/settings/_filter_subnav.html.erb @@ -1,4 +1,10 @@ -<ul class="tabs" data-tabs id="settings-tabs"> +<ul class="tabs" + id="settings-tabs" + data-deep-link="true" + data-update-history="true" + data-deep-link-smudge="true" + data-deep-link-smudge-delay="500" + data-tabs> <li class="tabs-title is-active"> <%= link_to "#tab-configuration" do %> <%= t("admin.settings.index.title") %> From 56bdcf4be2b1934d7db92352c2cdeddeb4df518d Mon Sep 17 00:00:00 2001 From: decabeza <alberto@decabeza.es> Date: Mon, 23 Jul 2018 20:21:35 +0200 Subject: [PATCH 15/15] Updates text on admin notifications spec --- spec/features/admin/admin_notifications_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/features/admin/admin_notifications_spec.rb b/spec/features/admin/admin_notifications_spec.rb index a97170e7c..19f873447 100644 --- a/spec/features/admin/admin_notifications_spec.rb +++ b/spec/features/admin/admin_notifications_spec.rb @@ -195,7 +195,7 @@ feature "Admin Notifications" do visit admin_admin_notification_path(notification) - accept_confirm { click_link "Send" } + accept_confirm { click_link "Send notification" } expect(page).to have_content "Notification sent successfully"