##// END OF EJS Templates
docs: added release notes for 4.13.2 release
docs: added release notes for 4.13.2 release

File last commit:

r2774:a8ecef4e default
r3031:56bb5b12 stable
Show More
index_base.mako
141 lines | 6.4 KiB | application/x-mako | MakoHtmlLexer
templating: use .mako as extensions for template files.
r1282 <%inherit file="/base/base.mako"/>
<%def name="main()">
<div class="box">
<!-- box / title -->
<div class="title">
<div class="block-left breadcrumbs">
${self.breadcrumbs()}
repo-switcher: new unified search box for filtering/accessing users, repos and repo groups....
r2774 <span id="match_container" style="display:none"><span id="match_count">0</span> ${_('matches')}</span>
templating: use .mako as extensions for template files.
r1282 </div>
%if c.rhodecode_user.username != h.DEFAULT_USER:
<div class="block-right">
<%
is_admin = h.HasPermissionAny('hg.admin')('can create repos index page')
create_repo = h.HasPermissionAny('hg.create.repository')('can create repository index page')
create_repo_group = h.HasPermissionAny('hg.repogroup.create.true')('can create repository groups index page')
create_user_group = h.HasPermissionAny('hg.usergroup.create.true')('can create user groups index page')
gr_name = c.repo_group.group_name if c.repo_group else None
# create repositories with write permission on group is set to true
create_on_write = h.HasPermissionAny('hg.create.write_on_repogroup.true')()
group_admin = h.HasRepoGroupPermissionAny('group.admin')(gr_name, 'group admin index page')
group_write = h.HasRepoGroupPermissionAny('group.write')(gr_name, 'can write into group index page')
%>
%if not c.repo_group:
## no repository group context here
%if is_admin or create_repo:
repositories: rewrote whole admin section to pyramid....
r2014 <a href="${h.route_path('repo_new')}" class="btn btn-small btn-success btn-primary">${_('Add Repository')}</a>
templating: use .mako as extensions for template files.
r1282 %endif
%if is_admin or create_repo_group:
repo-groups: moved to pyramid
r2175 <a href="${h.route_path('repo_group_new')}" class="btn btn-small btn-default">${_(u'Add Repository Group')}</a>
templating: use .mako as extensions for template files.
r1282 %endif
%else:
##we're inside other repository group other terms apply
%if is_admin or group_admin or (group_write and create_on_write):
routes: add parent_group in add repository link on repo groups. Was lost in pyramid migration.
r2085 <a href="${h.route_path('repo_new',_query=dict(parent_group=c.repo_group.group_id))}" class="btn btn-small btn-success btn-primary">${_('Add Repository')}</a>
templating: use .mako as extensions for template files.
r1282 %endif
%if is_admin or group_admin:
repo-groups: moved to pyramid
r2175 <a href="${h.route_path('repo_group_new',_query=dict(parent_group=c.repo_group.group_id))}" class="btn btn-small btn-default">${_(u'Add Repository Group')}</a>
templating: use .mako as extensions for template files.
r1282 %endif
%if is_admin or group_admin:
repo-groups: moved to pyramid
r2175 <a href="${h.route_path('edit_repo_group',repo_group_name=c.repo_group.group_name)}" title="${_('You have admin right to this group, and can edit it')}" class="btn btn-small btn-primary">${_('Edit Repository Group')}</a>
templating: use .mako as extensions for template files.
r1282 %endif
%endif
</div>
%endif
</div>
<!-- end box / title -->
<div class="table">
<div id="groups_list_wrap">
<table id="group_list_table" class="display"></table>
</div>
</div>
<div class="table">
<div id="repos_list_wrap">
<table id="repo_list_table" class="display"></table>
</div>
</div>
ui: hide empty no repos or no repo groups display. It often happens that starting...
r2447
## no repository groups and repos present, show something to the users
% if c.repo_groups_data == '[]' and c.repos_data == '[]':
<div class="table">
<h2 class="no-object-border">
${_('No repositories or repositories groups exists here.')}
</h2>
</div>
% endif
templating: use .mako as extensions for template files.
r1282 </div>
<script>
$(document).ready(function() {
ui: hide empty no repos or no repo groups display. It often happens that starting...
r2447 // repo group list
% if c.repo_groups_data != '[]':
$('#group_list_table').DataTable({
templating: use .mako as extensions for template files.
r1282 data: ${c.repo_groups_data|n},
dom: 'rtp',
pageLength: ${c.visual.dashboard_items},
order: [[ 0, "asc" ]],
columns: [
{ data: {"_": "name",
"sort": "name_raw"}, title: "${_('Name')}", className: "td-componentname" },
{ data: 'menu', "bSortable": false, className: "quick_repo_menu" },
{ data: {"_": "desc",
"sort": "desc"}, title: "${_('Description')}", className: "td-description" },
repository-groups: introduce last change for repository groups.
r1940 { data: {"_": "last_change",
"sort": "last_change_raw",
"type": Number}, title: "${_('Last Change')}", className: "td-time" },
templating: use .mako as extensions for template files.
r1282 { data: {"_": "owner",
"sort": "owner"}, title: "${_('Owner')}", className: "td-user" }
],
language: {
paginate: DEFAULT_GRID_PAGINATION,
emptyTable: _gettext("No repository groups available yet.")
},
"drawCallback": function( settings, json ) {
timeagoActivate();
quick_repo_menu();
}
});
ui: hide empty no repos or no repo groups display. It often happens that starting...
r2447 % endif
templating: use .mako as extensions for template files.
r1282
// repo list
ui: hide empty no repos or no repo groups display. It often happens that starting...
r2447 % if c.repos_data != '[]':
templating: use .mako as extensions for template files.
r1282 $('#repo_list_table').DataTable({
data: ${c.repos_data|n},
dom: 'rtp',
order: [[ 0, "asc" ]],
pageLength: ${c.visual.dashboard_items},
columns: [
{ data: {"_": "name",
"sort": "name_raw"}, title: "${_('Name')}", className: "truncate-wrap td-componentname" },
{ data: 'menu', "bSortable": false, className: "quick_repo_menu" },
{ data: {"_": "desc",
"sort": "desc"}, title: "${_('Description')}", className: "td-description" },
{ data: {"_": "last_change",
"sort": "last_change_raw",
"type": Number}, title: "${_('Last Change')}", className: "td-time" },
{ data: {"_": "last_changeset",
"sort": "last_changeset_raw",
"type": Number}, title: "${_('Commit')}", className: "td-hash" },
{ data: {"_": "owner",
ui: hide empty no repos or no repo groups display. It often happens that starting...
r2447 "sort": "owner"}, title: "${_('Owner')}", className: "td-user" }
templating: use .mako as extensions for template files.
r1282 ],
language: {
paginate: DEFAULT_GRID_PAGINATION,
emptyTable: _gettext("No repositories available yet.")
},
"drawCallback": function( settings, json ) {
timeagoActivate();
quick_repo_menu();
}
});
ui: hide empty no repos or no repo groups display. It often happens that starting...
r2447 % endif
templating: use .mako as extensions for template files.
r1282 });
</script>
</%def>