Skip to content

Commit

Permalink
- Fix issue with partials used within haml partials
Browse files Browse the repository at this point in the history
- Show all subtypes and types on most papers, and correct some formatting issues
  • Loading branch information
j-corry committed Aug 30, 2024
1 parent e28ba41 commit d8822a1
Show file tree
Hide file tree
Showing 13 changed files with 18 additions and 20 deletions.
1 change: 1 addition & 0 deletions app/models/content_object.rb
Original file line number Diff line number Diff line change
Expand Up @@ -507,6 +507,7 @@ def self.content_object_class(type_id, subtype_ids)
elsif subtype_ids&.include?(528127)
'PaperOrderedToBePrinted'
elsif subtype_ids&.include?(528129)
# Paper submitted has its own object view but uses the papers laid results view
'PaperSubmitted'
elsif subtype_ids&.include?(51288)
# changed from ParliamentaryPaperLaid when object added
Expand Down
4 changes: 1 addition & 3 deletions app/models/deposited_paper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,10 @@ def deposited_file
uris = get_all_from('depositedFile_uri')
return if uris.blank?

https_uris = uris.map do |uri|
uris.map do |uri|
full = URI.parse(uri[:value])
URI::HTTPS.build(host: full.host, path: full.path)
end

https_uris
end

def authors
Expand Down
2 changes: 1 addition & 1 deletion app/views/search/results/_command_paper.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<div class="row">
<div class="three-panel">
<div class="left" id="type">
<%= render 'search/results/item_details/subtype_and_type', subtype: object.subtype, type: object.type %>
<%= render 'search/results/item_details/subtype_and_type', subtype: object.subtypes, type: object.type %>
</div>
<div class="centre" id="status">

Expand Down
2 changes: 1 addition & 1 deletion app/views/search/results/_deposited_paper.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<div class="row">
<div class="three-panel">
<div class="left" id="type">
<%= render 'search/results/item_details/subtype_and_type', subtype: object.subtype, type: object.type %>
<%= render 'search/results/item_details/subtype_and_type', subtype: object.subtypes, type: object.type %>
</div>
<div class="centre" id="status">

Expand Down
2 changes: 1 addition & 1 deletion app/views/search/results/_house_of_commons_paper.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<div class="row">
<div class="three-panel">
<div class="left" id="type">
<%= render 'search/results/item_details/subtype_and_type', subtype: object.subtype, type: object.type %>
<%= render 'search/results/item_details/subtype_and_type', subtype: object.subtypes, type: object.type %>
</div>
<div class="centre" id="status">

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<div class="row">
<div class="three-panel">
<div class="left" id="type">
<%= render 'search/results/item_details/type', type: object.object_name %>
<%= render 'search/results/item_details/subtype_and_type', subtype: object.subtypes, type: object.type %>
</div>
<div class="centre" id="status">

Expand Down
2 changes: 1 addition & 1 deletion app/views/search/results/_parliamentary_committee.erb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<div class="row">
<div class="three-panel">
<div class="left" id="type">
<%= render 'search/results/item_details/type', type: object.object_name %>
<%= render 'search/results/item_details/subtype_and_type', subtype: object.subtypes, type: object.type %>
</div>
<div class="centre" id="status">

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<div class="row">
<div class="three-panel">
<div class="left" id="type">
<%= render 'search/results/item_details/type', type: object.object_name %>
<%= render 'search/results/item_details/subtype_and_type', subtype: object.subtypes, type: object.type %>
</div>
<div class="centre" id="status">

Expand Down
2 changes: 1 addition & 1 deletion app/views/search/results/_unprinted_command_paper.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<div class="row">
<div class="three-panel">
<div class="left" id="type">
<%= render 'search/results/item_details/subtype_and_type', subtype: object.subtype, type: object.type %>
<%= render 'search/results/item_details/subtype_and_type', subtype: object.subtypes, type: object.type %>
</div>
<div class="centre" id="status">

Expand Down
2 changes: 1 addition & 1 deletion app/views/search/results/_unprinted_paper.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<div class="row">
<div class="three-panel">
<div class="left" id="type">
<%= render 'search/results/item_details/subtype_and_type', subtype: object.subtype, type: object.type %>
<%= render 'search/results/item_details/subtype_and_type', subtype: object.subtypes, type: object.type %>
</div>
<div class="centre" id="status">

Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
- unless category.blank?
- if category.is_a?(Array)
- render 'search/fragments/simple_list', items: category, separator: ',', terminator: ',', singular: false
= render 'search/fragments/simple_list', items: category, separator: ',', terminator: ',', singular: false
- else
%span.item-details>= object_display_name(category, singular: true)
- unless subtype.blank?
- unless category.blank?
%span>= ", "
- if subtype.is_a?(Array)
- render 'search/fragments/simple_list', items: subtype, separator: ',', terminator: ',', singular: false
= render 'search/fragments/simple_list', items: subtype, separator: ',', terminator: ',', singular: false
- else
%span.item-details>= object_display_name(subtype, singular: true)
- if subtype.blank? && category.blank?
- if type.is_a?(Array)
- render 'search/fragments/simple_list', items: type, separator: ',', terminator: ',', singular: false
= render 'search/fragments/simple_list', items: type, separator: ',', terminator: ',', singular: false
- else
%span.item-details= object_display_name(type, singular: true)
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
- unless subtype.blank?
- if subtype.is_a?(Array)
- render 'search/fragments/simple_list', items: subtype, separator: ',', terminator: ',', singular: false
= render 'search/fragments/simple_list', items: subtype, separator: ',', terminator: ',', singular: false
- else
%span.item-details>= object_display_name(subtype, singular: true)
- unless type.blank?
- unless subtype.blank?
%span>= ", "
- unless type.blank?
- if type.is_a?(Array)
- render 'search/fragments/simple_list', items: type, separator: ',', terminator: ',', singular: false
= render 'search/fragments/simple_list', items: type, separator: ',', terminator: ',', singular: false
- else
%span.item-details= object_display_name(type, singular: true)
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
- unless subtype.blank?
- if subtype.is_a?(Array)
- render 'search/fragments/simple_list', items: subtype, separator: ',', terminator: ',', singular: false
= render 'search/fragments/simple_list', items: subtype, separator: ',', terminator: ',', singular: false
- else
%span.item-details>= object_display_name(subtype, singular: true)
- if subtype.blank?
- if type.is_a?(Array)
- render 'search/fragments/simple_list', items: type, separator: ',', terminator: ',', singular: false
= render 'search/fragments/simple_list', items: type, separator: ',', terminator: ',', singular: false
- else
%span.item-details= object_display_name(type, singular: true)

0 comments on commit d8822a1

Please sign in to comment.