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/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