Skip to content

Commit

Permalink
Merge pull request #195 from ukparliament/development
Browse files Browse the repository at this point in the history
Development merge
  • Loading branch information
j-corry authored Nov 25, 2024
2 parents 01482ab + 0719b9d commit fd159e3
Show file tree
Hide file tree
Showing 12 changed files with 29 additions and 18 deletions.
4 changes: 4 additions & 0 deletions app/models/research_briefing.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 2 additions & 8 deletions app/views/search/preliminary_sentences/_edm.haml
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,15 @@
.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)"
- else
%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)
Expand Down
2 changes: 1 addition & 1 deletion app/views/search/results/_research_briefing.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<div class="row">
<div class="result-panel">
<div id="type">
<%= render 'search/results/item_details/type', type: object.object_name %>
<%= render 'search/results/item_details/category_or_subtype', category: object.category, subtype: object.subtype %>
</div>
<div id="status"></div>
<div id="secondary-group"></div>
Expand Down
2 changes: 1 addition & 1 deletion app/views/search/results/item_details/_abstract.html.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<% unless abstract.blank? %>
<div class="item-details">
<span>
<%= raw abstract[:value].truncate_words(50) %>
<%= raw format_html(abstract[:value], 50) %>
</span>
</div>
<% end %>
13 changes: 13 additions & 0 deletions app/views/search/results/item_details/_category_or_subtype.haml
Original file line number Diff line number Diff line change
@@ -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)
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<% unless contribution_text.blank? %>
<div class="item-details">
<span>
<%= raw contribution_text[:value].truncate_words(50) %>
<%= raw format_html(contribution_text[:value], 50) %>
</span>
</div>
<% end %>
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<% unless correction_text.blank? %>
<div class="item-details">
<span>
<%= raw correction_text[:value].truncate_words(50) %>
<%= raw format_html(correction_text[:value], 50) %>
</span>
</div>
<% end %>
8 changes: 4 additions & 4 deletions app/views/search/results/item_details/_description.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
<div class="item-details">
<span>
<% 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 %>
</span>
</div>
<% end %>
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<% unless motion_text.blank? %>
<div class="item-details">
<span>
<%= raw motion_text[:value].truncate_words(50) %>
<%= raw format_html(motion_text[:value], 50) %>
</span>
</div>
<% end %>
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<% unless petition_text.blank? %>
<div class="item-details">
<span>
<%= raw petition_text[:value]&.truncate_words(50) %>
<%= raw format_html(petition_text[:value], 50) %>
</span>
</div>
<% end %>

0 comments on commit fd159e3

Please sign in to comment.