pyramid: stop relying on global mako url() function.
- use only the helpers method
This commit is contained in:
parent
68cdaa3763
commit
0b2c148765
38 changed files with 46 additions and 47 deletions
|
|
@ -54,7 +54,6 @@ def add_renderer_globals(event):
|
|||
# Put pylons stuff into the context. This will be removed as soon as
|
||||
# migration to pyramid is finished.
|
||||
event['c'] = pylons.tmpl_context
|
||||
event['url'] = pylons.url
|
||||
|
||||
# TODO: When executed in pyramid view context the request is not available
|
||||
# in the event. Find a better solution to get the request.
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
<h3 class="panel-title">${_('Default Settings For New Repositories')}</h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
${h.secure_form(url('admin_defaults_repositories'), method='post')}
|
||||
${h.secure_form(h.url('admin_defaults_repositories'), method='post')}
|
||||
<div class="form">
|
||||
<!-- fields -->
|
||||
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@
|
|||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
var url_action = "${url('notification', notification_id='__NOTIFICATION_ID__')}";
|
||||
var url_action = "${h.url('notification', notification_id='__NOTIFICATION_ID__')}";
|
||||
var run = function(){
|
||||
$('#notification_data').on('click','.delete-notification',function(e){
|
||||
var notification_id = e.currentTarget.id;
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ unread = lambda n:{False:'unread'}.get(n)
|
|||
<div id="notification_${notification.notification.notification_id}" class="container ${unread(notification.read)}">
|
||||
<div class="notification-header">
|
||||
<div class="desc ${unread(notification.read)}">
|
||||
<a href="${url('notification', notification_id=notification.notification.notification_id)}">
|
||||
<a href="${h.url('notification', notification_id=notification.notification.notification_id)}">
|
||||
${base.gravatar(notification.notification.created_by_user.email, 16)}
|
||||
${notification.notification.description}
|
||||
</a>
|
||||
|
|
|
|||
|
|
@ -47,8 +47,8 @@
|
|||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
var url = "${url('notification', notification_id='__NOTIFICATION_ID__')}";
|
||||
var main = "${url('notifications')}";
|
||||
var url = "${h.url('notification', notification_id='__NOTIFICATION_ID__')}";
|
||||
var main = "${h.url('notifications')}";
|
||||
$('.delete-notification').on('click',function(e){
|
||||
var notification_id = e.currentTarget.id;
|
||||
deleteNotification(url,notification_id,[function(){window.location=main}])
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
<h3 class="panel-title">${_('System Wide Application Permissions')}</h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
${h.secure_form(url('admin_permissions_application'), method='post')}
|
||||
${h.secure_form(h.url('admin_permissions_application'), method='post')}
|
||||
<div class="form">
|
||||
<!-- fields -->
|
||||
<div class="fields">
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
|
||||
${h.secure_form(url('admin_permissions_global'), method='post')}
|
||||
${h.secure_form(h.url('admin_permissions_global'), method='post')}
|
||||
<div class="form permissions-global">
|
||||
<!-- fields -->
|
||||
<div class="fields">
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
<div class="panel-body">
|
||||
<p>${_('Default system permissions. Each permissions management entity will be created with the following default settings. Check the overwrite checkbox to force any permission changes on already existing settings.')}
|
||||
</p>
|
||||
${h.secure_form(url('admin_permissions_object'), method='post')}
|
||||
${h.secure_form(h.url('admin_permissions_object'), method='post')}
|
||||
<div class="form">
|
||||
<div class="fields">
|
||||
<div class="field">
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@
|
|||
${self.breadcrumbs()}
|
||||
</div>
|
||||
<!-- end box / title -->
|
||||
${h.secure_form(url('repo_groups'), method='post')}
|
||||
${h.secure_form(h.url('repo_groups'), method='post')}
|
||||
<div class="form">
|
||||
<!-- fields -->
|
||||
<div class="fields">
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
<h3 class="panel-title">${_('Repository Group Permissions')}</h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
${h.secure_form(url('edit_repo_group_perms', group_name=c.repo_group.group_name),method='put')}
|
||||
${h.secure_form(h.url('edit_repo_group_perms', group_name=c.repo_group.group_name),method='put')}
|
||||
<table id="permissions_manage" class="rctable permissions">
|
||||
<tr>
|
||||
<th class="td-radio">${_('None')}</th>
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
<h3 class="panel-title">${_('Settings for Repository Group: %s') % c.repo_group.name}</h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
${h.secure_form(url('update_repo_group',group_name=c.repo_group.group_name),method='put')}
|
||||
${h.secure_form(h.url('update_repo_group',group_name=c.repo_group.group_name),method='put')}
|
||||
<div class="form">
|
||||
<!-- fields -->
|
||||
<div class="fields">
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
## -*- coding: utf-8 -*-
|
||||
|
||||
${h.secure_form(url('repos'))}
|
||||
${h.secure_form(h.url('repos'))}
|
||||
<div class="form">
|
||||
<!-- fields -->
|
||||
<div class="fields">
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@
|
|||
<td class="td-hash">${field.field_key}</td>
|
||||
<td class="td-type">${field.field_type}</td>
|
||||
<td class="td-action">
|
||||
${h.secure_form(url('delete_repo_fields', repo_name=c.repo_info.repo_name, field_id=field.repo_field_id),method='delete')}
|
||||
${h.secure_form(h.url('delete_repo_fields', repo_name=c.repo_info.repo_name, field_id=field.repo_field_id),method='delete')}
|
||||
${h.hidden('del_repo_field',field.repo_field_id)}
|
||||
<button class="btn btn-link btn-danger" type="submit"
|
||||
onclick="return confirm('${_('Confirm to delete this field: %s') % field.field_key}');">
|
||||
|
|
@ -31,7 +31,7 @@
|
|||
</table>
|
||||
</div>
|
||||
%endif
|
||||
${h.secure_form(url('create_repo_fields', repo_name=c.repo_name),method='put')}
|
||||
${h.secure_form(h.url('create_repo_fields', repo_name=c.repo_name),method='put')}
|
||||
<div class="form">
|
||||
<!-- fields -->
|
||||
<div class="fields">
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<%namespace name="its" file="/base/issue_tracker_settings.mako"/>
|
||||
|
||||
<div id="repo_issue_tracker" class="${'inherited' if c.settings_model.inherit_global_settings else ''}">
|
||||
${h.secure_form(url('repo_issuetracker_save', repo_name=c.repo_name), method='post', id="inherit-form")}
|
||||
${h.secure_form(h.url('repo_issuetracker_save', repo_name=c.repo_name), method='post', id="inherit-form")}
|
||||
<div class="panel panel-default panel-body">
|
||||
<div class="fields">
|
||||
<div class="field">
|
||||
|
|
@ -72,8 +72,8 @@
|
|||
<div class="panel-body">
|
||||
${its.issue_tracker_settings_table(
|
||||
patterns=c.repo_patterns.items(),
|
||||
form_url=url('repo_settings_issuetracker', repo_name=c.repo_info.repo_name),
|
||||
delete_url=url('repo_issuetracker_delete', repo_name=c.repo_info.repo_name)
|
||||
form_url=h.url('repo_settings_issuetracker', repo_name=c.repo_info.repo_name),
|
||||
delete_url=h.url('repo_issuetracker_delete', repo_name=c.repo_info.repo_name)
|
||||
)}
|
||||
<div class="buttons">
|
||||
<button type="submit" class="btn btn-primary save-inheritance" id="save">${_('Save')}</button>
|
||||
|
|
@ -92,7 +92,7 @@
|
|||
</div>
|
||||
<div class="panel-body">
|
||||
${its.issue_tracker_new_row()}
|
||||
${its.issue_tracker_settings_test(test_url=url('repo_issuetracker_test', repo_name=c.repo_info.repo_name))}
|
||||
${its.issue_tracker_settings_test(test_url=h.url('repo_issuetracker_test', repo_name=c.repo_info.repo_name))}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@
|
|||
</code>
|
||||
</p>
|
||||
|
||||
${h.secure_form(url('edit_repo_remote', repo_name=c.repo_name), method='put')}
|
||||
${h.secure_form(h.url('edit_repo_remote', repo_name=c.repo_name), method='put')}
|
||||
<div class="form">
|
||||
<div class="fields">
|
||||
${h.submit('remote_pull_%s' % c.repo_info.repo_name,_('Pull changes from remote location'),class_="btn btn-small",onclick="return confirm('"+_('Confirm to pull changes from remote side')+"');")}
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
<h3 class="panel-title">${_('Repository statistics')}</h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
${h.secure_form(url('edit_repo_statistics', repo_name=c.repo_info.repo_name), method='put')}
|
||||
${h.secure_form(h.url('edit_repo_statistics', repo_name=c.repo_info.repo_name), method='put')}
|
||||
<div class="form">
|
||||
<div class="fields">
|
||||
<div class="field" >
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<%namespace name="vcss" file="/base/vcs_settings.mako"/>
|
||||
|
||||
<div id="repo_vcs_settings" class="${'inherited' if c.inherit_global_settings else ''}">
|
||||
${h.secure_form(url('repo_vcs_settings', repo_name=c.repo_info.repo_name), method='post')}
|
||||
${h.secure_form(h.url('repo_vcs_settings', repo_name=c.repo_info.repo_name), method='post')}
|
||||
<div class="form panel panel-default">
|
||||
<div class="fields panel-body">
|
||||
<div class="field">
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@
|
|||
<h3 class="panel-title">${_('Test Email')}</h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
${h.secure_form(url('admin_settings_email'), method='post')}
|
||||
${h.secure_form(h.url('admin_settings_email'), method='post')}
|
||||
|
||||
<div class="field input">
|
||||
${h.text('test_email', size=60, placeholder=_('enter valid email'))}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
${h.secure_form(url('admin_settings_global'), method='post')}
|
||||
${h.secure_form(h.url('admin_settings_global'), method='post')}
|
||||
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading" id="branding-options">
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@
|
|||
</div>
|
||||
<div class="panel-body">
|
||||
% if c.visual.allow_custom_hooks_settings:
|
||||
${h.secure_form(url('admin_settings_hooks'), method='post')}
|
||||
${h.secure_form(h.url('admin_settings_hooks'), method='post')}
|
||||
<div class="form">
|
||||
<div class="fields">
|
||||
|
||||
|
|
|
|||
|
|
@ -5,11 +5,11 @@
|
|||
<h3 class="panel-title">${_('Issue Tracker / Wiki Patterns')}</h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
${h.secure_form(url('admin_settings_issuetracker_save'), method='post')}
|
||||
${h.secure_form(h.url('admin_settings_issuetracker_save'), method='post')}
|
||||
${its.issue_tracker_settings_table(
|
||||
patterns=c.issuetracker_entries.items(),
|
||||
form_url=url('admin_settings_issuetracker'),
|
||||
delete_url=url('admin_issuetracker_delete')
|
||||
form_url=h.url('admin_settings_issuetracker'),
|
||||
delete_url=h.url('admin_issuetracker_delete')
|
||||
)}
|
||||
<div class="buttons">
|
||||
<button type="submit" class="btn btn-primary" id="save">${_('Save')}</button>
|
||||
|
|
@ -25,7 +25,7 @@
|
|||
</div>
|
||||
<div class="panel-body">
|
||||
${its.issue_tracker_new_row()}
|
||||
${its.issue_tracker_settings_test(test_url=url('admin_issuetracker_test'))}
|
||||
${its.issue_tracker_settings_test(test_url=h.url('admin_issuetracker_test'))}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
<h3 class="panel-title">${_('Labs Settings')}</h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
${h.secure_form(url('admin_settings_labs'), method='post')}
|
||||
${h.secure_form(h.url('admin_settings_labs'), method='post')}
|
||||
<div class="form">
|
||||
<div class="fields">
|
||||
% if not c.lab_settings:
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
${h.secure_form(url('admin_settings_mapping'), method='post')}
|
||||
${h.secure_form(h.url('admin_settings_mapping'), method='post')}
|
||||
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<%namespace name="vcss" file="/base/vcs_settings.mako"/>
|
||||
|
||||
${h.secure_form(url('admin_settings_vcs'), method='post')}
|
||||
${h.secure_form(h.url('admin_settings_vcs'), method='post')}
|
||||
<div>
|
||||
${vcss.vcs_settings_fields(
|
||||
suffix='',
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
${h.secure_form(url('admin_settings_visual'), method='post')}
|
||||
${h.secure_form(h.url('admin_settings_visual'), method='post')}
|
||||
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading" id="general">
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@
|
|||
${self.breadcrumbs()}
|
||||
</div>
|
||||
<!-- end box / title -->
|
||||
${h.secure_form(url('users_groups'))}
|
||||
${h.secure_form(h.url('users_groups'))}
|
||||
<div class="form">
|
||||
<!-- fields -->
|
||||
<div class="fields">
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
<%namespace name="dpb" file="/base/default_perms_box.mako"/>
|
||||
${dpb.default_perms_box(url('edit_user_group_global_perms', user_group_id=c.user_group.users_group_id))}
|
||||
${dpb.default_perms_box(h.url('edit_user_group_global_perms', user_group_id=c.user_group.users_group_id))}
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
<h3 class="panel-title">${_('User Group Permissions')}</h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
${h.secure_form(url('edit_user_group_perms', user_group_id=c.user_group.users_group_id),method='put')}
|
||||
${h.secure_form(h.url('edit_user_group_perms', user_group_id=c.user_group.users_group_id),method='put')}
|
||||
<table id="permissions_manage" class="rctable permissions">
|
||||
<tr>
|
||||
<th class="td-radio">${_('None')}</th>
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
<h3 class="panel-title">${_('User Group: %s') % c.user_group.users_group_name}</h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
${h.secure_form(url('update_users_group', user_group_id=c.user_group.users_group_id),method='put', id='edit_users_group')}
|
||||
${h.secure_form(h.url('update_users_group', user_group_id=c.user_group.users_group_id),method='put', id='edit_users_group')}
|
||||
<div class="form">
|
||||
<!-- fields -->
|
||||
<div class="fields">
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@
|
|||
${self.breadcrumbs()}
|
||||
</div>
|
||||
<!-- end box / title -->
|
||||
${h.secure_form(url('users'))}
|
||||
${h.secure_form(h.url('users'))}
|
||||
<div class="form">
|
||||
<!-- fields -->
|
||||
<div class="fields">
|
||||
|
|
|
|||
|
|
@ -1,2 +1,2 @@
|
|||
<%namespace name="dpb" file="/base/default_perms_box.mako"/>
|
||||
${dpb.default_perms_box(url('edit_user_global_perms', user_id=c.user.user_id))}
|
||||
${dpb.default_perms_box(h.url('edit_user_global_perms', user_id=c.user.user_id))}
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
</div>
|
||||
<div class="panel-body">
|
||||
<div class="user-profile-content">
|
||||
${h.secure_form(url('update_user', user_id=c.user.user_id),method='put', class_='form')}
|
||||
${h.secure_form(h.url('update_user', user_id=c.user.user_id),method='put', class_='form')}
|
||||
<% readonly = None %>
|
||||
<% disabled = "" %>
|
||||
%if c.extern_type != 'rhodecode':
|
||||
|
|
|
|||
|
|
@ -106,7 +106,7 @@
|
|||
<span class="help-block">
|
||||
${h.literal(_('Select to inherit permissions from %s permissions settings, '
|
||||
'including default IP address whitelist and inheritance of \npermission by members of user groups.')
|
||||
% h.link_to('default user', url('admin_permissions_global')))}
|
||||
% h.link_to('default user', h.url('admin_permissions_global')))}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@
|
|||
<%def name="main()">
|
||||
<script>
|
||||
// TODO: marcink switch this to pyroutes
|
||||
AJAX_COMMENT_DELETE_URL = "${url('changeset_comment_delete',repo_name=c.repo_name,comment_id='__COMMENT_ID__')}";
|
||||
AJAX_COMMENT_DELETE_URL = "${h.url('changeset_comment_delete',repo_name=c.repo_name,comment_id='__COMMENT_ID__')}";
|
||||
templateContext.commit_data.commit_id = "${c.commit.raw_id}";
|
||||
</script>
|
||||
<div class="box">
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@
|
|||
${self.breadcrumbs()}
|
||||
</div>
|
||||
|
||||
${h.secure_form(url('repo_fork_create_home',repo_name=c.repo_info.repo_name))}
|
||||
${h.secure_form(h.url('repo_fork_create_home',repo_name=c.repo_info.repo_name))}
|
||||
<div class="form">
|
||||
<!-- fields -->
|
||||
<div class="fields">
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@
|
|||
${self.repo_page_title(c.rhodecode_db_repo)}
|
||||
</div>
|
||||
|
||||
${h.secure_form(url('pullrequest', repo_name=c.repo_name), method='post', id='pull_request_form')}
|
||||
${h.secure_form(h.url('pullrequest', repo_name=c.repo_name), method='post', id='pull_request_form')}
|
||||
|
||||
${self.breadcrumbs()}
|
||||
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@
|
|||
<div class="pull-request-merge-actions">
|
||||
% if c.allowed_to_merge:
|
||||
<div class="pull-right">
|
||||
${h.secure_form(url('pullrequest_merge', repo_name=c.repo_name, pull_request_id=c.pull_request.pull_request_id), id='merge_pull_request_form')}
|
||||
${h.secure_form(h.url('pullrequest_merge', repo_name=c.repo_name, pull_request_id=c.pull_request.pull_request_id), id='merge_pull_request_form')}
|
||||
<% merge_disabled = ' disabled' if c.pr_merge_possible is False else '' %>
|
||||
<a class="btn" href="#" onclick="refreshMergeChecks(); return false;">${_('refresh checks')}</a>
|
||||
<input type="submit" id="merge_pull_request" value="${_('Merge Pull Request')}" class="btn${merge_disabled}"${merge_disabled}>
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@
|
|||
|
||||
<script type="text/javascript">
|
||||
// TODO: marcink switch this to pyroutes
|
||||
AJAX_COMMENT_DELETE_URL = "${url('pullrequest_comment_delete',repo_name=c.repo_name,comment_id='__COMMENT_ID__')}";
|
||||
AJAX_COMMENT_DELETE_URL = "${h.url('pullrequest_comment_delete',repo_name=c.repo_name,comment_id='__COMMENT_ID__')}";
|
||||
templateContext.pull_request_data.pull_request_id = ${c.pull_request.pull_request_id};
|
||||
</script>
|
||||
<div class="box">
|
||||
|
|
@ -52,7 +52,7 @@
|
|||
%if c.allowed_to_update:
|
||||
<div id="delete_pullrequest" class="pull-right action_button ${'' if c.allowed_to_delete else 'disabled' }" style="clear:inherit;padding: 0">
|
||||
% if c.allowed_to_delete:
|
||||
${h.secure_form(url('pullrequest_delete', repo_name=c.pull_request.target_repo.repo_name, pull_request_id=c.pull_request.pull_request_id),method='delete')}
|
||||
${h.secure_form(h.url('pullrequest_delete', repo_name=c.pull_request.target_repo.repo_name, pull_request_id=c.pull_request.pull_request_id),method='delete')}
|
||||
${h.submit('remove_%s' % c.pull_request.pull_request_id, _('Delete'),
|
||||
class_="btn btn-link btn-danger no-margin",onclick="return confirm('"+_('Confirm to delete this pull request')+"');")}
|
||||
${h.end_form()}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue