-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathheader_base.html
133 lines (117 loc) · 5.17 KB
/
header_base.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
{#
## This file is part of Invenio.
## Copyright (C) 2012, 2013, 2014 CERN.
##
## Invenio is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
## published by the Free Software Foundation; either version 2 of the
## License, or (at your option) any later version.
##
## Invenio is distributed in the hope that it will be useful, but
## WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
## General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with Invenio; if not, write to the Free Software Foundation, Inc.,
## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
#}
{#
## This file contains header part of main page template.
##
## Usage:
## {% include 'header.html' %}
#}
<nav class="navbar navbar-fixed-top navbar-inverse">
<div class="container">
<div class="navbar-header">
<button class="navbar-toggle" type="button" 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>
<a class="navbar-brand" href="{{ url_for('search.index') }}">
<img src="{{ url_for('static', filename='img/logo_white.png') }}" alt="{{ config.CFG_SITE_NAME_INTL[g.ln] }}" />
</a>
</div>
<div class="navbar-collapse collapse">
<ul class="nav navbar-nav">
{%- for item in current_menu.submenu('main').children if item.visible recursive %}
{%- if item.children -%}
{%- if not current_user.is_guest and item.name == "admin" -%}
<li class="dropdown">.
<a href="{{ item.url }}" style="display: inline-block; padding-right: 5px;"> {{ item.text|safe }} </a>
<a href="#" class="dropdown-toggle" data-toggle="dropdown" style="display: inline-block; padding-left: 5px;">
<b class="caret"></b>
</a>
<ul class="dropdown-menu pull-right">
{{ loop(item.children) }}
</ul>
</li>
{%- endif -%}
{%- if item.name == "webnews" or item.name == "webnewsadmin" -%}
<li class="dropdown">.
<a href="{{ item.url }}" style="display: inline-block; padding-right: 5px;"> {{ item.text|safe }} </a>
<a href="#" class="dropdown-toggle" data-toggle="dropdown" style="display: inline-block; padding-left: 5px;">
<b class="caret"></b>
</a>
<ul class="dropdown-menu pull-left">
{{ loop(item.children) }}
</ul>
</li>
{%- endif -%}
{%- else -%}
<li><a href="{{ item.url }}" rel="tooltip" title="Key active" >{{ item.text|safe }}</a></li>
{%- endif -%}
{%- endfor -%}
</ul>
<ul class="nav navbar-nav navbar-right">
{% if current_user.is_guest %}
<div style="padding-top: 10px;">
<button class="btn btn-sm btn-default" onclick="window.location='{{url_for('webaccount.login')}}'">
<i class="fa fa-sign-in"></i> {{ _('Login') }}
</button>
{% if config.CFG_ACCESS_CONTROL_LEVEL_ACCOUNTS in [0, 1] %}
<button class="btn btn-sm btn-warning" onclick="window.location='{{url_for('webaccount.register')}}'">
<i class="fa fa-edit"></i> {{ _('Register') }}
</button>
{% endif %}
</div>
{% else %}
<li class="dropdown">
<a href="{{ url_for('accounts_settings.profile') }}" style="display: inline-block; padding-right: 5px;">
<i class="glyphicon glyphicon-user"></i> {{ current_user.nickname|default(current_user.email) }}
</a>
<a class="dropdown-toggle" data-toggle="dropdown" style="display: inline-block; padding-left: 5px;" href="#">
<b class="caret"></b>
</a>
<ul class="dropdown-menu">
<li>
<div class="navbar-content">
<div class="row">
<div class="col-md-3">
<i class="fa fa-user fa-3x"></i>
</div>
<div class="col-md-9">
<strong>
{{ current_user.nickname|default(current_user.email) }}
</strong>
<p class="text-muted small"> {{ current_user.email }} </p>
</div>
</div>
</div>
</li>
<li class="divider"></li>
<li>
<a href="{{ url_for('webaccount.logout') }}">
<i class="glyphicon glyphicon-log-out"></i> {{ _('Logout') }}
</a>
</li>
</ul>
</li>
{% endif %}
</ul>
</div>
</div>
</nav>