110: make branch property link to a source control viewer (such as Trac) [patch]

PNC****@gmai***** (Google Code) (Is this you? Claim this profile.)
Nov. 24, 2007
This patch will add a source_viewer property to the Repository object,
which acts in a similar way to the bug_tracker property.  It also includes
the appropriate Javascript changes to support AJAX editing of the new
linkable property.
Index: reviews/templatetags/reviewtags.py
===================================================================
--- reviews/templatetags/reviewtags.py	(revision 659)
+++ reviews/templatetags/reviewtags.py	(working copy)
@@ -403,3 +403,10 @@
         return review_request.repository.bug_tracker % bug_id
 
     return None
+    
+@register.filter
+def source_url(path, review_request):
+    if review_request.repository.source_viewer:
+        return review_request.repository.source_viewer % path
+
+    return None
Index: htdocs/scripts/reviews.js
===================================================================
--- htdocs/scripts/reviews.js	(revision 659)
+++ htdocs/scripts/reviews.js	(working copy)
@@ -54,6 +54,21 @@
 		this, true);
 }
 
+function registerLinkEditor(field, onComplete) {
+	var editor = new RB.widgets.InlineEditor({
+		el: field,
+		cls: field + '-editor',
+		showEditIcon: true,
+		stripTags: true,
+		notifyUnchangedCompletion: true
+	});
+
+	editor.on('complete',
+		funct
david
#1 david
Can you post this on http://reviews.review-board.org so we can do some back-and-forth
on it?
  • -Type-Defect
    +Type-Patch
    +Component-Reviews
david
#2 david
It seems to me that this has basically be abandoned.  Given that doing it right will
require a completely different approach (and I'm not sure it's even really possible
to "do it right" without some sort of cross-referencing system like ctags/lxr), I'm
going to close this out.
  • +Incomplete