[% IF template.name == "page/view.tt" or template.name == "page/highlight.tt" %]
    [% IF user %]
        [% PROCESS page/addtags.tt %]
    [% END %]
    <div id="tags">
        [% PROCESS page/tags.tt  %]
    </div>
[% END %]
<div id="bottomnav">
    <ul>
[% IF (!rev OR rev==page.content_version) %]
    [% PROCESS this_page_link.tt, accesskey = 0 %]

    [% IF c.check_permissions(page.path, c.user).delete && page.id && page.id > 1 +%]
        <li id="delete_page"><a title="[%loc('Delete page')%]" href="[%c.uri_for('delete')%]" rel="nofollow">[%loc('Delete page')%]</a></li>
    [% END %]
    [% IF c.req.action=='info' +%]
        <li><a title="[%loc('Page meta information')%]" class="navOn">[%loc('Page Info')%]</a></li>
    [% ELSE +%]
        <li><a title="[%loc('Page meta information')%]" href="[% c.uri_for('info')%]" accesskey="I">[%loc('Page Info')%]</a></li>
    [% END %]
    [% IF page.content_version && page.content_version > 1 +%]
        <li>
            <a title="[%loc('See previous revision')%]" href="[% c.uri_for('view', {rev=> page.content_version - 1}) %]" accesskey="R" rel="nofollow">[%loc('Back in time')%]</a>
            ([% page.content.max_version%] [% loc('revision') %][% IF page.content_version > 1 && !(lang=="pl"||lang=="ru"); "s" ; END %])  [%# TODO lame language-specific pluralization %]
        </li>
    [% END %]
    [% IF  (page.content_version AND page.content.max_version AND page.content_version < page.content.max_version) +%]
        <li>
            <a title="[%loc('See next revision')%]" href="[% c.uri_for('view',{ rev=> page.content_version + 1 }) %]" accesskey="R" rel="nofollow">[%loc('Forward in time')%]</a> ([% loc('x more',page.content.max_version - page.content_version )%])
        </li>
    [% END %]
[% ELSE %]
    [% IF (rev AND page.content.max_version AND rev < page.content.max_version) +%]
        <li>
            <a title="[%loc('See next revision')%]" href="[% c.uri_for('view',{ rev => rev + 1 }) %]" accesskey="R">[%loc('Forward in time')%]</a> ([% loc('x more',page.content.max_version - rev) %])
        </li>
    [% END %]
    [% IF rev AND rev > 1 +%]
        <li>
            <a title="[% loc('See previous revision') %]" href="[% c.uri_for('view', { rev=> rev - 1 })%]" accesskey="R">[%loc('Back in time')%]</a> ([% loc('x more', rev - 1) %])
        </li>
    [% END %]
    [% UNLESS rev||0 == page.content_version||0 +%]
        <li>
            <a title="[%loc('Back to the page')%]" href="[% c.uri_for('view')%]" accesskey="C">[%loc('Current Revision')%]</a>
        </li>
    [% END %]
[% END %]
[% IF page.content_version && page.content_version > 1 +%]
        <li>
            <span id="show_changes">
                <a title="[%loc('Show differences from previous version')%]" href="[%c.uri_for('jsrpc/diff', page.id , rev)%]" rel="nofollow" class="toggleChanges">[%loc('See changes')%]</a>
            </span>
            <span id="hide_changes" class="display-none">
                <a title="[%loc('Show normal page')%]" href="[%c.uri_for('jsrpc/diff', page.id , rev) %]" rel="nofollow" class="toggleChanges">[%loc('Hide changes')%]</a>
            </span>
        </li>
[% END +%]
        <li class="views-navbar">
            <span class="title">[% loc('Views') %]: <a title="[%loc('Format page for printing')%]" href="[%c.uri_for('print')%]">[%loc('Print')%]</a></span>
            <a title="[%loc('Subscribe to page changes')%]" href="[%c.uri_for('rss')%]">RSS</a>
            <a title="[%loc('Inline for including content')%]" href="[%c.uri_for('inline')%]" rel="nofollow">[%loc('Inline')%]</a>
[% IF c.req.params.rev %]
[% PROCESS page/rollback.tt | indent 6 %]
[% END %]
        </li>

[% IF user.is_admin +%]
        <li id="site_settings"><a title="[%loc('Change site settings')%]" href="[%c.uri_for('/.admin')%]" rel="nofollow">[%loc('Site settings')%]</a></li>
[% END %]

[%# TODO: this needs to become a dropdown -%]
        <li class="set-language-navbar">
            <span class="title">[% loc('Set language') %]:</span>
[% FOREACH lang IN ['en','de','fr','ja','no','ca','es','pl','ru','it'] +%]
            <a href="[% c.uri_for('set_lang',{lang=>lang}) | html %]">[%lang%]</a>
[% END +%]
        </li>
    </ul>
</div>
