##// END OF EJS Templates
routing: removed more usage of pylons url() objects.
marcink -
r2103:c8a23404 default
parent child
Show More
@@ -52,6 +52,7 class DebugStyleView(BaseAppView):
52 t_path = self.request.matchdict['t_path']
52 t_path = self.request.matchdict['t_path']
53 c = self.load_default_context()
53 c = self.load_default_context()
54 c.active = os.path.splitext(t_path)[0]
54 c.active = os.path.splitext(t_path)[0]
55 c.came_from = ''
55
56
56 return render_to_response(
57 return render_to_response(
57 'debug_style/' + t_path, self._get_template_context(c),
58 'debug_style/' + t_path, self._get_template_context(c),
@@ -38,7 +38,7 and our server configuration are in sync
38
38
39 then you can retrieve the url by simply calling the URL function:
39 then you can retrieve the url by simply calling the URL function:
40
40
41 `h.url('url_name')`
41 `h.route_path('url_name')`
42
42
43 The redirection must be first implemented in our servers before
43 The redirection must be first implemented in our servers before
44 you can see it working.
44 you can see it working.
@@ -299,7 +299,7 class CommentsModel(BaseModel):
299 'pullrequest_show',
299 'pullrequest_show',
300 repo_name=pr_target_repo.repo_name,
300 repo_name=pr_target_repo.repo_name,
301 pull_request_id=pull_request_obj.pull_request_id,
301 pull_request_id=pull_request_obj.pull_request_id,
302 anchor='comment-%s' % comment.comment_id)
302 _anchor='comment-%s' % comment.comment_id)
303
303
304 # set some variables for email notification
304 # set some variables for email notification
305 pr_target_repo_url = h.route_url(
305 pr_target_repo_url = h.route_url(
@@ -34,6 +34,8 function registerRCRoutes() {
34 pyroutes.register('ops_ping', '/_admin/ops/ping', []);
34 pyroutes.register('ops_ping', '/_admin/ops/ping', []);
35 pyroutes.register('ops_error_test', '/_admin/ops/error', []);
35 pyroutes.register('ops_error_test', '/_admin/ops/error', []);
36 pyroutes.register('ops_redirect_test', '/_admin/ops/redirect', []);
36 pyroutes.register('ops_redirect_test', '/_admin/ops/redirect', []);
37 pyroutes.register('ops_ping_legacy', '/_admin/ping', []);
38 pyroutes.register('ops_error_test_legacy', '/_admin/error_test', []);
37 pyroutes.register('admin_home', '/_admin', []);
39 pyroutes.register('admin_home', '/_admin', []);
38 pyroutes.register('admin_audit_logs', '/_admin/audit_logs', []);
40 pyroutes.register('admin_audit_logs', '/_admin/audit_logs', []);
39 pyroutes.register('pull_requests_global_0', '/_admin/pull_requests/%(pull_request_id)s', ['pull_request_id']);
41 pyroutes.register('pull_requests_global_0', '/_admin/pull_requests/%(pull_request_id)s', ['pull_request_id']);
@@ -4,13 +4,14
4 var CHANNELSTREAM_SETTINGS = {
4 var CHANNELSTREAM_SETTINGS = {
5 'enabled': true,
5 'enabled': true,
6 'ws_location': '${request.registry.settings.get('channelstream.ws_url')}',
6 'ws_location': '${request.registry.settings.get('channelstream.ws_url')}',
7 'webapp_location': '${h.url('/', qualified=True)[:-1]}'
7 'webapp_location': '${h.route_url('home').rstrip('/')}'
8 };
8 };
9 %else:
9 %else:
10 var CHANNELSTREAM_SETTINGS = {
10 var CHANNELSTREAM_SETTINGS = {
11 'enabled':false,
11 'enabled':false,
12 'ws_location': '',
12 'ws_location': '',
13 'webapp_location': ''};
13 'webapp_location': '${h.route_url('home').rstrip('/')}'
14 };
14 %endif
15 %endif
15
16
16 </script>
17 </script>
@@ -27,7 +27,7 return '%s_%s_%i' % (h.safeid(filename),
27 <%
27 <%
28 new_args = request.GET.mixed()
28 new_args = request.GET.mixed()
29 new_args.update(kw)
29 new_args.update(kw)
30 return h.url('', **new_args)
30 return request.current_route_path(_query=new_args)
31 %>
31 %>
32 </%def>
32 </%def>
33
33
@@ -124,15 +124,16 collapse_all = len(diffset.files) > coll
124 <a class="tooltip revision" title="${h.tooltip(commit.message)}" href="${h.route_path('repo_commit',repo_name=c.repo_name,commit_id=commit.raw_id)}">${'r%s:%s' % (commit.revision,h.short_id(commit.raw_id))}</a> -
124 <a class="tooltip revision" title="${h.tooltip(commit.message)}" href="${h.route_path('repo_commit',repo_name=c.repo_name,commit_id=commit.raw_id)}">${'r%s:%s' % (commit.revision,h.short_id(commit.raw_id))}</a> -
125 ${h.age_component(commit.date)} -
125 ${h.age_component(commit.date)} -
126 %endif
126 %endif
127 %if diffset.limited_diff:
127
128 ${_('The requested commit is too big and content was truncated.')}
128 %if diffset.limited_diff:
129 ${_('The requested commit is too big and content was truncated.')}
129
130
130 ${_ungettext('%(num)s file changed.', '%(num)s files changed.', diffset.changed_files) % {'num': diffset.changed_files}}
131 ${_ungettext('%(num)s file changed.', '%(num)s files changed.', diffset.changed_files) % {'num': diffset.changed_files}}
131 <a href="${link_for(fulldiff=1)}" onclick="return confirm('${_("Showing a big diff might take some time and resources, continue?")}')">${_('Show full diff')}</a>
132 <a href="${link_for(fulldiff=1)}" onclick="return confirm('${_("Showing a big diff might take some time and resources, continue?")}')">${_('Show full diff')}</a>
132 %else:
133 %else:
133 ${_ungettext('%(num)s file changed: %(linesadd)s inserted, ''%(linesdel)s deleted',
134 ${_ungettext('%(num)s file changed: %(linesadd)s inserted, ''%(linesdel)s deleted',
134 '%(num)s files changed: %(linesadd)s inserted, %(linesdel)s deleted', diffset.changed_files) % {'num': diffset.changed_files, 'linesadd': diffset.lines_added, 'linesdel': diffset.lines_deleted}}
135 '%(num)s files changed: %(linesadd)s inserted, %(linesdel)s deleted', diffset.changed_files) % {'num': diffset.changed_files, 'linesadd': diffset.lines_added, 'linesdel': diffset.lines_deleted}}
135 %endif
136 %endif
136
137
137 </h2>
138 </h2>
138 </div>
139 </div>
@@ -27,7 +27,7
27 <div id="quick_login">
27 <div id="quick_login">
28 <h4>${_('Sign in to your account')}</h4>
28 <h4>${_('Sign in to your account')}</h4>
29
29
30 ${h.form(h.url('login_home',came_from=h.url.current()), needs_csrf_token=False)}
30 ${h.form(h.route_path('login'), needs_csrf_token=False)}
31 <div class="form form-vertical">
31 <div class="form form-vertical">
32 <div class="fields">
32 <div class="fields">
33
33
@@ -43,7 +43,7
43 <div class="field">
43 <div class="field">
44 <div class="label">
44 <div class="label">
45 <label for="password">${_('Password')}:</label>
45 <label for="password">${_('Password')}:</label>
46 <span class="forgot_password">${h.link_to(_('(Forgot password?)'),h.url('reset_password'))}</span>
46 <span class="forgot_password">${h.link_to(_('(Forgot password?)'),h.route_path('reset_password'))}</span>
47 </div>
47 </div>
48 <div class="input">
48 <div class="input">
49 ${h.password('password',class_='focus',tabindex=2)}
49 ${h.password('password',class_='focus',tabindex=2)}
@@ -53,7 +53,7
53 <div class="buttons">
53 <div class="buttons">
54 <div class="register">
54 <div class="register">
55 %if h.HasPermissionAny('hg.admin', 'hg.register.auto_activate', 'hg.register.manual_activate')():
55 %if h.HasPermissionAny('hg.admin', 'hg.register.auto_activate', 'hg.register.manual_activate')():
56 ${h.link_to(_("Don't have an account ?"),h.url('register'))}
56 ${h.link_to(_("Don't have an account ?"),h.route_path('register'))}
57 %endif
57 %endif
58 </div>
58 </div>
59 <div class="submit">
59 <div class="submit">
General Comments 0
You need to be logged in to leave comments. Login now