base.html
239 lines
| 9.6 KiB
| text/html
|
HtmlLexer
Marcin Kuzminski
|
r0 | ## -*- coding: utf-8 -*- | |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | |||
r143 | <html xmlns="http://www.w3.org/1999/xhtml" id="mainhtml"> | ||
Marcin Kuzminski
|
r0 | <head> | |
r362 | <title>${next.title()}</title> | ||
r101 | <link rel="icon" href="/images/hgicon.png" type="image/png" /> | ||
r362 | <meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> | ||
r44 | <meta name="robots" content="index, nofollow"/> | ||
r362 | <!-- stylesheets --> | ||
r98 | ${self.css()} | ||
r362 | <!-- scripts --> | ||
Marcin Kuzminski
|
r79 | ${self.js()} | |
Marcin Kuzminski
|
r0 | </head> | |
r362 | <body> | ||
<!-- header --> | |||
<div id="header"> | |||
<!-- user --> | |||
<ul id="logged-user"> | |||
<li class="first"> | |||
r371 | ${h.link_to('%s %s (%s)'%(c.hg_app_user.name,c.hg_app_user.lastname,c.hg_app_user.username),h.url('admin_settings_my_account'))} | ||
r362 | </li> | ||
<li class="last highlight">${h.link_to(u'Logout',h.url('logout_home'))}</li> | |||
</ul> | |||
<!-- end user --> | |||
<div id="header-inner"> | |||
<div id="home"> | |||
<a href="${h.url('hg_home')}"></a> | |||
</div> | |||
<!-- logo --> | |||
<div id="logo"> | |||
<h1><a href="${h.url('hg_home')}">${c.hg_app_name}</a></h1> | |||
</div> | |||
<!-- end logo --> | |||
<!-- quick menu --> | |||
${self.page_nav()} | |||
<!-- end quick --> | |||
<div class="corner tl"></div> | |||
<div class="corner tr"></div> | |||
</div> | |||
</div> | |||
<!-- end header --> | |||
<!-- CONTENT --> | |||
<div id="content"> | |||
<div class="flash_msg"> | |||
<% messages = h.flash.pop_messages() %> | |||
% if messages: | |||
<ul id="flash-messages"> | |||
% for message in messages: | |||
<li class="${message.category}_msg">${message}</li> | |||
% endfor | |||
</ul> | |||
% endif | |||
</div> | |||
<div id="main"> | |||
${next.main()} | |||
</div> | |||
</div> | |||
<!-- END CONTENT --> | |||
Marcin Kuzminski
|
r0 | ||
r362 | <!-- footer --> | ||
<div id="footer"> | |||
<p>Hg App ${c.hg_app_version} © 2010 by Marcin Kuzminski</p> | |||
<script type="text/javascript">${h.tooltip.activate()}</script> | |||
</div> | |||
<!-- end footer --> | |||
</body> | |||
Marcin Kuzminski
|
r0 | ||
Marcin Kuzminski
|
r79 | </html> | |
r182 | ### MAKO DEFS ### | ||
r91 | <%def name="page_nav()"> | ||
${self.menu()} | |||
</%def> | |||
r362 | <%def name="menu(current=None)"> | ||
<% | |||
def is_current(selected): | |||
if selected == current: | |||
return "class='current'" | |||
%> | |||
r182 | %if current not in ['home','admin']: | ||
r362 | <script type="text/javascript"> | ||
YAHOO.util.Event.onDOMReady(function(){ | |||
YAHOO.util.Event.addListener('repo_switcher','click',function(){ | |||
if(YAHOO.util.Dom.hasClass('repo_switcher','selected')){ | |||
YAHOO.util.Dom.setStyle('switch_repos','display','none'); | |||
YAHOO.util.Dom.setStyle('repo_switcher','background',''); | |||
YAHOO.util.Dom.removeClass('repo_switcher','selected'); | |||
YAHOO.util.Dom.get('repo_switcher').removeAttribute('style'); | |||
} | |||
else{ | |||
YAHOO.util.Dom.setStyle('switch_repos','display',''); | |||
YAHOO.util.Dom.addClass('repo_switcher','selected'); | |||
} | |||
}); | |||
YAHOO.util.Event.addListener('repos_list','change',function(e){ | |||
var wa = YAHOO.util.Dom.get('repos_list').value; | |||
r373 | var url = "${h.url('summary_home',repo_name='__REPO__')}".replace('__REPO__',wa); | ||
r362 | window.location = url; | ||
}) | |||
}); | |||
</script> | |||
##REGULAR MENU | |||
<ul id="quick"> | |||
<!-- repo switcher --> | |||
r182 | <li> | ||
r362 | <a id="repo_switcher" title="${_('Switch repository')}" href="#"> | ||
<span class="icon"> | |||
<img src="/images/icons/database.png" alt="${_('Products')}" /> | |||
</span> | |||
<span>↓</span> | |||
</a> | |||
r373 | <div id="switch_repos" style="display:none;"> | ||
<select id="repos_list" size="10"> | |||
%for repo in c.repo_switcher_list: | |||
r256 | <option value="${repo}">${repo}</option> | ||
r182 | %endfor | ||
</select> | |||
</div> | |||
</li> | |||
r362 | |||
<li ${is_current('summary')}> | |||
<a title="${_('Summary')}" href="${h.url('summary_home',repo_name=c.repo_name)}"> | |||
<span class="icon"> | |||
<img src="/images/icons/clipboard_16.png" alt="${_('Summary')}" /> | |||
</span> | |||
<span>${_('Summary')}</span> | |||
</a> | |||
</li> | |||
<li ${is_current('shortlog')}> | |||
<a title="${_('Shortlog')}" href="${h.url('shortlog_home',repo_name=c.repo_name)}"> | |||
<span class="icon"> | |||
<img src="/images/icons/application_double.png" alt="${_('Shortlog')}" /> | |||
</span> | |||
<span>${_('Shortlog')}</span> | |||
</a> | |||
</li> | |||
<li ${is_current('changelog')}> | |||
<a title="${_('Changelog')}" href="${h.url('changelog_home',repo_name=c.repo_name)}"> | |||
<span class="icon"> | |||
<img src="/images/icons/time.png" alt="${_('Changelog')}" /> | |||
</span> | |||
<span>${_('Changelog')}</span> | |||
</a> | |||
</li> | |||
<li ${is_current('branches')}> | |||
<a title="${_('Branches')}" href="${h.url('branches_home',repo_name=c.repo_name)}"> | |||
<span class="icon"> | |||
<img src="/images/icons/arrow_branch.png" alt="${_('Branches')}" /> | |||
</span> | |||
<span>${_('Branches')}</span> | |||
</a> | |||
</li> | |||
<li ${is_current('tags')}> | |||
<a title="${_('Tags')}" href="${h.url('tags_home',repo_name=c.repo_name)}"> | |||
<span class="icon"> | |||
<img src="/images/icons/tag_blue.png" alt="${_('Tags')}" /> | |||
</span> | |||
<span>${_('Tags')}</span> | |||
</a> | |||
</li> | |||
<li ${is_current('files')}> | |||
<a title="${_('Files')}" href="${h.url('files_home',repo_name=c.repo_name)}"> | |||
<span class="icon"> | |||
<img src="/images/icons/file.png" alt="${_('Files')}" /> | |||
</span> | |||
<span>${_('Files')}</span> | |||
</a> | |||
</li> | |||
r318 | %if h.HasRepoPermissionAll('repository.admin')(c.repo_name): | ||
r362 | <li ${is_current('settings')}> | ||
<a title="${_('Settings')}" href="${h.url('repo_settings_home',repo_name=c.repo_name)}"> | |||
<span class="icon"> | |||
<img src="/images/icons/cog_edit.png" alt="${_('Settings')}" /> | |||
</span> | |||
<span>${_('Settings')}</span> | |||
</a> | |||
</li> | |||
r318 | %endif | ||
r182 | </ul> | ||
%else: | |||
r362 | ##ROOT MENU | ||
<ul id="quick"> | |||
<li> | |||
<a title="${_('Home')}" href="${h.url('hg_home')}"> | |||
<span class="icon"> | |||
<img src="/images/icons/home_16.png" alt="${_('Home')}" /> | |||
</span> | |||
<span>${_('Home')}</span> | |||
</a> | |||
</li> | |||
r318 | %if h.HasPermissionAll('hg.admin')('access admin main page'): | ||
r362 | <li ${is_current('admin')}> | ||
<a title="${_('Admin')}" href="${h.url('admin_home')}"> | |||
<span class="icon"> | |||
<img src="/images/icons/cog_edit.png" alt="${_('Admin')}" /> | |||
</span> | |||
<span>${_('Admin')}</span> | |||
</a> | |||
<ul> | |||
<li>${h.link_to(_('repositories'),h.url('repos'),class_='repos')}</li> | |||
<li>${h.link_to(_('users'),h.url('users'),class_='users')}</li> | |||
##<li>${h.link_to(_('permissions'),h.url('permissions'),class_='permissions')}</li> | |||
<li>${h.link_to(_('settings'),h.url('admin_settings'),class_='settings')}</li> | |||
</ul> | |||
</li> | |||
r318 | %endif | ||
r362 | |||
r182 | </ul> | ||
%endif | |||
r216 | </%def> | ||
r91 | |||
r98 | <%def name="css()"> | ||
r362 | <link rel="stylesheet" type="text/css" href="/css/reset.css" /> | ||
<link rel="stylesheet" type="text/css" href="/css/style.css" media="screen" /> | |||
<link rel="stylesheet" type="text/css" href="/css/style_full.css" /> | |||
<link id="color" rel="stylesheet" type="text/css" href="/css/colors/blue.css" /> | |||
<link rel="stylesheet" type="text/css" href="/css/pygments.css" /> | |||
<link rel="stylesheet" type="text/css" href="/css/diff.css" /> | |||
r98 | </%def> | ||
Marcin Kuzminski
|
r79 | ||
<%def name="js()"> | |||
<script type="text/javascript" src="/js/yui/utilities/utilities.js"></script> | |||
r362 | <!--[if IE]><script language="javascript" type="text/javascript" src="/js/excanvas.min.js"></script><![endif]--> | ||
r281 | <script type="text/javascript" src="/js/yui/container/container-min.js"></script> | ||
r298 | <script type="text/javascript" src="/js/yui/datasource/datasource-min.js"></script> | ||
<script type="text/javascript" src="/js/yui/autocomplete/autocomplete-min.js"></script> | |||
r362 | <script type="text/javascript" src="/js/yui.flot.js"></script> | ||
r176 | </%def> | ||
r362 | <%def name="breadcrumbs()"> | ||
<div class="breadcrumbs"> | |||
${self.breadcrumbs_links()} | |||
</div> | |||
Marcin Kuzminski
|
r79 | </%def> |