Move service and user nav to proposition header

This commit moves user-related navigation into the proposition header (the black
bar) at the top of the site. It adds some custom SASS to override GOV.UK
template and align these navigation items to the right (because it looks
better).

It then removes the service chooser dropdown (and its associated SASS and JS) in
favour of a link alongside the user-related navigation items. ‘Switch service’
is the best language for this that we’ve come up with so far.

This means that the only way of adding a new service is from the `/services`
page. So this commit removes the redirect if you land on this page with only one
service (else it would prevent you from ever being able to add more).
This commit is contained in:
Chris Hill-Scott
2016-02-01 11:26:38 +00:00
parent 674e40d8d4
commit 3617f2e936
12 changed files with 45 additions and 308 deletions

View File

@@ -28,10 +28,26 @@
{% block header_class %}with-proposition{% endblock %}
{% block proposition_header %}
<div class="header-proposition">
<div class='content'>
<div class="content">
<div class="phase-banner-beta">
<strong class="phase-tag">BETA</strong>
</div>
{% if current_user.is_authenticated() %}
<a href="#proposition-links" class="js-header-toggle menu">Menu</a>
<nav id="proposition-menu">
<ul id="proposition-links">
<li>
<a href="{{ url_for('main.user_profile') }}">{{ current_user.name }}</a>
</li>
<li>
<a href="{{ url_for('main.choose_service') }}">Switch service</a>
</li>
<li>
<a href="{{ url_for('main.sign_out')}}">Sign out</a>
</li>
</ul>
</nav>
{% endif %}
</div>
</div>
{% endblock %}
@@ -48,28 +64,6 @@
{% block content %}
{% if current_user.is_authenticated() and session['service_name'] != None %}
<nav class="management-navigation">
<div class="grid-row">
<div class="column-half">
<details class="dropdown">
<summary class="dropdown-toggle">
{{ session.get('service_name', 'Choose service') }}
</summary>
<div>
<a href="{{ url_for('main.choose_service') }}">Switch service</a>
<a href="{{ url_for('main.add_service') }}">Add a new service to GOV.UK Notify</a>
</div>
</details>
</div>
<div class="column-half management-navigation-account">
<a href="{{ url_for('main.user_profile') }}">{{ current_user.name }}</a>
<a href="{{ url_for('main.sign_out')}}">Sign out</a>
</div>
</div>
</nav>
{% endif %}
<main id="content" role="main" class="page-container">
{% with messages = get_flashed_messages(with_categories=true) %}
{% if messages %}

View File

@@ -1,4 +1,7 @@
<nav class="navigation">
<h2 class="navigation-service-name">
{{ session.get('service_name', 'Choose service') }}
</h2>
<ul>
<li><a href="{{ url_for('.service_dashboard', service_id=service_id) }}">Dashboard</a></li>
</ul>