Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added some more blocks to the header template because more blocks are…
… always good
- Loading branch information
1 parent
3c323e7
commit 1f75641
Showing
1 changed file
with
84 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,86 +1,99 @@ | ||
{% 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 }}"> | ||
{% 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 %} | ||
{% 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"> | ||
<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> | ||
<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> | ||
{% 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"> | ||
|
||
{% block header_site_navigation %} | ||
<nav class="section navigation"> | ||
<ul class="unstyled"> | ||
<li>{% link_for _('Log in'), controller='user', action='login' %}</li> | ||
<li>{% link_for _('Register'), controller='user', action='register', class_='sub' %}</li> | ||
{{ h.build_nav_main( | ||
('add dataset', _('Add Dataset'), 'package_create'), | ||
('search', _('Datasets')), | ||
('organizations_index', _('Organizations')), | ||
('group_index', _('Groups')), | ||
('about', _('About')) | ||
) }} | ||
</ul> | ||
</nav> | ||
{% endif %} | ||
{% 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 %} |