-
Notifications
You must be signed in to change notification settings - Fork 194
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9588 from alphagov/content-modelling/629-update-s…
…ummary-cards (629) Update summary cards
- Loading branch information
Showing
15 changed files
with
269 additions
and
113 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
...gines/content_block_manager/app/assets/stylesheets/content_block_manager/application.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
@import "components/filter-options-component"; | ||
@import "components/timeline-component"; |
62 changes: 62 additions & 0 deletions
62
...er/app/assets/stylesheets/content_block_manager/components/_filter-options-component.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
.app-c-content-block-manager-filter-options { | ||
.govuk-accordion__section-toggle, | ||
.govuk-accordion__controls .govuk-accordion-nav__chevron { | ||
@include govuk-visually-hidden; | ||
} | ||
|
||
@mixin chevron($dir) { | ||
&:before { | ||
border-style: solid; | ||
border-width: 0.2em 0.2em 0 0; | ||
content: ""; | ||
display: inline-block; | ||
height: 0.45em; | ||
left: 0.15em; | ||
position: relative; | ||
vertical-align: top; | ||
width: 0.45em; | ||
|
||
@include govuk-responsive-margin(3, "right"); | ||
|
||
@if $dir == "down" { | ||
top: 0.2em; | ||
transform: rotate(135deg); | ||
} | ||
|
||
@if $dir == "up" { | ||
top: 0.35em; | ||
transform: rotate(-45deg); | ||
} | ||
} | ||
} | ||
|
||
.govuk-accordion__controls { | ||
.govuk-accordion__show-all { | ||
.govuk-accordion__show-all-text { | ||
@include govuk-font($size: 19, $weight: bold); | ||
color: govuk-colour("black"); | ||
@include chevron("down"); | ||
} | ||
|
||
&[aria-expanded="true"] { | ||
.govuk-accordion__show-all-text { | ||
@include chevron("up"); | ||
} | ||
} | ||
} | ||
} | ||
|
||
.govuk-accordion__section-button { | ||
.govuk-accordion__section-heading-text { | ||
@include govuk-font($size: 19, $weight: bold); | ||
|
||
@include chevron("down"); | ||
} | ||
|
||
&[aria-expanded="true"] { | ||
.govuk-accordion__section-heading-text { | ||
@include chevron("up"); | ||
} | ||
} | ||
} | ||
} |
99 changes: 69 additions & 30 deletions
99
...ents/content_block_manager/content_block/document/index/filter_options_component.html.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,74 @@ | ||
<%= form_with url: helpers.content_block_manager.content_block_manager_content_block_documents_path, method: :get do %> | ||
<%= render "govuk_publishing_components/components/input", { | ||
label: { | ||
text: "Keyword", | ||
bold: true, | ||
}, | ||
hint: 'For example, "driving standards"', | ||
name: "keyword", | ||
id: "keyword_filter", | ||
value: !@filters.nil? && @filters[:keyword], | ||
<%= form_with url: helpers.content_block_manager.content_block_manager_content_block_documents_path, method: :get, class: "app-c-content-block-manager-filter-options" do %> | ||
<%= render "govuk_publishing_components/components/accordion", { | ||
disable_ga4: true, | ||
items: [ | ||
{ | ||
heading: { | ||
text: "Search by keyword", | ||
}, | ||
content: { | ||
html: ( | ||
render "govuk_publishing_components/components/input", { | ||
label: { | ||
text: "Keyword", | ||
bold: true, | ||
}, | ||
hint: 'For example, "driving standards"', | ||
name: "keyword", | ||
id: "keyword_filter", | ||
value: @filters.present? && @filters[:keyword], | ||
} | ||
), | ||
}, | ||
expanded: @filters&.fetch(:keyword, nil).present?, | ||
}, | ||
{ | ||
heading: { | ||
text: "Content block type", | ||
}, | ||
content: { | ||
html: ( | ||
render "govuk_publishing_components/components/checkboxes", { | ||
heading: "Content block type", | ||
visually_hide_heading: true, | ||
heading_size: "s", | ||
no_hint_text: true, | ||
id: "block_type", | ||
name: "block_type[]", | ||
items: items_for_block_type, | ||
} | ||
), | ||
}, | ||
expanded: @filters&.fetch(:block_type, nil).present?, | ||
}, | ||
{ | ||
heading: { | ||
text: "Lead organisation", | ||
}, | ||
content: { | ||
html: ( | ||
render "components/select_with_search", { | ||
id: "lead_organisation", | ||
name: "lead_organisation", | ||
include_blank: false, | ||
options: options_for_lead_organisation, | ||
} | ||
), | ||
}, | ||
expanded: @filters&.fetch(:lead_organisation, nil).present?, | ||
}, | ||
], | ||
} %> | ||
|
||
<%= render "govuk_publishing_components/components/checkboxes", { | ||
heading: "Content block type", | ||
heading_size: "s", | ||
no_hint_text: true, | ||
id: "block_type", | ||
name: "block_type[]", | ||
items: items_for_block_type, | ||
} %> | ||
<div class="govuk-button-group"> | ||
<%= render "govuk_publishing_components/components/button", { | ||
text: "View results", | ||
margin_bottom: 4, | ||
} %> | ||
|
||
<%= render "components/select_with_search", { | ||
id: "lead_organisation", | ||
name: "lead_organisation", | ||
label: "Lead organisation", | ||
heading_size: "s", | ||
include_blank: false, | ||
options: options_for_lead_organisation, | ||
} %> | ||
<%= link_to "Reset all fields", | ||
helpers.content_block_manager.content_block_manager_root_path(reset_fields: true), | ||
class: "govuk-link" %> | ||
</div> | ||
|
||
<%= render "govuk_publishing_components/components/button", { | ||
text: "View results", | ||
margin_bottom: 4, | ||
} %> | ||
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.