breadcrumbs.html 1.28 KB
Newer Older
1 2
## mako
<%! from django.core.urlresolvers import reverse %>
Tom Giannattasio committed
3

4
%if urlpath is not Undefined and urlpath:
Tom Giannattasio committed
5 6
<header>
  <ul class="breadcrumb pull-left" class="">
7 8 9 10 11 12 13 14 15 16 17 18
    <%
      # The create button links to the highest ancestor we have edit priveleges to
      create_article_root = None
    %>
    %for ancestor in urlpath.cached_ancestors:
      <li><a href="${reverse('wiki:get', kwargs={'path' : ancestor.path})}">${ancestor.article.current_revision.title}</a></li>
      <% 
        if not create_article_root and ancestor.article.can_write(user):
          create_article_root = ancestor
      %>
    %endfor
    <li class="active"><a href="${reverse('wiki:get', kwargs={'path' : urlpath.path})}">${article.current_revision.title}</a></li>
19 20 21 22
    <% 
      if not create_article_root and urlpath.article.can_write(user):
        create_article_root = urlpath
    %>
Tom Giannattasio committed
23 24 25
  </ul>

  <div class="global-functions pull-right">
26
    <!-- <form class="search-wiki pull-left">
Tom Giannattasio committed
27
      <input type="search" placeholder="search wiki" />
28
    </form> -->
29 30
    %if create_article_root:
    <a class="add-article-btn btn pull-left" href="${reverse('wiki:create', kwargs={'path' : create_article_root.path})}" style="padding: 7px;">
Tom Giannattasio committed
31
      <span class="icon-plus"></span>
32
      Add article
Tom Giannattasio committed
33
    </a>
34
    %endif
Tom Giannattasio committed
35 36 37
  </div>
</header>

38
%endif