summaryrefslogtreecommitdiffstats
path: root/extensions
diff options
context:
space:
mode:
authorByron Jones <glob@mozilla.com>2015-06-03 10:12:46 +0200
committerByron Jones <glob@mozilla.com>2015-06-03 10:12:46 +0200
commitc42abcbc471c8dba01402c814de65303f4668077 (patch)
treec5c9764813ac101a42a4d0c97d436dfc6864a6ab /extensions
parent135afb27802aae8e649e36f62b8037d939d2388a (diff)
downloadbugzilla-c42abcbc471c8dba01402c814de65303f4668077.tar.gz
bugzilla-c42abcbc471c8dba01402c814de65303f4668077.tar.xz
Bug 1146779: add search result navigation
Diffstat (limited to 'extensions')
-rw-r--r--extensions/BugModal/template/en/default/bug_modal/edit.html.tmpl2
-rw-r--r--extensions/BugModal/template/en/default/bug_modal/navigate.html.tmpl43
-rw-r--r--extensions/BugModal/web/bug_modal.css23
3 files changed, 68 insertions, 0 deletions
diff --git a/extensions/BugModal/template/en/default/bug_modal/edit.html.tmpl b/extensions/BugModal/template/en/default/bug_modal/edit.html.tmpl
index 55780813f..d59717233 100644
--- a/extensions/BugModal/template/en/default/bug_modal/edit.html.tmpl
+++ b/extensions/BugModal/template/en/default/bug_modal/edit.html.tmpl
@@ -132,6 +132,8 @@
<input type="hidden" name="format" value="modal">
<input type="hidden" name="editing" id="editing" value="">
<input type="hidden" name="token" value="[% issue_hash_token([bug.id, bug.delta_ts]) FILTER html %]">
+
+ [% PROCESS bug_modal/navigate.html.tmpl %]
[% END %]
[%# === header === %]
diff --git a/extensions/BugModal/template/en/default/bug_modal/navigate.html.tmpl b/extensions/BugModal/template/en/default/bug_modal/navigate.html.tmpl
new file mode 100644
index 000000000..cb4eb4ab4
--- /dev/null
+++ b/extensions/BugModal/template/en/default/bug_modal/navigate.html.tmpl
@@ -0,0 +1,43 @@
+[%# This Source Code Form is subject to the terms of the Mozilla Public
+ # License, v. 2.0. If a copy of the MPL was not distributed with this
+ # file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ #
+ # This Source Code Form is "Incompatible With Secondary Licenses", as
+ # defined by the Mozilla Public License, v. 2.0.
+ #%]
+
+
+[%
+ search = user.recent_search_for(bug);
+ RETURN UNLESS search;
+ last_bug_list = my_search.bug_list;
+ this_bug_idx = lsearch(last_bug_list, bug.id);
+%]
+
+<div id="search-nav">
+ <span id="search-nav-label">[% terms.Bug %] List:</span>
+ ([% this_bug_idx + 1 %] of [% last_bug_list.size %])
+ [% INCLUDE nav_link text="&#10096;&#10096; First" bug_id=last_bug_list.first %]
+ [% IF this_bug_idx > 0 %]
+ [% INCLUDE nav_link text="&#10096; Prev" bug_id=last_bug_list.item(this_bug_idx - 1) %]
+ [% ELSE %]
+ [% INCLUDE nav_link text="&#10096; Prev" bug_id="" %]
+ [% END %]
+ [% IF this_bug_idx + 1 < last_bug_list.size %]
+ [% INCLUDE nav_link text="Next &#10097;" bug_id=last_bug_list.item(this_bug_idx + 1) %]
+ [% ELSE %]
+ [% INCLUDE nav_link text="Next &#10097;" bug_id="" %]
+ [% END %]
+ [% INCLUDE nav_link text="Last &#10097;&#10097;" bug_id=last_bug_list.last %]
+ <a id="search-nav-reget" href="buglist.cgi?regetlastlist=[% my_search.id FILTER uri %]">Last search results</a>
+</div>
+
+[% BLOCK nav_link %]
+ [% IF bug_id == "" %]
+ <span class="search-nav-disabled">[% text FILTER none %]</span>
+ [% ELSE %]
+ <a class="search-nav-link" href="show_bug.cgi?id=[% bug_id FILTER uri %]&amp;list_id=[% my_search.id FILTER uri %]">
+ [%~ text FILTER none ~%]
+ </a>
+ [% END %]
+[% END %]
diff --git a/extensions/BugModal/web/bug_modal.css b/extensions/BugModal/web/bug_modal.css
index b02fc6067..0d34039af 100644
--- a/extensions/BugModal/web/bug_modal.css
+++ b/extensions/BugModal/web/bug_modal.css
@@ -846,3 +846,26 @@ div.ui-tooltip {
#pcs {
width: 235px;
}
+
+/* search navigation */
+
+#search-nav {
+ background: rgba(255, 255, 255, 0.3);
+ padding: 4px 8px;
+}
+
+#search-nav-label {
+ font-weight: bold;
+}
+
+.search-nav-link, .search-nav-disabled {
+ margin-left: 4px;
+}
+
+#search-nav-reget {
+ margin-left: 8px;
+}
+
+.search-nav-disabled {
+ color: #777;
+}