base.html
163 lines
| 6.1 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> | |
r101 | <link rel="icon" href="/images/hgicon.png" type="image/png" /> | ||
r44 | <meta name="robots" content="index, nofollow"/> | ||
r98 | <title>${next.title()}</title> | ||
r216 | ##For future use yui reset for cross browser compatability. | ||
r143 | ##<link rel="stylesheet" href="/js/yui/reset-fonts-grids/reset-fonts-grids.css" type="text/css" /> | ||
r98 | ${self.css()} | ||
Marcin Kuzminski
|
r79 | ${self.js()} | |
Marcin Kuzminski
|
r0 | </head> | |
r143 | <body class="mainbody"> | ||
r44 | <div id="container"> | ||
<div class="page-header"> | |||
r294 | <h1 class="breadcrumbs">${next.breadcrumbs()}</h1> | ||
r155 | ${self.page_nav()} | ||
r237 | <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"> | |||
r105 | ${next.main()} | ||
r289 | <script type="text/javascript">${h.tooltip.activate()}</script> | ||
r105 | </div> | ||
r44 | <div class="page-footer"> | ||
r216 | Hg App ${c.hg_app_version} © 2010 by Marcin Kuzminski | ||
r44 | </div> | ||
Marcin Kuzminski
|
r0 | ||
r44 | <div id="powered-by"> | ||
<p> | |||
<a href="http://mercurial.selenic.com/" title="Mercurial"> | |||
r101 | <img src="/images/hglogo.png" width="75" height="90" alt="mercurial"/></a> | ||
r44 | </p> | ||
</div> | |||
Marcin Kuzminski
|
r0 | ||
r44 | <div id="corner-top-left"></div> | ||
<div id="corner-top-right"></div> | |||
<div id="corner-bottom-left"></div> | |||
<div id="corner-bottom-right"></div> | |||
Marcin Kuzminski
|
r0 | ||
r44 | </div> | ||
</body> | |||
Marcin Kuzminski
|
r79 | </html> | |
r182 | ### MAKO DEFS ### | ||
r91 | <%def name="page_nav()"> | ||
${self.menu()} | |||
r216 | ${self.submenu()} | ||
r91 | </%def> | ||
<%def name="menu(current)"> | |||
r182 | <% | ||
def is_current(selected): | |||
if selected == current: | |||
r208 | return "class='current'" | ||
r182 | %> | ||
%if current not in ['home','admin']: | |||
r216 | ##regular menu | ||
r182 | <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'); | |||
r255 | YAHOO.util.Dom.get('repo_switcher').removeAttribute('style'); | ||
r182 | } | ||
else{ | |||
YAHOO.util.Dom.setStyle('switch_repos','display',''); | |||
YAHOO.util.Dom.setStyle('repo_switcher','background','#FFFFFF'); | |||
r225 | YAHOO.util.Dom.setStyle('repo_switcher','color','#556CB5'); | ||
r182 | 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; | |||
var url = "${h.url('summary_home',repo_name='__REPLACE__')}".replace('__REPLACE__',wa); | |||
window.location = url; | |||
}) | |||
}); | |||
r225 | </script> | ||
r182 | <ul class="page-nav"> | ||
<li> | |||
<a id="repo_switcher" title="${_('Switch repository')}" href="#">↓</a> | |||
r270 | <div id="switch_repos" style="display:none;position: absolute;height: 25px"> | ||
<select id="repos_list" size="=10" style="min-width: 150px"> | |||
r256 | %for repo in sorted(x.name.lower() for x in c.cached_repo_list.values()): | ||
<option value="${repo}">${repo}</option> | |||
r182 | %endfor | ||
</select> | |||
</div> | |||
</li> | |||
<li ${is_current('summary')}>${h.link_to(_('summary'),h.url('summary_home',repo_name=c.repo_name))}</li> | |||
<li ${is_current('shortlog')}>${h.link_to(_('shortlog'),h.url('shortlog_home',repo_name=c.repo_name))}</li> | |||
<li ${is_current('changelog')}>${h.link_to(_('changelog'),h.url('changelog_home',repo_name=c.repo_name))}</li> | |||
<li ${is_current('branches')}>${h.link_to(_('branches'),h.url('branches_home',repo_name=c.repo_name))}</li> | |||
<li ${is_current('tags')}>${h.link_to(_('tags'),h.url('tags_home',repo_name=c.repo_name))}</li> | |||
<li ${is_current('files')}>${h.link_to(_('files'),h.url('files_home',repo_name=c.repo_name))}</li> | |||
r318 | %if h.HasRepoPermissionAll('repository.admin')(c.repo_name): | ||
r320 | <li ${is_current('settings')}>${h.link_to(_('settings'),h.url('repo_settings_home',repo_name=c.repo_name))}</li> | ||
r318 | %endif | ||
r182 | </ul> | ||
%else: | |||
r216 | ##Root menu | ||
r182 | <ul class="page-nav"> | ||
<li ${is_current('home')}>${h.link_to(_('Home'),h.url('/'))}</li> | |||
r318 | %if h.HasPermissionAll('hg.admin')('access admin main page'): | ||
<li ${is_current('admin')}>${h.link_to(_('Admin'),h.url('admin_home'))}</li> | |||
%endif | |||
r182 | <li class="logout">${h.link_to(u'Logout',h.url('logout_home'))}</li> | ||
</ul> | |||
%endif | |||
r216 | </div> | ||
r91 | </%def> | ||
r216 | <%def name="submenu(current=None)"> | ||
<% | |||
def is_current(selected): | |||
if selected == current: | |||
return "class='current_submenu'" | |||
%> | |||
%if current != None: | |||
<div> | |||
<ul class="submenu"> | |||
r324 | <li ${is_current('repos')}>${h.link_to(_('repositories'),h.url('repos'),class_='repos')}</li> | ||
<li ${is_current('users')}>${h.link_to(_('users'),h.url('users'),class_='users')}</li> | |||
##commented<li ${is_current('permissions')}>${h.link_to(_('permissions'),h.url('permissions'),class_='permissions')}</li> | |||
r346 | <li ${is_current('settings')}>${h.link_to(_('settings'),h.url('admin_settings'),class_='settings')}</li> | ||
r216 | </ul> | ||
</div> | |||
%endif | |||
</%def> | |||
r91 | |||
r98 | <%def name="css()"> | ||
r102 | <link rel="stylesheet" href="/css/monoblue_custom.css" type="text/css" /> | ||
r98 | </%def> | ||
Marcin Kuzminski
|
r79 | ||
<%def name="js()"> | |||
<script type="text/javascript" src="/js/yui/utilities/utilities.js"></script> | |||
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> | |||
r176 | </%def> | ||
<!-- DEFINITION OF FORM ERROR FETCHER --> | |||
<%def name="get_form_error(element)"> | |||
%if hasattr(c,'form_errors') and type(c.form_errors) == dict: | |||
%if c.form_errors.get(element,False): | |||
<span class="error-message"> | |||
${c.form_errors.get(element,'')} | |||
</span> | |||
%endif | |||
%endif | |||
Marcin Kuzminski
|
r79 | </%def> |