Skip to content

Commit

Permalink
Merge pull request #397 from alphagov/dh-106-update-header-to-make-it…
Browse files Browse the repository at this point in the history
…-easier-to-find-support-guidance-and-where-to-log-in

Update header to make it easier to find support, guidance and where to log in
  • Loading branch information
DilwoarH authored Feb 15, 2018
2 parents a259903 + 5524e15 commit 62e640e
Show file tree
Hide file tree
Showing 5 changed files with 125 additions and 18 deletions.
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
- 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

0 comments on commit 62e640e

Please sign in to comment.