index_base.mako
131 lines
| 5.1 KiB
| application/x-mako
|
MakoHtmlLexer
r1282 | <%inherit file="/base/base.mako"/> | |||
r3442 | ||||
<%def name="menu_bar_subnav()"> | ||||
% if c.repo_group: | ||||
${self.repo_group_menu(active='home')} | ||||
% endif | ||||
</%def> | ||||
r1282 | <%def name="main()"> | |||
<div class="box"> | ||||
<!-- box / title --> | ||||
<div class="title"> | ||||
%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') | ||||
%> | ||||
%if not c.repo_group: | ||||
## no repository group context here | ||||
%if is_admin or create_repo: | ||||
r2014 | <a href="${h.route_path('repo_new')}" class="btn btn-small btn-success btn-primary">${_('Add Repository')}</a> | |||
r1282 | %endif | |||
%if is_admin or create_repo_group: | ||||
r2175 | <a href="${h.route_path('repo_group_new')}" class="btn btn-small btn-default">${_(u'Add Repository Group')}</a> | |||
r1282 | %endif | |||
%endif | ||||
</div> | ||||
%endif | ||||
</div> | ||||
<!-- end box / title --> | ||||
<div class="table"> | ||||
<div id="groups_list_wrap"> | ||||
r3166 | <table id="group_list_table" class="display" style="width: 100%"></table> | |||
r1282 | </div> | |||
</div> | ||||
<div class="table"> | ||||
<div id="repos_list_wrap"> | ||||
r3166 | <table id="repo_list_table" class="display" style="width: 100%"></table> | |||
r1282 | </div> | |||
</div> | ||||
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 | ||||
r1282 | </div> | |||
<script> | ||||
$(document).ready(function() { | ||||
r2447 | // repo group list | |||
% if c.repo_groups_data != '[]': | ||||
$('#group_list_table').DataTable({ | ||||
r1282 | data: ${c.repo_groups_data|n}, | |||
dom: 'rtp', | ||||
pageLength: ${c.visual.dashboard_items}, | ||||
order: [[ 0, "asc" ]], | ||||
columns: [ | ||||
{ data: {"_": "name", | ||||
r3557 | "sort": "name_raw"}, title: "${_('Name')}", className: "truncate-wrap td-grid-name" }, | |||
r1282 | { data: 'menu', "bSortable": false, className: "quick_repo_menu" }, | |||
{ data: {"_": "desc", | ||||
"sort": "desc"}, title: "${_('Description')}", className: "td-description" }, | ||||
r1940 | { data: {"_": "last_change", | |||
"sort": "last_change_raw", | ||||
"type": Number}, title: "${_('Last Change')}", className: "td-time" }, | ||||
r3557 | { data: {"_": "last_changeset", | |||
"sort": "last_changeset_raw", | ||||
"type": Number}, title: "", className: "td-hash" }, | ||||
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(); | ||||
} | ||||
}); | ||||
r2447 | % endif | |||
r1282 | ||||
// repo list | ||||
r2447 | % if c.repos_data != '[]': | |||
r1282 | $('#repo_list_table').DataTable({ | |||
data: ${c.repos_data|n}, | ||||
dom: 'rtp', | ||||
order: [[ 0, "asc" ]], | ||||
pageLength: ${c.visual.dashboard_items}, | ||||
columns: [ | ||||
{ data: {"_": "name", | ||||
r3557 | "sort": "name_raw"}, title: "${_('Name')}", className: "truncate-wrap td-grid-name" }, | |||
r1282 | { 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", | ||||
r2447 | "sort": "owner"}, title: "${_('Owner')}", className: "td-user" } | |||
r1282 | ], | |||
language: { | ||||
paginate: DEFAULT_GRID_PAGINATION, | ||||
emptyTable: _gettext("No repositories available yet.") | ||||
}, | ||||
"drawCallback": function( settings, json ) { | ||||
timeagoActivate(); | ||||
quick_repo_menu(); | ||||
} | ||||
}); | ||||
r2447 | % endif | |||
r1282 | }); | |||
</script> | ||||
</%def> | ||||