-
Notifications
You must be signed in to change notification settings - Fork 2k
/
header.html
102 lines (96 loc) · 4.05 KB
/
header.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
{% block header %}
<header class="masthead">
{% if g.debug and not g.debug_supress_header %}
<div class="debug">Controller : {{ c.controller }}<br/>Action : {{ c.action }}</div>
{% endif %}
<div class="container">
{# The .header-image class hides the main text and uses image replacement for the title #}
<hgroup class="{{ g.header_class }}">
{% block header_logo %}
{% if g.site_logo %}
<a class="logo" href="{{ h.url('home') }}"><img src="{{ h.url_for_static(g.site_logo) }}" alt="{{ g.site_title }} Logo" title="{{ g.site_title }} Logo" /></a>
{% else %}
<h1>
<a href="{{ h.url('home') }}">{{ g.site_title }}</a>
</h1>
{% if g.site_description %}<h2>{{ g.site_description }}</h2>{% endif %}
{% endif %}
{% endblock %}
</hgroup>
<div class="content">
{% block header_site_navigation %}
<nav class="section navigation">
<ul class="unstyled">
{{ h.build_nav_main(
('add dataset', _('Add Dataset'), 'package_create'),
('search', _('Datasets')),
('organizations_index', _('Organizations')),
('group_index', _('Groups')),
('about', _('About'))
) }}
</ul>
</nav>
{% endblock %}
{% block header_site_search %}
<form class="section site-search simple-input" action="{% url_for controller='package', action='search' %}" method="get">
<div class="field">
<label for="field-sitewide-search">{{ _('Search Datasets') }}</label>
<input id="field-sitewide-search" name="q" placeholder="{{ _('Search') }}" />
<button class="btn-search" type="submit">{{ _('Search') }}</button>
</div>
</form>
{% endblock %}
{% block header_account %}
{% if c.userobj %}
<div class="section account avatar authed" data-module="me" data-me="{{ c.userobj.id }}">
<div class="dropdown">
<a href="{{ h.url_for(controller='user', action='dashboard') }}" class="button notifications{% if c.new_activities > 0 %} notifications-important{% endif %}" title="{{ c.new_activities }} {{ _('new notifications') }}">
{{ c.new_activities }}
</a>
</div>
<div class="dropdown">
<a href="#" class="button image dropdown-toggle" data-toggle="dropdown">
{{ h.gravatar((c.userobj.email_hash if c and c.userobj else ''),size=25) }}
<i class="icon-chevron-down"></i>
</a>
<ul class="user-dropdown-menu dropdown-menu pull-right" role="menu">
<li>
<a href="{{ h.url_for(controller='user', action='dashboard') }}">
<i class="icon-dashboard"></i>
{{ _('Dashboard') }}
</a>
</li>
<li>
<a href="{{ h.url_for(controller='user', action='read', id=c.userobj.name) }}">
<i class="icon-user"></i>
{{ _('My Profile') }}
</a>
</li>
<li>
<a href="{{ h.url_for(controller='user', action='edit', id=c.userobj.name) }}">
<i class="icon-wrench"></i>
{{ _('Edit Profile') }}
</a>
</li>
<li>
<a href="{{ h.url_for('/user/_logout') }}">
<i class="icon-signout"></i>
{{ _('Log out') }}
</a>
</li>
</ul>
</div>
</div>
{% else %}
<nav class="section account not-authed">
<ul class="unstyled">
<li>{% link_for _('Log in'), controller='user', action='login' %}</li>
<li>{% link_for _('Register'), controller='user', action='register', class_='sub' %}</li>
</ul>
</nav>
{% endif %}
{% endblock %}
</div>
</div>
</header>
{% endblock %}