Skip to content

Commit c42abcb

Browse files
committed
Bug 1146779: add search result navigation
1 parent 135afb2 commit c42abcb

File tree

3 files changed

+68
-0
lines changed

3 files changed

+68
-0
lines changed

extensions/BugModal/template/en/default/bug_modal/edit.html.tmpl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,8 @@
132132
<input type="hidden" name="format" value="modal">
133133
<input type="hidden" name="editing" id="editing" value="">
134134
<input type="hidden" name="token" value="[% issue_hash_token([bug.id, bug.delta_ts]) FILTER html %]">
135+
136+
[% PROCESS bug_modal/navigate.html.tmpl %]
135137
[% END %]
136138

137139
[%# === header === %]
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
[%# This Source Code Form is subject to the terms of the Mozilla Public
2+
# License, v. 2.0. If a copy of the MPL was not distributed with this
3+
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
4+
#
5+
# This Source Code Form is "Incompatible With Secondary Licenses", as
6+
# defined by the Mozilla Public License, v. 2.0.
7+
#%]
8+
9+
10+
[%
11+
search = user.recent_search_for(bug);
12+
RETURN UNLESS search;
13+
last_bug_list = my_search.bug_list;
14+
this_bug_idx = lsearch(last_bug_list, bug.id);
15+
%]
16+
17+
<div id="search-nav">
18+
<span id="search-nav-label">[% terms.Bug %] List:</span>
19+
([% this_bug_idx + 1 %] of [% last_bug_list.size %])
20+
[% INCLUDE nav_link text="&#10096;&#10096; First" bug_id=last_bug_list.first %]
21+
[% IF this_bug_idx > 0 %]
22+
[% INCLUDE nav_link text="&#10096; Prev" bug_id=last_bug_list.item(this_bug_idx - 1) %]
23+
[% ELSE %]
24+
[% INCLUDE nav_link text="&#10096; Prev" bug_id="" %]
25+
[% END %]
26+
[% IF this_bug_idx + 1 < last_bug_list.size %]
27+
[% INCLUDE nav_link text="Next &#10097;" bug_id=last_bug_list.item(this_bug_idx + 1) %]
28+
[% ELSE %]
29+
[% INCLUDE nav_link text="Next &#10097;" bug_id="" %]
30+
[% END %]
31+
[% INCLUDE nav_link text="Last &#10097;&#10097;" bug_id=last_bug_list.last %]
32+
<a id="search-nav-reget" href="buglist.cgi?regetlastlist=[% my_search.id FILTER uri %]">Last search results</a>
33+
</div>
34+
35+
[% BLOCK nav_link %]
36+
[% IF bug_id == "" %]
37+
<span class="search-nav-disabled">[% text FILTER none %]</span>
38+
[% ELSE %]
39+
<a class="search-nav-link" href="show_bug.cgi?id=[% bug_id FILTER uri %]&amp;list_id=[% my_search.id FILTER uri %]">
40+
[%~ text FILTER none ~%]
41+
</a>
42+
[% END %]
43+
[% END %]

extensions/BugModal/web/bug_modal.css

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -846,3 +846,26 @@ div.ui-tooltip {
846846
#pcs {
847847
width: 235px;
848848
}
849+
850+
/* search navigation */
851+
852+
#search-nav {
853+
background: rgba(255, 255, 255, 0.3);
854+
padding: 4px 8px;
855+
}
856+
857+
#search-nav-label {
858+
font-weight: bold;
859+
}
860+
861+
.search-nav-link, .search-nav-disabled {
862+
margin-left: 4px;
863+
}
864+
865+
#search-nav-reget {
866+
margin-left: 8px;
867+
}
868+
869+
.search-nav-disabled {
870+
color: #777;
871+
}

0 commit comments

Comments
 (0)