root.html
170 lines
| 6.5 KiB
| text/html
|
HtmlLexer
r1157 | ## -*- coding: utf-8 -*- | |||
r2163 | <!DOCTYPE html> | |||
r1157 | <html xmlns="http://www.w3.org/1999/xhtml"> | |||
<head> | ||||
<title>${self.title()}</title> | ||||
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> | ||||
<meta name="robots" content="index, nofollow"/> | ||||
r1421 | <link rel="icon" href="${h.url('/images/icons/database_gear.png')}" type="image/png" /> | |||
## CSS ### | ||||
<%def name="css()"> | ||||
r2850 | <link rel="stylesheet" type="text/css" href="${h.url('/css/style.css', ver=c.rhodecode_version)}" media="screen"/> | |||
<link rel="stylesheet" type="text/css" href="${h.url('/css/pygments.css', ver=c.rhodecode_version)}"/> | ||||
r1421 | ## EXTRA FOR CSS | |||
${self.css_extra()} | ||||
</%def> | ||||
<%def name="css_extra()"> | ||||
</%def> | ||||
r1888 | ||||
r1157 | ${self.css()} | |||
r1888 | ||||
r1157 | %if c.ga_code: | |||
<!-- Analytics --> | ||||
<script type="text/javascript"> | ||||
var _gaq = _gaq || []; | ||||
_gaq.push(['_setAccount', '${c.ga_code}']); | ||||
_gaq.push(['_trackPageview']); | ||||
r1888 | ||||
r1157 | (function() { | |||
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; | ||||
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; | ||||
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); | ||||
})(); | ||||
</script> | ||||
%endif | ||||
r1888 | ||||
r1421 | ## JAVASCRIPT ## | |||
<%def name="js()"> | ||||
r2369 | <script type="text/javascript"> | |||
//JS translations map | ||||
var TRANSLATION_MAP = { | ||||
'add another comment':'${_("add another comment")}', | ||||
'Stop following this repository':"${_('Stop following this repository')}", | ||||
'Start following this repository':"${_('Start following this repository')}", | ||||
'Group':"${_('Group')}", | ||||
r2428 | 'members':"${_('members')}", | |||
'search truncated': "${_('search truncated')}", | ||||
r2453 | 'no matching files': "${_('no matching files')}" | |||
r2369 | ||||
}; | ||||
var _TM = TRANSLATION_MAP; | ||||
</script> | ||||
r2850 | <script type="text/javascript" src="${h.url('/js/yui.2.9.js', ver=c.rhodecode_version)}"></script> | |||
r2141 | <!--[if lt IE 9]> | |||
r1421 | <script language="javascript" type="text/javascript" src="${h.url('/js/excanvas.min.js')}"></script> | |||
<![endif]--> | ||||
r2850 | <script type="text/javascript" src="${h.url('/js/yui.flot.js', ver=c.rhodecode_version)}"></script> | |||
<script type="text/javascript" src="${h.url('/js/native.history.js', ver=c.rhodecode_version)}"></script> | ||||
<script type="text/javascript" src="${h.url('/js/rhodecode.js', ver=c.rhodecode_version)}"></script> | ||||
r1421 | ## EXTRA FOR JS | |||
${self.js_extra()} | ||||
r1888 | ||||
r1421 | <script type="text/javascript"> | |||
r2686 | (function(window,undefined){ | |||
// Prepare | ||||
var History = window.History; // Note: We are using a capital H instead of a lower h | ||||
if ( !History.enabled ) { | ||||
// History.js is disabled for this browser. | ||||
// This is because we can optionally choose to support HTML4 browsers or not. | ||||
return false; | ||||
} | ||||
})(window); | ||||
r1700 | var follow_base_url = "${h.url('toggle_following')}"; | |||
r2188 | ||||
r1700 | var onSuccessFollow = function(target){ | |||
r1421 | var f = YUD.get(target.id); | |||
var f_cnt = YUD.get('current_followers_count'); | ||||
r1888 | ||||
r1421 | if(f.getAttribute('class')=='follow'){ | |||
f.setAttribute('class','following'); | ||||
r2369 | f.setAttribute('title',_TM['Stop following this repository']); | |||
r1888 | ||||
r1421 | if(f_cnt){ | |||
var cnt = Number(f_cnt.innerHTML)+1; | ||||
f_cnt.innerHTML = cnt; | ||||
} | ||||
} | ||||
else{ | ||||
f.setAttribute('class','follow'); | ||||
r2369 | f.setAttribute('title',_TM['Start following this repository']); | |||
r1421 | if(f_cnt){ | |||
r2812 | var cnt = Number(f_cnt.innerHTML)-1; | |||
r1421 | f_cnt.innerHTML = cnt; | |||
r1888 | } | |||
r1421 | } | |||
} | ||||
r1888 | ||||
r1700 | var toggleFollowingUser = function(target,fallows_user_id,token,user_id){ | |||
r1421 | args = 'follows_user_id='+fallows_user_id; | |||
args+= '&auth_token='+token; | ||||
if(user_id != undefined){ | ||||
args+="&user_id="+user_id; | ||||
} | ||||
r1700 | YUC.asyncRequest('POST',follow_base_url,{ | |||
r1421 | success:function(o){ | |||
r1700 | onSuccessFollow(target); | |||
r1421 | } | |||
},args); | ||||
return false; | ||||
} | ||||
r1888 | ||||
r1700 | var toggleFollowingRepo = function(target,fallows_repo_id,token,user_id){ | |||
r1888 | ||||
r1421 | args = 'follows_repo_id='+fallows_repo_id; | |||
args+= '&auth_token='+token; | ||||
if(user_id != undefined){ | ||||
args+="&user_id="+user_id; | ||||
r1888 | } | |||
r1700 | YUC.asyncRequest('POST',follow_base_url,{ | |||
r1421 | success:function(o){ | |||
r1700 | onSuccessFollow(target); | |||
r1421 | } | |||
r1888 | },args); | |||
r1421 | return false; | |||
} | ||||
YUE.onDOMReady(function(){ | ||||
r1700 | tooltip_activate(); | |||
r1888 | show_more_event(); | |||
r1421 | YUE.on('quick_login_link','click',function(e){ | |||
r1888 | // make sure we don't redirect | |||
r1700 | YUE.preventDefault(e); | |||
r1888 | ||||
r1421 | if(YUD.hasClass('quick_login_link','enabled')){ | |||
YUD.setStyle('quick_login','display','none'); | ||||
YUD.removeClass('quick_login_link','enabled'); | ||||
} | ||||
else{ | ||||
YUD.setStyle('quick_login','display',''); | ||||
YUD.addClass('quick_login_link','enabled'); | ||||
r1926 | var usr = YUD.get('username'); | |||
if(usr){ | ||||
usr.focus(); | ||||
} | ||||
r1421 | } | |||
}); | ||||
r1888 | }) | |||
r1421 | </script> | |||
</%def> | ||||
r1700 | <%def name="js_extra()"></%def> | |||
r1157 | ${self.js()} | |||
r2413 | <%def name="head_extra()"></%def> | |||
${self.head_extra()} | ||||
r1157 | </head> | |||
<body id="body"> | ||||
r2163 | ## IE hacks | |||
<!--[if IE 7]> | ||||
<script>YUD.addClass(document.body,'ie7')</script> | ||||
r2174 | <![endif]--> | |||
r2163 | <!--[if IE 8]> | |||
<script>YUD.addClass(document.body,'ie8')</script> | ||||
<![endif]--> | ||||
<!--[if IE 9]> | ||||
<script>YUD.addClass(document.body,'ie9')</script> | ||||
r2174 | <![endif]--> | |||
r2163 | ||||
${next.body()} | ||||
r1157 | </body> | |||
r1888 | </html> | |||