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 header to make it easier to find support, guidance and where to log in #397

Merged
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
23 changes: 23 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,29 @@

Records breaking changes from major version bumps

## 28.0.0

PR: [#397](https://github.com/alphagov/digitalmarketplace-frontend-toolkit/pull/397)

### What changed

- Changes existing header to product page style header.
- Product page Github: https://github.com/alphagov/product-page-example
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we have in here what changes someone would need to make to a frontend app to bring this new version of the toolkit in? As in, I assume if one of the FE apps just bumped to this toolkit version without any other changes then things would break/look wrong?

E.g. mention the changes that you are currently having to make in the buyer FE.
For example does the FE need a certain version of utils pulled in?
Removal of phase banner
Adding of inside-header block
That type of stuff

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have updated the instructions below

- To get this working on a frontend application, do the following:
- in _base_page.html:
- Remove:
```python
{% include "toolkit/phase-banner.html" %}
```
- Add:
```python
{% block inside_header %}
{% include "toolkit/inside-header.html" %}
{% endblock %}
```
- Update the frontend toolkit to version 28.0.0
- Update the dmutils module to version 33.0.1 and above

## 27.0.0

PR: [#395](https://github.com/alphagov/digitalmarketplace-frontend-toolkit/pull/395)
Expand Down
2 changes: 1 addition & 1 deletion VERSION.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
27.4.0
28.0.0
68 changes: 68 additions & 0 deletions toolkit/scss/_proposition-header.scss
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,71 @@
.logout-button:hover {
text-decoration: underline;
}

#global-header.with-proposition {
.header-wrapper {
.header-global {
@media only screen and (min-width: 769px) {
width: 60%;
}

.header-logo {
width: auto;
}

.header-title {
float: left;
font-family: $toolkit-font-stack;
font-weight: normal;
padding-top: 7px;
font-size: 24px;

@media only screen and (max-width: 800px) {
padding-left: 15px;
}

@media only screen and (min-width: 473px) and (max-width: 769px) {
padding-left: 0px;
}

a {
color: $white;
text-decoration: none;
}

&:hover {
text-decoration: underline;
}
}

.phase-tag {
margin-left: 10px;
margin-top: 4px;
vertical-align: top;
}
}

.header-proposition {
text-align: right;

@media only screen and (min-width: 769px) {
width: 40%;
}

#proposition-links {
float: right;

li {
@media only screen and (max-width: 769px) {
text-align: left;
width: 100%;
}
}

@media only screen and (max-width: 769px) {
float: none;
}
}
}
}
}
4 changes: 4 additions & 0 deletions toolkit/templates/inside-header.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<div class="header-title">
<a href="/">Digital Marketplace</a>
<strong class="phase-tag">BETA</strong>
</div>
46 changes: 29 additions & 17 deletions toolkit/templates/proposition-header.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,37 @@
<div class="content">
<a href="#proposition-links" class="js-header-toggle menu">Menu</a>
<nav id="proposition-menu">
<a href="/" id="proposition-name">Digital Marketplace</a>
<ul id="proposition-links">
{% if (current_user.is_authenticated() if logged_in is not defined else logged_in) %}
{% if (role or current_user.role) == 'buyer' %}
<li><a href="/buyers">View your account</a></li>
{% elif (role or current_user.role) == 'supplier' %}
<li><a href="/suppliers">View your account</a></li>
{% endif %}
{% for item in items %}
<li><a href="{{ item.link }}">{{ item.label }}</a></li>
{% endfor %}
<li>
<form method="post" action="/user/logout">
<input type="submit" class="logout-button" value="Log out" />
<input type="hidden" name="csrf_token" value="{{ csrf_token_value or csrf_token() }}" />
</form>
</li>
<li>
<a href="https://www.gov.uk/government/collections/digital-marketplace-buyers-and-suppliers-information">Guidance</a>
</li>
<li>
<a href="{{ url_for('external.help') }}">Help</a>
</li>
{% if (current_user.is_authenticated() if logged_in is not defined else logged_in) %} {% if (role or current_user.role) == 'buyer' %}
<li>
<a href="{{ url_for('external.buyer_dashboard') }}">View your account</a>
</li>
{% elif (role or current_user.role) == 'supplier' %}
<li>
<a href="{{ url_for('external.supplier_dashboard') }}">View your account</a>
</li>
{% endif %}
{% for item in items %}
<li>
<a href="{{ item.link }}">{{ item.label }}</a>
</li>
{% endfor %}
<li>
<form method="post" action="{{ url_for('external.user_logout') }}">
<input type="submit" class="logout-button" value="Log out" />
<input type="hidden" name="csrf_token" value="{{ csrf_token_value or csrf_token() }}" />
</form>
</li>
{% else %}
<li><a href="/user/login">Log in</a></li>
<li>
<a href="{{ url_for('external.render_login') }}">Log in</a>
</li>
{% endif %}
</ul>
</nav>
Expand Down