Skip to content

Commit

Permalink
Merge pull request #9663 from alphagov/content-modelling/732-homepage…
Browse files Browse the repository at this point in the history
…-content

Content modelling/732 homepage content
  • Loading branch information
Harriethw authored Nov 28, 2024
2 parents 5e9bf71 + 707bdb7 commit aeef421
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 21 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@import "components/filter-options-component";
@import "components/host-editions-table-component";
@import "components/timeline-component";

@import "views/content_block_manager_header";
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.content-block-manager-header {
display: flex;
@include govuk-responsive-margin(8, "bottom");

&--column-right {
display: flex;
align-self: center;
justify-content: flex-end;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ def items
title_item,
*details_items,
organisation_item,
(instructions_item if content_block_document.latest_edition.instructions_to_publishers.present?),
last_updated_item,
(instructions_item if content_block_document.latest_edition.instructions_to_publishers.present?),
embed_code_item,
].compact
end
Expand All @@ -29,7 +29,7 @@ def title
def summary_card_actions
[
{
label: "View/edit",
label: "View",
href: helpers.content_block_manager.content_block_manager_content_block_document_path(content_block_document),
},
]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,23 +1,27 @@
<% content_for :title, product_name %>

<% content_for :title_margin_bottom, 6 %>

<div class="govuk-grid-row govuk-!-margin-bottom-8">
<div class="govuk-grid-column-full">
<p class="govuk-body">If you need any support or want to delete a content block, you can raise a support request.</p>
<span class="govuk-!-margin-right-2">
<%= render "govuk_publishing_components/components/button", {
text: "Create new object",
href: content_block_manager.new_content_block_manager_content_block_document_path,
} %>
</span>
<span>
<%= render "govuk_publishing_components/components/button", {
text: "Raise a support request",
href: support_url,
secondary_solid: true,
} %>
</span>
</div>
<div class="govuk-grid-row content-block-manager-header">
<div class="govuk-grid-column-one-half">
<h1 class="gem-c-title__text govuk-heading-xl">
Content Block Manager
</h1>
</div>
<div class="govuk-grid-column-one-half content-block-manager-header--column-right">
<div>
<span class="govuk-!-margin-right-2">
<%= render "govuk_publishing_components/components/button", {
text: "Create content block",
href: content_block_manager.new_content_block_manager_content_block_document_path,
} %>
</span>
<%= render "govuk_publishing_components/components/button", {
text: "Raise a support request",
href: support_url,
secondary_solid: true,
} %>
</div>
</div>
</div>

<div class="govuk-grid-row">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
end

When("I click to create an object") do
click_link "Create new object"
click_link "Create content block"
end

When("I click cancel") do
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ class ContentBlockManager::ContentBlock::Document::Index::SummaryCardComponentTe
assert_selector ".govuk-summary-card__action", count: 1
assert_selector ".govuk-summary-card__action .govuk-link[href='#{content_block_manager_content_block_document_path(content_block_document)}']"

assert_selector ".govuk-link", text: "View"

assert_selector ".govuk-summary-list__row", count: 6

assert_selector ".govuk-summary-list__key", text: "Title"
Expand Down

0 comments on commit aeef421

Please sign in to comment.