summary.mako
125 lines
| 3.6 KiB
| application/x-mako
|
MakoHtmlLexer
r2178 | <%inherit file="/summary/summary_base.mako"/> | |||
r1282 | ||||
<%namespace name="components" file="/summary/components.mako"/> | ||||
<%def name="menu_bar_subnav()"> | ||||
${self.repo_menu(active='summary')} | ||||
</%def> | ||||
<%def name="main()"> | ||||
<div id="repo-summary" class="summary"> | ||||
${components.summary_detail(breadcrumbs_links=self.breadcrumbs_links(), show_downloads=True)} | ||||
</div><!--end repo-summary--> | ||||
Liviu
|
r3620 | <div class="box"> | ||
%if not c.repo_commits: | ||||
<div class="empty-repo"> | ||||
<div class="title"> | ||||
<h3>${_('Quick start')}</h3> | ||||
</div> | ||||
Liviu
|
r3644 | <div class="clear-fix"></div> | ||
Liviu
|
r3620 | </div> | ||
%endif | ||||
<div class="table"> | ||||
<div id="shortlog_data"> | ||||
<%include file='summary_commits.mako'/> | ||||
</div> | ||||
r1282 | </div> | |||
</div> | ||||
%if c.readme_data: | ||||
<div id="readme" class="anchor"> | ||||
Liviu
|
r3620 | <div class="box"> | ||
r4097 | ||||
r4370 | <div class="readme-title" title="${h.tooltip(_('Readme file from commit %s:%s') % (c.rhodecode_db_repo.landing_ref_type, c.rhodecode_db_repo.landing_ref_name))}"> | |||
r4097 | <div> | |||
<i class="icon-file-text"></i> | ||||
r4370 | <a href="${h.route_path('repo_files',repo_name=c.repo_name,commit_id=c.rhodecode_db_repo.landing_ref_name,f_path=c.readme_file)}"> | |||
r3747 | ${c.readme_file} | |||
</a> | ||||
r4097 | </div> | |||
r1282 | </div> | |||
<div class="readme codeblock"> | ||||
r1731 | <div class="readme_box"> | |||
r1282 | ${c.readme_data|n} | |||
</div> | ||||
</div> | ||||
</div> | ||||
</div> | ||||
%endif | ||||
<script type="text/javascript"> | ||||
$(document).ready(function(){ | ||||
r3088 | ||||
var showCloneField = function(clone_url_format){ | ||||
r2497 | $.each(['http', 'http_id', 'ssh'], function (idx, val) { | |||
r3088 | if(val === clone_url_format){ | |||
r2497 | $('#clone_option_' + val).show(); | |||
r3088 | $('#clone_option').val(val) | |||
r2497 | } else { | |||
$('#clone_option_' + val).hide(); | ||||
} | ||||
}); | ||||
r3088 | }; | |||
// default taken from session | ||||
showCloneField(templateContext.session_attrs.clone_url_format); | ||||
$('#clone_option').on('change', function(e) { | ||||
var selected = $(this).val(); | ||||
storeUserSessionAttr('rc_user_session_attr.clone_url_format', selected); | ||||
showCloneField(selected) | ||||
r1282 | }); | |||
var initialCommitData = { | ||||
id: null, | ||||
r4412 | text: '${c.rhodecode_db_repo.landing_ref_name}', | |||
type: '${c.rhodecode_db_repo.landing_ref_type}', | ||||
r1282 | raw_id: null, | |||
files_url: null | ||||
}; | ||||
select2RefSwitcher('#download_options', initialCommitData); | ||||
// on change of download options | ||||
$('#download_options').on('change', function(e) { | ||||
// format of Object {text: "v0.0.3", type: "tag", id: "rev"} | ||||
r4450 | var selectedReference = e.added; | |||
r4412 | var ico = '<i class="icon-download"></i>'; | |||
r1282 | ||||
r4450 | $.each($('.archive_link'), function (key, val) { | |||
var ext = $(this).data('ext'); | ||||
var fname = selectedReference.raw_id + ext; | ||||
var href = pyroutes.url('repo_archivefile', { | ||||
'repo_name': templateContext.repo_name, | ||||
'fname': fname | ||||
}); | ||||
// set new label | ||||
$(this).html(ico + ' {0}{1}'.format(escapeHtml(e.added.text), ext)); | ||||
// set new url to button, | ||||
$(this).attr('href', href) | ||||
}); | ||||
r1282 | }); | |||
r3334 | // calculate size of repository | |||
calculateSize = function () { | ||||
r1282 | ||||
var callback = function (data) { | ||||
% if c.show_stats: | ||||
r1785 | showRepoStats('lang_stats', data); | |||
r1282 | % endif | |||
}; | ||||
r3334 | showRepoSize('repo_size_container', templateContext.repo_name, templateContext.repo_landing_commit, callback); | |||
r1282 | ||||
r3334 | } | |||
r1282 | ||||
}) | ||||
</script> | ||||
</%def> | ||||