-
Notifications
You must be signed in to change notification settings - Fork 2k
/
header.html
115 lines (109 loc) · 4.63 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
103
104
105
106
107
108
109
110
111
112
113
114
115
{% block header_wrapper %}
{% block header_account %}
<header class="account-masthead">
<div class="container">
{% block header_account_container_content %}
{% if c.userobj %}
<div class="account avatar authed" data-module="me" data-me="{{ c.userobj.id }}">
<ul class="unstyled">
{% block header_account_logged %}
{% if c.userobj.sysadmin %}
<li>
<a href="{{ h.url_for(controller='admin', action='index') }}" title="{{ _('Sysadmin settings') }}">
<i class="icon-legal"></i>
</a>
</li>
{% endif %}
<li>
<a href="{{ h.url_for(controller='user', action='read', id=c.userobj.name) }}" class="image" title="{{ _('View profile') }}">
{{ h.gravatar((c.userobj.email_hash if c and c.userobj else ''), size=22) }}
<span class="username">{{ c.userobj.display_name }}</span>
</a>
</li>
{% set new_activities = h.new_activities() %}
<li class="notifications {% if new_activities > 0 %}notifications-important{% endif %}">
{% set notifications_tooltip = ngettext('Dashboard (%(num)d new item)', 'Dashboard (%(num)d new items)', new_activities) %}
<a href="{{ h.url_for(controller='user', action='dashboard') }}" title="{{ notifications_tooltip }}">
<i class="icon-dashboard"></i>
<span>{{ new_activities }}</span>
</a>
</li>
{% block header_account_settings_link %}
<li>
<a href="{{ h.url_for(controller='user', action='edit', id=c.userobj.name) }}" title="{{ _('Edit settings') }}">
<i class="icon-cog"></i>
</a>
</li>
{% endblock %}
{% block header_account_log_out_link %}
<li>
<a href="{{ h.url_for('/user/_logout') }}" title="{{ _('Log out') }}">
<i class="icon-signout"></i>
</a>
</li>
{% endblock %}
{% endblock %}
</ul>
</div>
{% else %}
<nav class="account not-authed">
<ul class="unstyled">
{% block header_account_notlogged %}
<li>{% link_for _('Log in'), controller='user', action='login' %}</li>
<li>{% link_for _('Register'), controller='user', action='register', class_='sub' %}</li>
{% endblock %}
</ul>
</nav>
{% endif %}
{% endblock %}
</div>
</header>
{% endblock %}
<header class="masthead">
{% block header_debug %}
{% if g.debug and not g.debug_supress_header %}
<div class="debug">Controller : {{ c.controller }}<br/>Action : {{ c.action }}</div>
{% endif %}
{% endblock %}
<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="nav nav-pills">
{% block header_site_navigation_tabs %}
{{ h.build_nav_main(
('search', _('Datasets')),
('organizations_index', _('Organizations')),
('group_index', _('Groups')),
('about', _('About'))
) }}
{% endblock %}
</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" type="text" name="q" placeholder="{{ _('Search datasets...') }}" />
<button class="btn-search" type="submit"><i class="icon-search"></i></button>
</div>
</form>
{% endblock %}
</div>
</div>
</header>
{% endblock %}