diff options
author | Alexander Sulfrian <alex@spline.inf.fu-berlin.de> | 2014-11-18 05:18:46 +0100 |
---|---|---|
committer | Alexander Sulfrian <alex@spline.inf.fu-berlin.de> | 2014-11-19 02:15:55 +0100 |
commit | 8d602926f15f34cce578e50dbaa5877f47a5318d (patch) | |
tree | ed450afb9c81c77b6bea385d6fd0dd565b2bba14 | |
parent | 94a8f6a00efa21dc9f17ec9d181391526eab7a54 (diff) | |
download | padlite-teams-8d602926f15f34cce578e50dbaa5877f47a5318d.tar.gz padlite-teams-8d602926f15f34cce578e50dbaa5877f47a5318d.tar.bz2 padlite-teams-8d602926f15f34cce578e50dbaa5877f47a5318d.zip |
templates/layout: add navbar for breadcrubs and login/logout links
-rw-r--r-- | static/css/custom.css | 10 | ||||
-rw-r--r-- | templates/index.html | 2 | ||||
-rw-r--r-- | templates/layout.html | 55 |
3 files changed, 55 insertions, 12 deletions
diff --git a/static/css/custom.css b/static/css/custom.css new file mode 100644 index 0000000..2f86aee --- /dev/null +++ b/static/css/custom.css @@ -0,0 +1,10 @@ +.nav > .breadcrumb { + padding: 0 15px; + margin: 0; + background: none; +} + +.nav > .breadcrumb > li { + padding: 15px 0; +} + diff --git a/templates/index.html b/templates/index.html index c92a3a9..dddf664 100644 --- a/templates/index.html +++ b/templates/index.html @@ -33,6 +33,4 @@ </form> </div> </div> - -<a class="btn btn-default btn-block" href="{{ url_for('auth.logout') }}">Logout</a> {% endblock %} diff --git a/templates/layout.html b/templates/layout.html index 7325543..80b69a3 100644 --- a/templates/layout.html +++ b/templates/layout.html @@ -12,23 +12,58 @@ <script src="{{ url_for('static', filename='js/html5shiv.js') }}"></script> <script src="{{ url_for('static', filename='js/respond.min.js') }}"></script> <![endif]--> + + <link href="{{ url_for('static', filename='css/custom.css') }}" rel="stylesheet" media="screen"> </head> <body> <div class="container"> <div class="page-header"> <h1>{% block head %}{% endblock %}</h1> </div> + <nav class="navbar navbar-default" role="navigation"> + <div class="navbar-header"> + <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1"> + <span class="sr-only">Toggle navigation</span> + <span class="icon-bar"></span> + <span class="icon-bar"></span> + <span class="icon-bar"></span> + </button> + + <div class="nav navbar-left"> + <ol class="breadcrumb"> + <li{% if not breadcrumbs %} class="active"{% endif %}> + {% if breadcrumbs %}<a href="{{ url_for('index') }}">{% endif %} + Home + {% if breadcrumbs %}</a>{% endif %} + </li> + + {% for breadcrumb in breadcrumbs %} + <li{% if loop.last %} class="active"{% endif %}> + {% if not loop.last %}<a href="{{ breadcrumb.href }}">{% endif %} + {{breadcrumb.text}} + {% if not loop.last %}</a>{% endif %} + </li> + {% endfor %} + </ol> + </div> + </div> + + <!-- Collect the nav links, forms, and other content for toggling --> + <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1"> + <ul class="nav navbar-nav navbar-right"> + {% if user %} + {% if user.admin %} + <li><a href="{{ url_for('admin.index') }}"><span class="glyphicon glyphicon-dashboard" /> Admin</a></li> + {% endif %} + + <li><a href="{{ url_for('auth.logout') }}"><span class="glyphicon glyphicon-user" /> Logout</a></li> + {% else %} + <li><a href="{{ url_for('auth.login') }}"><span class="glyphicon glyphicon-user" /> Login</a></li> + {% endif %} + </ul> + </div><!-- /.navbar-collapse --> + </nav> - <ol class="breadcrumb"> - <li{% if not group %} class="active"{% endif %}> - {% if group %}<a href="{{ url_for('index') }}">{% endif %} - Home - {% if group %}</a>{% endif %} - </li> - {% if group %} - <li class="active">{{group}}</li> - {% endif %} - </ol> {% for categorie, message in get_flashed_messages(with_categories=true) %} |