pullrequests.mako
140 lines
| 5.1 KiB
| application/x-mako
|
MakoHtmlLexer
r1282 | <%inherit file="/base/base.mako"/> | |||
<%def name="title()"> | ||||
r4062 | ${_('{} Pull Requests').format(c.repo_name)} | |||
r1282 | %if c.rhodecode_name: | |||
· ${h.branding(c.rhodecode_name)} | ||||
%endif | ||||
</%def> | ||||
r3589 | <%def name="breadcrumbs_links()"></%def> | |||
r1282 | ||||
<%def name="menu_bar_nav()"> | ||||
${self.menu_items(active='repositories')} | ||||
</%def> | ||||
<%def name="menu_bar_subnav()"> | ||||
${self.repo_menu(active='showpullrequest')} | ||||
</%def> | ||||
<%def name="main()"> | ||||
r3757 | ||||
r1282 | <div class="box"> | |||
r3757 | <div class="title"> | |||
<ul class="button-links"> | ||||
r4062 | <li class="btn ${h.is_active('open', c.active)}"><a href="${h.route_path('pullrequest_show_all',repo_name=c.repo_name, _query={'source':0})}">${_('Opened')}</a></li> | |||
<li class="btn ${h.is_active('my', c.active)}"><a href="${h.route_path('pullrequest_show_all',repo_name=c.repo_name, _query={'source':0,'my':1})}">${_('Opened by me')}</a></li> | ||||
<li class="btn ${h.is_active('awaiting', c.active)}"><a href="${h.route_path('pullrequest_show_all',repo_name=c.repo_name, _query={'source':0,'awaiting_review':1})}">${_('Awaiting review')}</a></li> | ||||
<li class="btn ${h.is_active('awaiting_my', c.active)}"><a href="${h.route_path('pullrequest_show_all',repo_name=c.repo_name, _query={'source':0,'awaiting_my_review':1})}">${_('Awaiting my review')}</a></li> | ||||
<li class="btn ${h.is_active('closed', c.active)}"><a href="${h.route_path('pullrequest_show_all',repo_name=c.repo_name, _query={'source':0,'closed':1})}">${_('Closed')}</a></li> | ||||
<li class="btn ${h.is_active('source', c.active)}"><a href="${h.route_path('pullrequest_show_all',repo_name=c.repo_name, _query={'source':1})}">${_('From this repo')}</a></li> | ||||
r3757 | </ul> | |||
<ul class="links"> | ||||
% if c.rhodecode_user.username != h.DEFAULT_USER: | ||||
r1282 | <li> | |||
<span> | ||||
r1974 | <a id="open_new_pull_request" class="btn btn-small btn-success" href="${h.route_path('pullrequest_new',repo_name=c.repo_name)}"> | |||
r1282 | ${_('Open new Pull Request')} | |||
</a> | ||||
</span> | ||||
</li> | ||||
r3757 | % endif | |||
r4055 | ||||
<li> | ||||
<div class="grid-quick-filter"> | ||||
<ul class="grid-filter-box"> | ||||
<li class="grid-filter-box-icon"> | ||||
<i class="icon-search"></i> | ||||
</li> | ||||
<li class="grid-filter-box-input"> | ||||
<input class="q_filter_box" id="q_filter" size="15" type="text" name="filter" placeholder="${_('quick filter...')}" value=""/> | ||||
</li> | ||||
</ul> | ||||
</div> | ||||
</li> | ||||
r3757 | </ul> | |||
r1282 | ||||
</div> | ||||
<div class="main-content-full-width"> | ||||
r3761 | <table id="pull_request_list_table" class="display"></table> | |||
r1282 | </div> | |||
r3757 | ||||
r1282 | </div> | |||
<script type="text/javascript"> | ||||
$(document).ready(function() { | ||||
r1766 | var $pullRequestListTable = $('#pull_request_list_table'); | |||
r1282 | // object list | |||
r1766 | $pullRequestListTable.DataTable({ | |||
processing: true, | ||||
r1282 | serverSide: true, | |||
r1766 | ajax: { | |||
"url": "${h.route_path('pullrequest_show_all_data', repo_name=c.repo_name)}", | ||||
"data": function (d) { | ||||
d.source = "${c.source}"; | ||||
d.closed = "${c.closed}"; | ||||
d.my = "${c.my}"; | ||||
d.awaiting_review = "${c.awaiting_review}"; | ||||
d.awaiting_my_review = "${c.awaiting_my_review}"; | ||||
} | ||||
}, | ||||
dom: 'rtp', | ||||
r1282 | pageLength: ${c.visual.dashboard_items}, | |||
order: [[ 1, "desc" ]], | ||||
columns: [ | ||||
{ data: {"_": "status", | ||||
"sort": "status"}, title: "", className: "td-status", orderable: false}, | ||||
{ data: {"_": "name", | ||||
r4039 | "sort": "name_raw"}, title: "${_('Id')}", className: "td-componentname", "type": "num" }, | |||
{ data: {"_": "title", | ||||
"sort": "title"}, title: "${_('Title')}", className: "td-description" }, | ||||
r1282 | { data: {"_": "author", | |||
"sort": "author_raw"}, title: "${_('Author')}", className: "td-user", orderable: false }, | ||||
{ data: {"_": "comments", | ||||
"sort": "comments_raw"}, title: "", className: "td-comments", orderable: false}, | ||||
{ data: {"_": "updated_on", | ||||
"sort": "updated_on_raw"}, title: "${_('Last Update')}", className: "td-time" } | ||||
], | ||||
language: { | ||||
paginate: DEFAULT_GRID_PAGINATION, | ||||
r1766 | sProcessing: _gettext('loading...'), | |||
r1282 | emptyTable: _gettext("No pull requests available yet.") | |||
}, | ||||
"drawCallback": function( settings, json ) { | ||||
timeagoActivate(); | ||||
r4026 | tooltipActivate(); | |||
r1282 | }, | |||
"createdRow": function ( row, data, index ) { | ||||
if (data['closed']) { | ||||
r3816 | $(row).addClass('closed'); | |||
} | ||||
r1282 | } | |||
}); | ||||
r1766 | ||||
$pullRequestListTable.on('xhr.dt', function(e, settings, json, xhr){ | ||||
$pullRequestListTable.css('opacity', 1); | ||||
}); | ||||
$pullRequestListTable.on('preXhr.dt', function(e, settings, data){ | ||||
$pullRequestListTable.css('opacity', 0.3); | ||||
}); | ||||
r4055 | // filter | |||
$('#q_filter').on('keyup', | ||||
$.debounce(250, function() { | ||||
$pullRequestListTable.DataTable().search( | ||||
$('#q_filter').val() | ||||
).draw(); | ||||
}) | ||||
); | ||||
r1282 | }); | |||
</script> | ||||
</%def> | ||||