##// END OF EJS Templates
release: merge back stable branch into default
release: merge back stable branch into default

File last commit:

r4150:554d4203 default
r4612:cbbdebfd merge default
Show More
repos.mako
149 lines | 4.2 KiB | application/x-mako | MakoHtmlLexer
templating: use .mako as extensions for template files.
r1282 ## -*- coding: utf-8 -*-
<%inherit file="/base/base.mako"/>
<%def name="title()">
${_('Repositories administration')}
%if c.rhodecode_name:
&middot; ${h.branding(c.rhodecode_name)}
%endif
</%def>
nav: bring back quick filter and cleanup titles
r3589 <%def name="breadcrumbs_links()"></%def>
templating: use .mako as extensions for template files.
r1282
<%def name="menu_bar_nav()">
${self.menu_items(active='admin')}
</%def>
ui: navigation, fixed wrapping of new admin navigation items
r3566 <%def name="menu_bar_subnav()">
${self.admin_menu(active='repositories')}
</%def>
templating: use .mako as extensions for template files.
r1282 <%def name="main()">
<div class="box">
nav: bring back quick filter and cleanup titles
r3589
templating: use .mako as extensions for template files.
r1282 <div class="title">
nav: bring back quick filter and cleanup titles
r3589 <input class="q_filter_box" id="q_filter" size="15" type="text" name="filter" placeholder="${_('quick filter...')}" value=""/>
admin: made all grids use same partial loading logic...
r4146 <span id="repo_count"></span>
nav: bring back quick filter and cleanup titles
r3589
templating: use .mako as extensions for template files.
r1282 <ul class="links">
nav: bring back quick filter and cleanup titles
r3589 %if c.can_create_repo:
<li>
<a href="${h.route_path('repo_new')}" class="btn btn-small btn-success">${_(u'Add Repository')}</a>
</li>
%endif
templating: use .mako as extensions for template files.
r1282 </ul>
</div>
<div id="repos_list_wrap">
<table id="repo_list_table" class="display"></table>
</div>
admin: made all grids use same partial loading logic...
r4146
templating: use .mako as extensions for template files.
r1282 </div>
<script>
$(document).ready(function() {
admin: made all grids use same partial loading logic...
r4146 var $repoListTable = $('#repo_list_table');
templating: use .mako as extensions for template files.
r1282
// repo list
admin: made all grids use same partial loading logic...
r4146 $repoListTable.DataTable({
processing: true,
serverSide: true,
ajax: {
"url": "${h.route_path('repos_data')}",
"dataSrc": function (json) {
var filteredCount = json.recordsFiltered;
var total = json.recordsTotal;
var _text = _gettext(
"{0} of {1} repositories").format(
filteredCount, total);
if (total === filteredCount) {
_text = _gettext("{0} repositories").format(total);
}
$('#repo_count').text(_text);
return json.data;
},
},
dom: 'rtp',
pageLength: ${c.visual.admin_grid_items},
order: [[ 0, "asc" ]],
columns: [
{
data: {
"_": "name",
grids: columns and sorting fixes
r4150 "sort": "name"
admin: made all grids use same partial loading logic...
r4146 }, title: "${_('Name')}", className: "td-componentname"
},
{
data: 'menu', "bSortable": false, className: "quick_repo_menu"},
{
data: {
"_": "desc",
"sort": "desc"
}, title: "${_('Description')}", className: "td-description"
},
{
data: {
"_": "last_change",
grids: columns and sorting fixes
r4150 "sort": "last_change",
admin: made all grids use same partial loading logic...
r4146 "type": Number
}, title: "${_('Last Change')}", className: "td-time"
},
{
data: {
"_": "last_changeset",
"sort": "last_changeset_raw",
"type": Number
}, title: "${_('Commit')}", className: "td-commit", orderable: false
},
{
data: {
"_": "owner",
"sort": "owner"
}, title: "${_('Owner')}", className: "td-user"
},
{
data: {
"_": "state",
"sort": "state"
}, title: "${_('State')}", className: "td-tags td-state"
},
{
data: {
"_": "action",
"sort": "action"
}, title: "${_('Action')}", className: "td-action", orderable: false
}
],
language: {
templating: use .mako as extensions for template files.
r1282 paginate: DEFAULT_GRID_PAGINATION,
admin: made all grids use same partial loading logic...
r4146 sProcessing: _gettext('loading...'),
emptyTable:_gettext("No repositories present.")
},
"initComplete": function( settings, json ) {
quick_repo_menu();
}
templating: use .mako as extensions for template files.
r1282 });
admin: made all grids use same partial loading logic...
r4146 $repoListTable.on('xhr.dt', function(e, settings, json, xhr){
$repoListTable.css('opacity', 1);
});
$repoListTable.on('preXhr.dt', function(e, settings, data){
$repoListTable.css('opacity', 0.3);
templating: use .mako as extensions for template files.
r1282 });
admin: made all grids use same partial loading logic...
r4146 $('#q_filter').on('keyup',
$.debounce(250, function() {
$repoListTable.DataTable().search(
$('#q_filter').val()
).draw();
})
);
templating: use .mako as extensions for template files.
r1282
});
</script>
</%def>