summaryrefslogtreecommitdiff
path: root/templates/base.html
diff options
context:
space:
mode:
authorDamien Lespiau <damien.lespiau@intel.com>2014-09-09 14:22:25 +0100
committerStephen Finucane <stephen.finucane@intel.com>2015-11-05 03:51:32 +0000
commit6d854ab67ac01d62cbb29d299c5cfc6c4ac26083 (patch)
treee7570936c1f59df660c1d49d51d19f817e7e81bd /templates/base.html
parentc3598af342223f6384c9873e533277bc76f77119 (diff)
downloadpatchwork-6d854ab67ac01d62cbb29d299c5cfc6c4ac26083.tar
patchwork-6d854ab67ac01d62cbb29d299c5cfc6c4ac26083.tar.gz
templates: Redesign the title bar
Let's use HTML5 <nav> and bootstrap navigation facilities for this. Among the nice things that bootstrap brings to the table, the navigation bar is now mobile friendly: it will collapse when either, being displayed on a mobile device or when the screen isn't wide enough, to show the various items in a togglable menu. This can be tested by resizing the browser to have a width < 768px. This commit is just about layout changes, keeping the exact same information displayed on the page. This is based on work from Belén Barros Peña, but transposed to bootstrap. Signed-off-by: Damien Lespiau <damien.lespiau@intel.com> Acked-by: Stephen Finucane <stephen.finucane@intel.com>
Diffstat (limited to 'templates/base.html')
-rw-r--r--templates/base.html52
1 files changed, 28 insertions, 24 deletions
diff --git a/templates/base.html b/templates/base.html
index 0a2ced3..1e2d4c9 100644
--- a/templates/base.html
+++ b/templates/base.html
@@ -20,36 +20,40 @@
{% block headers %}{% endblock %}
</head>
<body>
- <div id="title">
- <h1 style="float: left;">
- <a
- href="{% url 'patchwork.views.projects' %}">Patchwork</a>
- {% block heading %}{% endblock %}</h1>
- <div id="auth">
+ <nav class="navbar navbar-patchwork" role="navigation">
+ <div class="container-fluid">
+ <div class="navbar-header">
+ <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar-collapse">
+ <span class="sr-only">Toggle navigation</span>
+ <span class="icon-bar"></span>
+ <span class="icon-bar"></span>
+ <span class="icon-bar"></span>
+ </button>
+ <span class="navbar-brand"><a
+ href="{% url 'patchwork.views.projects' %}">Patchwork</a>
+ {% block heading %}{% endblock %}</span>
+ </div>
+ <div class="collapse navbar-collapse" id="navbar-collapse">
+ <ul class="nav navbar-nav navbar-right">
{% if user.is_authenticated %}
- Logged in as
- <a href="{% url 'patchwork.views.user.profile' %}"
- ><strong>{{ user.username }}</strong></a>
- <br/>
- <a href="{% url 'patchwork.views.user.todo_lists' %}">todo
- ({{ user.profile.n_todo_patches }})</a> ::
- <a href="{% url 'patchwork.views.bundle.bundles' %}">bundles</a>
- <br/>
- <a href="{% url 'patchwork.views.user.profile' %}">profile</a> ::
+ <li><p class="navbar-text">Logged in as <a href="{% url 'patchwork.views.user.profile' %}"
+ ><strong>{{ user.username }}</strong></a></p></li>
+ <li><a href="{% url 'patchwork.views.user.todo_lists' %}">todo
+ ({{ user.profile.n_todo_patches }})</a></li>
+ <li><a href="{% url 'patchwork.views.bundle.bundles' %}">bundles</a></li>
+ <li><a href="{% url 'patchwork.views.user.profile' %}">profile</a></li>
{% if user.is_staff %}
- <a href="{% url 'admin:index' %}">admin</a> ::
+ <li><a href="{% url 'admin:index' %}">admin</a></li>
{% endif %}
- <a href="{% url 'auth_logout' %}">logout</a>
+ <li><a href="{% url 'auth_logout' %}">logout</a></li>
{% else %}
- <a href="{% url 'auth_login' %}">login</a>
- <br/>
- <a href="{% url 'patchwork.views.user.register' %}">register</a>
- <br/>
- <a href="{% url 'patchwork.views.mail.settings' %}">mail settings</a>
+ <li><a href="{% url 'auth_login' %}">login</a></li>
+ <li><a href="{% url 'patchwork.views.user.register' %}">register</a></li>
+ <li><a href="{% url 'patchwork.views.mail.settings' %}">mail settings</a></li>
{% endif %}
+ </div>
</div>
- <div style="clear: both;"></div>
- </div>
+ </nav>
<div id="nav">
<div id="navleft">
{% if project %}