diff --git a/app/assets/javascripts/markdown_editor.js.coffee b/app/assets/javascripts/markdown_editor.js.coffee index 1874da5aa..9065717fc 100644 --- a/app/assets/javascripts/markdown_editor.js.coffee +++ b/app/assets/javascripts/markdown_editor.js.coffee @@ -18,6 +18,7 @@ App.MarkdownEditor = $(this).on 'change input paste keyup', -> App.MarkdownEditor.refresh_preview($(this), md) + $('.legislation-draft-versions-edit .warning').show() return $(this).find('.fullscreen-toggle').on 'click', -> diff --git a/app/assets/stylesheets/admin.scss b/app/assets/stylesheets/admin.scss index c34eb3a10..486b93bc8 100644 --- a/app/assets/stylesheets/admin.scss +++ b/app/assets/stylesheets/admin.scss @@ -428,6 +428,13 @@ table.investment-projects-summary { // 06. Legislation // -------------- + +.legislation-admin { + .menu .active > a { + background: none; + } +} + .legislation-process-save { @include breakpoint(medium) { float: right; @@ -450,11 +457,7 @@ table.investment-projects-summary { } .legislation-process-edit { - - .menu .active > a { - background: none; - } - + .edit_legislation_process { small { @@ -480,11 +483,7 @@ table.investment-projects-summary { } .legislation-draft-versions-index { - - .menu .active > a { - background: none; - } - + .legislation-process-question { @include breakpoint(medium) { text-align: right; @@ -496,12 +495,8 @@ table.investment-projects-summary { } } -.legislation-questions-index { - - .menu .active > a { - background: none; - } - +.legislation-questions-form { + input[type]:not([type="submit"]):not([type="file"]):not([type="checkbox"]):not([type="radio"]) { background: $white; margin-bottom: 0; @@ -561,8 +556,8 @@ table.investment-projects-summary { } } -.legislation-draft-versions-index { - +.legislation-draft-versions-form { + .legislation-process-version { @include breakpoint(medium) { text-align: right; diff --git a/app/assets/stylesheets/legislation.scss b/app/assets/stylesheets/legislation.scss index bacfb1aac..c53216dd9 100644 --- a/app/assets/stylesheets/legislation.scss +++ b/app/assets/stylesheets/legislation.scss @@ -9,6 +9,7 @@ // ----------------- .brand-heading { background: $brand; + margin-bottom: 2rem; .column { padding-top: 10rem; @@ -25,35 +26,31 @@ // 02. Sidebar menu // ----------------- .legislation-categories { - ul { + + .menu.simple { + border-bottom: none; list-style: none; padding-left: 0; margin-left: 0; + margin-top: 0; + + @include breakpoint(medium) { + margin: 1.5rem 0; + } li { + display: block; cursor: pointer; + margin-bottom: 1rem; @include breakpoint(medium) { + margin-bottom: 2rem; max-width: 80%; } - - h4 { - font-weight: 400; - color: $text-medium; - margin-bottom: 3rem; - transition: color 0.25s ease-out, color 0.25s ease-out; - } - - &:hover h4, &:active h4 { - color: $brand; - } } - - .active h4 { + + li.active { font-weight: 700; - color: $brand; - padding-bottom: 0.5rem; - border-bottom: 2px solid $brand; } } } @@ -62,9 +59,6 @@ // ----------------- .legislation { margin: 0 0 4rem 0; -} - -.legislation { background: white; border: 1px solid; border-color: #e5e6e9 #dfe0e4 #d0d1d5; @@ -117,11 +111,21 @@ padding-top: 1rem; h5 { + margin-left: 0.25rem; margin-bottom: 0; color: #61686E; + + @include breakpoint(medium) { + margin-left: 0; + } } p { + margin-left: 0.25rem; font-size: $small-font-size; + + @include breakpoint(medium) { + margin-left: 0; + } } } diff --git a/app/controllers/admin/legislation/questions_controller.rb b/app/controllers/admin/legislation/questions_controller.rb index 9a1c3eb5b..e27e75ce7 100644 --- a/app/controllers/admin/legislation/questions_controller.rb +++ b/app/controllers/admin/legislation/questions_controller.rb @@ -6,6 +6,10 @@ class Admin::Legislation::QuestionsController < Admin::Legislation::BaseControll @questions = @process.questions end + def new + @question.question_options.build + end + def create @question.author = current_user if @question.save diff --git a/app/helpers/legislation_helper.rb b/app/helpers/legislation_helper.rb index 59a13f9a8..1692cf326 100644 --- a/app/helpers/legislation_helper.rb +++ b/app/helpers/legislation_helper.rb @@ -3,6 +3,10 @@ module LegislationHelper l(date, format: "%d %b %Y") if date end + def format_date_for_calendar_form(date) + l(date, format: "%d/%m/%Y") if date + end + def legislation_question_path(question) legislation_process_question_path(question.process, question) end diff --git a/app/models/legislation/process.rb b/app/models/legislation/process.rb index 2ab349623..995aedb9e 100644 --- a/app/models/legislation/process.rb +++ b/app/models/legislation/process.rb @@ -53,4 +53,8 @@ class Legislation::Process < ActiveRecord::Base today >= final_publication_date end end + + def total_comments + questions.map(&:comments_count).sum + end end diff --git a/app/views/admin/legislation/draft_versions/_form.html.erb b/app/views/admin/legislation/draft_versions/_form.html.erb index a55bddc66..a217580d6 100644 --- a/app/views/admin/legislation/draft_versions/_form.html.erb +++ b/app/views/admin/legislation/draft_versions/_form.html.erb @@ -27,6 +27,7 @@
<%= f.label :changelog %> + <%= t('admin.legislation.draft_versions.form.use_markdown') %>
<%= f.text_area :changelog, label: false, rows: 5 %> @@ -41,6 +42,7 @@ <% ::Legislation::DraftVersion::VALID_STATUSES.each do |status| %> <%= f.radio_button :status, status, label: false %> <%= f.label t("admin.legislation.draft_versions.statuses.#{status}") %> + <%= t("admin.legislation.draft_versions.form.hints.status.#{status}") %>
<% end %>
@@ -52,17 +54,28 @@
<%= 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') %>

-
- <%= link_to t("admin.legislation.draft_versions.form.fullscreen_toggle"), "#", class: 'fullscreen-toggle' %> +
+
Consul | Editando Versión 3 del proceso Licencias urbanísticas, declaraciones
+ +
+ Previsualizar + <%= f.submit(class: "button", value: t("admin.legislation.draft_versions.#{admin_submit_action(@draft_version)}.submit_button")) %> +
+ + <%= link_to "#", class: 'fullscreen-toggle' do %> + <%= t("admin.legislation.draft_versions.form.fullscreen_toggle")%> + <% end %>
<%= f.text_area :body, label: false %> @@ -75,9 +88,12 @@
-
-
+
+
<%= f.submit(class: "button 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 f347101cf..0a27ccd97 100644 --- a/app/views/admin/legislation/draft_versions/edit.html.erb +++ b/app/views/admin/legislation/draft_versions/edit.html.erb @@ -1,6 +1,10 @@ -
+<% provide :title do %> + Admin - <%= t("admin.menu.legislation") %> - <%= @process.title %> - <%= t("admin.legislation.draft_versions.index.title") %> - <%= @draft_version.title %> +<% end %> + +
- <%= link_to admin_legislation_process_path(@process), class: "back" do %> + <%= link_to admin_legislation_processes_path, class: "back" do %> <%= t("admin.legislation.draft_versions.edit.back") %> <% end %> @@ -9,13 +13,24 @@ <%= 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, + class: 'button hollow alert' %> +
+
<%= render 'form', url: admin_legislation_process_draft_version_path(@process, @draft_version) %> - - <%= link_to t("admin.legislation.processes.index.delete"), admin_legislation_process_draft_version_path(@process, @draft_version), - method: :delete, - class: 'button hollow alert' %> -
diff --git a/app/views/admin/legislation/draft_versions/index.html.erb b/app/views/admin/legislation/draft_versions/index.html.erb index db6a459d2..d86b61e26 100644 --- a/app/views/admin/legislation/draft_versions/index.html.erb +++ b/app/views/admin/legislation/draft_versions/index.html.erb @@ -1,4 +1,8 @@ -
+<% provide :title do %> + Admin - <%= t("admin.menu.legislation") %> - <%= @process.title %> - <%= t("admin.legislation.draft_versions.index.title") %> +<% end %> + +
<%= link_to admin_legislation_processes_path, class: "back" do %> @@ -9,19 +13,27 @@ <%= render 'admin/legislation/processes/subnav', process: @process, active: 'draft_versions' %> - <%= link_to t("admin.legislation.draft_versions.index.create"), - new_admin_legislation_process_draft_version_path, class: "button float-right" %> +
+
+

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

+
-

<%= 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" %> +
+
- - - - - - - - +
<%= 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") %>
+ + + + + + + + + + <% @process.draft_versions.each do |draft_version| %> <% end %> +
<%= 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") %>
@@ -33,6 +45,7 @@ <%= draft_version.final_version %>
diff --git a/app/views/admin/legislation/draft_versions/new.html.erb b/app/views/admin/legislation/draft_versions/new.html.erb index 7f7562339..e71bab339 100644 --- a/app/views/admin/legislation/draft_versions/new.html.erb +++ b/app/views/admin/legislation/draft_versions/new.html.erb @@ -1,4 +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") %> +<% end %> + +
<%= link_to admin_legislation_process_path(@process), class: "back" do %> @@ -9,7 +13,11 @@ <%= 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 fa1ddf54e..06bcfd43c 100644 --- a/app/views/admin/legislation/processes/_form.html.erb +++ b/app/views/admin/legislation/processes/_form.html.erb @@ -13,7 +13,105 @@
-<% end %> + <% 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" %> +
+ +
+ +
+
+ <%= 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" %> +
+ +
+ +
+
+ <%= 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.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.label :final_publication_date %> +
+
+ <%= f.text_field :final_publication_date, + label: false, + value: format_date_for_calendar_form(@process.final_publication_date), + class: "js-calendar-full", + id: "final_publication_date" %> +
+
@@ -28,6 +126,7 @@
<%= f.label :description %> + <%= t('admin.legislation.processes.form.use_markdown') %>
<%= f.text_area :description, @@ -39,6 +138,7 @@
<%= f.label :target %> + <%= t('admin.legislation.processes.form.use_markdown') %>
<%= f.text_area :target, @@ -50,6 +150,7 @@
<%= f.label :how_to_participate %> + <%= t('admin.legislation.processes.form.use_markdown') %>
<%= f.text_area :how_to_participate, @@ -61,6 +162,7 @@
<%= f.label :additional_info %> + <%= t('admin.legislation.processes.form.use_markdown') %>
<%= f.text_area :additional_info, @@ -70,85 +172,7 @@
-
- <%= f.label :start_date %> -
-
- <%= f.text_field :start_date, - label: false, - class: "js-calendar-full", - id: "start_date" %> -
-
- <%= f.label :end_date %> -
-
- <%= f.text_field :end_date, - label: false, - class: "js-calendar-full", - id: "end_date" %> -
-
- -
-
- <%= f.label :debate_start_date %> -
-
- <%= f.text_field :debate_start_date, - label: false, - class: "js-calendar-full", - id: "debate_start_date" %> -
-
- <%= f.label :debate_end_date %> -
-
- <%= f.text_field :debate_end_date, - label: false, - class: "js-calendar-full", - id: "debate_end_date" %> -
-
- <%= f.label :draft_publication_date %> -
-
- <%= f.text_field :draft_publication_date, - label: false, - class: "js-calendar-full", - id: "draft_publication_date" %> -
-
- <%= f.label :allegations_start_date %> -
-
- <%= f.text_field :allegations_start_date, - label: false, - class: "js-calendar-full", - id: "allegations_start_date" %> -
-
- <%= f.label :allegations_end_date %> -
-
- <%= f.text_field :allegations_end_date, - label: false, - class: "js-calendar-full", - id: "allegations_end_date" %> -
-
- <%= f.label :final_publication_date %> -
-
- <%= f.text_field :final_publication_date, - label: false, - class: "js-calendar-full", - id: "final_publication_date" %> -
-
- -
-
+
<%= f.submit(class: "button expanded", value: t("admin.legislation.processes.#{admin_submit_action(@process)}.submit_button")) %>
diff --git a/app/views/admin/legislation/processes/edit.html.erb b/app/views/admin/legislation/processes/edit.html.erb index 398dc1ec6..4bf418d06 100644 --- a/app/views/admin/legislation/processes/edit.html.erb +++ b/app/views/admin/legislation/processes/edit.html.erb @@ -1,4 +1,8 @@ -
+<% provide :title do %> + Admin - <%= t("admin.menu.legislation") %> - <%= @process.title %> +<% end %> + +
<%= link_to admin_legislation_processes_path, class: "back" do %> diff --git a/app/views/admin/legislation/processes/index.html.erb b/app/views/admin/legislation/processes/index.html.erb index c3ca87c51..7d4bd2996 100644 --- a/app/views/admin/legislation/processes/index.html.erb +++ b/app/views/admin/legislation/processes/index.html.erb @@ -1,30 +1,46 @@ -<%= link_to t("admin.legislation.processes.index.create"), - new_admin_legislation_process_path, class: "button success float-right" %> +<% provide :title do %> + Admin - <%= t("admin.menu.legislation") %> - <%= t("admin.legislation.processes.index.filters.#{@current_filter}") %> +<% end %> -

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

+
+
+
+

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

+
+
+ <%= link_to t("admin.legislation.processes.index.create"), new_admin_legislation_process_path, class: "button" %> +
+
-<%= render 'shared/filter_subnav', i18n_namespace: "admin.legislation.processes.index" %> + <%= render 'shared/filter_subnav', i18n_namespace: "admin.legislation.processes.index" %> -

<%= page_entries_info @processes %>

+

<%= page_entries_info @processes %>

- - - - - - <% @processes.each do |process| %> - - +
<%= t("admin.legislation.processes.process.title") %>
- <%= link_to process.title, edit_admin_legislation_process_path(process) %> -
+ + + + + + + + + <% @processes.each do |process| %> + + + + + + <% end %> + +
<%= t("admin.legislation.processes.process.title") %><%= t("admin.legislation.processes.process.comments") %>
+ <%= link_to process.title, edit_admin_legislation_process_path(process) %> + <%= process.total_comments %> + <%= link_to t("admin.legislation.processes.index.delete"), admin_legislation_process_path(process), + method: :delete, + class: 'button hollow alert' %> +
- - <%= link_to t("admin.legislation.processes.index.delete"), admin_legislation_process_path(process), - method: :delete, - class: 'button hollow alert' %> - - - <% end %> - + <%= paginate @processes %> -<%= paginate @processes %> +
diff --git a/app/views/admin/legislation/processes/new.html.erb b/app/views/admin/legislation/processes/new.html.erb index 21d5f01a7..3fed34799 100644 --- a/app/views/admin/legislation/processes/new.html.erb +++ b/app/views/admin/legislation/processes/new.html.erb @@ -1,4 +1,8 @@ -
+<% provide :title do %> + Admin - <%= t("admin.menu.legislation") %> - <%= t("admin.legislation.processes.new.title") %> +<% end %> + +
<%= link_to admin_legislation_processes_path, class: "back" do %> diff --git a/app/views/admin/legislation/questions/_form.html.erb b/app/views/admin/legislation/questions/_form.html.erb index f5288b487..cca5ca430 100644 --- a/app/views/admin/legislation/questions/_form.html.erb +++ b/app/views/admin/legislation/questions/_form.html.erb @@ -15,31 +15,29 @@ <% end %> -
-
- <%= f.label :title %> -
-
- <%= f.text_area :title, rows: 5, label: false %> -
+ +
+ <%= f.label :title %> +
+
+ <%= f.text_area :title, rows: 5, label: false %>
-
-
- <%= f.label :question_options %> -
-
- <%= f.fields_for :question_options do |ff| %> - <%= render 'question_option_fields', f: ff %> - <% end %> -
-
- <%= link_to_add_association t('.add_option'), f, :question_options %> -
+
+ <%= f.label :question_options %> +
+
+ <%= f.fields_for :question_options do |ff| %> + <%= render 'question_option_fields', f: ff %> + <% end %> +
+
+ <%= link_to_add_association t('.add_option'), f, :question_options %>
+
-
+
<%= f.submit(class: "button expanded", value: t("admin.legislation.questions.#{admin_submit_action(@question)}.submit_button")) %>
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 bfe51288e..0578e65ae 100644 --- a/app/views/admin/legislation/questions/_question_option_fields.html.erb +++ b/app/views/admin/legislation/questions/_question_option_fields.html.erb @@ -1,6 +1,11 @@
- <%= f.text_field :value, label: false %> - <%= link_to_remove_association t('.remove_option'), f %> +
+
+ <%= f.text_field :value, label: false %> +
+
+ <%= link_to_remove_association " #{t('.remove_option')}".html_safe, f %> +
diff --git a/app/views/admin/legislation/questions/edit.html.erb b/app/views/admin/legislation/questions/edit.html.erb index e62479fbb..d3f1f2df8 100644 --- a/app/views/admin/legislation/questions/edit.html.erb +++ b/app/views/admin/legislation/questions/edit.html.erb @@ -1,6 +1,10 @@ -
+<% provide :title do %> + Admin - <%= t("admin.menu.legislation") %> - <%= @process.title %> - <%= t("admin.legislation.questions.index.title") %> - <%= @question.title %> +<% end %> + +
- <%= link_to admin_legislation_process_path(@process), class: "back" do %> + <%= link_to admin_legislation_processes_path, class: "back" do %> <%= t("admin.legislation.questions.edit.back") %> <% end %> @@ -9,12 +13,17 @@ <%= render 'admin/legislation/processes/subnav', process: @process, active: 'questions' %> -

<%= @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' %> +
+
<%= render 'form', url: admin_legislation_process_question_path(@process, @question) %> - - <%= link_to t("admin.legislation.processes.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 f0a4638ee..4e82de910 100644 --- a/app/views/admin/legislation/questions/index.html.erb +++ b/app/views/admin/legislation/questions/index.html.erb @@ -1,4 +1,8 @@ -
+<% provide :title do %> + Admin - <%= t("admin.menu.legislation") %> - <%= @process.title %> - <%= t("admin.legislation.questions.index.title") %> +<% end %> + +
<%= link_to admin_legislation_processes_path, class: "back" do %> @@ -9,18 +13,26 @@ <%= render 'admin/legislation/processes/subnav', process: @process, active: 'questions' %> - <%= link_to t("admin.legislation.questions.index.create"), - new_admin_legislation_process_question_path, class: "button float-right" %> +
+
+

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

+
-

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

+
+ <%= link_to t("admin.legislation.questions.index.create"), new_admin_legislation_process_question_path, class: "button" %> +
+
- - - - - - - +
<%= 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") %>
+ + + + + + + + + <% @process.questions.each do |question| %> - + <% end %> +
<%= 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") %>
@@ -36,9 +48,10 @@ <% end %> <%= question.answers_count %><%= question.comments.count %><%= link_to question.comments.count, legislation_process_question_path(@process, question, anchor: 'comments') %>
diff --git a/app/views/admin/legislation/questions/new.html.erb b/app/views/admin/legislation/questions/new.html.erb index 7239134e1..4c657f92d 100644 --- a/app/views/admin/legislation/questions/new.html.erb +++ b/app/views/admin/legislation/questions/new.html.erb @@ -1,4 +1,8 @@ -
+<% provide :title do %> + Admin - <%= t("admin.menu.legislation") %> - <%= @process.title %> - <%= t("admin.legislation.questions.index.title") %> - <%= t("admin.legislation.questions.new.title") %> +<% end %> + +
<%= link_to admin_legislation_process_path(@process), class: "back" do %> @@ -9,7 +13,11 @@ <%= render 'admin/legislation/processes/subnav', process: @process, active: 'questions' %> -

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

+
+
+

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

+
+
<%= render 'form', url: admin_legislation_process_questions_path(@process) %>
diff --git a/app/views/legislation/processes/_header_full.html.erb b/app/views/legislation/processes/_header_full.html.erb index 4d365618e..d631f8de5 100644 --- a/app/views/legislation/processes/_header_full.html.erb +++ b/app/views/legislation/processes/_header_full.html.erb @@ -27,10 +27,15 @@

<%= t('.how_to_participate') %>

<%= markdown process.how_to_participate %>
+
+
+ <%= markdown process.additional_info if process.additional_info %> +
+
diff --git a/app/views/legislation/processes/index.html.erb b/app/views/legislation/processes/index.html.erb index e145896a7..1400f7854 100644 --- a/app/views/legislation/processes/index.html.erb +++ b/app/views/legislation/processes/index.html.erb @@ -1,3 +1,7 @@ +<% provide :title do %> + <%= t("layouts.header.collaborative_legislation") %> - <%= t("legislation.processes.index.filters.#{@current_filter}") %> +<% end %> +
diff --git a/app/views/sandbox/admin_legislation_debate.html.erb b/app/views/sandbox/admin_legislation_debate.html.erb index 9732fc478..de976de40 100644 --- a/app/views/sandbox/admin_legislation_debate.html.erb +++ b/app/views/sandbox/admin_legislation_debate.html.erb @@ -1,4 +1,4 @@ -
+
diff --git a/app/views/sandbox/admin_legislation_debate_question.html.erb b/app/views/sandbox/admin_legislation_debate_question.html.erb index 2d8928776..f5f6d90d6 100644 --- a/app/views/sandbox/admin_legislation_debate_question.html.erb +++ b/app/views/sandbox/admin_legislation_debate_question.html.erb @@ -1,4 +1,4 @@ -
+
diff --git a/app/views/sandbox/admin_legislation_draft.html.erb b/app/views/sandbox/admin_legislation_draft.html.erb index da4bc7f2c..363e9fc78 100644 --- a/app/views/sandbox/admin_legislation_draft.html.erb +++ b/app/views/sandbox/admin_legislation_draft.html.erb @@ -1,4 +1,4 @@ -
+
diff --git a/app/views/sandbox/admin_legislation_draft_edit.html.erb b/app/views/sandbox/admin_legislation_draft_edit.html.erb index 5deb77112..3443fdddc 100644 --- a/app/views/sandbox/admin_legislation_draft_edit.html.erb +++ b/app/views/sandbox/admin_legislation_draft_edit.html.erb @@ -1,4 +1,4 @@ -
+
diff --git a/app/views/sandbox/admin_legislation_index.html.erb b/app/views/sandbox/admin_legislation_index.html.erb index c054f1548..f4365116c 100644 --- a/app/views/sandbox/admin_legislation_index.html.erb +++ b/app/views/sandbox/admin_legislation_index.html.erb @@ -1,4 +1,4 @@ -
+

Procesos de legislación colaborativa

diff --git a/app/views/sandbox/admin_legislation_info.html.erb b/app/views/sandbox/admin_legislation_info.html.erb index 2fc10f4e2..eca094564 100644 --- a/app/views/sandbox/admin_legislation_info.html.erb +++ b/app/views/sandbox/admin_legislation_info.html.erb @@ -1,4 +1,4 @@ -
+
diff --git a/config/locales/activerecord.en.yml b/config/locales/activerecord.en.yml index e3a3a8aec..e3747d151 100644 --- a/config/locales/activerecord.en.yml +++ b/config/locales/activerecord.en.yml @@ -108,9 +108,10 @@ en: changelog: Changes status: Status final_version: Final version - legislation/questions: + legislation/question: title: "Title" - legislation/question_options: + question_options: Options + legislation/question_option: value: "Value" errors: models: diff --git a/config/locales/activerecord.es.yml b/config/locales/activerecord.es.yml index 59fba819b..479c3c004 100644 --- a/config/locales/activerecord.es.yml +++ b/config/locales/activerecord.es.yml @@ -108,9 +108,10 @@ es: changelog: Cambios status: Estado final_version: Versión final - legislation/questions: + legislation/question: title: "Título" - legislation/question_options: + question_options: Respuestas + legislation/question_option: value: "Valor" errors: models: diff --git a/config/locales/admin.en.yml b/config/locales/admin.en.yml index fbecd7bb7..eef45e8ac 100755 --- a/config/locales/admin.en.yml +++ b/config/locales/admin.en.yml @@ -90,6 +90,13 @@ en: errors: form: error: Error + form: + process: Process + debate_phase: Debate phase + allegations_phase: Allegations phase + start: Start + end: End + use_markdown: Use Markdown to format the text index: create: New process delete: Delete @@ -104,7 +111,8 @@ en: title: Create new collaborative legislation process submit_button: Create process process: - title: Collaborative legislation process title + title: Process + comments: Comments subnav: info: Information draft_texts: Text @@ -113,14 +121,22 @@ en: edit: back: Back submit_button: Save changes + warning: You've edited the text, don't forget to click on Save to permanently save the changes. errors: form: error: Error form: fullscreen_toggle: Toggle full screen + use_markdown: Use Markdown to format the text + hints: + final_version: This version will be published as Final Result for this process. Comments won't be allowed in this version. + status: + draft: You can preview as admin, no one else can see it + published: Visible for everybody index: title: Draft versions create: Create version + delete: Delete new: back: Back title: Create new version @@ -137,6 +153,7 @@ en: questions: edit: back: Back + title: "Edit “%{question_title}”" submit_button: Save changes errors: form: @@ -145,8 +162,9 @@ en: add_option: Add option index: back: Back - title: Questions + title: Questions associated to this process create: Create question + delete: Delete new: back: Back title: Create new question diff --git a/config/locales/admin.es.yml b/config/locales/admin.es.yml index d476b30a2..d2d8e5685 100644 --- a/config/locales/admin.es.yml +++ b/config/locales/admin.es.yml @@ -88,6 +88,13 @@ es: errors: form: error: Error + form: + process: Proceso + debate_phase: Fase previa + allegations_phase: Fase de alegaciones + start: Inicio + end: Fin + use_markdown: Usa Markdown para formatear el texto index: create: Nuevo proceso delete: Borrar @@ -102,7 +109,8 @@ es: title: Crear nuevo proceso de legislación colaborativa submit_button: Crear proceso process: - title: Título del proceso de legislación colaborativa + title: Proceso + comments: Comentarios subnav: info: Información draft_texts: Texto @@ -111,14 +119,22 @@ es: edit: back: Volver submit_button: Guardar cambios + warning: Ojo, has editado el texto. Para conservar de forma permanente los cambios, no te olvides de hacer click en Guardar. errors: form: error: Error form: fullscreen_toggle: Pantalla completa + use_markdown: Usa Markdown para formatear el texto + hints: + final_version: Será la versión que se publique en Publicación de Resultados. Esta versión no se podrá comentar + status: + draft: Podrás previsualizarlo como logueado, nadie más lo podrá ver + published: Será visible para todo el mundo index: title: Versiones del borrador create: Crear versión + delete: Borrar new: back: Volver title: Crear nueva versión @@ -135,6 +151,7 @@ es: questions: edit: back: Volver + title: "Editar “%{question_title}”" submit_button: Guardar cambios errors: form: @@ -143,8 +160,9 @@ es: add_option: +Añadir respuesta cerrada index: back: Volver - title: Preguntas + title: Preguntas asociadas a este proceso create: Crear pregunta + delete: Borrar new: back: Volver title: Crear nueva pregunta diff --git a/spec/features/admin/legislation/draft_versions_spec.rb b/spec/features/admin/legislation/draft_versions_spec.rb index 287b119ac..0a61f5d97 100644 --- a/spec/features/admin/legislation/draft_versions_spec.rb +++ b/spec/features/admin/legislation/draft_versions_spec.rb @@ -57,7 +57,9 @@ 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' - click_button 'Create version' + within('.primary-buttons') do + click_button 'Create version' + end expect(page).to have_content 'An example legislation process' expect(page).to have_content 'Version 3' diff --git a/spec/features/admin/legislation/processes_spec.rb b/spec/features/admin/legislation/processes_spec.rb index 03aae2768..0f1114f51 100644 --- a/spec/features/admin/legislation/processes_spec.rb +++ b/spec/features/admin/legislation/processes_spec.rb @@ -44,15 +44,15 @@ feature 'Admin legislation processes' do fill_in 'legislation_process_how_to_participate', with: 'You can partipate in this thing by doing...' base_date = Date.current - fill_in 'start_date', with: base_date.strftime("%d/%m/%Y") - fill_in 'end_date', with: (base_date + 5.days).strftime("%d/%m/%Y") + fill_in 'legislation_process[start_date]', with: base_date.strftime("%d/%m/%Y") + fill_in 'legislation_process[end_date]', with: (base_date + 5.days).strftime("%d/%m/%Y") - fill_in 'debate_start_date', with: base_date.strftime("%d/%m/%Y") - fill_in 'debate_end_date', with: (base_date + 2.days).strftime("%d/%m/%Y") - fill_in 'draft_publication_date', with: (base_date + 3.days).strftime("%d/%m/%Y") - fill_in 'allegations_start_date', with: (base_date + 3.days).strftime("%d/%m/%Y") - fill_in 'allegations_end_date', with: (base_date + 5.days).strftime("%d/%m/%Y") - fill_in 'final_publication_date', with: (base_date + 7.days).strftime("%d/%m/%Y") + fill_in 'legislation_process[debate_start_date]', with: base_date.strftime("%d/%m/%Y") + fill_in 'legislation_process[debate_end_date]', with: (base_date + 2.days).strftime("%d/%m/%Y") + fill_in 'legislation_process[draft_publication_date]', with: (base_date + 3.days).strftime("%d/%m/%Y") + fill_in 'legislation_process[allegations_start_date]', with: (base_date + 3.days).strftime("%d/%m/%Y") + fill_in 'legislation_process[allegations_end_date]', with: (base_date + 5.days).strftime("%d/%m/%Y") + fill_in 'legislation_process[final_publication_date]', with: (base_date + 7.days).strftime("%d/%m/%Y") click_button 'Create process'