diff --git a/app/models/research_briefing.rb b/app/models/research_briefing.rb index f767d8c..49a2bc5 100644 --- a/app/models/research_briefing.rb +++ b/app/models/research_briefing.rb @@ -40,6 +40,10 @@ def series get_first_from('category_ses') end + def category + get_first_from('category_ses') + end + def creator_party get_first_from('creatorParty_ses') end diff --git a/app/views/search/preliminary_sentences/_edm.haml b/app/views/search/preliminary_sentences/_edm.haml index 64dc14d..bc65cbf 100644 --- a/app/views/search/preliminary_sentences/_edm.haml +++ b/app/views/search/preliminary_sentences/_edm.haml @@ -2,12 +2,8 @@ .content-prelim-inner .content-prelim-text#prelim-text %span>= object_display_name_link(object.object_name) - - unless object.primary_sponsor.blank? && object.other_sponsors.blank? - %span=" sponsored by " - - if object.primary_sponsor.blank? - %span= render 'search/fragments/list', items: object.other_sponsors, terminator: '', singular: false - %span= " and " - - else object.primary_sponsor.blank? + - unless object.primary_sponsor.blank? + %span=" tabled by " %span>= search_link(object.primary_sponsor) - if object.primary_sponsor_party.blank? %span= " (primary sponsor)" @@ -15,8 +11,6 @@ %span= " (primary sponsor, " %span>= render 'search/fragments/list', items: object.primary_sponsor_party, terminator: '', singular: false %span= ")" - - unless object.other_sponsors.blank? - %span>= render 'search/fragments/edm_sponsor_list', items: object.other_sponsors, terminator: '', singular: false %span= " and " %span= " tabled on " %span>= format_date(object.date_tabled) diff --git a/app/views/search/results/_research_briefing.html.erb b/app/views/search/results/_research_briefing.html.erb index dcd137f..38675ec 100644 --- a/app/views/search/results/_research_briefing.html.erb +++ b/app/views/search/results/_research_briefing.html.erb @@ -25,7 +25,7 @@
- <%= render 'search/results/item_details/type', type: object.object_name %> + <%= render 'search/results/item_details/category_or_subtype', category: object.category, subtype: object.subtype %>
diff --git a/app/views/search/results/item_details/_abstract.html.erb b/app/views/search/results/item_details/_abstract.html.erb index 04c86e9..a2a0d4a 100644 --- a/app/views/search/results/item_details/_abstract.html.erb +++ b/app/views/search/results/item_details/_abstract.html.erb @@ -1,7 +1,7 @@ <% unless abstract.blank? %>
- <%= raw abstract[:value].truncate_words(50) %> + <%= raw format_html(abstract[:value], 50) %>
<% end %> \ No newline at end of file diff --git a/app/views/search/results/item_details/_category_or_subtype.haml b/app/views/search/results/item_details/_category_or_subtype.haml new file mode 100644 index 0000000..d7aba6a --- /dev/null +++ b/app/views/search/results/item_details/_category_or_subtype.haml @@ -0,0 +1,13 @@ +- unless category.blank? && subtype.blank? + %div.item-details + %div.item-details-label= "Type" + - unless category.blank? + - if category.is_a?(Array) + = render 'search/fragments/simple_list', items: category, separator: ';', terminator: '', singular: false + - else + = object_display_name(category, singular: false) + - if category.blank? + - if subtype.is_a?(Array) + = render 'search/fragments/simple_list', items: subtype, separator: ';', terminator: '', singular: false + - else + = object_display_name(subtype, singular: true) \ No newline at end of file diff --git a/app/views/search/results/item_details/_contribution_text.html.erb b/app/views/search/results/item_details/_contribution_text.html.erb index 26f82a9..3ed3ec6 100644 --- a/app/views/search/results/item_details/_contribution_text.html.erb +++ b/app/views/search/results/item_details/_contribution_text.html.erb @@ -1,7 +1,7 @@ <% unless contribution_text.blank? %>
- <%= raw contribution_text[:value].truncate_words(50) %> + <%= raw format_html(contribution_text[:value], 50) %>
<% end %> \ No newline at end of file diff --git a/app/views/search/results/item_details/_correction_text.html.erb b/app/views/search/results/item_details/_correction_text.html.erb index 72b2856..2e54982 100644 --- a/app/views/search/results/item_details/_correction_text.html.erb +++ b/app/views/search/results/item_details/_correction_text.html.erb @@ -1,7 +1,7 @@ <% unless correction_text.blank? %>
- <%= raw correction_text[:value].truncate_words(50) %> + <%= raw format_html(correction_text[:value], 50) %>
<% end %> \ No newline at end of file diff --git a/app/views/search/results/item_details/_description.html.erb b/app/views/search/results/item_details/_description.html.erb index 1ad0b1d..a228277 100644 --- a/app/views/search/results/item_details/_description.html.erb +++ b/app/views/search/results/item_details/_description.html.erb @@ -2,10 +2,10 @@
<% if full_text == true %> - <%= raw description[:value] %> - <% else %> - <%= raw description[:value].truncate_words(50) %> - <% end %> + <%= raw format_html(description[:value], false) %> + <% else %> + <%= raw format_html(description[:value], 50) %> + <% end %>
<% end %> \ No newline at end of file diff --git a/app/views/search/results/item_details/_motion_text.html.erb b/app/views/search/results/item_details/_motion_text.html.erb index bca93f4..68dc4fa 100644 --- a/app/views/search/results/item_details/_motion_text.html.erb +++ b/app/views/search/results/item_details/_motion_text.html.erb @@ -1,7 +1,7 @@ <% unless motion_text.blank? %>
- <%= raw motion_text[:value].truncate_words(50) %> + <%= raw format_html(motion_text[:value], 50) %>
<% end %> \ No newline at end of file diff --git a/app/views/search/results/item_details/_petition_text.html.erb b/app/views/search/results/item_details/_petition_text.html.erb index 2166da4..2244496 100644 --- a/app/views/search/results/item_details/_petition_text.html.erb +++ b/app/views/search/results/item_details/_petition_text.html.erb @@ -1,7 +1,7 @@ <% unless petition_text.blank? %>
- <%= raw petition_text[:value]&.truncate_words(50) %> + <%= raw format_html(petition_text[:value], 50) %>
<% end %> \ No newline at end of file diff --git a/app/views/search/results/item_details/_subtype_and_type.html.haml b/app/views/search/results/item_details/_subtype_and_type.haml similarity index 100% rename from app/views/search/results/item_details/_subtype_and_type.html.haml rename to app/views/search/results/item_details/_subtype_and_type.haml diff --git a/app/views/search/results/item_details/_subtype_or_type.html.haml b/app/views/search/results/item_details/_subtype_or_type.haml similarity index 100% rename from app/views/search/results/item_details/_subtype_or_type.html.haml rename to app/views/search/results/item_details/_subtype_or_type.haml