components.mako
276 lines
| 12.1 KiB
| application/x-mako
|
MakoHtmlLexer
r3621 | <%namespace name="base" file="/base/base.mako"/> | |||
r1282 | <%def name="refs_counters(branches, closed_branches, tags, bookmarks)"> | |||
r3766 | <span class="summary-branchtag summary-tag"> | |||
r1746 | <a href="${h.route_path('branches_home',repo_name=c.repo_name)}" class="childs"> | |||
Liviu
|
r3620 | <i class="icon-branch"></i> | ||
% if len(branches) == 1: | ||||
<span>${len(branches)}</span> ${_('Branch')} | ||||
% else: | ||||
<span>${len(branches)}</span> ${_('Branches')} | ||||
% endif | ||||
</a> | ||||
r1282 | </span> | |||
%if closed_branches: | ||||
r3766 | <span class="summary-branchtag summary-tag"> | |||
r1746 | <a href="${h.route_path('branches_home',repo_name=c.repo_name)}" class="childs"> | |||
Liviu
|
r3620 | <i class="icon-branch"></i> | ||
% if len(closed_branches) == 1: | ||||
<span>${len(closed_branches)}</span> ${_('Closed Branch')} | ||||
% else: | ||||
<span>${len(closed_branches)}</span> ${_('Closed Branches')} | ||||
% endif | ||||
</a> | ||||
r1282 | </span> | |||
%endif | ||||
r3766 | <span class="summary-tagtag summary-tag"> | |||
r1746 | <a href="${h.route_path('tags_home',repo_name=c.repo_name)}" class="childs"> | |||
Liviu
|
r3620 | <i class="icon-tag"></i> | ||
% if len(tags) == 1: | ||||
<span>${len(tags)}</span> ${_('Tag')} | ||||
% else: | ||||
<span>${len(tags)}</span> ${_('Tags')} | ||||
% endif | ||||
</a> | ||||
r1282 | </span> | |||
%if bookmarks: | ||||
r3766 | <span class="summary-booktag summary-tag"> | |||
r1746 | <a href="${h.route_path('bookmarks_home',repo_name=c.repo_name)}" class="childs"> | |||
Liviu
|
r3620 | <i class="icon-bookmark"></i> | ||
% if len(bookmarks) == 1: | ||||
<span>${len(bookmarks)}</span> ${_('Bookmark')} | ||||
% else: | ||||
<span>${len(bookmarks)}</span> ${_('Bookmarks')} | ||||
% endif | ||||
</a> | ||||
r1282 | </span> | |||
%endif | ||||
</%def> | ||||
<%def name="summary_detail(breadcrumbs_links, show_downloads=True)"> | ||||
<% summary = lambda n:{False:'summary-short'}.get(n) %> | ||||
<div id="summary-menu-stats" class="summary-detail"> | ||||
<div class="fieldset"> | ||||
Liviu
|
r3620 | <div class="left-content"> | ||
r2497 | <div class="left-clone"> | |||
<select id="clone_option" name="clone_option"> | ||||
<option value="http" selected="selected">HTTP</option> | ||||
<option value="http_id">HTTP UID</option> | ||||
r2498 | % if c.ssh_enabled: | |||
<option value="ssh">SSH</option> | ||||
% endif | ||||
r2497 | </select> | |||
r1282 | </div> | |||
Liviu
|
r3620 | |||
r2497 | <div class="right-clone"> | |||
<% | ||||
maybe_disabled = '' | ||||
if h.is_svn_without_proxy(c.rhodecode_db_repo): | ||||
maybe_disabled = 'disabled' | ||||
%> | ||||
<span id="clone_option_http"> | ||||
<input type="text" class="input-monospace clone_url_input" ${maybe_disabled} readonly="readonly" value="${c.clone_repo_url}"/> | ||||
<i class="tooltip icon-clipboard clipboard-action" data-clipboard-text="${c.clone_repo_url}" title="${_('Copy the clone url')}"></i> | ||||
</span> | ||||
r1942 | ||||
r2497 | <span style="display: none;" id="clone_option_http_id"> | |||
<input type="text" class="input-monospace clone_url_input" ${maybe_disabled} readonly="readonly" value="${c.clone_repo_url_id}"/> | ||||
<i class="tooltip icon-clipboard clipboard-action" data-clipboard-text="${c.clone_repo_url_id}" title="${_('Copy the clone by id url')}"></i> | ||||
</span> | ||||
r1942 | ||||
r2497 | <span style="display: none;" id="clone_option_ssh"> | |||
<input type="text" class="input-monospace clone_url_input" ${maybe_disabled} readonly="readonly" value="${c.clone_repo_url_ssh}"/> | ||||
<i class="tooltip icon-clipboard clipboard-action" data-clipboard-text="${c.clone_repo_url_ssh}" title="${_('Copy the clone by ssh url')}"></i> | ||||
</span> | ||||
% if maybe_disabled: | ||||
<p class="help-block">${_('SVN Protocol is disabled. To enable it, see the')} <a href="${h.route_url('enterprise_svn_setup')}" target="_blank">${_('documentation here')}</a>.</p> | ||||
% endif | ||||
r1282 | </div> | |||
Liviu
|
r3620 | </div> | ||
r1282 | ||||
r3183 | <div class="right-content"> | |||
<div class="commit-info"> | ||||
<div class="tags"> | ||||
r4420 | <% commit_rev = h.safe_int(c.rhodecode_db_repo.changeset_cache.get('revision'), 0) + 1 %> | |||
r3183 | % if c.rhodecode_repo: | |||
${refs_counters( | ||||
c.rhodecode_repo.branches, | ||||
c.rhodecode_repo.branches_closed, | ||||
c.rhodecode_repo.tags, | ||||
c.rhodecode_repo.bookmarks)} | ||||
% else: | ||||
## missing requirements can make c.rhodecode_repo None | ||||
${refs_counters([], [], [], [])} | ||||
% endif | ||||
## commits | ||||
r3766 | <span class="summary-tag"> | |||
r3183 | % if commit_rev == -1: | |||
r3760 | <i class="icon-history"></i> | |||
Liviu
|
r3620 | % if commit_rev == -1: | ||
<span>0</span> ${_('Commit')} | ||||
% else: | ||||
<span>0</span> ${_('Commits')} | ||||
% endif | ||||
r3183 | % else: | |||
r3742 | <a href="${h.route_path('repo_commits', repo_name=c.repo_name)}"> | |||
r3760 | <i class="icon-history"></i> | |||
Liviu
|
r3620 | % if commit_rev == 1: | ||
<span>${commit_rev}</span> ${_('Commit')} | ||||
% else: | ||||
<span>${commit_rev}</span> ${_('Commits')} | ||||
% endif | ||||
</a> | ||||
r3183 | % endif | |||
</span> | ||||
## forks | ||||
r3766 | <span class="summary-tag"> | |||
r3183 | <a title="${_('Number of Repository Forks')}" href="${h.route_path('repo_forks_show_all', repo_name=c.repo_name)}"> | |||
Liviu
|
r3620 | <i class="icon-code-fork"></i> | ||
<span>${c.repository_forks}</span> ${_ungettext('Fork', 'Forks', c.repository_forks)}</a> | ||||
r3183 | </span> | |||
r3334 | </div> | |||
</div> | ||||
</div> | ||||
r3657 | </div> | |||
## owner, description, downloads, statistics | ||||
r3183 | ||||
r3657 | ## Owner | |||
r3334 | <div class="fieldset collapsable-content" data-toggle="summary-details" style="display: none;"> | |||
<div class="left-label-summary"> | ||||
r3657 | <p>${_('Owner')}</p> | |||
Liviu
|
r3639 | <div class="right-label-summary"> | ||
r4026 | ${base.gravatar_with_user(c.rhodecode_db_repo.user.email, 16, tooltip=True)} | |||
r3183 | </div> | |||
r3657 | ||||
r3183 | </div> | |||
</div> | ||||
r3657 | ## Description | |||
r3183 | <div class="fieldset collapsable-content" data-toggle="summary-details" style="display: none;"> | |||
<div class="left-label-summary"> | ||||
Liviu
|
r3620 | <p>${_('Description')}</p> | ||
Liviu
|
r3639 | <div class="right-label-summary input ${summary(c.show_stats)}"> | ||
r2091 | <%namespace name="dt" file="/data_table/_dt_elements.mako"/> | |||
${dt.repo_desc(c.rhodecode_db_repo.description_safe, c.visual.stylify_metatags)} | ||||
</div> | ||||
r1282 | </div> | |||
</div> | ||||
r3657 | ## Downloads | |||
r1282 | % if show_downloads: | |||
<div class="fieldset collapsable-content" data-toggle="summary-details" style="display: none;"> | ||||
r3183 | <div class="left-label-summary"> | |||
Liviu
|
r3620 | <p>${_('Downloads')}</p> | ||
Liviu
|
r3639 | <div class="right-label-summary input ${summary(c.show_stats)} downloads"> | ||
r3106 | % if c.rhodecode_repo and len(c.rhodecode_repo.commit_ids) == 0: | |||
r1282 | <span class="disabled"> | |||
${_('There are no downloads yet')} | ||||
</span> | ||||
% elif not c.enable_downloads: | ||||
<span class="disabled"> | ||||
r3183 | ${_('Downloads are disabled for this repository')}. | |||
r1282 | </span> | |||
r3587 | % if c.is_super_admin: | |||
r3183 | ${h.link_to(_('Enable downloads'),h.route_path('edit_repo',repo_name=c.repo_name, _anchor='repo_enable_downloads'))} | |||
r1282 | % endif | |||
% else: | ||||
r4450 | <div class="enabled pull-left" style="margin-right: 10px"> | |||
<div class="btn-group btn-group-actions"> | ||||
r4534 | <a class="archive_link btn btn-small" data-ext=".zip" href="${h.route_path('repo_archivefile',repo_name=c.rhodecode_db_repo.repo_name, fname=c.rhodecode_db_repo.landing_ref_name+'.zip', _query={'with_hash': '1'})}"> | |||
r4450 | <i class="icon-download"></i> | |||
${c.rhodecode_db_repo.landing_ref_name}.zip | ||||
## replaced by some JS on select | ||||
</a> | ||||
r4452 | <a class="tooltip btn btn-primary btn-more-option" data-toggle="dropdown" aria-pressed="false" role="button" title="${_('more download options')}"> | |||
r4450 | <i class="icon-down"></i> | |||
</a> | ||||
r4412 | ||||
r4450 | <div class="btn-action-switcher-container left-align"> | |||
r4536 | <ul class="btn-action-switcher" role="menu" style="min-width: 200px; width: max-content"> | |||
r4450 | % for a_type, content_type, extension in h.ARCHIVE_SPECS: | |||
% if extension not in ['.zip']: | ||||
<li> | ||||
r4534 | <a class="archive_link" data-ext="${extension}" href="${h.route_path('repo_archivefile',repo_name=c.rhodecode_db_repo.repo_name, fname=c.rhodecode_db_repo.landing_ref_name+extension, _query={'with_hash': '1'})}"> | |||
r4450 | <i class="icon-download"></i> | |||
${c.rhodecode_db_repo.landing_ref_name+extension} | ||||
</a> | ||||
</li> | ||||
% endif | ||||
% endfor | ||||
</ul> | ||||
</div> | ||||
</div> | ||||
</div> | ||||
r1282 | ${h.hidden('download_options')} | |||
% endif | ||||
</div> | ||||
</div> | ||||
</div> | ||||
% endif | ||||
r3657 | ## Repo size | |||
<div class="fieldset collapsable-content" data-toggle="summary-details" style="display: none;"> | ||||
<div class="left-label-summary"> | ||||
<p>${_('Repository size')}</p> | ||||
<div class="right-label-summary"> | ||||
<div class="tags"> | ||||
## repo size | ||||
% if commit_rev == -1: | ||||
<span class="stats-bullet">0 B</span> | ||||
% else: | ||||
<span> | ||||
<a href="#showSize" onclick="calculateSize(); $(this).hide(); return false" id="show-repo-size">Show repository size</a> | ||||
</span> | ||||
<span class="stats-bullet" id="repo_size_container" style="display:none"> | ||||
${_('Calculating Repository Size...')} | ||||
</span> | ||||
% endif | ||||
</div> | ||||
</div> | ||||
</div> | ||||
</div> | ||||
r3183 | ## Statistics | |||
<div class="fieldset collapsable-content" data-toggle="summary-details" style="display: none;"> | ||||
<div class="left-label-summary"> | ||||
r3657 | <p>${_('Code Statistics')}</p> | |||
Liviu
|
r3620 | |||
Liviu
|
r3639 | <div class="right-label-summary input ${summary(c.show_stats)} statistics"> | ||
r3183 | % if c.show_stats: | |||
<div id="lang_stats" class="enabled"> | ||||
r3657 | <a href="#showSize" onclick="calculateSize(); $('#show-repo-size').hide(); $(this).hide(); return false" id="show-repo-size">Show code statistics</a> | |||
r3183 | </div> | |||
% else: | ||||
<span class="disabled"> | ||||
${_('Statistics are disabled for this repository')}. | ||||
</span> | ||||
r3587 | % if c.is_super_admin: | |||
r3183 | ${h.link_to(_('Enable statistics'),h.route_path('edit_repo',repo_name=c.repo_name, _anchor='repo_enable_statistics'))} | |||
% endif | ||||
% endif | ||||
</div> | ||||
</div> | ||||
</div> | ||||
Liviu
|
r3620 | |||
r1282 | </div><!--end summary-detail--> | |||
Liviu
|
r3620 | |||
<div id="summary_details_expand" class="btn-collapse" data-toggle="summary-details"> | ||||
${_('Show More')} | ||||
</div> | ||||
r1282 | </%def> | |||