Skip to content

Commit

Permalink
Merge pull request #181 from ukparliament/development
Browse files Browse the repository at this point in the history
Development merge
  • Loading branch information
j-corry committed Sep 20, 2024
2 parents a53d771 + 753bd20 commit aa68337
Show file tree
Hide file tree
Showing 72 changed files with 792 additions and 859 deletions.
13 changes: 6 additions & 7 deletions app/assets/stylesheets/primary.css
Original file line number Diff line number Diff line change
Expand Up @@ -497,6 +497,7 @@ table {
}

.result-panel {
display: flex;
flex-direction: column;
gap: 0;
}
Expand Down Expand Up @@ -551,6 +552,7 @@ table {
}

.result-panel {
display: flex;
flex-direction: column;
justify-content: space-between;
gap: 0;
Expand Down Expand Up @@ -604,13 +606,10 @@ table {
flex-direction: row;
}

/* for full-size displays we switch to a grid system, as it gives us alignment between multiple rows */
.result-panel {
flex-direction: row;
justify-content: space-between;
gap: 0.75rem;

div {
flex: 1 0 100px;
}
display: grid;
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
gap: 6px;
}
}
7 changes: 3 additions & 4 deletions app/assets/stylesheets/search_results.css
Original file line number Diff line number Diff line change
Expand Up @@ -176,10 +176,9 @@
padding: 4px 0;

.row {
margin: 12px 0;

.result-panel {
display: flex;
.item-details {
padding-top: 3px;
padding-bottom: 3px;
}
}

Expand Down
3 changes: 2 additions & 1 deletion app/helpers/application_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ module ApplicationHelper
include ActiveSupport::NumberHelper

# ## We set the date display format.
DATE_DISPLAY_FORMAT = '%A, %e %B %Y'
DATE_FORMAT_WITH_DAY = '%A, %e %B %Y'
DATE_FORMAT_WITHOUT_DAY = '%e %B %Y'

def format_html(html, truncate_words)
if truncate_words == false
Expand Down
10 changes: 9 additions & 1 deletion app/helpers/date_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@ def format_date(data)

return if data[:value].blank?

data[:value].to_date.strftime(ApplicationHelper::DATE_DISPLAY_FORMAT)
data[:value].to_date.strftime(ApplicationHelper::DATE_FORMAT_WITH_DAY)
end

def format_date_without_day(data)
return unless data

return if data[:value].blank?

data[:value].to_date.strftime(ApplicationHelper::DATE_FORMAT_WITHOUT_DAY)
end
end
4 changes: 2 additions & 2 deletions app/views/search/fragments/_edm_amendments.haml
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@
%span= "It has been signed by "
%span= amendment[:number_of_signatures][:value]
- if amendment[:number_of_signatures][:value] == 1
%span>= " Member in total"
%span>= " member in total"
- else
%span>= " Members in total"
%span>= " members in total"
%span= "."

.content-text
Expand Down
4 changes: 2 additions & 2 deletions app/views/search/preliminary_sentences/_edm.haml
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@
%strong= "signed by "
%strong= object.number_of_signatures[:value]
- if object.number_of_signatures[:value] == 1
%strong>= " Member in total"
%strong>= " member in total"
- else
%strong>= " Members in total"
%strong>= " members in total"
- unless object.subtype.blank? && object.number_of_signatures.blank?
%span= "."
- if object.withdrawn?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
%span= " in the "
%span>= render 'search/fragments/list', items: object.legislature, terminator: '', singular: false
%span>= "."
%span>= " The Member has subsequently withdrawn this question"
%span>= " The member has subsequently withdrawn this question"
- if object.department.blank?
%span>= " and it no longer needs to be answered"
- else
Expand Down
84 changes: 11 additions & 73 deletions app/views/search/results/_bill.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -5,94 +5,32 @@

<div class="row">
<div class="result-panel">
<div class="left" id="primary-person">
<div id="primary-person">
<%= render 'search/results/item_details/member', member: object.member, member_party: object.member_parties %>
</div>
<div class="centre" id="secondary-person">
<div id="secondary-person">
</div>
<div class="right" id="primary-group">
<div id="primary-group">
<%= render 'search/results/item_details/departments', departments: object.departments, hide_label: false %>
</div>
</div>
</div>

<div class="row">
<div class="result-panel">
<div class="left" id="type">
<div id="type">
<%= render 'search/results/item_details/type', type: object.object_name %>
</div>
<div class="centre" id="status">
<div id="status">

</div>
<div class="right" id="secondary-group">
<div id="secondary-group">

</div>
</div>
</div>

<div <%= 'hidden' unless params[:show_detailed] == "true" %> class="row" id="detailed-view" data-detailed-results-target="toggleHidden">

<!-- <div class="row">-->
<!-- <div class="result-panel">-->
<!-- <div class="left" id="legislative-stage">-->

<!-- </div>-->
<!-- <div class="right" id="procedure">-->

<!-- </div>-->
<!-- </div>-->
<!-- </div>-->

<!-- <div class="row">-->
<!-- <div class="result-panel">-->
<!-- <div class="left-outer" id="specific-date-1">-->

<!-- </div>-->
<!-- <div class="left-inner" id="specific-date-2">-->

<!-- </div>-->
<!-- <div class="right-inner" id="specific-date-3">-->

<!-- </div>-->
<!-- <div class="right-outer" id="specific-date-4">-->

<!-- </div>-->
<!-- </div>-->
<!-- </div>-->

<!-- <div class="row">-->
<!-- <div id="coming-into-force">-->

<!-- </div>-->
<!-- </div>-->

<!-- <div class="row">-->
<!-- <div id="supplementary-content">-->

<!-- </div>-->
<!-- </div>-->

<!-- <div class="row">-->
<!-- <div id="corrected">-->

<!-- </div>-->
<!-- </div>-->

<%# unless object.amendments.blank? %>
<%# object.amendments.each do |amendment| %>
<!-- <div class="row">-->
<!-- <div class="result-panel">-->
<!-- <div class="left" id="amending-member">-->

<!-- </div>-->
<!-- <div class="right" id="amendment-date">-->

<!-- </div>-->
<!-- </div>-->
<!-- </div>-->
<%# 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? %>
Expand All @@ -101,10 +39,10 @@

<div class="row">
<div class="result-panel">
<div class="left" id="commons-library-location">
<div id="commons-library-location">
<%= render 'search/results/item_details/commons_library_location', location: object.commons_library_location unless object.commons_library_location.blank? %>
</div>
<div class="right" id="lords-library-location">
<div id="lords-library-location">
<%= render 'search/results/item_details/lords_library_location', location: object.lords_library_location unless object.lords_library_location.blank? %>
</div>
</div>
Expand All @@ -114,13 +52,13 @@

<div class="row">
<div class="result-panel">
<div class="left" id="significant-date">
<div id="significant-date">
<%= render 'search/results/item_details/date', date: object.standard_date %>
</div>
<div class="centre" id="reference">
<div id="reference">
<%= render 'search/results/item_details/reference', reference: object.standard_reference %>
</div>
<div class="right" id="house">
<div id="house">
<%= render 'search/results/item_details/legislature', legislature: object.legislature %>
</div>
</div>
Expand Down
35 changes: 16 additions & 19 deletions app/views/search/results/_church_of_england_measure.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@

<div class="row">
<div class="result-panel">
<div class="left" id="type">
<div id="type">
<%= render 'search/results/item_details/type', type: object.object_name %>
</div>
<div class="centre" id="status">
<div id="status">

</div>
<div class="right" id="secondary-group">
<div id="secondary-group">

</div>
</div>
Expand All @@ -21,27 +21,27 @@

<div class="row">
<div class="result-panel">
<div class="left" id="legislative-stage">
<div id="legislative-stage">

</div>
<div class="right" id="procedure">
<div id="procedure">

</div>
</div>
</div>

<div class="row">
<div class="result-panel">
<div class="left-outer" id="specific-date-1">
<div id="specific-date-1">

</div>
<div class="left-inner" id="specific-date-2">
<div id="specific-date-2">

</div>
<div class="right-inner" id="specific-date-3">
<div id="specific-date-3">

</div>
<div class="right-outer" id="specific-date-4">
<div id="specific-date-4">

</div>
</div>
Expand Down Expand Up @@ -69,10 +69,10 @@
<% object.amendments.each do |amendment| %>
<div class="row">
<div class="result-panel">
<div class="left" id="amending-member">
<div id="amending-member">

</div>
<div class="right" id="amendment-date">
<div id="amendment-date">

</div>
</div>
Expand All @@ -81,17 +81,15 @@
<% 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? %>

<div class="row">
<div class="result-panel">
<div class="left" id="commons-library-location">
<div id="commons-library-location">
<%= render 'search/results/item_details/commons_library_location', location: object.commons_library_location unless object.commons_library_location.blank? %>
</div>
<div class="right" id="lords-library-location">
<div id="lords-library-location">
<%= render 'search/results/item_details/lords_library_location', location: object.lords_library_location unless object.lords_library_location.blank? %>
</div>
</div>
Expand All @@ -101,14 +99,13 @@

<div class="row">
<div class="result-panel">
<div class="left" id="significant-date">
<div id="significant-date">
<%= render 'search/results/item_details/date', date: object.standard_date %>
</div>
<div class="centre" id="reference">
<div id="reference">
<%= render 'search/results/item_details/reference', reference: object.standard_reference %>
</div>
<div class="right" id="house">
<%#= render 'search/results/item_details/legislature', legislature: object.legislature %>
<div id="house">
</div>
</div>
</div>
Expand Down
Loading

0 comments on commit aa68337

Please sign in to comment.