Mercurial > kallithea
diff pylons_app/templates/files/files_source.html @ 413:0ebec9b88d13
added jump to revision from file history.
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Thu, 19 Aug 2010 22:38:00 +0200 |
parents | 9a7ae16ff53e |
children | 9836541b0509 |
line wrap: on
line diff
--- a/pylons_app/templates/files/files_source.html Thu Aug 19 21:38:08 2010 +0200 +++ b/pylons_app/templates/files/files_source.html Thu Aug 19 22:38:00 2010 +0200 @@ -17,8 +17,9 @@ <div> ${h.form(h.url('files_diff_home',repo_name=c.repo_name,f_path=c.f_path),method='get')} ${h.hidden('diff2',c.files_list.last_changeset._short)} - ${h.select('diff1','',c.file_history)} - ${h.submit('diff','diff',class_="ui-button ui-widget ui-state-default ui-corner-all")} + ${h.select('diff1',c.files_list.last_changeset._short,c.file_history)} + ${h.submit('diff','diff to revision',class_="ui-button ui-widget ui-state-default ui-corner-all")} + ${h.submit('show_rev','show at revision',class_="ui-button ui-widget ui-state-default ui-corner-all")} ${h.end_form()} </div> </dd> @@ -33,4 +34,15 @@ <div class="code-body"> ${h.pygmentize(c.files_list,linenos=True,anchorlinenos=True,lineanchors='S',cssclass="code-highlight")} </div> -</div> \ No newline at end of file +</div> + +<script type="text/javascript"> +YAHOO.util.Event.onDOMReady(function(){ + YAHOO.util.Event.addListener('show_rev','click',function(e){ + YAHOO.util.Event.preventDefault(e); + var cs = YAHOO.util.Dom.get('diff1').value; + var url = "${h.url('files_home',repo_name=c.repo_name,revision='__CS__',f_path=c.f_path)}".replace('__CS__',cs); + window.location = url; + }); + }); +</script> \ No newline at end of file