## -*- coding: utf-8 -*- <%inherit file="/base/base.mako"/> <%def name="title()"> %if c.repo_name: ${_('Search inside repository {repo_name}').format(repo_name=c.repo_name)} %elif c.repo_group_name: ${_('Search inside repository group {repo_group_name}').format(repo_group_name=c.repo_group_name)} %else: ${_('Search inside all accessible repositories')} %endif %if c.rhodecode_name: · ${h.branding(c.rhodecode_name)} %endif <%def name="breadcrumbs_links()"> %if c.repo_name: ${_('Search inside repository {repo_name}').format(repo_name=c.repo_name)} %elif c.repo_group_name: ${_('Search inside repository group {repo_group_name}').format(repo_group_name=c.repo_group_name)} %else: ${_('Search inside all accessible repositories')} %endif <%def name="menu_bar_nav()"> %if c.repo_name: ${self.menu_items(active='search')} %elif c.repo_group_name: ${self.menu_items(active='search')} %else: ${self.menu_items(active='search')} %endif <%def name="menu_bar_subnav()"> %if c.repo_name: <% active_entry = {'content':'files', 'path':'files', 'commit':'commits'}.get(c.search_type, 'summary')%> ${self.repo_menu(active=active_entry)} %elif c.repo_group_name: ${self.repo_group_menu(active='home')} %endif <%def name="repo_icon(db_repo)"> %if h.is_hg(db_repo): %endif %if h.is_git(db_repo): %endif %if h.is_svn(db_repo): %endif <%def name="repo_group_icon()"> <%def name="field_sort(field_name)"> <% if c.sort.startswith('asc:'): return c.url_generator(sort='desc:{}'.format(field_name)) elif c.sort.startswith('desc:'): return c.url_generator(sort='asc:{}'.format(field_name)) return c.url_generator(sort='asc:{}'.format(field_name)) %> <%def name="main()">
%if c.repo_name: ${h.form(h.route_path('search_repo',repo_name=c.repo_name),method='get')} %elif c.repo_group_name: ${h.form(h.route_path('search_repo_group',repo_group_name=c.repo_group_name),method='get')} %else:
${self.breadcrumbs()}
${h.form(h.route_path('search'), method='get')} %endif
${h.text('q', c.cur_query, placeholder="Enter query...")} ${h.select('type',c.search_type,[('content',_('Files')), ('path',_('File path')),('commit',_('Commits'))],id='id_search_type')} ${h.hidden('max_lines', '10')}
%if c.repo_name: ${_('Global Search')} %elif c.repo_group_name: ${_('Global Search')} % else: ${_('Global Search')} %endif %if c.repo_name: » ${repo_icon(c.rhodecode_db_repo)} ${c.repo_name} %elif c.repo_group_name: » ${repo_group_icon()} ${c.repo_group_name} %endif % if c.sort_tag: % if c.sort_tag_dir == 'asc': % elif c.sort_tag_dir == 'desc': % endif ${_('sort')}:${c.sort_tag} % endif % for search_tag in c.search_tags:
${search_tag} % endfor
% for error in c.errors: % for k,v in error.asdict().items(): ${k} - ${v} % endfor % endfor

${_('Query Language examples')}

${c.runtime}
${h.end_form()}