diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 31485e6..3ab5714 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -102,8 +102,8 @@ def filter_field_name(field) subject_t: 'Subject', legislationTitle_t: 'Legislation', department_t: 'Department', - year: 'Year', - month: 'Month' + year: 'Date', + month: 'Date' } field_names[field.to_sym] diff --git a/app/models/content_object.rb b/app/models/content_object.rb index adb86a3..3584a39 100644 --- a/app/models/content_object.rb +++ b/app/models/content_object.rb @@ -448,7 +448,7 @@ def get_all_from(field_name) def self.content_object_class(type_id, subtype_ids) case type_id when 363376 - 'NotSupported' + 'ResearchMaterial' when 90996 'Edm' when 346697 diff --git a/app/models/research_material.rb b/app/models/research_material.rb new file mode 100644 index 0000000..e193b95 --- /dev/null +++ b/app/models/research_material.rb @@ -0,0 +1,14 @@ +class ResearchMaterial < ContentObject + + def initialize(content_object_data) + super + end + + def template + 'search/objects/research_material' + end + + def search_result_partial + 'search/results/research_material' + end +end \ No newline at end of file diff --git a/app/views/search/index.html.erb b/app/views/search/index.html.erb index 1e04dbd..e342680 100644 --- a/app/views/search/index.html.erb +++ b/app/views/search/index.html.erb @@ -82,7 +82,7 @@
- Month + Date
<% @search_data.months.each_with_index do |month, index| %> @@ -99,7 +99,7 @@
- Year + Date
<% @search_data.years[0..4].each do |year_data| %> diff --git a/app/views/search/results/_research_material.html.erb b/app/views/search/results/_research_material.html.erb new file mode 100644 index 0000000..8b67b7d --- /dev/null +++ b/app/views/search/results/_research_material.html.erb @@ -0,0 +1,131 @@ +
+
+ <%= format_object_title(object.object_title, @ses_data) %> +
+ +
+ <%#= render 'search/results/item_details/description', description: object.abstract_text %> +
+ +
+
+
+ <%#= render 'search/results/item_details/member', member: object.member, member_party: object.member_party %> +
+
+ <%#= render 'search/results/item_details/member', member: object.member, member_party: object.member_party %> +
+
+ <%#= render 'search/results/item_details/departments', departments: object.departments, hide_label: false %> +
+
+
+ +
+
+
+ <%= render 'search/results/item_details/type', type: object.object_name %> +
+
+ +
+
+
+
+
+ +
class="row" id="detailed-view" data-detailed-results-target="toggleHidden"> + +
+
+
+
+
+
+
+
+ +
+
+
+
+
+
+
+ +
+
+ +
+
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ + <% unless object.amendments.blank? %> + <% object.amendments.each do |amendment| %> +
+
+
+ <%#= render 'search/results/item_details/amended_by', primary_sponsor: amendment.dig(:primary_sponsor, :value) unless amendment.dig(:primary_sponsor, :value).blank? %> +
+
+ <%#= render 'search/results/item_details/amended_on', date_tabled: amendment.dig(:date_tabled, :value) unless amendment.dig(:date_tabled, :value).blank? %> +
+
+
+ <% end %> + <% end %> + + <%#= render 'search/results/item_details/legislation', legislation: object.legislation unless object.legislation.blank? %> + <%#= render 'search/results/item_details/witnesses', witnesses: object.witnesses unless object.witnesses.blank? %> + <%#= render 'search/results/item_details/subjects', subjects: object.subjects unless object.subjects.blank? %> + <%#= render 'search/results/item_details/topics', topics: object.topics unless object.topics.blank? %> + <%#= render 'search/results/item_details/notes', notes: object.notes unless object.notes.blank? %> + + <% unless object.commons_library_location.blank? && object.lords_library_location.blank? %> +
+
+
+ <%#= render 'search/results/item_details/commons_library_location', location: object.commons_library_location unless object.commons_library_location.blank? %> +
+
+ <%#= render 'search/results/item_details/lords_library_location', location: object.lords_library_location unless object.lords_library_location.blank? %> +
+
+
+ <% end %> + +
+ +
+
+
+ <%= render 'search/results/item_details/date', date: object.standard_date %> +
+
+ <%= render 'search/results/item_details/reference', reference: object.standard_reference %> +
+
+ <%= render 'search/results/item_details/legislature', legislature: object.legislature %> +
+
+
+
+
\ No newline at end of file diff --git a/app/views/search/results/item_details/_creators.html.erb b/app/views/search/results/item_details/_creators.html.erb index 5f42296..430542e 100644 --- a/app/views/search/results/item_details/_creators.html.erb +++ b/app/views/search/results/item_details/_creators.html.erb @@ -1,4 +1,4 @@
By
- <%= render 'search/fragments/name_list', items: creators, terminator: "", singular: false %> + <%= render 'search/fragments/simple_list', items: creators, terminator: "", singular: false %>
diff --git a/app/views/search/results/item_details/_legislative_stage.html.erb b/app/views/search/results/item_details/_legislative_stage.html.erb index 3e3df09..5529a8e 100644 --- a/app/views/search/results/item_details/_legislative_stage.html.erb +++ b/app/views/search/results/item_details/_legislative_stage.html.erb @@ -2,7 +2,7 @@
Legislative stage
- <%= render 'search/fragments/name_list', items: legislative_stage, terminator: "", singular: false %> + <%= render 'search/fragments/simple_list', items: legislative_stage, terminator: "", singular: false %>
<% end %> \ No newline at end of file diff --git a/app/views/search/results/item_details/_legislature.html.erb b/app/views/search/results/item_details/_legislature.html.erb index a4b0695..cff5cb6 100644 --- a/app/views/search/results/item_details/_legislature.html.erb +++ b/app/views/search/results/item_details/_legislature.html.erb @@ -1,3 +1,3 @@
- <%= render 'search/fragments/name_list', items: legislature, terminator: "", singular: false %> + <%= render 'search/fragments/simple_list', items: legislature, terminator: "", singular: false %>
diff --git a/app/views/search/results/item_details/_object_name.html.erb b/app/views/search/results/item_details/_object_name.html.erb index 0e57121..66f30dc 100644 --- a/app/views/search/results/item_details/_object_name.html.erb +++ b/app/views/search/results/item_details/_object_name.html.erb @@ -1,3 +1,3 @@
- <%= render 'search/fragments/name_list', items: object_name, terminator: "", singular: true %> + <%= render 'search/fragments/simple_list', items: object_name, terminator: "", singular: true %>
diff --git a/app/views/search/results/item_details/_type.html.erb b/app/views/search/results/item_details/_type.html.erb index 8cc7deb..0132dc1 100644 --- a/app/views/search/results/item_details/_type.html.erb +++ b/app/views/search/results/item_details/_type.html.erb @@ -1,6 +1,6 @@ <% unless type.blank? %> <% if type.is_a?(Array) %> - <%= render 'search/results/item_details/list', items: type, seperator: ';', terminator: '', singular: false %> + <%= render 'search/fragments/simple_list', items: type, seperator: ';', terminator: '', singular: false %> <% else %>
<%= object_display_name(type, singular: true) %>