From afb8c2992da7a664d7042cf8d9ad3588a186f1d5 Mon Sep 17 00:00:00 2001 From: j-corry Date: Fri, 29 Nov 2024 17:12:55 +0000 Subject: [PATCH] - Add claw row to every search result --- app/assets/stylesheets/primary.css | 3 +-- app/assets/stylesheets/search_results.css | 19 ++++++++++++++ app/javascript/controllers/claw_controller.js | 11 +++++--- .../fragments/_about_this_result.html.erb | 2 +- .../search/fragments/_search_claw.html.erb | 26 +++++++++++++++++++ app/views/search/index.html.erb | 4 ++- app/views/search/results/_bill.html.erb | 3 +-- .../_church_of_england_measure.html.erb | 3 +-- .../search/results/_command_paper.html.erb | 3 +-- .../results/_committee_proceeding.html.erb | 3 +-- .../search/results/_deposited_paper.html.erb | 3 +-- .../search/results/_early_day_motion.html.erb | 3 +-- .../_european_deposited_document.html.erb | 3 +-- .../results/_european_material.html.erb | 3 +-- ...n_scrutiny_explanatory_memorandum.html.erb | 3 +-- ...rutiny_ministerial_correspondence.html.erb | 3 +-- ..._european_scrutiny_recommendation.html.erb | 3 +-- .../results/_formal_proceeding.html.erb | 3 +-- .../_grand_committee_proceeding.html.erb | 3 +-- .../results/_house_of_commons_paper.html.erb | 3 +-- .../results/_impact_assessment.html.erb | 3 +-- .../results/_ministerial_correction.html.erb | 3 +-- .../_observation_on_a_petition.html.erb | 3 +-- .../results/_oral_answer_to_question.html.erb | 3 +-- .../search/results/_oral_question.html.erb | 3 +-- .../_oral_question_time_intervention.html.erb | 3 +-- .../_paper_ordered_to_be_printed.html.erb | 3 +-- .../search/results/_paper_petition.html.erb | 3 +-- .../results/_parliamentary_committee.erb | 3 +-- .../_parliamentary_paper_laid.html.erb | 3 +-- .../_parliamentary_proceeding.html.erb | 3 +-- .../search/results/_private_act.html.erb | 3 +-- .../results/_proceeding_contribution.html.erb | 3 +-- app/views/search/results/_public_act.html.erb | 3 +-- .../results/_research_briefing.html.erb | 3 +-- .../results/_research_material.html.erb | 3 +-- .../results/_statutory_instrument.html.erb | 3 +-- app/views/search/results/_template.html.erb | 3 +-- ...t_and_works_act_order_application.html.erb | 3 +-- .../results/_unprinted_command_paper.html.erb | 3 +-- .../search/results/_unprinted_paper.html.erb | 3 +-- .../search/results/_written_question.html.erb | 3 +-- .../results/_written_statement.html.erb | 3 +-- 43 files changed, 94 insertions(+), 82 deletions(-) create mode 100644 app/views/search/fragments/_search_claw.html.erb diff --git a/app/assets/stylesheets/primary.css b/app/assets/stylesheets/primary.css index c68b2114..aff064ea 100644 --- a/app/assets/stylesheets/primary.css +++ b/app/assets/stylesheets/primary.css @@ -166,7 +166,7 @@ div.callout { /* Object view sections */ -#about-this-result { +.object-claw { border: 1px solid black; padding: 16px; @@ -409,7 +409,6 @@ table { padding: 4px 8px; cursor: pointer; font-size: small; - /*width: 250px;*/ &:hover { background: #f1f1f1; diff --git a/app/assets/stylesheets/search_results.css b/app/assets/stylesheets/search_results.css index baa66604..0ec309b2 100644 --- a/app/assets/stylesheets/search_results.css +++ b/app/assets/stylesheets/search_results.css @@ -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%; diff --git a/app/javascript/controllers/claw_controller.js b/app/javascript/controllers/claw_controller.js index 2dd9b63b..0bb73af3 100644 --- a/app/javascript/controllers/claw_controller.js +++ b/app/javascript/controllers/claw_controller.js @@ -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"); + } + ) } } diff --git a/app/views/search/fragments/_about_this_result.html.erb b/app/views/search/fragments/_about_this_result.html.erb index 150e0cf1..eac2b161 100644 --- a/app/views/search/fragments/_about_this_result.html.erb +++ b/app/views/search/fragments/_about_this_result.html.erb @@ -1,4 +1,4 @@ - \ No newline at end of file diff --git a/app/views/search/results/_church_of_england_measure.html.erb b/app/views/search/results/_church_of_england_measure.html.erb index a74a8a6b..7b6fa785 100644 --- a/app/views/search/results/_church_of_england_measure.html.erb +++ b/app/views/search/results/_church_of_england_measure.html.erb @@ -47,5 +47,4 @@ - -
\ No newline at end of file + \ No newline at end of file diff --git a/app/views/search/results/_command_paper.html.erb b/app/views/search/results/_command_paper.html.erb index e1a441be..c2d74c0e 100644 --- a/app/views/search/results/_command_paper.html.erb +++ b/app/views/search/results/_command_paper.html.erb @@ -100,5 +100,4 @@ - -
\ No newline at end of file + \ No newline at end of file diff --git a/app/views/search/results/_committee_proceeding.html.erb b/app/views/search/results/_committee_proceeding.html.erb index 29e246b7..9b8d945f 100644 --- a/app/views/search/results/_committee_proceeding.html.erb +++ b/app/views/search/results/_committee_proceeding.html.erb @@ -69,5 +69,4 @@ - -
\ No newline at end of file + \ No newline at end of file diff --git a/app/views/search/results/_deposited_paper.html.erb b/app/views/search/results/_deposited_paper.html.erb index e122be43..b67562fc 100644 --- a/app/views/search/results/_deposited_paper.html.erb +++ b/app/views/search/results/_deposited_paper.html.erb @@ -82,5 +82,4 @@ - -
\ No newline at end of file + \ No newline at end of file diff --git a/app/views/search/results/_early_day_motion.html.erb b/app/views/search/results/_early_day_motion.html.erb index e76b4c1d..fd6dde5f 100644 --- a/app/views/search/results/_early_day_motion.html.erb +++ b/app/views/search/results/_early_day_motion.html.erb @@ -66,5 +66,4 @@ - -
\ No newline at end of file + \ No newline at end of file diff --git a/app/views/search/results/_european_deposited_document.html.erb b/app/views/search/results/_european_deposited_document.html.erb index 369a7421..bab1be0a 100644 --- a/app/views/search/results/_european_deposited_document.html.erb +++ b/app/views/search/results/_european_deposited_document.html.erb @@ -54,5 +54,4 @@ - -
\ No newline at end of file + \ No newline at end of file diff --git a/app/views/search/results/_european_material.html.erb b/app/views/search/results/_european_material.html.erb index 24b92b67..55167e07 100644 --- a/app/views/search/results/_european_material.html.erb +++ b/app/views/search/results/_european_material.html.erb @@ -45,5 +45,4 @@ - -
\ No newline at end of file + \ No newline at end of file diff --git a/app/views/search/results/_european_scrutiny_explanatory_memorandum.html.erb b/app/views/search/results/_european_scrutiny_explanatory_memorandum.html.erb index fa2406de..2bd3888f 100644 --- a/app/views/search/results/_european_scrutiny_explanatory_memorandum.html.erb +++ b/app/views/search/results/_european_scrutiny_explanatory_memorandum.html.erb @@ -40,5 +40,4 @@ - -
\ No newline at end of file + \ No newline at end of file diff --git a/app/views/search/results/_european_scrutiny_ministerial_correspondence.html.erb b/app/views/search/results/_european_scrutiny_ministerial_correspondence.html.erb index b7a1e564..4657db40 100644 --- a/app/views/search/results/_european_scrutiny_ministerial_correspondence.html.erb +++ b/app/views/search/results/_european_scrutiny_ministerial_correspondence.html.erb @@ -40,5 +40,4 @@
- -
\ No newline at end of file + \ No newline at end of file diff --git a/app/views/search/results/_european_scrutiny_recommendation.html.erb b/app/views/search/results/_european_scrutiny_recommendation.html.erb index 24c0b3f6..714e951b 100644 --- a/app/views/search/results/_european_scrutiny_recommendation.html.erb +++ b/app/views/search/results/_european_scrutiny_recommendation.html.erb @@ -39,5 +39,4 @@
- -
\ No newline at end of file + \ No newline at end of file diff --git a/app/views/search/results/_formal_proceeding.html.erb b/app/views/search/results/_formal_proceeding.html.erb index 9929feca..de2dbeb0 100644 --- a/app/views/search/results/_formal_proceeding.html.erb +++ b/app/views/search/results/_formal_proceeding.html.erb @@ -64,5 +64,4 @@ - -
\ No newline at end of file + \ No newline at end of file diff --git a/app/views/search/results/_grand_committee_proceeding.html.erb b/app/views/search/results/_grand_committee_proceeding.html.erb index 65edb1fb..265ff8de 100644 --- a/app/views/search/results/_grand_committee_proceeding.html.erb +++ b/app/views/search/results/_grand_committee_proceeding.html.erb @@ -66,5 +66,4 @@ - -
\ No newline at end of file + \ No newline at end of file diff --git a/app/views/search/results/_house_of_commons_paper.html.erb b/app/views/search/results/_house_of_commons_paper.html.erb index 9feee014..e8840952 100644 --- a/app/views/search/results/_house_of_commons_paper.html.erb +++ b/app/views/search/results/_house_of_commons_paper.html.erb @@ -90,5 +90,4 @@ - -
\ No newline at end of file + \ No newline at end of file diff --git a/app/views/search/results/_impact_assessment.html.erb b/app/views/search/results/_impact_assessment.html.erb index d31ee4f0..73d0e3de 100644 --- a/app/views/search/results/_impact_assessment.html.erb +++ b/app/views/search/results/_impact_assessment.html.erb @@ -64,5 +64,4 @@ - -
\ No newline at end of file + \ No newline at end of file diff --git a/app/views/search/results/_ministerial_correction.html.erb b/app/views/search/results/_ministerial_correction.html.erb index b496e979..b052bb60 100644 --- a/app/views/search/results/_ministerial_correction.html.erb +++ b/app/views/search/results/_ministerial_correction.html.erb @@ -52,5 +52,4 @@ - -
\ No newline at end of file + \ No newline at end of file diff --git a/app/views/search/results/_observation_on_a_petition.html.erb b/app/views/search/results/_observation_on_a_petition.html.erb index 2b93750c..5ecc541f 100644 --- a/app/views/search/results/_observation_on_a_petition.html.erb +++ b/app/views/search/results/_observation_on_a_petition.html.erb @@ -68,5 +68,4 @@ - -
\ No newline at end of file + \ No newline at end of file diff --git a/app/views/search/results/_oral_answer_to_question.html.erb b/app/views/search/results/_oral_answer_to_question.html.erb index d8b4c9a3..992c3354 100644 --- a/app/views/search/results/_oral_answer_to_question.html.erb +++ b/app/views/search/results/_oral_answer_to_question.html.erb @@ -75,5 +75,4 @@ - -
\ No newline at end of file + \ No newline at end of file diff --git a/app/views/search/results/_oral_question.html.erb b/app/views/search/results/_oral_question.html.erb index 99f2cd9e..b76f21fd 100644 --- a/app/views/search/results/_oral_question.html.erb +++ b/app/views/search/results/_oral_question.html.erb @@ -94,5 +94,4 @@ - -
\ No newline at end of file + \ No newline at end of file diff --git a/app/views/search/results/_oral_question_time_intervention.html.erb b/app/views/search/results/_oral_question_time_intervention.html.erb index 73da9407..14d0d96f 100644 --- a/app/views/search/results/_oral_question_time_intervention.html.erb +++ b/app/views/search/results/_oral_question_time_intervention.html.erb @@ -63,5 +63,4 @@ - -
\ No newline at end of file + \ No newline at end of file diff --git a/app/views/search/results/_paper_ordered_to_be_printed.html.erb b/app/views/search/results/_paper_ordered_to_be_printed.html.erb index 0f4bdbc8..b447174f 100644 --- a/app/views/search/results/_paper_ordered_to_be_printed.html.erb +++ b/app/views/search/results/_paper_ordered_to_be_printed.html.erb @@ -89,5 +89,4 @@ - -
\ No newline at end of file + \ No newline at end of file diff --git a/app/views/search/results/_paper_petition.html.erb b/app/views/search/results/_paper_petition.html.erb index 2d356b62..002773f9 100644 --- a/app/views/search/results/_paper_petition.html.erb +++ b/app/views/search/results/_paper_petition.html.erb @@ -50,5 +50,4 @@ - -
\ No newline at end of file + \ No newline at end of file diff --git a/app/views/search/results/_parliamentary_committee.erb b/app/views/search/results/_parliamentary_committee.erb index b8fa2a8d..eda0b488 100644 --- a/app/views/search/results/_parliamentary_committee.erb +++ b/app/views/search/results/_parliamentary_committee.erb @@ -52,5 +52,4 @@ - -
\ No newline at end of file + \ No newline at end of file diff --git a/app/views/search/results/_parliamentary_paper_laid.html.erb b/app/views/search/results/_parliamentary_paper_laid.html.erb index 2d5b6362..29591321 100644 --- a/app/views/search/results/_parliamentary_paper_laid.html.erb +++ b/app/views/search/results/_parliamentary_paper_laid.html.erb @@ -90,5 +90,4 @@ - -
\ No newline at end of file + \ No newline at end of file diff --git a/app/views/search/results/_parliamentary_proceeding.html.erb b/app/views/search/results/_parliamentary_proceeding.html.erb index 4a17f17c..909d5180 100644 --- a/app/views/search/results/_parliamentary_proceeding.html.erb +++ b/app/views/search/results/_parliamentary_proceeding.html.erb @@ -68,5 +68,4 @@ - -
\ No newline at end of file + \ No newline at end of file diff --git a/app/views/search/results/_private_act.html.erb b/app/views/search/results/_private_act.html.erb index 53d7adda..91a372f3 100644 --- a/app/views/search/results/_private_act.html.erb +++ b/app/views/search/results/_private_act.html.erb @@ -48,5 +48,4 @@ - -
\ No newline at end of file + \ No newline at end of file diff --git a/app/views/search/results/_proceeding_contribution.html.erb b/app/views/search/results/_proceeding_contribution.html.erb index 73da9407..14d0d96f 100644 --- a/app/views/search/results/_proceeding_contribution.html.erb +++ b/app/views/search/results/_proceeding_contribution.html.erb @@ -63,5 +63,4 @@ - -
\ No newline at end of file + \ No newline at end of file diff --git a/app/views/search/results/_public_act.html.erb b/app/views/search/results/_public_act.html.erb index f0d9af97..8edf6ab5 100644 --- a/app/views/search/results/_public_act.html.erb +++ b/app/views/search/results/_public_act.html.erb @@ -51,5 +51,4 @@ - -
\ No newline at end of file + \ No newline at end of file diff --git a/app/views/search/results/_research_briefing.html.erb b/app/views/search/results/_research_briefing.html.erb index 38675ec7..ecbede99 100644 --- a/app/views/search/results/_research_briefing.html.erb +++ b/app/views/search/results/_research_briefing.html.erb @@ -51,5 +51,4 @@ - -
\ No newline at end of file + \ No newline at end of file diff --git a/app/views/search/results/_research_material.html.erb b/app/views/search/results/_research_material.html.erb index 9789a0bc..85e13334 100644 --- a/app/views/search/results/_research_material.html.erb +++ b/app/views/search/results/_research_material.html.erb @@ -26,5 +26,4 @@ - -
\ No newline at end of file + \ No newline at end of file diff --git a/app/views/search/results/_statutory_instrument.html.erb b/app/views/search/results/_statutory_instrument.html.erb index 978f2271..92f37289 100644 --- a/app/views/search/results/_statutory_instrument.html.erb +++ b/app/views/search/results/_statutory_instrument.html.erb @@ -99,5 +99,4 @@ - -
\ No newline at end of file + \ No newline at end of file diff --git a/app/views/search/results/_template.html.erb b/app/views/search/results/_template.html.erb index 7a390887..499736a1 100644 --- a/app/views/search/results/_template.html.erb +++ b/app/views/search/results/_template.html.erb @@ -127,5 +127,4 @@ - -
\ No newline at end of file + \ No newline at end of file diff --git a/app/views/search/results/_transport_and_works_act_order_application.html.erb b/app/views/search/results/_transport_and_works_act_order_application.html.erb index 7b9801c6..217ca21e 100644 --- a/app/views/search/results/_transport_and_works_act_order_application.html.erb +++ b/app/views/search/results/_transport_and_works_act_order_application.html.erb @@ -63,5 +63,4 @@ - -
\ No newline at end of file + \ No newline at end of file diff --git a/app/views/search/results/_unprinted_command_paper.html.erb b/app/views/search/results/_unprinted_command_paper.html.erb index 4bd96d42..e4e6ef6c 100644 --- a/app/views/search/results/_unprinted_command_paper.html.erb +++ b/app/views/search/results/_unprinted_command_paper.html.erb @@ -94,5 +94,4 @@ - -
\ No newline at end of file + \ No newline at end of file diff --git a/app/views/search/results/_unprinted_paper.html.erb b/app/views/search/results/_unprinted_paper.html.erb index e777c3b4..61e65bb6 100644 --- a/app/views/search/results/_unprinted_paper.html.erb +++ b/app/views/search/results/_unprinted_paper.html.erb @@ -104,5 +104,4 @@ - -
\ No newline at end of file + \ No newline at end of file diff --git a/app/views/search/results/_written_question.html.erb b/app/views/search/results/_written_question.html.erb index 382d0487..ebf38004 100644 --- a/app/views/search/results/_written_question.html.erb +++ b/app/views/search/results/_written_question.html.erb @@ -97,5 +97,4 @@ - -
\ No newline at end of file + \ No newline at end of file diff --git a/app/views/search/results/_written_statement.html.erb b/app/views/search/results/_written_statement.html.erb index da3abf7d..8ee9b780 100644 --- a/app/views/search/results/_written_statement.html.erb +++ b/app/views/search/results/_written_statement.html.erb @@ -52,5 +52,4 @@ - -
\ No newline at end of file + \ No newline at end of file