Commit 8c1a3e8f authored by jouni%heikniemi.net's avatar jouni%heikniemi.net

Bug 103274: Site Navigation Bar incorrect if viewing a bug not in the list

Patch by GavinS <bugzilla@chimpychompy.org> r=jouni, a=justdave
parent 5414dfb9
......@@ -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 %]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment