summaryrefslogtreecommitdiffstats
path: root/template/en/default
diff options
context:
space:
mode:
authorjouni%heikniemi.net <>2004-07-12 14:20:09 +0200
committerjouni%heikniemi.net <>2004-07-12 14:20:09 +0200
commit8c1a3e8ff7f6c05ee9e7f45871cea073c4c26c91 (patch)
treefbd32c5f44bf4e4626ad26227fb2c6ddb3954f7b /template/en/default
parent5414dfb90d011ce314bb04e7363a931cb4558291 (diff)
downloadbugzilla-8c1a3e8ff7f6c05ee9e7f45871cea073c4c26c91.tar.gz
bugzilla-8c1a3e8ff7f6c05ee9e7f45871cea073c4c26c91.tar.xz
Bug 103274: Site Navigation Bar incorrect if viewing a bug not in the list
Patch by GavinS <bugzilla@chimpychompy.org> r=jouni, a=justdave
Diffstat (limited to 'template/en/default')
-rw-r--r--template/en/default/global/site-navigation.html.tmpl23
1 files changed, 14 insertions, 9 deletions
diff --git a/template/en/default/global/site-navigation.html.tmpl b/template/en/default/global/site-navigation.html.tmpl
index f48620081..189d596fc 100644
--- a/template/en/default/global/site-navigation.html.tmpl
+++ b/template/en/default/global/site-navigation.html.tmpl
@@ -37,18 +37,23 @@
[% IF bug && bug_list && bug_list.size > 0 %]
<link rel="Up" href="buglist.cgi?regetlastlist=1">
+ <link rel="First" href="show_bug.cgi?id=[% bug_list.first %]">
+ <link rel="Last" href="show_bug.cgi?id=[% bug_list.last %]">
+
[% current_bug_idx = lsearch(bug_list, bug.bug_id) %]
- [% IF current_bug_idx > 0 %]
- <link rel="First" href="show_bug.cgi?id=[% bug_list.first %]">
- [% prev_bug = current_bug_idx - 1 %]
- <link rel="Prev" href="show_bug.cgi?id=[% bug_list.$prev_bug %]">
- [% END %]
+ [% IF current_bug_idx != -1 %]
+
+ [% IF current_bug_idx > 0 %]
+ [% prev_bug = current_bug_idx - 1 %]
+ <link rel="Prev" href="show_bug.cgi?id=[% bug_list.$prev_bug %]">
+ [% END %]
+
+ [% IF current_bug_idx + 1 < bug_list.size %]
+ [% next_bug = current_bug_idx + 1 %]
+ <link rel="Next" href="show_bug.cgi?id=[% bug_list.$next_bug %]">
+ [% END %]
- [% IF current_bug_idx + 1 < bug_list.size %]
- [% next_bug = current_bug_idx + 1 %]
- <link rel="Next" href="show_bug.cgi?id=[% bug_list.$next_bug %]">
- <link rel="Last" href="show_bug.cgi?id=[% bug_list.last %]">
[% END %]
[% END %]