comparison rhodecode/templates/summary/summary.html @ 3655:c78de39f30fc beta

summary: redirect from repo URLs with #branchname to changelog with this branch This implements partial support for the Mercurial syntax for specifying revisions so https://secure.rhodecode.org/rhodecode/#beta works both for pulling with Mercurial and browsing. This uses javascript, and has a bit of extra support for onhashchange in HTML5 browsers.
author Mads Kiilerich <madski@unity3d.com>
date Wed, 03 Apr 2013 17:20:32 +0200
parents ec6354949623
children 79abd21d51c4
comparison
equal deleted inserted replaced
3654:ec6354949623 3655:c78de39f30fc
13 </%def> 13 </%def>
14 14
15 <%def name="head_extra()"> 15 <%def name="head_extra()">
16 <link href="${h.url('atom_feed_home',repo_name=c.dbrepo.repo_name,api_key=c.rhodecode_user.api_key)}" rel="alternate" title="${_('%s ATOM feed') % c.repo_name}" type="application/atom+xml" /> 16 <link href="${h.url('atom_feed_home',repo_name=c.dbrepo.repo_name,api_key=c.rhodecode_user.api_key)}" rel="alternate" title="${_('%s ATOM feed') % c.repo_name}" type="application/atom+xml" />
17 <link href="${h.url('rss_feed_home',repo_name=c.dbrepo.repo_name,api_key=c.rhodecode_user.api_key)}" rel="alternate" title="${_('%s RSS feed') % c.repo_name}" type="application/rss+xml" /> 17 <link href="${h.url('rss_feed_home',repo_name=c.dbrepo.repo_name,api_key=c.rhodecode_user.api_key)}" rel="alternate" title="${_('%s RSS feed') % c.repo_name}" type="application/rss+xml" />
18
19 <script>
20 redirect_hash_branch = function(){
21 var branch = window.location.hash.replace(/^#(.*)/, '$1');
22 if (branch){
23 window.location = "${h.url('changelog_home',repo_name=c.repo_name,branch='__BRANCH__')}"
24 .replace('__BRANCH__',branch);
25 }
26 }
27 redirect_hash_branch();
28 window.onhashchange = function() {
29 redirect_hash_branch();
30 };
31 </script>
32
18 </%def> 33 </%def>
19 34
20 <%def name="main()"> 35 <%def name="main()">
21 ${self.context_bar('summary')} 36 ${self.context_bar('summary')}
22 <% 37 <%