Changeset - c78de39f30fc
[Not reviewed]
beta
0 1 0
Mads Kiilerich - 13 years ago 2013-04-03 17:20:32
madski@unity3d.com
Grafted from: 5e0cfb2234ca
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.
1 file changed with 15 insertions and 0 deletions:
0 comments (0 inline, 0 general)
rhodecode/templates/summary/summary.html
Show inline comments
 
@@ -15,6 +15,21 @@
 
<%def name="head_extra()">
 
<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" />
 
<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" />
 

	
 
<script>
 
redirect_hash_branch = function(){
 
    var branch = window.location.hash.replace(/^#(.*)/, '$1');
 
	if (branch){
 
	    window.location = "${h.url('changelog_home',repo_name=c.repo_name,branch='__BRANCH__')}"
 
	    	.replace('__BRANCH__',branch);
 
	}
 
}
 
redirect_hash_branch();
 
window.onhashchange = function() {
 
	redirect_hash_branch();
 
};
 
</script>
 

	
 
</%def>
 

	
 
<%def name="main()">
0 comments (0 inline, 0 general)