##// END OF EJS Templates
goto-switcher: optimized performance and query capabilities....
goto-switcher: optimized performance and query capabilities. - Previous implementation had on significant bug. The use of LIMIT 20 was limiting results BEFORE auth checks. In case of large ammount of similarly named repositories user didn't had access too, the result goto search was empty. This was becuase first 20 items fetched didn't pass permission checks and final auth list was empty. To fix this we now use proper filtering for auth using SQL. It means we first check user allowed repositories, and add this as a filter so end result from database is already to only the accessible repositories.

File last commit:

r1988:f7d6f6e1 default
r2038:2bdf9d4d default
Show More
components.mako
211 lines | 9.4 KiB | application/x-mako | MakoHtmlLexer
templating: use .mako as extensions for template files.
r1282 <%def name="refs_counters(branches, closed_branches, tags, bookmarks)">
<span class="branchtag tag">
tags/branches/bookmarks: moved views into pyramid.
r1746 <a href="${h.route_path('branches_home',repo_name=c.repo_name)}" class="childs">
repo-summary: re-implemented summary view as pyramid....
r1785 <i class="icon-branch"></i>${_ungettext(
templating: use .mako as extensions for template files.
r1282 '%(num)s Branch','%(num)s Branches', len(branches)) % {'num': len(branches)}}</a>
</span>
%if closed_branches:
<span class="branchtag tag">
tags/branches/bookmarks: moved views into pyramid.
r1746 <a href="${h.route_path('branches_home',repo_name=c.repo_name)}" class="childs">
repo-summary: re-implemented summary view as pyramid....
r1785 <i class="icon-branch"></i>${_ungettext(
templating: use .mako as extensions for template files.
r1282 '%(num)s Closed Branch', '%(num)s Closed Branches', len(closed_branches)) % {'num': len(closed_branches)}}</a>
</span>
%endif
<span class="tagtag tag">
tags/branches/bookmarks: moved views into pyramid.
r1746 <a href="${h.route_path('tags_home',repo_name=c.repo_name)}" class="childs">
repo-summary: re-implemented summary view as pyramid....
r1785 <i class="icon-tag"></i>${_ungettext(
templating: use .mako as extensions for template files.
r1282 '%(num)s Tag', '%(num)s Tags', len(tags)) % {'num': len(tags)}}</a>
</span>
%if bookmarks:
<span class="booktag tag">
tags/branches/bookmarks: moved views into pyramid.
r1746 <a href="${h.route_path('bookmarks_home',repo_name=c.repo_name)}" class="childs">
repo-summary: re-implemented summary view as pyramid....
r1785 <i class="icon-bookmark"></i>${_ungettext(
templating: use .mako as extensions for template files.
r1282 '%(num)s Bookmark', '%(num)s Bookmarks', len(bookmarks)) % {'num': len(bookmarks)}}</a>
</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="summary-detail-header">
<div class="breadcrumbs files_location">
<h4>
${breadcrumbs_links}
</h4>
</div>
<div id="summary_details_expand" class="btn-collapse" data-toggle="summary-details">
${_('Show More')}
</div>
</div>
<div class="fieldset">
%if h.is_svn_without_proxy(c.rhodecode_db_repo):
<div class="left-label disabled">
${_('Read-only url')}:
</div>
<div class="right-content disabled">
ui: use monospace fonts on clone urls.
r1468 <input type="text" class="input-monospace" id="clone_url" disabled value="${c.clone_repo_url}"/>
templates: add copy to clipboard for repository clone.
r1942 <i id="clone_by_name_copy" class="tooltip icon-clipboard clipboard-action" data-clipboard-text="${c.clone_repo_url}" title="${_('Copy the clone url')}"></i>
ui: use monospace fonts on clone urls.
r1468 <input type="text" class="input-monospace" id="clone_url_id" disabled value="${c.clone_repo_url_id}" style="display: none;"/>
templates: add copy to clipboard for repository clone.
r1942 <i id="clone_by_id_copy" class="tooltip icon-clipboard clipboard-action" data-clipboard-text="${c.clone_repo_url_id}" title="${_('Copy the clone by id url')}" style="display: none"></i>
templating: use .mako as extensions for template files.
r1282 <a id="clone_by_name" class="clone" style="display: none;">${_('Show by Name')}</a>
<a id="clone_by_id" class="clone">${_('Show by ID')}</a>
templates: add copy to clipboard for repository clone.
r1942
routing: switched static redirection links to pyramid....
r1679 <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>
templating: use .mako as extensions for template files.
r1282 </div>
%else:
<div class="left-label">
${_('Clone url')}:
</div>
<div class="right-content">
ui: use monospace fonts on clone urls.
r1468 <input type="text" class="input-monospace" id="clone_url" readonly="readonly" value="${c.clone_repo_url}"/>
templates: add copy to clipboard for repository clone.
r1942 <i id="clone_by_name_copy" class="tooltip icon-clipboard clipboard-action" data-clipboard-text="${c.clone_repo_url}" title="${_('Copy the clone url')}"></i>
ui: use monospace fonts on clone urls.
r1468 <input type="text" class="input-monospace" id="clone_url_id" readonly="readonly" value="${c.clone_repo_url_id}" style="display: none;"/>
templates: add copy to clipboard for repository clone.
r1942 <i id="clone_by_id_copy" class="tooltip icon-clipboard clipboard-action" data-clipboard-text="${c.clone_repo_url_id}" title="${_('Copy the clone by id url')}" style="display: none"></i>
templating: use .mako as extensions for template files.
r1282 <a id="clone_by_name" class="clone" style="display: none;">${_('Show by Name')}</a>
<a id="clone_by_id" class="clone">${_('Show by ID')}</a>
</div>
%endif
</div>
<div class="fieldset collapsable-content" data-toggle="summary-details" style="display: none;">
<div class="left-label">
${_('Description')}:
</div>
<div class="right-content">
%if c.visual.stylify_metatags:
<div class="input ${summary(c.show_stats)} desc">${h.urlify_text(h.escaped_stylize(c.rhodecode_db_repo.description))}</div>
%else:
<div class="input ${summary(c.show_stats)} desc">${h.urlify_text(h.html_escape(c.rhodecode_db_repo.description))}</div>
%endif
</div>
</div>
<div class="fieldset collapsable-content" data-toggle="summary-details" style="display: none;">
<div class="left-label">
${_('Information')}:
</div>
<div class="right-content">
<div class="repo-size">
html: fixed found syntax problems
r1283 <% commit_rev = c.rhodecode_db_repo.changeset_cache.get('revision') %>
templating: use .mako as extensions for template files.
r1282
## commits
% if commit_rev == -1:
repo-summary: re-implemented summary view as pyramid....
r1785 ${_ungettext('%(num)s Commit', '%(num)s Commits', 0) % {'num': 0}},
templating: use .mako as extensions for template files.
r1282 % else:
changelog: ported to pyramid views.
r1931 <a href="${h.route_path('repo_changelog', repo_name=c.repo_name)}">
repo-summary: re-implemented summary view as pyramid....
r1785 ${_ungettext('%(num)s Commit', '%(num)s Commits', commit_rev) % {'num': commit_rev}}</a>,
templating: use .mako as extensions for template files.
r1282 % endif
## forks
forks: moved pylons code into pyramid.
r1988 <a title="${_('Number of Repository Forks')}" href="${h.route_path('repo_forks_show_all', repo_name=c.repo_name)}">
repo-summary: re-implemented summary view as pyramid....
r1785 ${c.repository_forks} ${_ungettext('Fork', 'Forks', c.repository_forks)}</a>,
templating: use .mako as extensions for template files.
r1282
## repo size
% if commit_rev == -1:
<span class="stats-bullet">0 B</span>
% else:
<span class="stats-bullet" id="repo_size_container">
${_('Calculating Repository Size...')}
</span>
% endif
</div>
<div class="commit-info">
<div class="tags">
% 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
</div>
</div>
</div>
</div>
<div class="fieldset collapsable-content" data-toggle="summary-details" style="display: none;">
<div class="left-label">
${_('Statistics')}:
</div>
<div class="right-content">
<div class="input ${summary(c.show_stats)} statistics">
% if c.show_stats:
<div id="lang_stats" class="enabled">
${_('Calculating Code Statistics...')}
</div>
% else:
<span class="disabled">
${_('Statistics are disabled for this repository')}
</span>
% if h.HasPermissionAll('hg.admin')('enable stats on from summary'):
translation: unified usage of pluralize function ungettext....
r1945 , ${h.link_to(_('enable statistics'),h.route_path('edit_repo',repo_name=c.repo_name, _anchor='repo_enable_statistics'))}
templating: use .mako as extensions for template files.
r1282 % endif
% endif
</div>
</div>
</div>
% if show_downloads:
<div class="fieldset collapsable-content" data-toggle="summary-details" style="display: none;">
<div class="left-label">
${_('Downloads')}:
</div>
<div class="right-content">
<div class="input ${summary(c.show_stats)} downloads">
% if c.rhodecode_repo and len(c.rhodecode_repo.revisions) == 0:
<span class="disabled">
${_('There are no downloads yet')}
</span>
% elif not c.enable_downloads:
<span class="disabled">
${_('Downloads are disabled for this repository')}
</span>
% if h.HasPermissionAll('hg.admin')('enable downloads on from summary'):
translation: unified usage of pluralize function ungettext....
r1945 , ${h.link_to(_('enable downloads'),h.route_path('edit_repo',repo_name=c.repo_name, _anchor='repo_enable_downloads'))}
templating: use .mako as extensions for template files.
r1282 % endif
% else:
<span class="enabled">
files: ported repository files controllers to pyramid views.
r1927 <a id="archive_link" class="btn btn-small" href="${h.route_path('repo_archivefile',repo_name=c.rhodecode_db_repo.repo_name,fname='tip.zip')}">
templating: use .mako as extensions for template files.
r1282 <i class="icon-archive"></i> tip.zip
## replaced by some JS on select
</a>
</span>
${h.hidden('download_options')}
% endif
</div>
</div>
</div>
% endif
</div><!--end summary-detail-->
</%def>
<%def name="summary_stats(gravatar_function)">
<div class="sidebar-right">
<div class="summary-detail-header">
<h4 class="item">
${_('Owner')}
</h4>
</div>
<div class="sidebar-right-content">
${gravatar_function(c.rhodecode_db_repo.user.email, 16)}
</div>
</div><!--end sidebar-right-->
</%def>