##// END OF EJS Templates
login: Make register views more robust if some POST parameters are missing....
login: Make register views more robust if some POST parameters are missing. We fail to delete passsword/password confirm parameters if they are not part of the POST parameters. But failing to delete them if they are not present seems wrong. Better silently ignore if they are not present.

File last commit:

r793:fc8d2069 default
r1065:64aae6b3 default
Show More
list.html
251 lines | 9.5 KiB | text/html | HtmlLexer
dan
integrations: add integration support...
r411 ## -*- coding: utf-8 -*-
<%inherit file="base.html"/>
<%def name="breadcrumbs_links()">
%if c.repo:
${h.link_to('Settings',h.url('edit_repo', repo_name=c.repo.repo_name))}
dan
integrations: refactor/cleanup + features, fixes #4181...
r731 %elif c.repo_group:
${h.link_to(_('Admin'),h.url('admin_home'))}
&raquo;
${h.link_to(_('Repository Groups'),h.url('repo_groups'))}
&raquo;
${h.link_to(c.repo_group.group_name,h.url('edit_repo_group', group_name=c.repo_group.group_name))}
dan
integrations: add integration support...
r411 %else:
${h.link_to(_('Admin'),h.url('admin_home'))}
&raquo;
${h.link_to(_('Settings'),h.url('admin_settings'))}
%endif
%if current_IntegrationType:
&raquo;
%if c.repo:
${h.link_to(_('Integrations'),
request.route_url(route_name='repo_integrations_home',
repo_name=c.repo.repo_name))}
dan
integrations: refactor/cleanup + features, fixes #4181...
r731 %elif c.repo_group:
${h.link_to(_('Integrations'),
request.route_url(route_name='repo_group_integrations_home',
repo_group_name=c.repo_group.group_name))}
dan
integrations: add integration support...
r411 %else:
${h.link_to(_('Integrations'),
request.route_url(route_name='global_integrations_home'))}
%endif
&raquo;
${current_IntegrationType.display_name}
%else:
&raquo;
${_('Integrations')}
%endif
</%def>
dan
integrations: refactor/cleanup + features, fixes #4181...
r731
dan
integrations: add integration support...
r411 <div class="panel panel-default">
<div class="panel-heading">
dan
integrations: refactor/cleanup + features, fixes #4181...
r731 <h3 class="panel-title">
%if c.repo:
${_('Current Integrations for Repository: {repo_name}').format(repo_name=c.repo.repo_name)}
%elif c.repo_group:
${_('Current Integrations for repository group: {repo_group_name}').format(repo_group_name=c.repo_group.group_name)}
%else:
${_('Current Integrations')}
%endif
</h3>
dan
integrations: add integration support...
r411 </div>
<div class="panel-body">
dan
integrations: refactor/cleanup + features, fixes #4181...
r731 <%
if c.repo:
home_url = request.route_path('repo_integrations_home',
repo_name=c.repo.repo_name)
elif c.repo_group:
home_url = request.route_path('repo_group_integrations_home',
repo_group_name=c.repo_group.group_name)
else:
home_url = request.route_path('global_integrations_home')
%>
<a href="${home_url}" class="btn ${not current_IntegrationType and 'btn-primary' or ''}">${_('All')}</a>
%for integration_key, IntegrationType in available_integrations.items():
<%
if c.repo:
list_url = request.route_path('repo_integrations_list',
dan
integrations: add integration support...
r411 repo_name=c.repo.repo_name,
dan
integrations: refactor/cleanup + features, fixes #4181...
r731 integration=integration_key)
elif c.repo_group:
list_url = request.route_path('repo_group_integrations_list',
dan
integrations: add repo group integrations, fixes #4175
r667 repo_group_name=c.repo_group.group_name,
dan
integrations: refactor/cleanup + features, fixes #4181...
r731 integration=integration_key)
else:
list_url = request.route_path('global_integrations_list',
integration=integration_key)
%>
<a href="${list_url}"
class="btn ${current_IntegrationType and integration_key == current_IntegrationType.key and 'btn-primary' or ''}">
${IntegrationType.display_name}
dan
integrations: add integration support...
r411 </a>
%endfor
dan
integrations: refactor/cleanup + features, fixes #4181...
r731
<%
if c.repo:
create_url = h.route_path('repo_integrations_new', repo_name=c.repo.repo_name)
elif c.repo_group:
create_url = h.route_path('repo_group_integrations_new', repo_group_name=c.repo_group.group_name)
else:
create_url = h.route_path('global_integrations_new')
%>
<p class="pull-right">
<a href="${create_url}" class="btn btn-small btn-success">${_(u'Create new integration')}</a>
</p>
<table class="rctable integrations">
dan
integrations: add integration support...
r411 <thead>
<tr>
dan
integrations: refactor/cleanup + features, fixes #4181...
r731 <th><a href="?sort=enabled:${rev_sort_dir}">${_('Enabled')}</a></th>
<th><a href="?sort=name:${rev_sort_dir}">${_('Name')}</a></th>
<th colspan="2"><a href="?sort=integration_type:${rev_sort_dir}">${_('Type')}</a></th>
<th><a href="?sort=scope:${rev_sort_dir}">${_('Scope')}</a></th>
dan
integrations: add integration support...
r411 <th>${_('Actions')}</th>
ux: additional capitalisation and string translation in integration templates
r646 <th></th>
dan
integrations: add integration support...
r411 </tr>
</thead>
<tbody>
dan
integrations: refactor/cleanup + features, fixes #4181...
r731 %if not integrations_list:
<tr>
<td colspan="7">
<% integration_type = current_IntegrationType and current_IntegrationType.display_name or '' %>
%if c.repo:
${_('No {type} integrations for repo {repo} exist yet.').format(type=integration_type, repo=c.repo.repo_name)}
%elif c.repo_group:
${_('No {type} integrations for repogroup {repogroup} exist yet.').format(type=integration_type, repogroup=c.repo_group.group_name)}
%else:
${_('No {type} integrations exist yet.').format(type=integration_type)}
%endif
dan
integrations: add integration support...
r411
dan
integrations: refactor/cleanup + features, fixes #4181...
r731 %if current_IntegrationType:
<%
if c.repo:
create_url = h.route_path('repo_integrations_create', repo_name=c.repo.repo_name, integration=current_IntegrationType.key)
elif c.repo_group:
create_url = h.route_path('repo_group_integrations_create', repo_group_name=c.repo_group.group_name, integration=current_IntegrationType.key)
else:
create_url = h.route_path('global_integrations_create', integration=current_IntegrationType.key)
%>
%endif
<a href="${create_url}">${_(u'Create one')}</a>
</td>
</tr>
%endif
%for IntegrationType, integration in integrations_list:
dan
integrations: add integration support...
r411 <tr id="integration_${integration.integration_id}">
<td class="td-enabled">
%if integration.enabled:
<div class="flag_status approved pull-left"></div>
%else:
<div class="flag_status rejected pull-left"></div>
%endif
</td>
<td class="td-description">
${integration.name}
</td>
dan
integrations: refactor/cleanup + features, fixes #4181...
r731 <td class="td-icon">
%if integration.integration_type in available_integrations:
<div class="integration-icon">
${available_integrations[integration.integration_type].icon|n}
</div>
%else:
?
%endif
</td>
<td class="td-type">
dan
integrations: add integration support...
r411 ${integration.integration_type}
</td>
dan
integrations: refactor/cleanup + features, fixes #4181...
r731 <td class="td-scope">
%if integration.repo:
<a href="${h.url('summary_home', repo_name=integration.repo.repo_name)}">
${_('repo')}:${integration.repo.repo_name}
</a>
%elif integration.repo_group:
<a href="${h.url('repo_group_home', group_name=integration.repo_group.group_name)}">
${_('repogroup')}:${integration.repo_group.group_name}
dan
integrations: add recursive repo group scope to allow integrations...
r793 %if integration.child_repos_only:
${_('child repos only')}
%else:
${_('cascade to all')}
%endif
dan
integrations: refactor/cleanup + features, fixes #4181...
r731 </a>
%else:
dan
integrations: add recursive repo group scope to allow integrations...
r793 %if integration.child_repos_only:
dan
integrations: refactor/cleanup + features, fixes #4181...
r731 ${_('top level repos only')}
dan
integrations: add recursive repo group scope to allow integrations...
r793 %else:
dan
integrations: refactor/cleanup + features, fixes #4181...
r731 ${_('global')}
%endif
</td>
%endif
dan
integrations: add integration support...
r411 <td class="td-action">
dan
integrations: refactor/cleanup + features, fixes #4181...
r731 %if not IntegrationType:
dan
integrations: add integration support...
r411 ${_('unknown integration')}
%else:
<%
if c.repo:
dan
integrations: add repo group integrations, fixes #4175
r667 edit_url = request.route_path('repo_integrations_edit',
dan
integrations: add integration support...
r411 repo_name=c.repo.repo_name,
integration=integration.integration_type,
integration_id=integration.integration_id)
dan
integrations: add repo group integrations, fixes #4175
r667 elif c.repo_group:
edit_url = request.route_path('repo_group_integrations_edit',
repo_group_name=c.repo_group.group_name,
integration=integration.integration_type,
integration_id=integration.integration_id)
dan
integrations: add integration support...
r411 else:
dan
integrations: add repo group integrations, fixes #4175
r667 edit_url = request.route_path('global_integrations_edit',
dan
integrations: add integration support...
r411 integration=integration.integration_type,
integration_id=integration.integration_id)
%>
<div class="grid_edit">
<a href="${edit_url}">${_('Edit')}</a>
</div>
<div class="grid_delete">
<a href="${edit_url}"
class="btn btn-link btn-danger delete_integration_entry"
data-desc="${integration.name}"
data-uid="${integration.integration_id}">
${_('Delete')}
</a>
</div>
%endif
</td>
</tr>
%endfor
<tr id="last-row"></tr>
</tbody>
</table>
dan
integrations: refactor/cleanup + features, fixes #4181...
r731 <div class="integrations-paginator">
<div class="pagination-wh pagination-left">
${integrations_list.pager('$link_previous ~2~ $link_next')}
</div>
</div>
dan
integrations: add integration support...
r411 </div>
</div>
<script type="text/javascript">
var delete_integration = function(entry) {
if (confirm("Confirm to remove this integration: "+$(entry).data('desc'))) {
var request = $.ajax({
type: "POST",
url: $(entry).attr('href'),
data: {
'delete': 'delete',
'csrf_token': CSRF_TOKEN
},
success: function(){
location.reload();
},
error: function(data, textStatus, errorThrown){
alert("Error while deleting entry.\nError code {0} ({1}). URL: {2}".format(data.status,data.statusText,$(entry)[0].url));
}
});
};
}
$('.delete_integration_entry').on('click', function(e){
e.preventDefault();
delete_integration(this);
});
</script>