From 6cce083127980757e41090148d746511e394b4bc Mon Sep 17 00:00:00 2001 From: Graeme Porteous Date: Tue, 1 Oct 2024 12:17:02 +0100 Subject: [PATCH 01/14] Broaden Citation#type classifications We care more about the general grouping rather than a citation being e.g. specifically an _academic_ research. It could be some other generally research that we'd want to track. --- app/helpers/admin/citations_helper.rb | 2 +- app/models/citation.rb | 5 ++--- app/views/citations/new.html.erb | 14 ++++++------- .../info_request_batch/_citations.html.erb | 4 ++-- app/views/request/_citations.html.erb | 4 ++-- ...14832_change_citation_type_values_again.rb | 21 +++++++++++++++++++ doc/CHANGES.md | 2 +- spec/helpers/admin/citations_helper_spec.rb | 8 +++---- spec/models/citation_spec.rb | 2 +- 9 files changed, 41 insertions(+), 21 deletions(-) create mode 100644 db/migrate/20241001114832_change_citation_type_values_again.rb diff --git a/app/helpers/admin/citations_helper.rb b/app/helpers/admin/citations_helper.rb index a383aa7d67..135c2f8519 100644 --- a/app/helpers/admin/citations_helper.rb +++ b/app/helpers/admin/citations_helper.rb @@ -3,7 +3,7 @@ module Admin::CitationsHelper ICONS = { journalism: '🗞️', campaigning: '📣', - academic: '🎓', + research: '📚', other: '🌐' }.with_indifferent_access.freeze diff --git a/app/models/citation.rb b/app/models/citation.rb index 460eb357ef..54abf8f303 100644 --- a/app/models/citation.rb +++ b/app/models/citation.rb @@ -14,8 +14,7 @@ # ## -# A Citation of an InfoRequest or InfoRequestBatch in news stories or an -# academic paper +# A Citation of an InfoRequest or InfoRequestBatch # class Citation < ApplicationRecord self.inheritance_column = nil @@ -29,7 +28,7 @@ class Citation < ApplicationRecord message: _('Source URL is too long') }, format: { with: /\Ahttps?:\/\/.*\z/, message: _('Please enter a Source URL') } - validates :type, inclusion: { in: %w(journalism academic campaigning other), + validates :type, inclusion: { in: %w(journalism research campaigning other), message: _('Please select a type') } scope :newest, ->(limit = 1) do diff --git a/app/views/citations/new.html.erb b/app/views/citations/new.html.erb index 996858f3dd..a6cddcb184 100644 --- a/app/views/citations/new.html.erb +++ b/app/views/citations/new.html.erb @@ -2,11 +2,11 @@

<% if @resource.is_a?(InfoRequestBatch) %> - <%= _('Has this batch request been referenced in a news article or ' \ - 'academic paper? Let us know:') %> + <%= _('Has this batch request been referenced in journalism, ' \ + 'campaigning, or research?') %> <% else %> - <%= _('Has this request been referenced in a news article or academic ' \ - 'paper? Let us know:') %> + <%= _('Has this request been referenced in journalism, campaigning, ' \ + 'or research?') %> <% end %>

@@ -40,9 +40,9 @@ <%= _('Campaigning') %> -