diff --git a/app/admin/external_legislations.rb b/app/admin/external_legislations.rb index 619aa9b96..1cd641ce6 100644 --- a/app/admin/external_legislations.rb +++ b/app/admin/external_legislations.rb @@ -1,7 +1,7 @@ ActiveAdmin.register ExternalLegislation do config.batch_actions = false - menu parent: 'Laws', priority: 5 + menu parent: 'Laws', priority: 5, label: 'External Laws' decorate_with ExternalLegislationDecorator @@ -11,7 +11,7 @@ filter :url_contains, label: 'URL' filter :geography - data_export_sidebar 'External Legislations' + data_export_sidebar 'External Laws' show do attributes_table do @@ -25,7 +25,7 @@ active_admin_comments end - index do + index title: 'External Laws' do column :name, &:name_summary_link column 'URL', :url column :geography diff --git a/app/admin/legislations.rb b/app/admin/legislations.rb index 661a09f65..16d976f76 100644 --- a/app/admin/legislations.rb +++ b/app/admin/legislations.rb @@ -1,7 +1,7 @@ ActiveAdmin.register Legislation do config.sort_order = 'date_passed_desc' - menu parent: 'Laws', priority: 1 + menu parent: 'Laws', priority: 1, label: 'Laws and Policies' decorate_with LegislationDecorator @@ -30,7 +30,7 @@ as: :select, collection: proc { array_to_select_collection(VisibilityStatus::VISIBILITY) } - index do + index title: 'Laws and Policies' do selectable_column column :title, &:title_summary_link column :legislation_type @@ -48,7 +48,7 @@ publishable_sidebar only: :show - data_export_sidebar 'Legislations', documents: true, events: true + data_export_sidebar 'Laws', documents: true, events: true show do tabs do @@ -121,9 +121,9 @@ archive_command = ::Command::Batch::Archive.new(batch_action_collection, ids) message = if archive_command.call - {notice: "Successfully archived #{ids.count} Legislations"} + {notice: "Successfully archived #{ids.count} Laws"} else - {alert: 'Could not archive selected Legislations'} + {alert: 'Could not archive selected Laws'} end redirect_to collection_path(scope: 'archived'), message @@ -133,9 +133,9 @@ delete_command = Command::Batch::Delete.new(batch_action_collection, ids) message = if delete_command.call - {notice: "Successfully deleted #{ids.count} Legislations"} + {notice: "Successfully deleted #{ids.count} Laws"} else - {alert: 'Could not delete selected Legislations'} + {alert: 'Could not delete selected Laws'} end redirect_to collection_path, message diff --git a/app/admin/litigations.rb b/app/admin/litigations.rb index f6471970b..f4fecc02d 100644 --- a/app/admin/litigations.rb +++ b/app/admin/litigations.rb @@ -10,6 +10,7 @@ permit_params :title, :jurisdiction_id, :sector_id, :document_type, :visibility_status, :summary, :core_objective, + :citation_reference_number, :created_by_id, :updated_by_id, :keywords_string, litigation_sides_attributes: permit_params_for(:litigation_sides), documents_attributes: permit_params_for(:documents), @@ -89,8 +90,8 @@ row :created_at row :created_by list_row 'Documents', :document_links - list_row 'Legislations', :legislation_links - list_row 'External Legislations', :external_legislation_links + list_row 'Laws', :legislation_links + list_row 'External Laws', :external_legislation_links end end diff --git a/app/admin/targets.rb b/app/admin/targets.rb index 9575637fe..92b887180 100644 --- a/app/admin/targets.rb +++ b/app/admin/targets.rb @@ -52,7 +52,7 @@ row :target_type row :description row :geography - list_row 'Legislations', :legislation_links + list_row 'Laws', :legislation_links row :updated_at row :updated_by row :created_at diff --git a/app/views/admin/litigations/_form.html.erb b/app/views/admin/litigations/_form.html.erb index d437be46e..6b11a8c3e 100644 --- a/app/views/admin/litigations/_form.html.erb +++ b/app/views/admin/litigations/_form.html.erb @@ -17,12 +17,13 @@ <%= f.inputs do %> <%= f.input :title %> <%= f.input :jurisdiction %> + <%= f.input :citation_reference_number %> <%= f.input :sector %> <%= f.input :document_type, as: :select, collection: array_to_select_collection(Litigation::DOCUMENT_TYPES) %> <%= f.input :summary, as: :trix %> <%= f.input :core_objective, as: :trix %> - <%= f.input :legislation_ids, as: :selected_list, label: 'Connected Legislations', fields: [:title], display_name: :title, order: 'title_asc' %> - <%= f.input :external_legislation_ids, as: :selected_list, label: 'Connected External Legislations', fields: [:name], display_name: :name, order: 'name_asc' %> + <%= f.input :legislation_ids, as: :selected_list, label: 'Connected Laws', fields: [:title], display_name: :title, order: 'title_asc' %> + <%= f.input :external_legislation_ids, as: :selected_list, label: 'Connected External Laws', fields: [:name], display_name: :name, order: 'name_asc' %> <%= f.input :visibility_status, as: :select %> <%= f.input :keywords_string, as: :tags, label: 'Keywords', hint: t('hint.tag'), collection: Keyword.all.pluck(:name) %> <% end %> diff --git a/app/views/admin/targets/_form.html.erb b/app/views/admin/targets/_form.html.erb index b4650211e..0ec6c8548 100644 --- a/app/views/admin/targets/_form.html.erb +++ b/app/views/admin/targets/_form.html.erb @@ -20,7 +20,7 @@ <%= f.input :geography %> <%= f.input :sector %> <%= f.input :target_scope %> - <%= f.input :legislation_ids, as: :selected_list, label: 'Connected Legislations', fields: [:title], display_name: :title, order: 'title_asc' %> + <%= f.input :legislation_ids, as: :selected_list, label: 'Connected Laws', fields: [:title], display_name: :title, order: 'title_asc' %> <%= f.input :description, as: :trix %> <%= f.input :visibility_status, as: :select %> <% end %> diff --git a/spec/controllers/admin/legislations_controller_spec.rb b/spec/controllers/admin/legislations_controller_spec.rb index cc3584aa9..ffcde26c4 100644 --- a/spec/controllers/admin/legislations_controller_spec.rb +++ b/spec/controllers/admin/legislations_controller_spec.rb @@ -162,7 +162,7 @@ it 'redirects to index & renders alert message' do expect(subject).to redirect_to(admin_legislations_path) - expect(flash[:alert]).to match('Could not delete selected Legislations') + expect(flash[:alert]).to match('Could not delete selected Laws') end end @@ -208,7 +208,7 @@ expect(legislation_to_delete_1.reload.discarded_at).to_not be_nil expect(Legislation.all_discarded.find_by_id(ids_to_delete)).to_not be_nil - expect(flash[:notice]).to match('Successfully deleted 3 Legislations') + expect(flash[:notice]).to match('Successfully deleted 3 Laws') end end @@ -236,7 +236,7 @@ expect(legislation_to_keep_1.reload.visibility_status).to eq('draft') expect(legislation_to_keep_2.reload.visibility_status).to eq('draft') - expect(flash[:notice]).to match('Successfully archived 2 Legislations') + expect(flash[:notice]).to match('Successfully archived 2 Laws') end end end