##// 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 text-align: right;
268 text-align: right;
269 color: @grey4;
269 color: @grey4;
270 }
270 }
271
272 .file-container {
273 display: inline-block;
274 width: 100%;
275 }
276
271 }
277 }
272
278
273 #summary-menu-stats {
279 #summary-menu-stats {
@@ -43,6 +43,22 b''
43 %endif
43 %endif
44 </%def>
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 <%def name="main()">
62 <%def name="main()">
47 <div class="box">
63 <div class="box">
48 %if c.repo_name:
64 %if c.repo_name:
@@ -80,9 +96,9 b''
80 <div class="search-tags">
96 <div class="search-tags">
81 <span class="tag tag8">
97 <span class="tag tag8">
82 %if c.repo_name:
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 %elif c.repo_group_name:
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 % else:
102 % else:
87 ${_('Global Search')}
103 ${_('Global Search')}
88 %endif
104 %endif
@@ -91,22 +107,14 b''
91 %if c.repo_name:
107 %if c.repo_name:
92 »
108 »
93 <span class="tag tag8">
109 <span class="tag tag8">
94 %if h.is_hg(c.rhodecode_db_repo):
110 ${repo_icon(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
103 ${c.repo_name}
111 ${c.repo_name}
104 </span>
112 </span>
105
113
106 %elif c.repo_group_name:
114 %elif c.repo_group_name:
107 »
115 »
108 <span class="tag tag8">
116 <span class="tag tag8">
109 <i class="icon-folder-close"></i>
117 ${repo_group_icon()}
110 ${c.repo_group_name}
118 ${c.repo_group_name}
111 </span>
119 </span>
112 %endif
120 %endif
@@ -1,4 +1,5 b''
1 <%namespace name="base" file="/base/base.mako"/>
1 <%namespace name="base" file="/base/base.mako"/>
2 <%namespace name="search" file="/search/search.mako"/>
2
3
3 % if c.formatted_results:
4 % if c.formatted_results:
4
5
@@ -23,13 +24,7 b''
23 <tr class="body">
24 <tr class="body">
24 <td class="td-componentname">
25 <td class="td-componentname">
25 <% repo_type = entry.get('repo_type') or h.get_repo_type_by_name(entry.get('repository')) %>
26 <% repo_type = entry.get('repo_type') or h.get_repo_type_by_name(entry.get('repository')) %>
26 %if repo_type == 'hg':
27 ${search.repo_icon(repo_type)}
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
33 ${h.link_to(entry['repository'], h.route_path('repo_summary',repo_name=entry['repository']))}
28 ${h.link_to(entry['repository'], h.route_path('repo_summary',repo_name=entry['repository']))}
34 </td>
29 </td>
35 <td class="td-commit">
30 <td class="td-commit">
@@ -1,3 +1,4 b''
1 <%namespace name="search" file="/search/search.mako"/>
1
2
2 <%def name="highlight_text_file(has_matched_content, file_content, lexer, html_formatter, matching_lines, shown_matching_lines, url, use_hl_filter)">
3 <%def name="highlight_text_file(has_matched_content, file_content, lexer, html_formatter, matching_lines, shown_matching_lines, url, use_hl_filter)">
3 % if has_matched_content:
4 % if has_matched_content:
@@ -61,56 +62,83 b''
61 <div class="codeblock-header">
62 <div class="codeblock-header">
62 <h1>
63 <h1>
63 <% repo_type = entry.get('repo_type') or h.get_repo_type_by_name(entry.get('repository')) %>
64 <% repo_type = entry.get('repo_type') or h.get_repo_type_by_name(entry.get('repository')) %>
64 %if repo_type == 'hg':
65 ${search.repo_icon(repo_type)}
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
71 ${h.link_to(entry['repository'], h.route_path('repo_summary',repo_name=entry['repository']))}
66 ${h.link_to(entry['repository'], h.route_path('repo_summary',repo_name=entry['repository']))}
72 </h1>
67 </h1>
73
68 ## level 1
74 <div class="stats">
69 <div class="file-container">
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>
86
70
87 <span >
71 <div class="pull-left">
88 %if entry.get('lines'):
72 <span class="stats-filename">
89 | ${entry.get('lines', 0.)} ${_ungettext('line', 'lines', entry.get('lines', 0.))}
73 <strong>
90 %endif
74 <i class="icon-file-text"></i>
91 </span>
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>
83 <div class="pull-right">
94 %if entry.get('size'):
84 <div class="buttons">
95 | ${h.format_byte_size_binary(entry['size'])}
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',''))}">
96 %endif
86 ${_('Show Full History')}
97 </span>
87 </a>
98
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','')))}
99 <span>
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','')))}
100 %if entry.get('mimetype'):
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','')))}
101 | ${entry.get('mimetype', "unknown mimetype")}
91 </div>
102 %endif
92 </div>
103 </span>
104
93
105 </div>
94 </div>
106 <div class="buttons">
95 ## level 2
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',''))}">
96 <div class="file-container">
108 ${_('Show Full History')}
97
109 </a>
98 <div class="pull-left">
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','')))}
99 <span class="stats-first-item">
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','')))}
100 %if entry.get('lines'):
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','')))}
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 </div>
140 </div>
141
114 </div>
142 </div>
115 <div class="code-body search-code-body">
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 % if c.formatted_results:
3 % if c.formatted_results:
2
4
3 <table class="rctable search-results">
5 <table class="rctable search-results">
@@ -13,13 +15,7 b''
13 <tr class="body">
15 <tr class="body">
14 <td class="td-componentname">
16 <td class="td-componentname">
15 <% repo_type = entry.get('repo_type') or h.get_repo_type_by_name(entry.get('repository')) %>
17 <% repo_type = entry.get('repo_type') or h.get_repo_type_by_name(entry.get('repository')) %>
16 %if repo_type == 'hg':
18 ${search.repo_icon(repo_type)}
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
23 ${h.link_to(entry['repository'], h.route_path('repo_summary',repo_name=entry['repository']))}
19 ${h.link_to(entry['repository'], h.route_path('repo_summary',repo_name=entry['repository']))}
24 </td>
20 </td>
25 <td class="td-componentname">
21 <td class="td-componentname">
General Comments 0
You need to be logged in to leave comments. Login now