##// END OF EJS Templates
docs: added admin task for bulk editing permissions.
docs: added admin task for bulk editing permissions.

File last commit:

r4313:4bf03e9f default
r4326:818f6cb9 default
Show More
repo_edit_advanced.mako
299 lines | 12.7 KiB | application/x-mako | MakoHtmlLexer
/ rhodecode / templates / admin / repos / repo_edit_advanced.mako
templating: use .mako as extensions for template files.
r1282 <%namespace name="base" file="/base/base.mako"/>
<%
elems = [
templates: expose IDs of objects in advanced views. Usefull for API or ishell.
r3332 (_('Repository ID'), c.rhodecode_db_repo.repo_id, '', ''),
hovercacrds: added new tooltips and hovercards to expose certain information for objects shown in UI
r4026 (_('Owner'), lambda:base.gravatar_with_user(c.rhodecode_db_repo.user.email, tooltip=True), '', ''),
apps: removed deprecated usage of c.repo_info
r2081 (_('Created on'), h.format_date(c.rhodecode_db_repo.created_on), '', ''),
(_('Updated on'), h.format_date(c.rhodecode_db_repo.updated_on), '', ''),
(_('Cached Commit id'), lambda: h.link_to(c.rhodecode_db_repo.changeset_cache.get('short_id'), h.route_path('repo_commit',repo_name=c.repo_name,commit_id=c.rhodecode_db_repo.changeset_cache.get('raw_id'))), '', ''),
feat: changed last change of repo group to be commit of a latest repository.
r3689 (_('Cached Commit date'), c.rhodecode_db_repo.changeset_cache.get('date'), '', ''),
dan
cache-commits: add option to refresh caches manually from advanced pages.
r4159 (_('Cached Commit data'), lambda: h.link_to('refresh now', h.current_route_path(request, update_commit_cache=1)), '', ''),
repository: fixed a bug when scoped token was attached to repository, admins were unable to remove that repository.
r2482 (_('Attached scoped tokens'), len(c.rhodecode_db_repo.scoped_tokens), '', [x.user for x in c.rhodecode_db_repo.scoped_tokens]),
repository: add check preventing of removal of repo with attached pull requests....
r3089 (_('Pull requests source'), len(c.rhodecode_db_repo.pull_requests_source), '', ['pr_id:{}, repo:{}'.format(x.pull_request_id,x.source_repo.repo_name) for x in c.rhodecode_db_repo.pull_requests_source]),
(_('Pull requests target'), len(c.rhodecode_db_repo.pull_requests_target), '', ['pr_id:{}, repo:{}'.format(x.pull_request_id,x.target_repo.repo_name) for x in c.rhodecode_db_repo.pull_requests_target]),
artifacts: show attached artifacts in advanced page, and delete them on repo deletion
r3752 (_('Attached Artifacts'), len(c.rhodecode_db_repo.artifacts), '', ''),
templating: use .mako as extensions for template files.
r1282 ]
%>
<div class="panel panel-default">
repo-settings: moved advanced setion into pyramid views....
r1751 <div class="panel-heading" id="advanced-info" >
apps: removed deprecated usage of c.repo_info
r2081 <h3 class="panel-title">${_('Repository: %s') % c.rhodecode_db_repo.repo_name} <a class="permalink" href="#advanced-info"> ¶</a></h3>
templating: use .mako as extensions for template files.
r1282 </div>
<div class="panel-body">
${base.dt_info_panel(elems)}
</div>
</div>
<div class="panel panel-default">
repo-settings: moved advanced setion into pyramid views....
r1751 <div class="panel-heading" id="advanced-fork">
<h3 class="panel-title">${_('Fork Reference')} <a class="permalink" href="#advanced-fork"> ¶</a></h3>
templating: use .mako as extensions for template files.
r1282 </div>
<div class="panel-body">
forms: unified usage of h.secure_form. Make sure we ALWAYS pass in...
r2105 ${h.secure_form(h.route_path('edit_repo_advanced_fork', repo_name=c.rhodecode_db_repo.repo_name), request=request)}
templating: use .mako as extensions for template files.
r1282
apps: removed deprecated usage of c.repo_info
r2081 % if c.rhodecode_db_repo.fork:
<div class="panel-body-title-text">${h.literal(_('This repository is a fork of %(repo_link)s') % {'repo_link': h.link_to_if(c.has_origin_repo_read_perm,c.rhodecode_db_repo.fork.repo_name, h.route_path('repo_summary', repo_name=c.rhodecode_db_repo.fork.repo_name))})}
templating: use .mako as extensions for template files.
r1282 | <button class="btn btn-link btn-danger" type="submit">Remove fork reference</button></div>
% endif
<div class="field">
${h.hidden('id_fork_of')}
apps: removed deprecated usage of c.repo_info
r2081 ${h.submit('set_as_fork_%s' % c.rhodecode_db_repo.repo_name,_('Set'),class_="btn btn-small",)}
templating: use .mako as extensions for template files.
r1282 </div>
<div class="field">
<span class="help-block">${_('Manually set this repository as a fork of another from the list')}</span>
</div>
${h.end_form()}
</div>
</div>
<div class="panel panel-default">
repo-settings: moved advanced setion into pyramid views....
r1751 <div class="panel-heading" id="advanced-journal">
<h3 class="panel-title">${_('Public Journal Visibility')} <a class="permalink" href="#advanced-journal"> ¶</a></h3>
templating: use .mako as extensions for template files.
r1282 </div>
<div class="panel-body">
forms: unified usage of h.secure_form. Make sure we ALWAYS pass in...
r2105 ${h.secure_form(h.route_path('edit_repo_advanced_journal', repo_name=c.rhodecode_db_repo.repo_name), request=request)}
templating: use .mako as extensions for template files.
r1282 <div class="field">
%if c.in_public_journal:
<button class="btn btn-small" type="submit">
${_('Remove from Public Journal')}
</button>
%else:
<button class="btn btn-small" type="submit">
${_('Add to Public Journal')}
</button>
%endif
</div>
<div class="field" >
<span class="help-block">${_('All actions made on this repository will be visible to everyone following the public journal.')}</span>
</div>
${h.end_form()}
</div>
</div>
<div class="panel panel-default">
repo-settings: moved advanced setion into pyramid views....
r1751 <div class="panel-heading" id="advanced-locking">
<h3 class="panel-title">${_('Locking state')} <a class="permalink" href="#advanced-locking"> ¶</a></h3>
templating: use .mako as extensions for template files.
r1282 </div>
<div class="panel-body">
forms: unified usage of h.secure_form. Make sure we ALWAYS pass in...
r2105 ${h.secure_form(h.route_path('edit_repo_advanced_locking', repo_name=c.rhodecode_db_repo.repo_name), request=request)}
templating: use .mako as extensions for template files.
r1282
apps: removed deprecated usage of c.repo_info
r2081 %if c.rhodecode_db_repo.locked[0]:
<div class="panel-body-title-text">${'Locked by %s on %s. Lock reason: %s' % (h.person_by_id(c.rhodecode_db_repo.locked[0]),
h.format_date(h. time_to_datetime(c.rhodecode_db_repo.locked[1])), c.rhodecode_db_repo.locked[2])}</div>
templating: use .mako as extensions for template files.
r1282 %else:
<div class="panel-body-title-text">${_('This Repository is not currently locked.')}</div>
%endif
<div class="field" >
apps: removed deprecated usage of c.repo_info
r2081 %if c.rhodecode_db_repo.locked[0]:
templating: use .mako as extensions for template files.
r1282 ${h.hidden('set_unlock', '1')}
<button class="btn btn-small" type="submit"
templates: switched most of confirm dialogs to sweetalert2
r4313 onclick="submitConfirm(event, this, _gettext('Confirm to unlock this repository'), _gettext('Unlock'), '${c.rhodecode_db_repo.repo_name}')"
>
templating: use .mako as extensions for template files.
r1282 <i class="icon-unlock"></i>
${_('Unlock repository')}
</button>
%else:
${h.hidden('set_lock', '1')}
<button class="btn btn-small" type="submit"
templates: switched most of confirm dialogs to sweetalert2
r4313 onclick="submitConfirm(event, this, _gettext('Confirm to lock this repository'), _gettext('lock'), '${c.rhodecode_db_repo.repo_name}')"
>
templating: use .mako as extensions for template files.
r1282 <i class="icon-lock"></i>
repositories: added option to archive repositories instead of deleting them....
r3090 ${_('Lock repository')}
templating: use .mako as extensions for template files.
r1282 </button>
%endif
</div>
<div class="field" >
<span class="help-block">
${_('Force repository locking. This only works when anonymous access is disabled. Pulling from the repository locks the repository to that user until the same user pushes to that repository again.')}
</span>
</div>
${h.end_form()}
</div>
</div>
repositories: added option to archive repositories instead of deleting them....
r3090
repo: show hooks version and update link in advanced section of repository.
r3377 <div class="panel panel-default">
<div class="panel-heading" id="advanced-hooks">
<h3 class="panel-title">${_('Hooks')} <a class="permalink" href="#advanced-hooks"> ¶</a></h3>
</div>
<div class="panel-body">
<table class="rctable">
<th>${_('Hook type')}</th>
<th>${_('Hook version')}</th>
<th>${_('Current version')}</th>
repositories: handle vcs backend unavailable correctly in advanced settings.
r3382 % if c.ver_info_dict:
repo: show hooks version and update link in advanced section of repository.
r3377 <tr>
<td>${_('PRE HOOK')}</td>
repositories: handle vcs backend unavailable correctly in advanced settings.
r3382 <td>${c.ver_info_dict['pre_version']}</td>
repo: show hooks version and update link in advanced section of repository.
r3377 <td>${c.rhodecode_version}</td>
</tr>
<tr>
<td>${_('POST HOOK')}</td>
repositories: handle vcs backend unavailable correctly in advanced settings.
r3382 <td>${c.ver_info_dict['post_version']}</td>
repo: show hooks version and update link in advanced section of repository.
r3377 <td>${c.rhodecode_version}</td>
</tr>
repositories: handle vcs backend unavailable correctly in advanced settings.
r3382 % else:
<tr>
<td>${_('Unable to read hook information from VCS Server')}</td>
</tr>
% endif
repo: show hooks version and update link in advanced section of repository.
r3377 </table>
ui: fix buttons on advanced page
r4127 <a class="btn btn-primary" href="${h.route_path('edit_repo_advanced_hooks', repo_name=c.repo_name)}"
repo: show hooks version and update link in advanced section of repository.
r3377 onclick="return confirm('${_('Confirm to reinstall hooks for this repository.')}');">
${_('Update Hooks')}
</a>
repository: show recomendation for updating hooks if they are outdated.
r4290 % if c.hooks_outdated:
<span class="alert-error" style="padding: 10px">
${_('Outdated hooks detected, please update hooks using `Update Hooks` action.')}
</span>
% endif
repo: show hooks version and update link in advanced section of repository.
r3377 </div>
</div>
repositories: added option to archive repositories instead of deleting them....
r3090 <div class="panel panel-warning">
<div class="panel-heading" id="advanced-archive">
<h3 class="panel-title">${_('Archive repository')} <a class="permalink" href="#advanced-archive"> ¶</a></h3>
</div>
<div class="panel-body">
${h.secure_form(h.route_path('edit_repo_advanced_archive', repo_name=c.repo_name), request=request)}
<div style="margin: 0 0 20px 0" class="fake-space"></div>
<div class="field">
ui: fix buttons on advanced page
r4127 <button class="btn btn-small btn-warning" type="submit"
templates: switched most of confirm dialogs to sweetalert2
r4313 onclick="submitConfirm(event, this, _gettext('Confirm to archive this repository'), _gettext('Archive'), '${c.rhodecode_db_repo.repo_name}')"
>
repositories: added option to archive repositories instead of deleting them....
r3090 ${_('Archive this repository')}
</button>
</div>
<div class="field">
<span class="help-block">
${_('Archiving the repository will make it entirely read-only. The repository cannot be committed to.'
'It is hidden from the search results and dashboard. ')}
</span>
</div>
${h.end_form()}
</div>
</div>
templating: use .mako as extensions for template files.
r1282 <div class="panel panel-danger">
repo-settings: moved advanced setion into pyramid views....
r1751 <div class="panel-heading" id="advanced-delete">
<h3 class="panel-title">${_('Delete repository')} <a class="permalink" href="#advanced-delete"> ¶</a></h3>
templating: use .mako as extensions for template files.
r1282 </div>
<div class="panel-body">
forms: unified usage of h.secure_form. Make sure we ALWAYS pass in...
r2105 ${h.secure_form(h.route_path('edit_repo_advanced_delete', repo_name=c.repo_name), request=request)}
templating: use .mako as extensions for template files.
r1282 <table class="display">
<tr>
<td>
apps: removed deprecated usage of c.repo_info
r2081 ${_ungettext('This repository has %s fork.', 'This repository has %s forks.', c.rhodecode_db_repo.forks.count()) % c.rhodecode_db_repo.forks.count()}
templating: use .mako as extensions for template files.
r1282 </td>
<td>
apps: removed deprecated usage of c.repo_info
r2081 %if c.rhodecode_db_repo.forks.count():
templating: use .mako as extensions for template files.
r1282 <input type="radio" name="forks" value="detach_forks" checked="checked"/> <label for="forks">${_('Detach forks')}</label>
%endif
</td>
<td>
apps: removed deprecated usage of c.repo_info
r2081 %if c.rhodecode_db_repo.forks.count():
templating: use .mako as extensions for template files.
r1282 <input type="radio" name="forks" value="delete_forks"/> <label for="forks">${_('Delete forks')}</label>
%endif
</td>
</tr>
repository: add check preventing of removal of repo with attached pull requests....
r3089 <% attached_prs = len(c.rhodecode_db_repo.pull_requests_source + c.rhodecode_db_repo.pull_requests_target) %>
% if c.rhodecode_db_repo.pull_requests_source or c.rhodecode_db_repo.pull_requests_target:
<tr>
<td>
${_ungettext('This repository has %s attached pull request.', 'This repository has %s attached pull requests.', attached_prs) % attached_prs}
<br/>
${_('Consider to archive this repository instead.')}
</td>
<td></td>
<td></td>
</tr>
% endif
templating: use .mako as extensions for template files.
r1282 </table>
<div style="margin: 0 0 20px 0" class="fake-space"></div>
<div class="field">
<button class="btn btn-small btn-danger" type="submit"
templates: switched most of confirm dialogs to sweetalert2
r4313 onclick="submitConfirm(event, this, _gettext('Confirm to delete this repository'), _gettext('Delete'), '${c.rhodecode_db_repo.repo_name}')"
>
repositories: added option to archive repositories instead of deleting them....
r3090 ${_('Delete this repository')}
templating: use .mako as extensions for template files.
r1282 </button>
</div>
<div class="field">
<span class="help-block">
repo-settings: moved advanced setion into pyramid views....
r1751 ${_('This repository will be renamed in a special way in order to make it inaccessible to RhodeCode Enterprise and its VCS systems. If you need to fully delete it from the file system, please do it manually, or with rhodecode-cleanup-repos command available in rhodecode-tools.')}
templating: use .mako as extensions for template files.
r1282 </span>
</div>
${h.end_form()}
</div>
</div>
<script>
apps: removed deprecated usage of c.repo_info
r2081 var currentRepoId = ${c.rhodecode_db_repo.repo_id};
templating: use .mako as extensions for template files.
r1282
var repoTypeFilter = function(data) {
var results = [];
if (!data.results[0]) {
return data
}
$.each(data.results[0].children, function() {
// filter out the SAME repo, it cannot be used as fork of itself
repo-switcher: new unified search box for filtering/accessing users, repos and repo groups....
r2774 if (this.repo_id != currentRepoId) {
this.id = this.repo_id;
templating: use .mako as extensions for template files.
r1282 results.push(this)
}
});
data.results[0].children = results;
return data;
};
$("#id_fork_of").select2({
cachedDataSource: {},
minimumInputLength: 2,
apps: removed deprecated usage of c.repo_info
r2081 placeholder: "${_('Change repository') if c.rhodecode_db_repo.fork else _('Pick repository')}",
templating: use .mako as extensions for template files.
r1282 dropdownAutoWidth: true,
containerCssClass: "drop-menu",
dropdownCssClass: "drop-menu-dropdown",
repo-switcher: new unified search box for filtering/accessing users, repos and repo groups....
r2774 formatResult: formatRepoResult,
templating: use .mako as extensions for template files.
r1282 query: $.debounce(250, function(query){
self = this;
var cacheKey = query.term;
var cachedData = self.cachedDataSource[cacheKey];
if (cachedData) {
query.callback({results: cachedData.results});
} else {
$.ajax({
core: moved repo_list data to pyramid.
r1667 url: pyroutes.url('repo_list_data'),
apps: removed deprecated usage of c.repo_info
r2081 data: {'query': query.term, repo_type: '${c.rhodecode_db_repo.repo_type}'},
templating: use .mako as extensions for template files.
r1282 dataType: 'json',
type: 'GET',
success: function(data) {
data = repoTypeFilter(data);
self.cachedDataSource[cacheKey] = data;
query.callback({results: data.results});
},
error: function(data, textStatus, errorThrown) {
alert("Error while fetching entries.\nError code {0} ({1}).".format(data.status, data.statusText));
}
})
}
})
});
</script>