changeset 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 b6a25169c005
children 27f801e03489
files pylons_app/templates/files/files_source.html
diffstat 1 files changed, 15 insertions(+), 3 deletions(-) [+]
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