Skip to content

Commit

Permalink
Merge pull request #197 from ukparliament/development
Browse files Browse the repository at this point in the history
Development merge
  • Loading branch information
j-corry authored Nov 29, 2024
2 parents d304f53 + b8d0330 commit 7f27f09
Show file tree
Hide file tree
Showing 46 changed files with 137 additions and 124 deletions.
3 changes: 1 addition & 2 deletions app/assets/stylesheets/primary.css
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ div.callout {

/* Object view sections */

#about-this-result {
.object-claw {
border: 1px solid black;
padding: 16px;

Expand Down Expand Up @@ -409,7 +409,6 @@ table {
padding: 4px 8px;
cursor: pointer;
font-size: small;
/*width: 250px;*/

&:hover {
background: #f1f1f1;
Expand Down
19 changes: 19 additions & 0 deletions app/assets/stylesheets/search_results.css
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,25 @@
}
}

.results-claw {
font-size: smaller;

div.grid-container {
display: grid;
grid-template-columns: auto auto auto auto auto;
grid-template-rows: auto;
padding: 0;
margin-top: 4px;
column-gap: 12px;
row-gap: 12px;

span {
align-content: center;
word-wrap: anywhere;
}
}
}

#search-results {
width: 100%;

Expand Down
11 changes: 7 additions & 4 deletions app/javascript/controllers/claw_controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,12 @@ export default class extends Controller {
}

showClaw() {
const element = document.querySelector("#about-this-result");
if (element) {
element.toggleAttribute("hidden");
}
const all_elements = Array.from(document.getElementsByClassName('claw'));

all_elements.forEach(
element => {
element.toggleAttribute("hidden");
}
)
}
}
2 changes: 1 addition & 1 deletion app/views/search/fragments/_about_this_result.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<section hidden data-controller="claw" data-action="keydown@document->claw#handleKeyDown" id="about-this-result">
<section hidden data-controller="claw" data-action="keydown@document->claw#handleKeyDown" id="about-this-result" class="object-claw claw">
<div class="content-heading-small">Librarians' tools</div>
<div class="claw-grid-container">
<% unless object.date.blank? %>
Expand Down
30 changes: 30 additions & 0 deletions app/views/search/fragments/_search_claw.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<div hidden class="results-claw claw">
<div class="grid-container">
<% unless object.timestamp.blank? %>
<span class="claw-timestamp"><%= object.timestamp[:value] %></span>
<% end %>
<% unless object.object_uri.blank? %>
<span class="claw-uri"><%= object.object_uri[:value] %></span>
<% end %>
<% unless object.object_uri.blank? %>
<span data-controller="clipboard" class="mini-button-container">
<span hidden data-clipboard-target="source" data-clipboard-text="<%= object.object_uri.dig(:value) %>"></span>
<button data-action="clipboard#copy" title="Copy" class="page-button">
Copy
</button>
</span>
<% end %>
<% unless object.indexing_link.blank? %>
<span class="mini-button-container">
<%= link_to 'Indexing', object.indexing_link, target: :_blank, class: 'page-button' %>
</span>
<% end %>
<% unless object.solr_deep_link.blank? %>
<span class="mini-button-container">
<%= link_to 'Solr', object.solr_deep_link, target: :_blank, class: 'page-button' %>
</span>
<% end %>
</div>
</div>
4 changes: 3 additions & 1 deletion app/views/search/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,11 @@
<div class="results-container">
<%= render 'search_control_panel' %>

<div>
<div data-controller="claw" data-action="keydown@document->claw#handleKeyDown">
<% @search_data.objects.each do |object| %>
<%= render object.search_result_partial, object: object unless object.class == NotSupported %>
<%= render 'search/fragments/search_claw', object: object %>
<hr>
<% end %>
<% unless @search_data.current_page.blank? || @search_data.total_pages.blank? %>
Expand Down
13 changes: 5 additions & 8 deletions app/views/search/preliminary_sentences/_edm.haml
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,13 @@
.content-prelim-text#prelim-text
%span>= object_display_name_link(object.object_name)
- unless object.primary_sponsor.blank?
%span=" tabled by "
%span=" tabled by primary sponsor "
%span>= search_link(object.primary_sponsor)
- if object.primary_sponsor_party.blank?
%span= " (primary sponsor)"
- else
%span= " (primary sponsor, "
- unless object.primary_sponsor_party.blank?
%span= " ("
%span>= render 'search/fragments/list', items: object.primary_sponsor_party, terminator: '', singular: false
%span= ")"
%span= " and "
%span= " tabled on "
%span>= ")"
%span= ", on "
%span>= format_date(object.date_tabled)
%span= ", in the "
%span= render 'search/fragments/list', items: object.legislature, terminator: '.', singular: false
Expand Down
3 changes: 1 addition & 2 deletions app/views/search/results/_bill.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -64,5 +64,4 @@
</div>
</div>
</div>
</section>
<hr/>
</section>
3 changes: 1 addition & 2 deletions app/views/search/results/_church_of_england_measure.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,4 @@
</div>
</div>
</div>
</section>
<hr/>
</section>
3 changes: 1 addition & 2 deletions app/views/search/results/_command_paper.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -100,5 +100,4 @@
</div>
</div>
</div>
</div>
<hr/>
</div>
3 changes: 1 addition & 2 deletions app/views/search/results/_committee_proceeding.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -69,5 +69,4 @@
</div>
</div>
</div>
</div>
<hr/>
</div>
3 changes: 1 addition & 2 deletions app/views/search/results/_deposited_paper.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -82,5 +82,4 @@
</div>
</div>
</div>
</div>
<hr/>
</div>
3 changes: 1 addition & 2 deletions app/views/search/results/_early_day_motion.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -66,5 +66,4 @@
</div>
</div>
</div>
</div>
<hr/>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,4 @@
</div>
</div>
</div>
</div>
<hr/>
</div>
3 changes: 1 addition & 2 deletions app/views/search/results/_european_material.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,4 @@
</div>
</div>
</div>
</div>
<hr/>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,4 @@
</div>
</div>
</div>
</div>
<hr/>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,4 @@
<div id="house"></div>
</div>
</div>
</div>
<hr/>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,4 @@
<div id="house"></div>
</div>
</div>
</div>
<hr/>
</div>
3 changes: 1 addition & 2 deletions app/views/search/results/_formal_proceeding.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -64,5 +64,4 @@
</div>
</div>
</div>
</div>
<hr/>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -66,5 +66,4 @@
</div>
</div>
</div>
</div>
<hr/>
</div>
3 changes: 1 addition & 2 deletions app/views/search/results/_house_of_commons_paper.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -90,5 +90,4 @@
</div>
</div>
</div>
</div>
<hr/>
</div>
3 changes: 1 addition & 2 deletions app/views/search/results/_impact_assessment.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -64,5 +64,4 @@
</div>
</div>
</div>
</div>
<hr/>
</div>
3 changes: 1 addition & 2 deletions app/views/search/results/_ministerial_correction.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,4 @@
</div>
</div>
</div>
</div>
<hr/>
</div>
3 changes: 1 addition & 2 deletions app/views/search/results/_observation_on_a_petition.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -68,5 +68,4 @@
</div>
</div>
</div>
</div>
<hr/>
</div>
3 changes: 1 addition & 2 deletions app/views/search/results/_oral_answer_to_question.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -75,5 +75,4 @@
</div>
</div>
</div>
</div>
<hr/>
</div>
3 changes: 1 addition & 2 deletions app/views/search/results/_oral_question.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -94,5 +94,4 @@
</div>
</div>
</div>
</div>
<hr/>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -63,5 +63,4 @@
</div>
</div>
</div>
</div>
<hr/>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -89,5 +89,4 @@
</div>
</div>
</div>
</div>
<hr/>
</div>
3 changes: 1 addition & 2 deletions app/views/search/results/_paper_petition.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,4 @@
</div>
</div>
</div>
</div>
<hr/>
</div>
3 changes: 1 addition & 2 deletions app/views/search/results/_parliamentary_committee.erb
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,4 @@
</div>
</div>
</div>
</div>
<hr/>
</div>
3 changes: 1 addition & 2 deletions app/views/search/results/_parliamentary_paper_laid.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -90,5 +90,4 @@
</div>
</div>
</div>
</div>
<hr/>
</div>
3 changes: 1 addition & 2 deletions app/views/search/results/_parliamentary_proceeding.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -68,5 +68,4 @@
</div>
</div>
</div>
</div>
<hr/>
</div>
3 changes: 1 addition & 2 deletions app/views/search/results/_private_act.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,4 @@
</div>
</div>
</div>
</div>
<hr/>
</div>
3 changes: 1 addition & 2 deletions app/views/search/results/_proceeding_contribution.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -63,5 +63,4 @@
</div>
</div>
</div>
</div>
<hr/>
</div>
3 changes: 1 addition & 2 deletions app/views/search/results/_public_act.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,4 @@
</div>
</div>
</div>
</div>
<hr/>
</div>
3 changes: 1 addition & 2 deletions app/views/search/results/_research_briefing.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,4 @@
</div>
</div>
</div>
</div>
<hr/>
</div>
Loading

0 comments on commit 7f27f09

Please sign in to comment.