[PATCH 1 of 3] pullrequest overview: render data from templates iso controller

Thomas De Schampheleire patrickdepinguin at gmail.com
Sat Feb 21 16:48:13 EST 2015


# HG changeset patch
# User Thomas De Schampheleire <thomas.de_schampheleire at alcatel-lucent.com>
# Date 1424552694 -3600
#      Sat Feb 21 22:04:54 2015 +0100
# Node ID ddadf072c99554bfb9d174664148f77d453912fc
# Parent  077945f977a22701f48e4512b42bfea6f342be13
pullrequest overview: render data from templates iso controller

Currently, the pullrequest controller renders the 'data' part of the
pullrequest overview in a context variable, expanded in the
pullrequest_show_all template. This pattern is used in a few other places,
but mainly useful when that data is also loaded dynamically over ajax, which
is not the case for the pullrequest overview.

Remove this context variable  and include the data template directly from
the show_all template directly.

diff --git a/kallithea/controllers/pullrequests.py b/kallithea/controllers/pullrequests.py
--- a/kallithea/controllers/pullrequests.py
+++ b/kallithea/controllers/pullrequests.py
@@ -204,11 +204,6 @@
 
         c.pullrequests_pager = Page(c.pull_requests, page=p, items_per_page=10)
 
-        c.pullrequest_data = render('/pullrequests/pullrequest_data.html')
-
-        if request.environ.get('HTTP_X_PARTIAL_XHR'):
-            return c.pullrequest_data
-
         return render('/pullrequests/pullrequest_show_all.html')
 
     @LoginRequired()
diff --git a/kallithea/templates/pullrequests/pullrequest_show_all.html b/kallithea/templates/pullrequests/pullrequest_show_all.html
--- a/kallithea/templates/pullrequests/pullrequest_show_all.html
+++ b/kallithea/templates/pullrequests/pullrequest_show_all.html
@@ -54,7 +54,7 @@
         </div>
     </div>
 
-    ${c.pullrequest_data}
+    <%include file='pullrequest_data.html'/>
 
 </div>
 </%def>


More information about the kallithea-general mailing list