Skip to content

Commit

Permalink
[2474] Convert base templates into Jinja templates
Browse files Browse the repository at this point in the history
  • Loading branch information
aron committed May 29, 2012
1 parent ce636fe commit 6ffe69e
Show file tree
Hide file tree
Showing 4 changed files with 100 additions and 0 deletions.
20 changes: 20 additions & 0 deletions ckan/templates/base.jinja.html
@@ -0,0 +1,20 @@
{% block doctype %}<!DOCTYPE html>{% endblock %}
{% block htmltag %}<html lang="en-gb">{% endblock %}
{% block headtag %}<head>{% endblock %}
{% block meta %}
<meta charset="utf-8" />
{% endblock %}
<title>{% if title %}{{title}} - {% endif %}CKAN</title>
{% block links %}
<link rel="shortcut icon" href="/base/images/ckan.ico" />
{% endblock %}
{% block styles %}
<link rel="stylesheet/less" href="/base/less/main.less" />
<script src="/base/test/vendor/less.js"></script>
{% endblock %}
</head>
{% block bodytag %}<body>{% endblock %}
{% block page %}{% endblock %}
{% block scripts %}{% endblock %}
</body>
</html>
20 changes: 20 additions & 0 deletions ckan/templates/footer.jinja.html
@@ -0,0 +1,20 @@
<footer class="site-footer">
<div class="container">
<nav class="footer-links row-fluid">
<ul class="unstyled row-fluid">
<li><a href="#">Terms and Conditions</a></li>
<li><a href="#">Accessibility</a></li>
<li><a href="#">Code of conduct</a></li>
<li><a href="#">Moderation policy</a></li>
<li><a href="#">FAQ</a></li>
<li><a href="#">Privacy</a></li>
<li><a href="#">Contact us</a></li>
<li><a href="#">Consultation</a></li>
</ul>
</nav>
<div class="attribution">
<p><strong>Powered by</strong> <a href="">CityData</a> from <a href="">CKAN</a></p>
<p><small>Maps powered by Leaflet, map data &copy; OpenStreetMap contributors, CC-BY-SA, map imagery &copy; CloudMade</small></p>
</div>
</div>
</footer>
28 changes: 28 additions & 0 deletions ckan/templates/header.jinja.html
@@ -0,0 +1,28 @@
<header class="masthead">
<div class="container">
<hgroup>
<a class="logo" href="{{ h.url('home') }}"><img width="64" src="{{ h.url_for_static(g.site_logo) }}" alt="{{ g.site_title }} Logo" title="{{ g.site_title }} Logo" /></a>
<h1><a href="{{ h.url('home') }}">{{ g.site_title }}</a></h1>
<p>{{ g.site_description }}</p>
</hgroup>
<div class="account" py:if="c.userobj">
<a href="{{ h.url_for(controller='user',action='me') }}" class="image">
{{ h.gravatar((c.userobj.email_hash if c and c.userobj else ''),size=25) }}
</a>
<span class="links">
<a href="{{ h.url_for(controller='user',action='me') }}">{{ c.user }}</a>
<a class="logout" href="${h.url_for('/user/_logout')}">Log out</a>
</span>
</div>
<nav class="account" py:if="not c.userobj">
<ul class="unstyled">
{{ h.build_nav_main(('login', _('Login')),('register', _('Register'))) }}
</ul>
</nav>
<nav>
<ul class="unstyled">
{{ h.build_nav_main(('search', _('Search')),('default_group', _('Groups')), ('add dataset', _('Add Dataset')), ('about', _('About'))) }}
</ul>
</nav>
</div>
</header>
32 changes: 32 additions & 0 deletions ckan/templates/page.jinja.html
@@ -0,0 +1,32 @@
{% extends "base.jinja.html" %}

{% block page %}
{% block header %}
{% include "header.jinja.html" %}
{% endblock %}
{% block content %}
<div role="main">
<div class="container">
{% block toolbar %}
<div class="toolbar">
{% block breadcrumb %}{% endblock %}
{% block actions %}{% endblock %}
</div>
{% endblock %}
{% block primary %}
<div class="primary">
{% block primary_content %}{% endblock %}
</div>
{% endblock %}
{% block secondary %}
<aside class="secondary">
{% block secondary_content %}{% endblock %}
</aside>
{% endblock %}
</div>
</div>
{% endblock %}
{% block footer %}
{% include "footer.jinja.html" %}
{% endblock %}
{% endblock %}

0 comments on commit 6ffe69e

Please sign in to comment.