Skip to content
Permalink
Browse files

baby steps

  • Loading branch information
ralsina committed May 25, 2015
1 parent 31cf1b3 commit 71e95a91cff1733a7fff23060ab24439d45110a9
Showing with 59 additions and 71 deletions.
  1. +6 −10 v7/base-jade/templates/base_footer.jade
  2. +53 −61 v7/base-jade/templates/base_header.jade
@@ -1,11 +1,7 @@
## -*- coding: utf-8 -*-
<%namespace name="base" file="base_helper.tmpl" import="*"/>
//- namespace name="base" file="base_helper.tmpl" import="*"
<%def name="html_footer()">
%if content_footer:
<footer id="footer" role="contentinfo">
<p>${content_footer}</p>
${template_hooks['page_footer']()}
</footer>
%endif
</%def>
mixin html_footer()
if content_footer
footer (id="footer", role="contentinfo")
p #{content_footer}
!= template_hooks['page_footer']()
@@ -1,66 +1,58 @@
## -*- coding: utf-8 -*-
<%namespace name="base" file="base_helper.tmpl" import="*"/>

<%def name="html_header()">
<header id="header" role="banner">
${html_site_title()}
${html_translation_header()}
${html_navigation_links()}
%if search_form:
<div class="searchform" role="search">
${search_form}
</div>
%endif
</header>
${template_hooks['page_header']()}
</%def>
- import "base_helper.jade" as helper with context

<%def name="html_site_title()">
<h1 id="brand"><a href="${abs_link(_link("root", None, lang))}" title="${blog_title}" rel="home">
%if logo_url:
<img src="${logo_url}" alt="${blog_title}" id="logo">
%endif
mixin html_header()
header(id="header", role="banner")
!= html_site_title()
!= html_translation_header()
!= html_navigation_links()
if search_form
div(class="searchform", role="search")
!= search_form
!= template_hooks['page_header']()

% if show_blog_title:
<span id="blog-title">${blog_title}</span>
% endif
</a></h1>
</%def>
mixin html_site_title()
h1(id="brand")
a(href="#{abs_link(_link("root", None, lang))}" title="#{blog_title}" rel="home")
if logo_url
img(src="#{logo_url}", alt="#{blog_title}", id="logo")
if show_blog_title:
span(id="blog-title")
= blog_title

<%def name="html_navigation_links()">
<nav id="menu" role="navigation">
<ul>
%for url, text in navigation_links[lang]:
% if isinstance(url, tuple):
<li> ${text}
<ul>
%for suburl, text in url:
% if rel_link(permalink, suburl) == "#":
<li class="active"><a href="${permalink}">${text}</a></li>
%else:
<li><a href="${suburl}">${text}</a></li>
%endif
%endfor
</ul>
% else:
% if rel_link(permalink, url) == "#":
<li class="active"><a href="${permalink}">${text}</a></li>
%else:
<li><a href="${url}">${text}</a></li>
%endif
% endif
%endfor
${template_hooks['menu']()}
${template_hooks['menu_alt']()}
</ul>
</nav>
</%def>
mixin html_navigation_links()
nav(id="menu", role="navigation")
ul
for url, text in navigation_links[lang]
if isinstance(url, tuple)
li
= text
ul
for suburl, text in url
if rel_link(permalink, suburl) == "#"
li(class="active")
a(href="#{permalink}")
= text
else
li
a(href="#{suburl}")
=text
else
if rel_link(permalink, url) == "#"
li(class="active")
a(href="#{permalink}")
= text
else
li
a(href="#{url}")
= text

<%def name="html_translation_header()">
%if len(translations) > 1:
<div id="toptranslations">
<h2>${messages("Languages:")}</h2>
${base.html_translations()}
</div>
%endif
</%def>
!= template_hooks['menu']()
!= template_hooks['menu_alt']()

mixin html_translation_header()
if len(translations) > 1
div(id="toptranslations")
h2
= messages("Languages:")
= base.html_translations()

0 comments on commit 71e95a9

Please sign in to comment.
You can’t perform that action at this time.