@@ -9,10 +9,15 @@ <h2>Issue searching</h2>
99< input type ="hidden " name =":action " value ="search ">
1010
1111< table class ="form " tal:define ="
12- cols python:'id activity priority title status assignedto'.split();
13- defsort python:['activity'];
14- defgroup python:['priority'];
15- defdisp python:'id activity title status assignedto'.split() ">
12+ cols python:request.columns or 'id activity title status assignedto'.split();
13+ sort_on python:request.sort[1] or 'activity';
14+ group_on python:request.group[1] or 'priority';
15+
16+ search_input templates/page/macros/search_input;
17+ column_input templates/page/macros/column_input;
18+ sort_input templates/page/macros/sort_input;
19+ group_input templates/page/macros/group_input;
20+ search_select templates/page/macros/search_select; ">
1621
1722< tr >
1823 < th class ="header "> </ th >
@@ -22,159 +27,144 @@ <h2>Issue searching</h2>
2227 < th class ="header "> Group on</ th >
2328</ tr >
2429
25- < tr >
26- < th > All text*:</ th >
27- < td > < input name =":search_text "
28- tal:attributes ="value request/form/:search_text/value | nothing ">
29- </ td >
30- < td > </ td >
31- < td > </ td >
32- < td > </ td >
33- </ tr >
34-
35- < tr >
36- < th > Title:</ th >
37- < td > < input name ="title "> </ td >
38- < td > < input type ="checkbox " name =":columns " value ="title " checked > </ td >
39- < td > < input type ="radio " name =":sort " value ="title "> </ td >
40- < td > </ td >
41- </ tr >
42-
43- < tr >
44- < th > Topic:</ th >
45- < td >
46- < select name ="topic ">
47- < option value =""> don't care</ option >
48- < option value =""> ------------</ option >
49- < option tal:repeat ="s db/keyword/list " tal:attributes ="value s/name "
50- tal:content ="s/name "> topic to filter on</ option >
51- </ select >
52- </ td >
53- < td > < input type ="checkbox " name =":columns " value ="topic " checked > </ td >
54- < td > < input type ="radio " name =":sort " value ="topic "> </ td >
55- < td > < input type ="radio " name =":group " value ="topic "> </ td >
56- </ tr >
57-
58- < tr >
59- < th > ID:</ th >
60- < td > < input name ="id "> </ td >
61- < td > < input type ="checkbox " name =":columns " value ="id " checked > </ td >
62- < td > < input type ="radio " name =":sort " value ="id "> </ td >
63- < td > </ td >
64- </ tr >
65-
66- < tr >
67- < th > Creation date:</ th >
68- < td > < input name ="creation "> </ td >
69- < td > < input type ="checkbox " name =":columns " value ="creation "> </ td >
70- < td > < input type ="radio " name =":sort " value ="creation "> </ td >
71- < td > < input type ="radio " name =":group " value ="creation "> </ td >
72- </ tr >
73-
74- < tr >
75- < th > Creator:</ th >
76- < td >
77- < select name ="creator ">
78- < option value =""> don't care</ option >
79- < option tal:attributes ="value request/user/id "> created by me</ option >
80- < option value ="-1 "> ------------</ option >
81- < option tal:repeat ="s db/user/list " tal:attributes ="value s/id "
82- tal:content ="s/username "> user to filter on</ option >
83- </ select >
84- </ td >
85- < td > < input type ="checkbox " name =":columns " value ="creator " checked > </ td >
86- < td > < input type ="radio " name =":sort " value ="creator "> </ td >
87- < td > < input type ="radio " name =":group " value ="creator "> </ td >
88- </ tr >
89-
90- < tr >
91- < th > Activity:</ th >
92- < td > < input name ="activity "> </ td >
93- < td > < input type ="checkbox " name =":columns " value ="activity " checked > </ td >
94- < td > < input type ="radio " name =":sort " value ="activity "> </ td >
95- < td > </ td >
96- </ tr >
97-
98- < tr >
99- < th > Priority:</ th >
100- < td >
101- < select name ="priority ">
102- < option value =""> don't care</ option >
103- < option value ="-1 "> not selected</ option >
104- < option value =""> ------------</ option >
105- < option tal:repeat ="s db/priority/list " tal:attributes ="value s/id "
106- tal:content ="s/name "> priority to filter on</ option >
107- </ select >
108- </ td >
109- < td > < input type ="checkbox " name =":columns " value ="priority "> </ td >
110- < td > < input type ="radio " name =":sort " value ="priority "> </ td >
111- < td > < input type ="radio " name =":group " value ="priority "> </ td >
112- </ tr >
113-
114- < tr >
115- < th > Status:</ th >
116- < td >
117- < select name ="status ">
118- < option value =""> don't care</ option >
119- < option value ="-1,1,2,3,4,5,6,7 "> not resolved</ option >
120- < option value ="-1 "> not selected</ option >
121- < option value =""> ------------</ option >
122- < option tal:repeat ="s db/status/list " tal:attributes ="value s/id "
123- tal:content ="s/name "> status to filter on</ option >
124- </ select >
125- </ td >
126- < td > < input type ="checkbox " name =":columns " value ="status " checked > </ td >
127- < td > < input type ="radio " name =":sort " value ="status "> </ td >
128- < td > < input type ="radio " name =":group " value ="status "> </ td >
129- </ tr >
130-
131- < tr >
132- < th > Assigned To:</ th >
133- < td >
134- < select name ="assignedto ">
135- < option value =""> don't care</ option >
136- < option tal:attributes ="value request/user/id "> assigned to me</ option >
137- < option value ="-1 "> unassigned</ option >
138- < option value =""> ------------</ option >
139- < option tal:repeat ="s db/user/list " tal:attributes ="value s/id "
140- tal:content ="s/username "> user to filter on</ option >
141- </ select >
142- </ td >
143- < td > < input type ="checkbox " name =":columns " value ="assignedto " checked > </ td >
144- < td > < input type ="radio " name =":sort " value ="assignedto "> </ td >
145- < td > < input type ="radio " name =":group " value ="assignedto "> </ td >
30+ < tr tal:define ="name string::search_text ">
31+ < th > All text*:</ th >
32+ < td metal:use-macro ="search_input "> </ td >
33+ < td > </ td >
34+ < td > </ td >
35+ < td > </ td >
36+ </ tr >
37+
38+ < tr tal:define ="name string:title ">
39+ < th > Title:</ th >
40+ < td metal:use-macro ="search_input "> </ td >
41+ < td metal:use-macro ="column_input "> </ td >
42+ < td metal:use-macro ="sort_input "> </ td >
43+ < td > </ td >
44+ </ tr >
45+
46+ < tr tal:define ="name string:topic;
47+ db_klass string:keyword;
48+ db_content string:name; ">
49+ < th > Topic:</ th >
50+ < td metal:use-macro ="search_select "> </ td >
51+ < td metal:use-macro ="column_input "> </ td >
52+ < td metal:use-macro ="sort_input "> </ td >
53+ < td metal:use-macro ="group_input "> </ td >
54+ </ tr >
55+
56+ < tr tal:define ="name string:id ">
57+ < th > ID:</ th >
58+ < td metal:use-macro ="search_input "> </ td >
59+ < td metal:use-macro ="column_input "> </ td >
60+ < td metal:use-macro ="sort_input "> </ td >
61+ < td > </ td >
62+ </ tr >
63+
64+ < tr tal:define ="name string:creation ">
65+ < th > Creation Date:</ th >
66+ < td metal:use-macro ="search_input "> </ td >
67+ < td metal:use-macro ="column_input "> </ td >
68+ < td metal:use-macro ="sort_input "> </ td >
69+ < td metal:use-macro ="group_input "> </ td >
70+ </ tr >
71+
72+ < tr tal:define ="name string:creator;
73+ db_klass string:user;
74+ db_content string:username; ">
75+ < th > Creator:</ th >
76+ < td metal:use-macro ="search_select ">
77+ < option metal:fill-slot ="extra_options "
78+ tal:attributes ="value request/user/id "> created by me</ option >
79+ </ td >
80+ < td metal:use-macro ="column_input "> </ td >
81+ < td metal:use-macro ="sort_input "> </ td >
82+ < td metal:use-macro ="group_input "> </ td >
83+ </ tr >
84+
85+ < tr tal:define ="name string:activity ">
86+ < th > Activity:</ th >
87+ < td metal:use-macro ="search_input "> </ td >
88+ < td metal:use-macro ="column_input "> </ td >
89+ < td metal:use-macro ="sort_input "> </ td >
90+ < td > </ td >
91+ </ tr >
92+
93+ < tr tal:define ="name string:priority;
94+ db_klass string:priority;
95+ db_content string:name; ">
96+ < th > Priority:</ th >
97+ < td metal:use-macro ="search_select ">
98+ < option metal:fill-slot ="extra_options " value ="-1 "
99+ tal:attributes ="selected python:value == '-1' "> not selected</ option >
100+ </ td >
101+ < td metal:use-macro ="column_input "> </ td >
102+ < td metal:use-macro ="sort_input "> </ td >
103+ < td metal:use-macro ="group_input "> </ td >
104+ </ tr >
105+
106+ < tr tal:define ="name string:status;
107+ db_klass string:status;
108+ db_content string:name; ">
109+ < th > Status:</ th >
110+ < td metal:use-macro ="search_select ">
111+ < tal:block metal:fill-slot ="extra_options ">
112+ < option value ="-1,1,2,3,4,5,6,7 "
113+ tal:attributes ="selected python:value == '-1,1,2,3,4,5,6,7' "> not resolved</ option >
114+ < option value ="-1 "
115+ tal:attributes ="selected python:value == '-1' "> not selected</ option >
116+ </ tal:block >
117+ </ td >
118+ < td metal:use-macro ="column_input "> </ td >
119+ < td metal:use-macro ="sort_input "> </ td >
120+ < td metal:use-macro ="group_input "> </ td >
121+ </ tr >
122+
123+ < tr tal:define ="name string:assignedto;
124+ db_klass string:user;
125+ db_content string:username; ">
126+ < th > Assigned to:</ th >
127+ < td metal:use-macro ="search_select ">
128+ < tal:block metal:fill-slot ="extra_options ">
129+ < option tal:attributes ="value request/user/id "> assigned to me</ option >
130+ < option value ="-1 " tal:attributes ="selected python:value == '-1' "> unassigned</ option >
131+ </ tal:block >
132+ </ td >
133+ < td metal:use-macro ="column_input "> </ td >
134+ < td metal:use-macro ="sort_input "> </ td >
135+ < td metal:use-macro ="group_input "> </ td >
146136</ tr >
147137
148138< tr >
149139< th > Pagesize:</ th >
150- < td > < input type ="text " name =":pagesize " size ="3 " value ="50 "> </ td >
140+ < td > < input name =":pagesize " size ="3 " value ="50 "
141+ tal:attributes ="value request/form/:pagesize/value | default "> </ td >
151142</ tr >
152143
153144< tr >
154145< th > Start With:</ th >
155- < td > < input type ="text " name =":startwith " size ="3 " value ="0 "> </ td >
146+ < td > < input name =":startwith " size ="3 " value ="0 "
147+ tal:attributes ="value request/form/:startwith/value | default "> </ td >
156148</ tr >
157149
158150< tr >
159151< th > Sort Descending:</ th >
160- < td > < input type ="checkbox " name =":sortdir " checked >
152+ < td > < input type ="checkbox " name =":sortdir "
153+ tal:attributes ="checked python:request.sort[0] == '-' or request.sort[0] is None ">
161154</ td >
155+ </ tr >
162156
163157< tr >
164158< th > Group Descending:</ th >
165- < td > < input type ="checkbox " name =":groupdir ">
159+ < td > < input type ="checkbox " name =":groupdir "
160+ tal:attributes ="checked python:request.group[0] == '-' ">
166161</ td >
167162</ tr >
168163
169164< tr >
170165< th > Query name**:</ th >
171166< td > < input name =":queryname "
172- tal:attributes ="value request/form/:queryname/value | nothing ">
173- </ td >
174- </ tr >
175-
176- < tr > < td > </ td >
177- < td > < input type ="submit " value ="Search "> </ td >
167+ tal:attributes ="value request/form/:queryname/value | default "> </ td >
178168</ tr >
179169
180170< tr > < td > </ td >
0 commit comments