]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 103274: Site Navigation Bar incorrect if viewing a bug not in the list
authorjouni%heikniemi.net <>
Mon, 12 Jul 2004 12:20:09 +0000 (12:20 +0000)
committerjouni%heikniemi.net <>
Mon, 12 Jul 2004 12:20:09 +0000 (12:20 +0000)
Patch by GavinS <bugzilla@chimpychompy.org>
r=jouni, a=justdave

template/en/default/global/site-navigation.html.tmpl

index f48620081e1f3ff53623f38dca0d80c3cf96e76d..189d596fc22a15a89823deaf78df1ff9376c9605 100644 (file)
   [% 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 %]