##// END OF EJS Templates
deps: bumped attrs==24.2.0
deps: bumped attrs==24.2.0

File last commit:

r5037:bd722d6e default
r5638:e7de4707 default
Show More
changelog.mako
352 lines | 14.4 KiB | application/x-mako | MakoHtmlLexer
changelog: rename changelog to commits pages
r3742
<%inherit file="/base/base.mako"/>
<%def name="title()">
${_('%s Changelog') % c.repo_name}
%if c.changelog_for_path:
/${c.changelog_for_path}
%endif
%if c.rhodecode_name:
&middot; ${h.branding(c.rhodecode_name)}
%endif
</%def>
<%def name="breadcrumbs_links()">
%if c.changelog_for_path:
/${c.changelog_for_path}
%endif
</%def>
<%def name="menu_bar_nav()">
${self.menu_items(active='repositories')}
</%def>
<%def name="menu_bar_subnav()">
${self.repo_menu(active='commits')}
</%def>
<%def name="main()">
<div class="box">
dan
commits: new commits page based on new UI
r3758
changelog: rename changelog to commits pages
r3742 <div class="title">
dan
commits: new commits page based on new UI
r3758 <div id="filter_changelog">
${h.hidden('branch_filter')}
%if c.selected_name:
<div class="btn btn-default" id="clear_filter" >
${_('Clear filter')}
</div>
%endif
</div>
<div class="pull-left obsolete-toggle">
% if h.is_hg(c.rhodecode_repo):
% if c.show_hidden:
<a class="action-link" href="${h.current_route_path(request, evolve=0)}">${_('Hide obsolete/hidden')}</a>
% else:
<a class="action-link" href="${h.current_route_path(request, evolve=1)}">${_('Show obsolete/hidden')}</a>
% endif
% else:
<span class="action-link disabled">${_('Show hidden')}</span>
% endif
</div>
changelog: rename changelog to commits pages
r3742 <ul class="links">
<li>
dan
commits: new commits page based on new UI
r3758
changelog: rename changelog to commits pages
r3742 %if c.rhodecode_db_repo.fork:
<span>
<a id="compare_fork_button"
title="${h.tooltip(_('Compare fork with %s' % c.rhodecode_db_repo.fork.repo_name))}"
class="btn btn-small"
href="${h.route_path('repo_compare',
repo_name=c.rhodecode_db_repo.fork.repo_name,
landing-refs: create helpers for landing ref to make clear indication about type/name
r4370 source_ref_type=c.rhodecode_db_repo.landing_ref_type,
source_ref=c.rhodecode_db_repo.landing_ref_name,
target_ref_type='branch' if request.GET.get('branch') else c.rhodecode_db_repo.landing_ref_type,
target_ref=request.GET.get('branch') or c.rhodecode_db_repo.landing_ref_name,
changelog: rename changelog to commits pages
r3742 _query=dict(merge=1, target_repo=c.repo_name))}"
>
${_('Compare fork with Parent (%s)' % c.rhodecode_db_repo.fork.repo_name)}
</a>
</span>
%endif
## pr open link
%if h.is_hg(c.rhodecode_repo) or h.is_git(c.rhodecode_repo):
<span>
<a id="open_new_pull_request" class="btn btn-small btn-success" href="${h.route_path('pullrequest_new',repo_name=c.repo_name)}">
${_('Open new pull request')}
</a>
</span>
%endif
</li>
</ul>
</div>
% if c.pagination:
<script type="text/javascript" src="${h.asset('js/src/plugins/jquery.commits-graph.js')}"></script>
<div class="graph-header">
${self.breadcrumbs('breadcrumbs_light')}
</div>
<div id="graph">
<div class="graph-col-wrapper">
<div id="graph_nodes">
<div id="graph_canvas"></div>
</div>
dan
commits: new commits page based on new UI
r3758 <div id="graph_content" class="graph_full_width">
changelog: rename changelog to commits pages
r3742
<div class="table">
tables: unified tables for main pages of rhodecode repo pages.
r4511 <table id="changesets" class="rctable table-bordered">
changelog: rename changelog to commits pages
r3742 <tr>
## checkbox
dan
commits: new commits page based on new UI
r3758 <th colspan="4">
## clear selection
<div title="${_('Clear selection')}" class="btn btn-sm" id="rev_range_clear" style="display:none">
<i class="icon-cancel-circled2"></i>
</div>
<div class="btn btn-sm disabled" disabled="disabled" id="rev_range_more" style="display:none;">${_('Select second commit')}</div>
commit-ranges: enable combined diff compare directly from range selector.
r4552
<div id="rev_range_action" class="btn-group btn-group-actions" style="display:none;">
<a href="#" class="btn btn-success btn-sm" id="rev_range_container" style="display:none;"></a>
<a class="btn btn-success btn-sm btn-more-option" data-toggle="dropdown" aria-pressed="false" role="button">
<i class="icon-down"></i>
</a>
<div class="btn-action-switcher-container right-align">
<ul class="btn-action-switcher" role="menu" style="min-width: 220px; width: max-content">
<li>
## JS fills the URL
<a id="rev_range_combined_url" class="btn btn-primary btn-sm" href="">
${_('Show combined diff')}
</a>
</li>
</ul>
</div>
</div>
dan
commits: new commits page based on new UI
r3758 </th>
changelog: rename changelog to commits pages
r3742
## commit message expand arrow
<th></th>
<th>${_('Commit Message')}</th>
<th>${_('Age')}</th>
<th>${_('Author')}</th>
<th>${_('Refs')}</th>
## comments
<th></th>
</tr>
<tbody class="commits-range">
<%include file='changelog_elements.mako'/>
</tbody>
</table>
</div>
</div>
<div class="pagination-wh pagination-left">
dan
webhelpers: replaced paginate library with custom lib
r4091 ${c.pagination.render()}
changelog: rename changelog to commits pages
r3742 </div>
dan
commits: new commits page based on new UI
r3758 <div id="commit-counter" data-total=${c.total_cs} class="pull-right">
${_ungettext('showing %d out of %d commit', 'showing %d out of %d commits', c.showing_commits) % (c.showing_commits, c.total_cs)}
</div>
changelog: rename changelog to commits pages
r3742 </div>
<script type="text/javascript">
var cache = {};
$(function(){
// Create links to commit ranges when range checkboxes are selected
var $commitCheckboxes = $('.commit-range');
// cache elements
dan
commits: new commits page based on new UI
r3758 var $commitRangeMore = $('#rev_range_more');
changelog: rename changelog to commits pages
r3742 var $commitRangeContainer = $('#rev_range_container');
var $commitRangeClear = $('#rev_range_clear');
commit-ranges: enable combined diff compare directly from range selector.
r4552 var $commitRangeAction = $('#rev_range_action');
var $commitRangeCombinedUrl = $('#rev_range_combined_url');
var $compareFork = $('#compare_fork_button');
changelog: rename changelog to commits pages
r3742
var checkboxRangeSelector = function(e){
var selectedCheckboxes = [];
for (pos in $commitCheckboxes){
if($commitCheckboxes[pos].checked){
selectedCheckboxes.push($commitCheckboxes[pos]);
}
}
var open_new_pull_request = $('#open_new_pull_request');
dan
commits: new commits page based on new UI
r3758
if (open_new_pull_request) {
var selected_changes = selectedCheckboxes.length;
open_new_pull_request.hide();
if (selected_changes == 1) {
open_new_pull_request.html(_gettext('Open new pull request for selected commit'));
} else {
open_new_pull_request.html(_gettext('Open new pull request'));
}
open_new_pull_request.show();
changelog: rename changelog to commits pages
r3742 }
dan
commits: new commits page based on new UI
r3758 if (selectedCheckboxes.length > 0) {
commit-ranges: enable combined diff compare directly from range selector.
r4552 $compareFork.hide();
dan
commits: new commits page based on new UI
r3758 var commitStart = $(selectedCheckboxes[selectedCheckboxes.length-1]).data();
var revStart = commitStart.commitId;
var commitEnd = $(selectedCheckboxes[0]).data();
var revEnd = commitEnd.commitId;
changelog: rename changelog to commits pages
r3742
commits: use short-id for range selector
r3774 var lbl_start = '{0}'.format(commitStart.commitIdx, commitStart.shortId);
var lbl_end = '{0}'.format(commitEnd.commitIdx, commitEnd.shortId);
ui: fixed commits page details
r3771
dan
commits: new commits page based on new UI
r3758 var url = pyroutes.url('repo_commit', {'repo_name': '${c.repo_name}', 'commit_id': revStart+'...'+revEnd});
commit-ranges: enable combined diff compare directly from range selector.
r4552 var urlCombined = pyroutes.url('repo_commit', {'repo_name': '${c.repo_name}', 'commit_id': revStart+'...'+revEnd, 'redirect_combined': '1'});
var link = _gettext('Show commit range {0}<i class="icon-angle-right"></i>{1}').format(lbl_start, lbl_end);
dan
commits: new commits page based on new UI
r3758
if (selectedCheckboxes.length > 1) {
$commitRangeClear.show();
$commitRangeMore.hide();
changelog: rename changelog to commits pages
r3742
dan
commits: new commits page based on new UI
r3758 $commitRangeContainer
.attr('href',url)
.html(link)
.show();
commit-ranges: enable combined diff compare directly from range selector.
r4552 $commitRangeCombinedUrl.attr('href', urlCombined);
$commitRangeAction.show();
changelog: rename changelog to commits pages
r3742
dan
commits: new commits page based on new UI
r3758 } else {
$commitRangeContainer.hide();
commit-ranges: enable combined diff compare directly from range selector.
r4552 $commitRangeAction.hide();
dan
commits: new commits page based on new UI
r3758 $commitRangeClear.show();
$commitRangeMore.show();
}
changelog: rename changelog to commits pages
r3742
dan
commits: new commits page based on new UI
r3758 // pull-request link
if (selectedCheckboxes.length == 1){
var _url = pyroutes.url('pullrequest_new', {'repo_name': '${c.repo_name}', 'commit': revEnd});
open_new_pull_request.attr('href', _url);
} else {
var _url = pyroutes.url('pullrequest_new', {'repo_name': '${c.repo_name}'});
open_new_pull_request.attr('href', _url);
}
changelog: rename changelog to commits pages
r3742 } else {
$commitRangeContainer.hide();
$commitRangeClear.hide();
dan
commits: new commits page based on new UI
r3758 $commitRangeMore.hide();
commit-ranges: enable combined diff compare directly from range selector.
r4552 $commitRangeAction.hide();
changelog: rename changelog to commits pages
r3742
%if c.branch_name:
dan
commits: new commits page based on new UI
r3758 var _url = pyroutes.url('pullrequest_new', {'repo_name': '${c.repo_name}', 'branch':'${c.branch_name}'});
changelog: rename changelog to commits pages
r3742 open_new_pull_request.attr('href', _url);
%else:
dan
commits: new commits page based on new UI
r3758 var _url = pyroutes.url('pullrequest_new', {'repo_name': '${c.repo_name}'});
changelog: rename changelog to commits pages
r3742 open_new_pull_request.attr('href', _url);
%endif
commit-ranges: enable combined diff compare directly from range selector.
r4552 $compareFork.show();
changelog: rename changelog to commits pages
r3742 }
};
$commitCheckboxes.on('click', checkboxRangeSelector);
$commitRangeClear.on('click',function(e) {
$commitCheckboxes.attr('checked', false);
checkboxRangeSelector();
e.preventDefault();
});
// make sure the buttons are consistent when navigate back and forth
checkboxRangeSelector();
var msgs = $('.message');
// get first element height
var el = $('#graph_content .container')[0];
var row_h = el.clientHeight;
for (var i=0; i < msgs.length; i++) {
var m = msgs[i];
var h = m.clientHeight;
var pad = $(m).css('padding');
if (h > row_h) {
var offset = row_h - (h+12);
$(m.nextElementSibling).css('display','block');
$(m.nextElementSibling).css('margin-top',offset+'px');
}
}
$("#clear_filter").on("click", function() {
var filter = {'repo_name': '${c.repo_name}'};
window.location = pyroutes.url('repo_commits', filter);
});
$("#branch_filter").select2({
'dropdownAutoWidth': true,
'width': 'resolve',
dan
commits: new commits page based on new UI
r3758 'placeholder': "${c.selected_name or _('Branch filter')}",
changelog: rename changelog to commits pages
r3742 containerCssClass: "drop-menu",
dropdownCssClass: "drop-menu-dropdown",
query: function(query){
var key = 'cache';
var cached = cache[key] ;
if(cached) {
var data = {results: []};
//filter results
$.each(cached.results, function(){
var section = this.text;
var children = [];
$.each(this.children, function(){
if(query.term.length == 0 || this.text.toUpperCase().indexOf(query.term.toUpperCase()) >= 0 ){
children.push({'id': this.id, 'text': this.text, 'type': this.type})
}
});
data.results.push({'text': section, 'children': children});
query.callback({results: data.results});
});
}else{
$.ajax({
url: pyroutes.url('repo_refs_changelog_data', {'repo_name': '${c.repo_name}'}),
data: {},
dataType: 'json',
type: 'GET',
success: function(data) {
cache[key] = data;
query.callback({results: data.results});
}
})
}
}
});
$('#branch_filter').on('change', function(e){
var data = $('#branch_filter').select2('data');
//type: branch_closed
var selected = data.text;
var filter = {'repo_name': '${c.repo_name}'};
if(data.type == 'branch' || data.type == 'branch_closed'){
filter["branch"] = selected;
if (data.type == 'branch_closed') {
filter["evolve"] = '1';
}
}
else if (data.type == 'book'){
filter["bookmark"] = selected;
}
window.location = pyroutes.url('repo_commits', filter);
});
commitsController = new CommitsController();
% if not c.changelog_for_path:
commitsController.reloadGraph();
% endif
});
</script>
</div>
% else:
${_('There are no changes yet')}
% endif
</div>
</%def>