Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update site to style the page/sidebar closer to the new styles #706

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion assets/stylesheets/components/_content_page.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
.content_page {
.content_page .primary-content {
padding: var(--space);
background-color: var(--color-background);
border-radius: var(--border-radius);

h1 {
margin-top: 0;
}
}

.ws-content-page__metadata {
Expand Down
16 changes: 8 additions & 8 deletions src/core/templates/dwds_content.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,11 @@
<div class="stack">
{% block pre_content %}
{% endblock pre_content %}
{% block page_title %}
<h1>{{ page.title }}</h1>
{% endblock page_title %}
{% block bookmark %}
{% if FEATURE_FLAGS.new_homepage and page %}
<div class="dwds">{% bookmark_page_input user page %}</div>
{% endif %}
{% endblock bookmark %}
<div class="with-sidebar-right">
<div class="primary-content">
{% block page_title %}
<h1>{{ page.title }}</h1>
{% endblock page_title %}
{% block pre_primary_content %}
{% endblock pre_primary_content %}
{% block primary_content %}
Expand All @@ -32,6 +27,11 @@ <h1>{{ page.title }}</h1>
{% endblock post_primary_content %}
</div>
<div class="secondary-content">
{% block bookmark %}
{% if FEATURE_FLAGS.new_homepage and page %}
{% bookmark_page_input user page %}
{% endif %}
{% endblock bookmark %}
{% block pre_secondary_content %}
{% endblock pre_secondary_content %}
{% block secondary_content %}
Expand Down
45 changes: 30 additions & 15 deletions src/interactions/templates/interactions/bookmark_page_input.html
Original file line number Diff line number Diff line change
@@ -1,15 +1,30 @@
{% if page %}
<button class="bookmark-page-input"
title="{{ is_bookmarked|yesno:'Remove bookmark,Bookmark this page' }}"
data-is-htmx="{{ request.headers.hx_request }}"
hx-post="{{ post_url }}"
hx-vals='{"page_id": {{ page.id }}}'
hx-headers='{"X-CSRFToken": "{{ csrf_token }}"}'
hx-trigger="click"
hx-select="button"
hx-target="this"
hx-swap="outerHTML">
{% include 'dwds/elements/icon.html' with id='bookmark-icon' is_filled=is_bookmarked %}
<span>{{ is_bookmarked|yesno:'Bookmarked,Bookmark' }}</span>
</button>
{% endif %}
{% extends "dwds/elements/extendable/card.html" %}

{% block card_container_classes %}dwds-card-white{% endblock %}

{% block card_header %}
{% endblock card_header %}

{% block card_content_image %}
{% endblock card_content_image %}

{% block card_content_body %}
{% if page %}
<button class="bookmark-page-input"
title="{{ is_bookmarked|yesno:'Remove bookmark,Bookmark this page' }}"
data-is-htmx="{{ request.headers.hx_request }}"
hx-post="{{ post_url }}"
hx-vals='{"page_id": {{ page.id }}}'
hx-headers='{"X-CSRFToken": "{{ csrf_token }}"}'
hx-trigger="click"
hx-select="button"
hx-target="this"
hx-swap="outerHTML">
{% include 'dwds/elements/icon.html' with id='bookmark-icon' is_filled=is_bookmarked %}
<span>{{ is_bookmarked|yesno:'Bookmarked,Bookmark' }}</span>
</button>
{% endif %}
{% endblock card_content_body %}

{% block card_footer %}
{% endblock card_footer %}
10 changes: 10 additions & 0 deletions src/news/templates/news/includes/news_categories_new.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<nav aria-labelledby="news-category-heading">
<h3 id="news-category-heading">All news categories</h3>
<ul>
{% for category in categories %}
<li>
<a href="/news-and-views/category/{{ category.slug }}">{{ category.category }}</a>
</li>
{% endfor %}
</ul>
</nav>
2 changes: 1 addition & 1 deletion src/news/templates/news/news_home_new.html
Original file line number Diff line number Diff line change
Expand Up @@ -61,5 +61,5 @@ <h2 class="govuk-heading-m">
{% endblock primary_content %}

{% block secondary_content %}
{% include "news/includes/news_categories.html" %}
{% include "news/includes/news_categories_new.html" %}
{% endblock secondary_content %}
2 changes: 1 addition & 1 deletion src/news/templates/news/news_page_new.html
Original file line number Diff line number Diff line change
Expand Up @@ -111,5 +111,5 @@ <h2 class="govuk-heading-m">Leave a comment</h2>
{% endblock post_primary_content %}

{% block secondary_content %}
{% include "news/includes/news_categories.html" %}
{% include "news/includes/news_categories_new.html" %}
{% endblock secondary_content %}