From d624a08abc7288ce7ec87a1615b2f8d22ef9b93e Mon Sep 17 00:00:00 2001 From: Bertocq Date: Sat, 10 Jun 2017 23:11:55 +0200 Subject: [PATCH 1/4] Remove How To Participate field from Legislative Process from views, i18n, factories and specs --- .../admin/legislation/processes_controller.rb | 1 - .../legislation/processes/_form.html.erb | 13 ------------ .../legislation/processes/_header.html.erb | 8 +------ .../processes/_header_full.html.erb | 6 ------ .../sandbox/admin_legislation_info.html.erb | 21 +++++-------------- config/locales/activerecord.en.yml | 1 - config/locales/activerecord.es.yml | 1 - config/locales/admin.en.yml | 1 - config/locales/admin.es.yml | 1 - config/locales/legislation.en.yml | 1 - config/locales/legislation.es.yml | 1 - db/dev_seeds.rb | 1 - spec/factories.rb | 1 - .../admin/legislation/processes_spec.rb | 1 - 14 files changed, 6 insertions(+), 52 deletions(-) diff --git a/app/controllers/admin/legislation/processes_controller.rb b/app/controllers/admin/legislation/processes_controller.rb index 268ef35c1..06adf6370 100644 --- a/app/controllers/admin/legislation/processes_controller.rb +++ b/app/controllers/admin/legislation/processes_controller.rb @@ -38,7 +38,6 @@ class Admin::Legislation::ProcessesController < Admin::Legislation::BaseControll :summary, :description, :target, - :how_to_participate, :additional_info, :start_date, :end_date, diff --git a/app/views/admin/legislation/processes/_form.html.erb b/app/views/admin/legislation/processes/_form.html.erb index 75c47aa39..ff0132e53 100644 --- a/app/views/admin/legislation/processes/_form.html.erb +++ b/app/views/admin/legislation/processes/_form.html.erb @@ -203,19 +203,6 @@ -
-
- <%= f.label :how_to_participate %> - <%= t('admin.legislation.processes.form.use_markdown') %> -
-
- <%= f.text_area :how_to_participate, - label: false, - rows: 5, - placeholder: t('admin.legislation.processes.form.how_to_participate_placeholder') %> -
-
-
<%= f.label :additional_info %> diff --git a/app/views/legislation/processes/_header.html.erb b/app/views/legislation/processes/_header.html.erb index 14fe5e565..18dd34d88 100644 --- a/app/views/legislation/processes/_header.html.erb +++ b/app/views/legislation/processes/_header.html.erb @@ -19,12 +19,6 @@ <%= markdown process.target %> <% end %>
-
- <% if process.how_to_participate.present? %> -

<%= t('legislation.processes.header_full.how_to_participate') %>

- <%= markdown process.how_to_participate %> - <% end %> -
<% if process.additional_info.present? %>
@@ -34,7 +28,7 @@ <% end %>
- <% if process.description.present? || process.target.present? || process.how_to_participate.present? || process.additional_info.present? %> + <% if process.description.present? || process.target.present? || process.additional_info.present? %> -
- <% if process.how_to_participate.present? %> -

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

- <%= markdown process.how_to_participate %> - <% end %> -
<% if process.additional_info.present? %>
diff --git a/app/views/sandbox/admin_legislation_info.html.erb b/app/views/sandbox/admin_legislation_info.html.erb index eca094564..82db31ed8 100644 --- a/app/views/sandbox/admin_legislation_info.html.erb +++ b/app/views/sandbox/admin_legislation_info.html.erb @@ -36,8 +36,8 @@
- - + +
@@ -53,7 +53,7 @@
- +
@@ -69,7 +69,7 @@
- +
@@ -109,17 +109,6 @@
-
-
- -
-
- -
-
-
@@ -151,7 +140,7 @@
- +
diff --git a/config/locales/activerecord.en.yml b/config/locales/activerecord.en.yml index f2ea427f8..f764e053d 100644 --- a/config/locales/activerecord.en.yml +++ b/config/locales/activerecord.en.yml @@ -168,7 +168,6 @@ en: title: Process Title description: Description target: Target - how_to_participate: How to participate additional_info: Additional info start_date: Start date end_date: End date diff --git a/config/locales/activerecord.es.yml b/config/locales/activerecord.es.yml index 1fe3319bc..fe310b973 100644 --- a/config/locales/activerecord.es.yml +++ b/config/locales/activerecord.es.yml @@ -163,7 +163,6 @@ es: title: Título del proceso description: En qué consiste target: A quién afecta - how_to_participate: Cómo participar additional_info: Información adicional start_date: Fecha de inicio del proceso end_date: Fecha de fin del proceso diff --git a/config/locales/admin.en.yml b/config/locales/admin.en.yml index 3385d3178..9e3a23118 100755 --- a/config/locales/admin.en.yml +++ b/config/locales/admin.en.yml @@ -222,7 +222,6 @@ en: summary_placeholder: Short summary of the description description_placeholder: Add a description of the process target_placeholder: Describe who is the target of the process - how_to_participate_placeholder: Describe how to participate additional_info_placeholder: Add an additional information you consider useful index: create: New process diff --git a/config/locales/admin.es.yml b/config/locales/admin.es.yml index 3aefaa20c..ad48015a4 100644 --- a/config/locales/admin.es.yml +++ b/config/locales/admin.es.yml @@ -222,7 +222,6 @@ es: summary_placeholder: Resumen corto de la descripción description_placeholder: Añade una descripción del proceso target_placeholder: Describe a quién va dirigido - how_to_participate_placeholder: Describe cómo participar additional_info_placeholder: Añade cualquier información adicional que pueda ser de interés index: create: Nuevo proceso diff --git a/config/locales/legislation.en.yml b/config/locales/legislation.en.yml index 72f319448..10146d80c 100644 --- a/config/locales/legislation.en.yml +++ b/config/locales/legislation.en.yml @@ -56,7 +56,6 @@ en: title: Participate description: Description target: Target - how_to_participate: How to participate more_info: More information and context index: filters: diff --git a/config/locales/legislation.es.yml b/config/locales/legislation.es.yml index e4c1c0f34..063dd5169 100644 --- a/config/locales/legislation.es.yml +++ b/config/locales/legislation.es.yml @@ -56,7 +56,6 @@ es: title: Colabora en la elaboración de la normativa sobre description: En qué consiste target: A quién va dirigido - how_to_participate: Cómo puedes participar more_info: Más información y contexto index: filters: diff --git a/db/dev_seeds.rb b/db/dev_seeds.rb index a787edbde..ccae0b74b 100644 --- a/db/dev_seeds.rb +++ b/db/dev_seeds.rb @@ -636,7 +636,6 @@ print "Creating legislation processes" description: Faker::Lorem.paragraphs.join("\n\n"), summary: Faker::Lorem.paragraph, target: Faker::Lorem.paragraphs.join("\n\n"), - how_to_participate: Faker::Lorem.paragraphs.join("\n\n"), additional_info: Faker::Lorem.paragraphs.join("\n\n"), start_date: Date.current - 3.days, end_date: Date.current + 3.days, diff --git a/spec/factories.rb b/spec/factories.rb index ed89ec154..26e3a1abf 100644 --- a/spec/factories.rb +++ b/spec/factories.rb @@ -605,7 +605,6 @@ FactoryGirl.define do description "Description of the process" summary "Summary of the process" target "Who will affected by this law?" - how_to_participate "You can participate by answering some questions" start_date Date.current - 5.days end_date Date.current + 5.days debate_start_date Date.current - 5.days diff --git a/spec/features/admin/legislation/processes_spec.rb b/spec/features/admin/legislation/processes_spec.rb index f34e93d3d..9973ba357 100644 --- a/spec/features/admin/legislation/processes_spec.rb +++ b/spec/features/admin/legislation/processes_spec.rb @@ -42,7 +42,6 @@ feature 'Admin legislation processes' do fill_in 'legislation_process_summary', with: 'Summary of the process' fill_in 'legislation_process_description', with: 'Describing the process' fill_in 'legislation_process_target', with: 'This thing affects people' - fill_in 'legislation_process_how_to_participate', with: 'You can partipate in this thing by doing...' base_date = Date.current fill_in 'legislation_process[start_date]', with: base_date.strftime("%d/%m/%Y") From 02d31953bed97b684e0e459bc247c0e975c81a0c Mon Sep 17 00:00:00 2001 From: Bertocq Date: Sat, 10 Jun 2017 23:16:13 +0200 Subject: [PATCH 2/4] Remove Target field from Legislative Process from views, i18n, factories and specs --- .../admin/legislation/processes_controller.rb | 1 - .../admin/legislation/processes/_form.html.erb | 13 ------------- app/views/legislation/processes/_header.html.erb | 8 +------- .../legislation/processes/_header_full.html.erb | 6 ------ app/views/sandbox/admin_legislation_info.html.erb | 12 ------------ config/locales/activerecord.en.yml | 1 - config/locales/activerecord.es.yml | 1 - config/locales/admin.en.yml | 1 - config/locales/admin.es.yml | 1 - config/locales/legislation.en.yml | 1 - config/locales/legislation.es.yml | 1 - db/dev_seeds.rb | 1 - spec/factories.rb | 1 - spec/features/admin/legislation/processes_spec.rb | 1 - 14 files changed, 1 insertion(+), 48 deletions(-) diff --git a/app/controllers/admin/legislation/processes_controller.rb b/app/controllers/admin/legislation/processes_controller.rb index 06adf6370..8d349633b 100644 --- a/app/controllers/admin/legislation/processes_controller.rb +++ b/app/controllers/admin/legislation/processes_controller.rb @@ -37,7 +37,6 @@ class Admin::Legislation::ProcessesController < Admin::Legislation::BaseControll :title, :summary, :description, - :target, :additional_info, :start_date, :end_date, diff --git a/app/views/admin/legislation/processes/_form.html.erb b/app/views/admin/legislation/processes/_form.html.erb index ff0132e53..ac49f8a7d 100644 --- a/app/views/admin/legislation/processes/_form.html.erb +++ b/app/views/admin/legislation/processes/_form.html.erb @@ -190,19 +190,6 @@ -
-
- <%= f.label :target %> - <%= t('admin.legislation.processes.form.use_markdown') %> -
-
- <%= f.text_area :target, - label: false, - rows: 5, - placeholder: t('admin.legislation.processes.form.target_placeholder') %> -
-
-
<%= f.label :additional_info %> diff --git a/app/views/legislation/processes/_header.html.erb b/app/views/legislation/processes/_header.html.erb index 18dd34d88..e958e48cb 100644 --- a/app/views/legislation/processes/_header.html.erb +++ b/app/views/legislation/processes/_header.html.erb @@ -13,12 +13,6 @@ <%= markdown process.description %> <% end %>
-
- <% if process.target.present? %> -

<%= t('legislation.processes.header_full.target') %>

- <%= markdown process.target %> - <% end %> -
<% if process.additional_info.present? %>
@@ -28,7 +22,7 @@ <% end %>
- <% if process.description.present? || process.target.present? || process.additional_info.present? %> + <% if process.description.present? || process.additional_info.present? %>
-
- <% if process.target.present? %> -

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

- <%= markdown process.target %> - <% end %> -
<% if process.additional_info.present? %>
diff --git a/app/views/sandbox/admin_legislation_info.html.erb b/app/views/sandbox/admin_legislation_info.html.erb index 82db31ed8..fe53bc724 100644 --- a/app/views/sandbox/admin_legislation_info.html.erb +++ b/app/views/sandbox/admin_legislation_info.html.erb @@ -97,18 +97,6 @@
-
-
- -
-
- -
-
-
diff --git a/config/locales/activerecord.en.yml b/config/locales/activerecord.en.yml index f764e053d..c9fd00aab 100644 --- a/config/locales/activerecord.en.yml +++ b/config/locales/activerecord.en.yml @@ -167,7 +167,6 @@ en: legislation/process: title: Process Title description: Description - target: Target additional_info: Additional info start_date: Start date end_date: End date diff --git a/config/locales/activerecord.es.yml b/config/locales/activerecord.es.yml index fe310b973..7b4fbebeb 100644 --- a/config/locales/activerecord.es.yml +++ b/config/locales/activerecord.es.yml @@ -162,7 +162,6 @@ es: legislation/process: title: Título del proceso description: En qué consiste - target: A quién afecta additional_info: Información adicional start_date: Fecha de inicio del proceso end_date: Fecha de fin del proceso diff --git a/config/locales/admin.en.yml b/config/locales/admin.en.yml index 9e3a23118..15e0d2ed7 100755 --- a/config/locales/admin.en.yml +++ b/config/locales/admin.en.yml @@ -221,7 +221,6 @@ en: title_placeholder: The title of the process summary_placeholder: Short summary of the description description_placeholder: Add a description of the process - target_placeholder: Describe who is the target of the process additional_info_placeholder: Add an additional information you consider useful index: create: New process diff --git a/config/locales/admin.es.yml b/config/locales/admin.es.yml index ad48015a4..bee867531 100644 --- a/config/locales/admin.es.yml +++ b/config/locales/admin.es.yml @@ -221,7 +221,6 @@ es: title_placeholder: Escribe el título del proceso summary_placeholder: Resumen corto de la descripción description_placeholder: Añade una descripción del proceso - target_placeholder: Describe a quién va dirigido additional_info_placeholder: Añade cualquier información adicional que pueda ser de interés index: create: Nuevo proceso diff --git a/config/locales/legislation.en.yml b/config/locales/legislation.en.yml index 10146d80c..7faa3b44c 100644 --- a/config/locales/legislation.en.yml +++ b/config/locales/legislation.en.yml @@ -55,7 +55,6 @@ en: header_full: title: Participate description: Description - target: Target more_info: More information and context index: filters: diff --git a/config/locales/legislation.es.yml b/config/locales/legislation.es.yml index 063dd5169..acb6583ee 100644 --- a/config/locales/legislation.es.yml +++ b/config/locales/legislation.es.yml @@ -55,7 +55,6 @@ es: header_full: title: Colabora en la elaboración de la normativa sobre description: En qué consiste - target: A quién va dirigido more_info: Más información y contexto index: filters: diff --git a/db/dev_seeds.rb b/db/dev_seeds.rb index ccae0b74b..5dd5bc0c7 100644 --- a/db/dev_seeds.rb +++ b/db/dev_seeds.rb @@ -635,7 +635,6 @@ print "Creating legislation processes" process = ::Legislation::Process.create!(title: Faker::Lorem.sentence(3).truncate(60), description: Faker::Lorem.paragraphs.join("\n\n"), summary: Faker::Lorem.paragraph, - target: Faker::Lorem.paragraphs.join("\n\n"), additional_info: Faker::Lorem.paragraphs.join("\n\n"), start_date: Date.current - 3.days, end_date: Date.current + 3.days, diff --git a/spec/factories.rb b/spec/factories.rb index 26e3a1abf..91a511420 100644 --- a/spec/factories.rb +++ b/spec/factories.rb @@ -604,7 +604,6 @@ FactoryGirl.define do title "A collaborative legislation process" description "Description of the process" summary "Summary of the process" - target "Who will affected by this law?" start_date Date.current - 5.days end_date Date.current + 5.days debate_start_date Date.current - 5.days diff --git a/spec/features/admin/legislation/processes_spec.rb b/spec/features/admin/legislation/processes_spec.rb index 9973ba357..9956c5cc7 100644 --- a/spec/features/admin/legislation/processes_spec.rb +++ b/spec/features/admin/legislation/processes_spec.rb @@ -41,7 +41,6 @@ feature 'Admin legislation processes' do fill_in 'legislation_process_title', with: 'An example legislation process' fill_in 'legislation_process_summary', with: 'Summary of the process' fill_in 'legislation_process_description', with: 'Describing the process' - fill_in 'legislation_process_target', with: 'This thing affects people' base_date = Date.current fill_in 'legislation_process[start_date]', with: base_date.strftime("%d/%m/%Y") From 2c82eec0fd91e3404621150bde22c62904d06592 Mon Sep 17 00:00:00 2001 From: Bertocq Date: Sat, 10 Jun 2017 23:17:25 +0200 Subject: [PATCH 3/4] Remove target and how_to_participate columns from legislation_processes table, no longer used --- ...027_remove_ht_participate_and_target_from_leg_process.rb | 6 ++++++ db/schema.rb | 4 +--- spec/features/admin/legislation/processes_spec.rb | 2 -- 3 files changed, 7 insertions(+), 5 deletions(-) create mode 100644 db/migrate/20170610211027_remove_ht_participate_and_target_from_leg_process.rb diff --git a/db/migrate/20170610211027_remove_ht_participate_and_target_from_leg_process.rb b/db/migrate/20170610211027_remove_ht_participate_and_target_from_leg_process.rb new file mode 100644 index 000000000..f7fbda32c --- /dev/null +++ b/db/migrate/20170610211027_remove_ht_participate_and_target_from_leg_process.rb @@ -0,0 +1,6 @@ +class RemoveHtParticipateAndTargetFromLegProcess < ActiveRecord::Migration + def change + remove_column :legislation_processes, :how_to_participate, :text + remove_column :legislation_processes, :target, :text + end +end diff --git a/db/schema.rb b/db/schema.rb index 7e49bdfc7..ad8bffd24 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20170602162155) do +ActiveRecord::Schema.define(version: 20170610211027) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -404,8 +404,6 @@ ActiveRecord::Schema.define(version: 20170602162155) do create_table "legislation_processes", force: :cascade do |t| t.string "title" t.text "description" - t.text "target" - t.text "how_to_participate" t.text "additional_info" t.date "start_date" t.date "end_date" diff --git a/spec/features/admin/legislation/processes_spec.rb b/spec/features/admin/legislation/processes_spec.rb index 9956c5cc7..60a872190 100644 --- a/spec/features/admin/legislation/processes_spec.rb +++ b/spec/features/admin/legislation/processes_spec.rb @@ -63,14 +63,12 @@ feature 'Admin legislation processes' do expect(page).to have_content 'An example legislation process' expect(page).not_to have_content 'Summary of the process' expect(page).to have_content 'Describing the process' - expect(page).to have_content 'This thing affects people' visit legislation_processes_path expect(page).to have_content 'An example legislation process' expect(page).to have_content 'Summary of the process' expect(page).not_to have_content 'Describing the process' - expect(page).not_to have_content 'This thing affects people' end end From 41ec36f47049b3211da78b80337001b0cca55116 Mon Sep 17 00:00:00 2001 From: Bertocq Date: Sat, 10 Jun 2017 23:31:19 +0200 Subject: [PATCH 4/4] Correct the Legislative Process description column width to occupy full page now that its alone --- app/views/legislation/processes/_header.html.erb | 2 +- app/views/legislation/processes/_header_full.html.erb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/legislation/processes/_header.html.erb b/app/views/legislation/processes/_header.html.erb index e958e48cb..ef1e640e9 100644 --- a/app/views/legislation/processes/_header.html.erb +++ b/app/views/legislation/processes/_header.html.erb @@ -7,7 +7,7 @@
-
+
<% if process.description.present? %>

<%= t('legislation.processes.header_full.description') %>

<%= markdown process.description %> diff --git a/app/views/legislation/processes/_header_full.html.erb b/app/views/legislation/processes/_header_full.html.erb index 5b04c2cdd..67ca474a9 100644 --- a/app/views/legislation/processes/_header_full.html.erb +++ b/app/views/legislation/processes/_header_full.html.erb @@ -9,7 +9,7 @@
-
+
<% if process.description.present? %>

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

<%= markdown process.description %>