Mercurial > p > roundup > code
comparison templates/classic/html/page.html @ 3704:18def94e5150
macro th_label:
- usage of th_label in user.item.html (for a start)
- macro search_select_translated (for status and priority)
- Javascript support for adding uses (just past the email address and
leave the input field)
| author | Tobias Herp <tobias-herp@users.sourceforge.net> |
|---|---|
| date | Sun, 17 Sep 2006 23:27:21 +0000 |
| parents | 101ef7a4f9a1 |
| children | ba2eeadeed69 |
comparison
equal
deleted
inserted
replaced
| 3703:b0b333957d91 | 3704:18def94e5150 |
|---|---|
| 1 <tal:block metal:define-macro="icing"> | 1 <tal:block metal:define-macro="icing"><!-- ££££µµµµ vim:sw=2 ts=2 |
| 2 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" | 2 --><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" |
| 3 "http://www.w3.org/TR/html4/strict.dtd"> | 3 "http://www.w3.org/TR/html4/strict.dtd"> |
| 4 <html> | 4 <html> |
| 5 <head> | 5 <head> |
| 6 <title metal:define-slot="head_title">title goes here</title> | 6 <title metal:define-slot="head_title">title goes here</title> |
| 7 <link rel="stylesheet" type="text/css" href="@@file/style.css"> | 7 <link rel="stylesheet" type="text/css" href="@@file/style.css"> |
| 8 <meta http-equiv="Content-Type" | 8 <meta http-equiv="Content-Type" |
| 9 tal:attributes="content string:text/html;; charset=${request/client/charset}" /> | 9 tal:attributes="content string:text/html;; charset=${request/client/charset}" /> |
| 10 <script tal:replace="structure request/base_javascript"> | 10 <script tal:replace="structure request/base_javascript"> |
| 11 </script> | 11 </script> |
| 12 <metal:x define-slot="more-javascript" /> | |
| 12 | 13 |
| 13 </head> | 14 </head> |
| 14 <body class="body"> | 15 <body class="body"> |
| 15 | 16 |
| 16 <table class="body"> | 17 <table class="body" |
| 18 tal:define=" | |
| 19 kw_edit python:request.user.hasPermission('Edit', 'keyword'); | |
| 20 kw_create python:request.user.hasPermission('Create', 'keyword'); | |
| 21 kw_edit_link python:kw_edit and db.keyword.list(); | |
| 22 columns string:id,activity,title,creator,status; | |
| 23 columns_showall string:id,activity,title,creator,assignedto,status; | |
| 24 status_notresolved string:-1,1,2,3,4,5,6,7; | |
| 25 " | |
| 26 > | |
| 17 | 27 |
| 18 <tr> | 28 <tr> |
| 19 <td class="page-header-left"> </td> | 29 <td class="page-header-left"> </td> |
| 20 <td class="page-header-top"> | 30 <td class="page-header-top"> |
| 21 <div id="body-title"> | 31 <div id="body-title"> |
| 22 <h2><span metal:define-slot="body_title">body title</span></h2> | 32 <h2><span metal:define-slot="body_title">body title</span></h2> |
| 23 </div> | 33 </div> |
| 24 <div id="searchbox"> | 34 <div id="searchbox"> |
| 25 <form method="GET" action="issue"> | 35 <form method="GET" action="issue"> |
| 26 <input type="hidden" name="@columns" | 36 <input type="hidden" name="@columns" |
| 27 value="id,activity,title,creator,assignedto,status"/> | 37 tal:attributes="value columns_showall" |
| 38 value="id,activity,title,creator,assignedto,status"/> | |
| 28 <input type="hidden" name="@sort" value="activity"/> | 39 <input type="hidden" name="@sort" value="activity"/> |
| 29 <input type="hidden" name="@group" value="priority"/> | 40 <input type="hidden" name="@group" value="priority"/> |
| 30 <input id="search-text" name="@search_text" size="10"/> | 41 <input id="search-text" name="@search_text" size="10"/> |
| 31 <input type="submit" id="submit" name="submit" value="Search" i18n:attributes="value"/> | 42 <input type="submit" id="submit" name="submit" value="Search" i18n:attributes="value"/> |
| 32 </form> | 43 </form> |
| 51 tal:condition="python:request.user.hasPermission('View', 'issue')"> | 62 tal:condition="python:request.user.hasPermission('View', 'issue')"> |
| 52 <b i18n:translate="">Issues</b><br> | 63 <b i18n:translate="">Issues</b><br> |
| 53 <span tal:condition="python:request.user.hasPermission('Create', 'issue')"> | 64 <span tal:condition="python:request.user.hasPermission('Create', 'issue')"> |
| 54 <a href="issue?@template=item" i18n:translate="">Create New</a><br> | 65 <a href="issue?@template=item" i18n:translate="">Create New</a><br> |
| 55 </span> | 66 </span> |
| 56 <a tal:attributes="href python:request.indexargs_url('issue', { | 67 <a href="#" |
| 68 tal:define="txt python:i18n.gettext('Show Unassigned')" | |
| 69 tal:attributes="href python:request.indexargs_url('issue', { | |
| 57 '@sort': '-activity', | 70 '@sort': '-activity', |
| 58 '@group': 'priority', | 71 '@group': 'priority', |
| 59 '@filter': 'status,assignedto', | 72 '@filter': 'status,assignedto', |
| 60 '@columns': 'id,activity,title,creator,status', | 73 '@columns': columns, |
| 61 'status': '-1,1,2,3,4,5,6,7', | 74 'status': status_notresolved, |
| 62 'assignedto': '-1', | 75 'assignedto': '-1', |
| 63 '@dispname': i18n.gettext('Show Unassigned'), | 76 '@dispname': txt, |
| 64 })" i18n:translate="">Show Unassigned</a><br> | 77 })" |
| 65 <a tal:attributes="href python:request.indexargs_url('issue', { | 78 tal:content="txt">Show Unassigned</a><br> |
| 79 <a href="#" | |
| 80 tal:define="txt python:i18n.gettext('Show All')" | |
| 81 tal:attributes="href python:request.indexargs_url('issue', { | |
| 66 '@sort': '-activity', | 82 '@sort': '-activity', |
| 67 '@group': 'priority', | 83 '@group': 'priority', |
| 68 '@filter': 'status', | 84 '@filter': 'status', |
| 69 '@columns': 'id,activity,title,creator,assignedto,status', | 85 '@columns': columns_showall, |
| 70 'status': '-1,1,2,3,4,5,6,7', | 86 'status': status_notresolved, |
| 71 '@dispname': i18n.gettext('Show All'), | 87 '@dispname': txt, |
| 72 })" i18n:translate="">Show All</a><br> | 88 })" |
| 89 tal:content="txt">Show All</a><br> | |
| 73 <a href="issue?@template=search" i18n:translate="">Search</a><br> | 90 <a href="issue?@template=search" i18n:translate="">Search</a><br> |
| 74 <input type="submit" class="form-small" value="Show issue:" | 91 <input type="submit" class="form-small" value="Show issue:" |
| 75 i18n:attributes="value"><input class="form-small" size="4" | 92 i18n:attributes="value"><input class="form-small" size="4" |
| 76 type="text" name="@number"> | 93 type="text" name="@number"> |
| 77 <input type="hidden" name="@type" value="issue"> | 94 <input type="hidden" name="@type" value="issue"> |
| 78 <input type="hidden" name="@action" value="show"> | 95 <input type="hidden" name="@action" value="show"> |
| 79 </p> | 96 </p> |
| 80 </form> | 97 </form> |
| 81 | 98 |
| 82 <p class="classblock" | 99 <p class="classblock" |
| 83 tal:condition="python:request.user.hasPermission('Edit', 'keyword') | 100 tal:condition="python:kw_edit or kw_create"> |
| 84 or request.user.hasPermission('Create', 'keyword')"> | |
| 85 <b i18n:translate="">Keywords</b><br> | 101 <b i18n:translate="">Keywords</b><br> |
| 86 <span tal:condition="python:request.user.hasPermission('Create', 'keyword')"> | 102 <span tal:condition="python:request.user.hasPermission('Create', 'keyword')"> |
| 87 <a href="keyword?@template=item" i18n:translate="">Create New</a><br> | 103 <a href="keyword?@template=item" i18n:translate="">Create New</a><br> |
| 88 </span> | 104 </span> |
| 89 <span tal:condition="python:db.keyword.list() and | 105 <span tal:condition="kw_edit_link"> |
| 90 request.user.hasPermission('Edit', 'keyword')"> | |
| 91 <a href="keyword?@template=item" i18n:translate="">Edit Existing</a><br> | 106 <a href="keyword?@template=item" i18n:translate="">Edit Existing</a><br> |
| 92 </span> | 107 </span> |
| 93 </p> | 108 </p> |
| 94 | 109 |
| 95 <p class="classblock" | 110 <p class="classblock" |
| 170 The invoking context must define a "name" variable which names the | 185 The invoking context must define a "name" variable which names the |
| 171 property being searched. | 186 property being searched. |
| 172 | 187 |
| 173 See issue.search.html in the classic template for examples. | 188 See issue.search.html in the classic template for examples. |
| 174 --> | 189 --> |
| 190 | |
| 191 <!-- creates a th and a label: --> | |
| 192 <th metal:define-macro="th_label" | |
| 193 tal:define="required required | python:[]" | |
| 194 tal:attributes="class python:(name in required) and 'required' or nothing"> | |
| 195 <label tal:attributes="for name" tal:content="label" i18n:translate="">text</label> | |
| 196 <metal:x define-slot="behind_the_label" /> | |
| 197 </th> | |
| 198 | |
| 175 <td metal:define-macro="search_input"> | 199 <td metal:define-macro="search_input"> |
| 176 <input tal:attributes="value python:request.form.getvalue(name) or nothing; | 200 <input tal:attributes="value python:request.form.getvalue(name) or nothing; |
| 177 name name"> | 201 name name; |
| 202 id name"> | |
| 178 </td> | 203 </td> |
| 179 | 204 |
| 180 <td metal:define-macro="search_date"> | 205 <td metal:define-macro="search_date"> |
| 181 <input tal:attributes="value python:request.form.getvalue(name) or nothing; | 206 <input tal:attributes="value python:request.form.getvalue(name) or nothing; |
| 182 name name"> | 207 name name; |
| 183 <a class="classhelp" tal:attributes="href python:'''javascript:help_window('issue?@template=calendar&property=%s&form=itemSynopsis', 300, 200)'''%name">(cal)</a> | 208 id name"> |
| 209 <a class="classhelp" | |
| 210 tal:attributes="href python:'''javascript:help_window('issue?@template=calendar&property=%s&form=itemSynopsis', 300, 200)'''%name">(cal)</a> | |
| 184 </td> | 211 </td> |
| 185 | 212 |
| 186 <td metal:define-macro="search_popup"> | 213 <td metal:define-macro="search_popup"> |
| 187 <!-- | 214 <!-- |
| 188 context needs to specify the popup "columns" as a comma-separated | 215 context needs to specify the popup "columns" as a comma-separated |
| 189 string (eg. "id,title" or "id,name,description") as well as name | 216 string (eg. "id,title" or "id,name,description") as well as name |
| 190 --> | 217 --> |
| 191 <input tal:attributes="value python:request.form.getvalue(name) or nothing; | 218 <input tal:attributes="value python:request.form.getvalue(name) or nothing; |
| 192 name name"> | 219 name name; |
| 220 id name"> | |
| 193 <span tal:replace="structure python:db.issue.classhelp(columns, | 221 <span tal:replace="structure python:db.issue.classhelp(columns, |
| 194 property=name)" /> | 222 property=name)" /> |
| 195 </td> | 223 </td> |
| 196 | 224 |
| 197 <td metal:define-macro="search_select"> | 225 <td metal:define-macro="search_select"> |
| 198 <select tal:attributes="name name" | 226 <select tal:attributes="name name; id name" |
| 199 tal:define="value python:request.form.getvalue(name)"> | 227 tal:define="value python:request.form.getvalue(name)"> |
| 200 <option value="" i18n:translate="">don't care</option> | 228 <option value="" i18n:translate="">don't care</option> |
| 201 <tal:block metal:define-slot="extra_options"></tal:block> | 229 <metal:slot define-slot="extra_options" /> |
| 202 <option value="" i18n:translate="">------------</option> | 230 <option value="" i18n:translate="" disabled="disabled">------------</option> |
| 203 <option tal:repeat="s python:db[db_klass].list()" | 231 <option tal:repeat="s python:db[db_klass].list()" |
| 204 tal:attributes="value s/id; selected python:value == s.id" | 232 tal:attributes="value s/id; selected python:value == s.id" |
| 205 tal:content="python:s[db_content]"></option> | 233 tal:content="python:s[db_content]"></option> |
| 206 </select> | 234 </select> |
| 207 </td> | 235 </td> |
| 208 | 236 |
| 237 <!-- like search_select, but translates the further values. | |
| 238 Could extend it (METAL 1.1 attribute "extend-macro") | |
| 239 --> | |
| 240 <td metal:define-macro="search_select_translated"> | |
| 241 <select tal:attributes="name name; id name" | |
| 242 tal:define="value python:request.form.getvalue(name)"> | |
| 243 <option value="" i18n:translate="">don't care</option> | |
| 244 <metal:slot define-slot="extra_options" /> | |
| 245 <option value="" i18n:translate="" disabled="disabled">------------</option> | |
| 246 <option tal:repeat="s python:db[db_klass].list()" | |
| 247 tal:attributes="value s/id; selected python:value == s.id" | |
| 248 tal:content="python:s[db_content]" | |
| 249 i18n:translate=""></option> | |
| 250 </select> | |
| 251 </td> | |
| 252 | |
| 253 <!-- currently, there is no convenient API to get a list of all roles --> | |
| 254 <td metal:define-macro="search_select_roles"> | |
| 255 <select name=roles id=roles> | |
| 256 <option value="" i18n:translate="">don't care</option> | |
| 257 <option value="" i18n:translate="" disabled="disabled">------------</option> | |
| 258 <option value="User">User</option> | |
| 259 <option value="Admin">Admin</option> | |
| 260 <option value="Anonymous">Anonymous</option> | |
| 261 </select> | |
| 262 </td> | |
| 263 | |
| 209 <td metal:define-macro="search_multiselect"> | 264 <td metal:define-macro="search_multiselect"> |
| 210 <input tal:attributes="value python:request.form.getvalue(name) or nothing; | 265 <input tal:attributes="value python:request.form.getvalue(name) or nothing; |
| 211 name name"> | 266 name name; |
| 267 id name"> | |
| 212 <span tal:replace="structure python:db[db_klass].classhelp(db_content, | 268 <span tal:replace="structure python:db[db_klass].classhelp(db_content, |
| 213 property=name, width='600')" /> | 269 property=name, width='600')" /> |
| 214 </td> | 270 </td> |
| 215 | 271 |
| 216 <td metal:define-macro="search_checkboxes"> | 272 <td metal:define-macro="search_checkboxes"> |
| 247 <input type="radio" name="@group" | 303 <input type="radio" name="@group" |
| 248 tal:attributes="value name; | 304 tal:attributes="value name; |
| 249 checked python:name == group_on"> | 305 checked python:name == group_on"> |
| 250 </td> | 306 </td> |
| 251 | 307 |
| 308 <!-- | |
| 309 The following macros are intended for user editing. | |
| 310 | |
| 311 The invoking context must define a "name" variable which names the | |
| 312 property being searched; the "edit_ok" variable tells whether the | |
| 313 current user is allowed to edit. | |
| 314 | |
| 315 See user.item.html in the classic template for examples. | |
| 316 --> | |
| 317 <script metal:define-macro="user_utils" type="text/javascript" src="@@file/user_utils.js"></script> | |
| 318 | |
| 319 <!-- src: value will be re-used for other input fields --> | |
| 320 <input metal:define-macro="user_src_input" | |
| 321 type="text" tal:attributes="onblur python:edit_ok and 'split_name(this)'; | |
| 322 id name; name name; value value; readonly not:edit_ok" | |
| 323 value="heinz.kunz"> | |
| 324 <!-- normal: no re-using --> | |
| 325 <input metal:define-macro="user_normal_input" type="text" | |
| 326 tal:attributes="id name; name name; value value; readonly not:edit_ok" | |
| 327 value="heinz"> | |
| 328 <!-- password: type; no initial value --> | |
| 329 <input metal:define-macro="user_pw_input" type="password" | |
| 330 tal:attributes="id name; name name; readonly not:edit_ok" value=""> | |
| 331 |
