Add a "search_tabs" hook to allow additional search tabs

RESOLVED FIXED in Bugzilla 5.0

Status

()

Bugzilla
Query/Bug List
--
enhancement
RESOLVED FIXED
6 years ago
6 years ago

People

(Reporter: Albert Ting, Assigned: Albert Ting)

Tracking

4.0.3
Bugzilla 5.0
Bug Flags:
approval +

Details

Attachments

(1 attachment, 3 obsolete attachments)

v4
1.56 KB, patch
Frédéric Buclin
: review+
Details | Diff | Splinter Review
(Assignee)

Description

6 years ago
Created attachment 708251 [details] [diff] [review]
v1

Request that you add a hook in search/tabs.html.tmpl, which allows one to add additional tabs to the search page without having to modify the original file.

Updated

6 years ago
Attachment #708251 - Attachment is patch: true

Comment 1

6 years ago
Comment on attachment 708251 [details] [diff] [review]
v1

before_tabs is not a good name. search_tabs would be better.
Attachment #708251 - Flags: review-
(Assignee)

Comment 2

6 years ago
Created attachment 708272 [details] [diff] [review]
v2

Updated version
Attachment #708251 - Attachment is obsolete: true
Attachment #708272 - Flags: review?(LpSolit)

Updated

6 years ago
Blocks: 832095

Comment 3

6 years ago
Comment on attachment 708272 [details] [diff] [review]
v2

>+[% tabs = [ { name => 'specific', label => "Simple Search",
>                 link => "query.cgi?format=specific" },
>               { name => 'advanced', label => "Advanced Search",
>-                link => "query.cgi?format=advanced" } ]
>+                link => "query.cgi?format=advanced" } ] %]

Please fix the indentation for all lines, now that you made the first line shorter.


>+[% WRAPPER global/tabs.html.tmpl
>      current_tab_name = query_format || format || "advanced"
> %]

Please pass tabs = tabs to the wrapper, so that we understand where the tabs array is used.


Also, your patch needs a new extensions/Example/template/en/default/hook/search/tabs-search_tabs.html.tmpl template to show how this hook works.


Otherwise looks good and works fine.
Attachment #708272 - Flags: review?(LpSolit) → review-

Updated

6 years ago
Assignee: query-and-buglist → altlist
Status: NEW → ASSIGNED
Target Milestone: --- → Bugzilla 5.0
(Assignee)

Updated

6 years ago
No longer blocks: 832095
(Assignee)

Comment 4

6 years ago
Created attachment 710992 [details] [diff] [review]
v3

Updated patch with example hook
Attachment #708272 - Attachment is obsolete: true
Attachment #710992 - Flags: review?(LpSolit)

Comment 5

6 years ago
Comment on attachment 710992 [details] [diff] [review]
v3

>+++ extensions/Example/template/en/default/hook/search/tabs-search_tabs.html.tmpl	2013-02-06 14:42:09.593282000 -0800

Missing MPL2 license.
Attachment #710992 - Flags: review?(LpSolit) → review-
(Assignee)

Comment 6

6 years ago
Hi Frederic,

   I can add the license, but had merely used the same style as the other hooks in the Example (no MPL2).  Shouldn't the other hooks be updated as well?

Albert

Comment 7

6 years ago
All existing files already have the MPL license in them.
(Assignee)

Comment 8

6 years ago
Created attachment 711918 [details] [diff] [review]
v4

Understood.  Still using 4.0, gotta find the time to upgrade to 4.4!

Attached is the updated version.
Attachment #710992 - Attachment is obsolete: true
Attachment #711918 - Flags: review?(LpSolit)

Comment 9

6 years ago
Comment on attachment 711918 [details] [diff] [review]
v4

r=LpSolit
Attachment #711918 - Flags: review?(LpSolit) → review+

Updated

6 years ago
Flags: approval+
Summary: Add a "before_tabs" hook to allow additional search tabs → Add a "search_tabs" hook to allow additional search tabs

Comment 10

6 years ago
Committing to: bzr+ssh://lpsolit%40gmail.com@bzr.mozilla.org/bugzilla/trunk/
added extensions/Example/template/en/default/hook/search
added extensions/Example/template/en/default/hook/search/tabs-search_tabs.html.tmpl
modified template/en/default/search/tabs.html.tmpl
Committed revision 8579.
Status: ASSIGNED → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.