##// END OF EJS Templates
search: added narrow result links for global search.
marcink -
r3467:36ee2e14 default
parent child Browse files
Show More
@@ -268,6 +268,12 b''
268 268 text-align: right;
269 269 color: @grey4;
270 270 }
271
272 .file-container {
273 display: inline-block;
274 width: 100%;
275 }
276
271 277 }
272 278
273 279 #summary-menu-stats {
@@ -43,6 +43,22 b''
43 43 %endif
44 44 </%def>
45 45
46 <%def name="repo_icon(db_repo)">
47 %if h.is_hg(db_repo):
48 <i class="icon-hg"></i>
49 %endif
50 %if h.is_git(db_repo):
51 <i class="icon-git"></i>
52 %endif
53 %if h.is_svn(db_repo):
54 <i class="icon-svn"></i>
55 %endif
56 </%def>
57
58 <%def name="repo_group_icon()">
59 <i class="icon-folder-close"></i>
60 </%def>
61
46 62 <%def name="main()">
47 63 <div class="box">
48 64 %if c.repo_name:
@@ -80,9 +96,9 b''
80 96 <div class="search-tags">
81 97 <span class="tag tag8">
82 98 %if c.repo_name:
83 <a href="${h.route_path('search', _query={'q': c.cur_query})}">${_('Global Search')}</a>
99 <a href="${h.route_path('search', _query={'q': c.cur_query, 'type': request.GET.get('type', 'content')})}">${_('Global Search')}</a>
84 100 %elif c.repo_group_name:
85 <a href="${h.route_path('search', _query={'q': c.cur_query})}">${_('Global Search')}</a>
101 <a href="${h.route_path('search', _query={'q': c.cur_query, 'type': request.GET.get('type', 'content')})}">${_('Global Search')}</a>
86 102 % else:
87 103 ${_('Global Search')}
88 104 %endif
@@ -91,22 +107,14 b''
91 107 %if c.repo_name:
92 108 »
93 109 <span class="tag tag8">
94 %if h.is_hg(c.rhodecode_db_repo):
95 <i class="icon-hg"></i>
96 %endif
97 %if h.is_git(c.rhodecode_db_repo):
98 <i class="icon-git"></i>
99 %endif
100 %if h.is_svn(c.rhodecode_db_repo):
101 <i class="icon-svn"></i>
102 %endif
110 ${repo_icon(c.rhodecode_db_repo)}
103 111 ${c.repo_name}
104 112 </span>
105 113
106 114 %elif c.repo_group_name:
107 115 »
108 116 <span class="tag tag8">
109 <i class="icon-folder-close"></i>
117 ${repo_group_icon()}
110 118 ${c.repo_group_name}
111 119 </span>
112 120 %endif
@@ -1,4 +1,5 b''
1 1 <%namespace name="base" file="/base/base.mako"/>
2 <%namespace name="search" file="/search/search.mako"/>
2 3
3 4 % if c.formatted_results:
4 5
@@ -23,13 +24,7 b''
23 24 <tr class="body">
24 25 <td class="td-componentname">
25 26 <% repo_type = entry.get('repo_type') or h.get_repo_type_by_name(entry.get('repository')) %>
26 %if repo_type == 'hg':
27 <i class="icon-hg"></i>
28 %elif repo_type == 'git':
29 <i class="icon-git"></i>
30 %elif repo_type == 'svn':
31 <i class="icon-svn"></i>
32 %endif
27 ${search.repo_icon(repo_type)}
33 28 ${h.link_to(entry['repository'], h.route_path('repo_summary',repo_name=entry['repository']))}
34 29 </td>
35 30 <td class="td-commit">
@@ -1,3 +1,4 b''
1 <%namespace name="search" file="/search/search.mako"/>
1 2
2 3 <%def name="highlight_text_file(has_matched_content, file_content, lexer, html_formatter, matching_lines, shown_matching_lines, url, use_hl_filter)">
3 4 % if has_matched_content:
@@ -61,56 +62,83 b''
61 62 <div class="codeblock-header">
62 63 <h1>
63 64 <% repo_type = entry.get('repo_type') or h.get_repo_type_by_name(entry.get('repository')) %>
64 %if repo_type == 'hg':
65 <i class="icon-hg"></i>
66 %elif repo_type == 'git':
67 <i class="icon-git"></i>
68 %elif repo_type == 'svn':
69 <i class="icon-svn"></i>
70 %endif
65 ${search.repo_icon(repo_type)}
71 66 ${h.link_to(entry['repository'], h.route_path('repo_summary',repo_name=entry['repository']))}
72 67 </h1>
73
74 <div class="stats">
75 <span class="stats-filename">
76 <strong>
77 <i class="icon-file-text"></i>
78 ${h.link_to(h.literal(entry['f_path']), h.route_path('repo_files',repo_name=entry['repository'],commit_id=entry.get('commit_id', 'tip'),f_path=entry['f_path']))}
79 </strong>
80 </span>
81 <span class="item last"><i class="tooltip icon-clipboard clipboard-action" data-clipboard-text="${entry['f_path']}" title="${_('Copy the full path')}"></i></span>
82 <br/>
83 <span class="stats-first-item">
84 ${len(matching_lines)} ${_ungettext('search match', 'search matches', len(matching_lines))}
85 </span>
68 ## level 1
69 <div class="file-container">
86 70
87 <span >
88 %if entry.get('lines'):
89 | ${entry.get('lines', 0.)} ${_ungettext('line', 'lines', entry.get('lines', 0.))}
90 %endif
91 </span>
71 <div class="pull-left">
72 <span class="stats-filename">
73 <strong>
74 <i class="icon-file-text"></i>
75 ${h.link_to(h.literal(entry['f_path']), h.route_path('repo_files',repo_name=entry['repository'],commit_id=entry.get('commit_id', 'tip'),f_path=entry['f_path']))}
76 </strong>
77 </span>
78 <span class="item last">
79 <i class="tooltip icon-clipboard clipboard-action" data-clipboard-text="${entry['f_path']}" title="${_('Copy the full path')}"></i>
80 </span>
81 </div>
92 82
93 <span>
94 %if entry.get('size'):
95 | ${h.format_byte_size_binary(entry['size'])}
96 %endif
97 </span>
98
99 <span>
100 %if entry.get('mimetype'):
101 | ${entry.get('mimetype', "unknown mimetype")}
102 %endif
103 </span>
83 <div class="pull-right">
84 <div class="buttons">
85 <a id="file_history_overview_full" href="${h.route_path('repo_changelog_file',repo_name=entry.get('repository',''),commit_id=entry.get('commit_id', 'tip'),f_path=entry.get('f_path',''))}">
86 ${_('Show Full History')}
87 </a>
88 | ${h.link_to(_('Annotation'), h.route_path('repo_files:annotated', repo_name=entry.get('repository',''),commit_id=entry.get('commit_id', 'tip'),f_path=entry.get('f_path','')))}
89 | ${h.link_to(_('Raw'), h.route_path('repo_file_raw', repo_name=entry.get('repository',''),commit_id=entry.get('commit_id', 'tip'),f_path=entry.get('f_path','')))}
90 | ${h.link_to(_('Download'), h.route_path('repo_file_download',repo_name=entry.get('repository',''),commit_id=entry.get('commit_id', 'tip'),f_path=entry.get('f_path','')))}
91 </div>
92 </div>
104 93
105 94 </div>
106 <div class="buttons">
107 <a id="file_history_overview_full" href="${h.route_path('repo_changelog_file',repo_name=entry.get('repository',''),commit_id=entry.get('commit_id', 'tip'),f_path=entry.get('f_path',''))}">
108 ${_('Show Full History')}
109 </a>
110 | ${h.link_to(_('Annotation'), h.route_path('repo_files:annotated', repo_name=entry.get('repository',''),commit_id=entry.get('commit_id', 'tip'),f_path=entry.get('f_path','')))}
111 | ${h.link_to(_('Raw'), h.route_path('repo_file_raw', repo_name=entry.get('repository',''),commit_id=entry.get('commit_id', 'tip'),f_path=entry.get('f_path','')))}
112 | ${h.link_to(_('Download'), h.route_path('repo_file_download',repo_name=entry.get('repository',''),commit_id=entry.get('commit_id', 'tip'),f_path=entry.get('f_path','')))}
95 ## level 2
96 <div class="file-container">
97
98 <div class="pull-left">
99 <span class="stats-first-item">
100 %if entry.get('lines'):
101 ${entry.get('lines', 0.)} ${_ungettext('line', 'lines', entry.get('lines', 0.))}
102 (${len(matching_lines)} ${_ungettext('matched', 'matched', len(matching_lines))})
103 %endif
104 </span>
105
106 <span>
107 %if entry.get('size'):
108 | ${h.format_byte_size_binary(entry['size'])}
109 %endif
110 </span>
111
112 <span>
113 %if entry.get('mimetype'):
114 | ${entry.get('mimetype', "unknown mimetype")}
115 %endif
116 </span>
117 </div>
118
119 <div class="pull-right">
120 <div class="search-tags">
121
122 <% repo_group = entry.get('repository_group')%>
123 ## hiden if in repo group view
124 % if repo_group and not c.repo_group_name:
125 <span class="tag tag8">
126 ${search.repo_group_icon()}
127 <a href="${h.route_path('search_repo_group', repo_group_name=repo_group, _query={'q': c.cur_query})}">${_('Narrow to this repository group')}</a>
128 </span>
129 % endif
130 ## hiden if in repo view
131 % if not c.repo_name:
132 <span class="tag tag8">
133 ${search.repo_icon(repo_type)}
134 <a href="${h.route_path('search_repo', repo_name=entry.get('repo_name'), _query={'q': c.cur_query})}">${_('Narrow to this repository')}</a>
135 </span>
136 % endif
137 </div>
138 </div>
139
113 140 </div>
141
114 142 </div>
115 143 <div class="code-body search-code-body">
116 144
@@ -1,3 +1,5 b''
1 <%namespace name="search" file="/search/search.mako"/>
2
1 3 % if c.formatted_results:
2 4
3 5 <table class="rctable search-results">
@@ -13,13 +15,7 b''
13 15 <tr class="body">
14 16 <td class="td-componentname">
15 17 <% repo_type = entry.get('repo_type') or h.get_repo_type_by_name(entry.get('repository')) %>
16 %if repo_type == 'hg':
17 <i class="icon-hg"></i>
18 %elif repo_type == 'git':
19 <i class="icon-git"></i>
20 %elif repo_type == 'svn':
21 <i class="icon-svn"></i>
22 %endif
18 ${search.repo_icon(repo_type)}
23 19 ${h.link_to(entry['repository'], h.route_path('repo_summary',repo_name=entry['repository']))}
24 20 </td>
25 21 <td class="td-componentname">
General Comments 0
You need to be logged in to leave comments. Login now