##// END OF EJS Templates
core: use new style pyramid partial renderer where possible.
marcink -
r1897:01df07bd default
parent child Browse files
Show More
@@ -24,7 +24,6 b' import logging'
24 24 from pyramid.httpexceptions import HTTPFound
25 25
26 26 from rhodecode.lib import helpers as h
27 from rhodecode.lib.utils import PartialRenderer
28 27 from rhodecode.lib.utils2 import StrictAttributeDict, safe_int, datetime_to_time
29 28 from rhodecode.lib.vcs.exceptions import RepositoryRequirementError
30 29 from rhodecode.lib.ext_json import json
@@ -219,8 +218,8 b' class BaseReferencesView(RepoAppView):'
219 218 return c
220 219
221 220 def load_refs_context(self, ref_items, partials_template):
222 _render = PartialRenderer(partials_template)
223 221 _data = []
222 _render = self.request.get_partial_renderer(partials_template)
224 223 pre_load = ["author", "date", "message"]
225 224
226 225 is_svn = h.is_svn(self.rhodecode_vcs_repo)
@@ -33,7 +33,6 b' from rhodecode.lib.ext_json import json'
33 33 from rhodecode.lib.auth import (
34 34 LoginRequired, HasPermissionAllDecorator, CSRFRequired)
35 35 from rhodecode.lib import helpers as h
36 from rhodecode.lib.utils import PartialRenderer
37 36 from rhodecode.lib.utils2 import safe_int, safe_unicode
38 37 from rhodecode.model.auth_token import AuthTokenModel
39 38 from rhodecode.model.user import UserModel
@@ -82,7 +81,8 b' class AdminUsersView(BaseAppView, DataGr'
82 81 draw, start, limit = self._extract_chunk(self.request)
83 82 search_q, order_by, order_dir = self._extract_ordering(self.request)
84 83
85 _render = PartialRenderer('data_table/_dt_elements.mako')
84 _render = self.request.get_partial_renderer(
85 'data_table/_dt_elements.mako')
86 86
87 87 def user_actions(user_id, username):
88 88 return _render("user_actions", user_id, username)
@@ -112,8 +112,8 b' class GistView(BaseAppView):'
112 112 gists = _gists.filter(Gist.gist_type == Gist.GIST_PUBLIC)
113 113 c.active = 'public'
114 114
115 from rhodecode.lib.utils import PartialRenderer
116 _render = PartialRenderer('data_table/_dt_elements.mako')
115 _render = self.request.get_partial_renderer(
116 'data_table/_dt_elements.mako')
117 117
118 118 data = []
119 119
@@ -35,7 +35,6 b' from rhodecode.lib.ext_json import json'
35 35 from rhodecode.lib.auth import LoginRequired, NotAnonymous, CSRFRequired
36 36 from rhodecode.lib.channelstream import channelstream_request, \
37 37 ChannelstreamException
38 from rhodecode.lib.utils import PartialRenderer
39 38 from rhodecode.lib.utils2 import safe_int, md5, str2bool
40 39 from rhodecode.model.auth_token import AuthTokenModel
41 40 from rhodecode.model.comment import CommentsModel
@@ -496,7 +495,8 b' class MyAccountView(BaseAppView, DataGri'
496 495 def _get_pull_requests_list(self, statuses):
497 496 draw, start, limit = self._extract_chunk(self.request)
498 497 search_q, order_by, order_dir = self._extract_ordering(self.request)
499 _render = PartialRenderer('data_table/_dt_elements.mako')
498 _render = self.request.get_partial_renderer(
499 'data_table/_dt_elements.mako')
500 500
501 501 pull_requests = PullRequestModel().get_im_participating_in(
502 502 user_id=self._rhodecode_user.user_id,
@@ -28,7 +28,6 b' from rhodecode.apps._base import RepoApp'
28 28 from rhodecode.lib import helpers as h, diffs, codeblocks
29 29 from rhodecode.lib.auth import (
30 30 LoginRequired, HasRepoPermissionAnyDecorator)
31 from rhodecode.lib.utils import PartialRenderer
32 31 from rhodecode.lib.utils2 import str2bool, safe_int, safe_str
33 32 from rhodecode.lib.vcs.backends.base import EmptyCommit
34 33 from rhodecode.lib.vcs.exceptions import CommitDoesNotExistError, \
@@ -57,7 +56,8 b' class RepoPullRequestsView(RepoAppView, '
57 56
58 57 draw, start, limit = self._extract_chunk(self.request)
59 58 search_q, order_by, order_dir = self._extract_ordering(self.request)
60 _render = PartialRenderer('data_table/_dt_elements.mako')
59 _render = self.request.get_partial_renderer(
60 'data_table/_dt_elements.mako')
61 61
62 62 # pagination
63 63
@@ -106,9 +106,10 b' class UserGroupsController(BaseControlle'
106 106 # permission check inside
107 107 @NotAnonymous()
108 108 def index(self):
109
110 from rhodecode.lib.utils import PartialRenderer
111 _render = PartialRenderer('data_table/_dt_elements.mako')
109 # TODO(marcink): remove bind to self.request after pyramid migration
110 self.request = c.pyramid_request
111 _render = self.request.get_partial_renderer(
112 'data_table/_dt_elements.mako')
112 113
113 114 def user_group_name(user_group_id, user_group_name):
114 115 return _render("user_group_name", user_group_id, user_group_name)
@@ -195,10 +195,9 b' class RepoModel(BaseModel):'
195 195
196 196 def get_repos_as_dict(self, repo_list=None, admin=False,
197 197 super_user_actions=False):
198
199 from rhodecode.lib.utils import PartialRenderer
200 _render = PartialRenderer('data_table/_dt_elements.mako')
201 c = _render.c
198 _render = get_current_request().get_partial_renderer(
199 'data_table/_dt_elements.mako')
200 c = _render.get_call_context()
202 201
203 202 def quick_menu(repo_name):
204 203 return _render('quick_menu', repo_name)
@@ -673,10 +673,11 b' class RepoGroupModel(BaseModel):'
673 673 def get_repo_groups_as_dict(self, repo_group_list=None, admin=False,
674 674 super_user_actions=False):
675 675
676 from rhodecode.lib.utils import PartialRenderer
677 _render = PartialRenderer('data_table/_dt_elements.mako')
678 c = _render.c
679 h = _render.h
676 from pyramid.threadlocal import get_current_request
677 _render = get_current_request().get_partial_renderer(
678 'data_table/_dt_elements.mako')
679 c = _render.get_call_context()
680 h = _render.get_helpers()
680 681
681 682 def quick_menu(repo_group_name):
682 683 return _render('quick_repo_group_menu', repo_group_name)
General Comments 0
You need to be logged in to leave comments. Login now