Add milestones summary to legislation processes
This commit is contained in:
@@ -10,10 +10,11 @@ class Legislation::Process < ActiveRecord::Base
|
||||
acts_as_paranoid column: :hidden_at
|
||||
acts_as_taggable_on :customs
|
||||
|
||||
translates :title, touch: true
|
||||
translates :summary, touch: true
|
||||
translates :description, touch: true
|
||||
translates :additional_info, touch: true
|
||||
translates :title, touch: true
|
||||
translates :summary, touch: true
|
||||
translates :description, touch: true
|
||||
translates :additional_info, touch: true
|
||||
translates :milestones_summary, touch: true
|
||||
include Globalizable
|
||||
|
||||
PHASES_AND_PUBLICATIONS = %i(draft_phase debate_phase allegations_phase proposals_phase draft_publication result_publication).freeze
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
<%= render "admin/shared/globalize_locales", resource: @process %>
|
||||
|
||||
<%= translatable_form_for [:admin, @process] do |f| %>
|
||||
<%= f.translatable_fields do |translations_form| %>
|
||||
<div class="ckeditor">
|
||||
<%= translations_form.cktext_area :milestones_summary, ckeditor: { language: I18n.locale } %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<%= f.submit class: "button success" %>
|
||||
<% end %>
|
||||
@@ -8,4 +8,5 @@
|
||||
<h2><%= @process.title %></h2>
|
||||
|
||||
<%= render "admin/legislation/processes/subnav", process: @process, active: "milestones" %>
|
||||
<%= render "summary_form", process: @process %>
|
||||
<%= render "admin/milestones/milestones", milestoneable: @process %>
|
||||
|
||||
@@ -4,6 +4,12 @@
|
||||
|
||||
<%= render "key_dates", process: @process, phase: @phase %>
|
||||
|
||||
<div class="row">
|
||||
<div class="small-12 column">
|
||||
<%= WYSIWYGSanitizer.new.sanitize(@process.milestones_summary) %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="tab-milestones">
|
||||
<%= render "milestones/milestones_content", milestoneable: @process %>
|
||||
</div>
|
||||
|
||||
@@ -239,6 +239,7 @@ en:
|
||||
summary: Summary
|
||||
description: Description
|
||||
additional_info: Additional info
|
||||
milestones_summary: Summary
|
||||
legislation/draft_version:
|
||||
title: Version title
|
||||
body: Text
|
||||
|
||||
@@ -239,6 +239,7 @@ es:
|
||||
summary: Resumen
|
||||
description: En qué consiste
|
||||
additional_info: Información adicional
|
||||
milestones_summary: Seguimiento del proceso
|
||||
legislation/draft_version:
|
||||
title: Título de la version
|
||||
body: Texto
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
class AddMilestonesSummaryToLegislationProcessTranslation < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :legislation_process_translations, :milestones_summary, :text
|
||||
end
|
||||
end
|
||||
@@ -11,7 +11,7 @@
|
||||
#
|
||||
# It's strongly recommended that you check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema.define(version: 20181109111037) do
|
||||
ActiveRecord::Schema.define(version: 20181121123512) do
|
||||
|
||||
# These are extensions that must be enabled in order to support this database
|
||||
enable_extension "plpgsql"
|
||||
@@ -627,6 +627,7 @@ ActiveRecord::Schema.define(version: 20181109111037) do
|
||||
t.text "summary"
|
||||
t.text "description"
|
||||
t.text "additional_info"
|
||||
t.text "milestones_summary"
|
||||
end
|
||||
|
||||
add_index "legislation_process_translations", ["legislation_process_id"], name: "index_199e5fed0aca73302243f6a1fca885ce10cdbb55", using: :btree
|
||||
|
||||
@@ -188,5 +188,22 @@ feature 'Admin legislation processes' do
|
||||
visit admin_legislation_process_proposals_path(process)
|
||||
expect(page).to have_field("Categories", with: "bicycles, recycling")
|
||||
end
|
||||
|
||||
scenario "Edit milestones summary", :js do
|
||||
visit admin_legislation_process_milestones_path(process)
|
||||
|
||||
within(".translatable-fields[data-locale='en']") do
|
||||
fill_in_ckeditor find("textarea", visible: false)[:id],
|
||||
with: "There is still a long journey ahead of us"
|
||||
end
|
||||
|
||||
click_button "Update Process"
|
||||
|
||||
expect(page).to have_current_path admin_legislation_process_milestones_path(process)
|
||||
|
||||
visit milestones_legislation_process_path(process)
|
||||
|
||||
expect(page).to have_content "There is still a long journey ahead of us"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user