paul@0 | 1 | <!-- vim:sw=2 sts=2 |
paul@0 | 2 | --><tal:block metal:define-macro="icing" |
paul@0 | 3 | ><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> |
paul@0 | 4 | <html> |
paul@0 | 5 | <head> |
paul@0 | 6 | <title metal:define-slot="head_title">title goes here</title> |
paul@2 | 7 | <link rel="stylesheet" type="text/css" href="@@file/style-mercurialweb.css"> |
paul@0 | 8 | <link rel="stylesheet" type="text/css" href="@@file/style.css"> |
paul@0 | 9 | <meta http-equiv="Content-Type" |
paul@0 | 10 | tal:attributes="content string:text/html;; charset=${request/client/charset}" /> |
paul@0 | 11 | <script tal:replace="structure request/base_javascript"> |
paul@0 | 12 | </script> |
paul@0 | 13 | <metal:x define-slot="more-javascript" /> |
paul@0 | 14 | |
paul@0 | 15 | </head> |
paul@2 | 16 | <body class="body" |
paul@0 | 17 | tal:define=" |
paul@0 | 18 | kw_edit python:request.user.hasPermission('Edit', 'keyword'); |
paul@0 | 19 | kw_create python:request.user.hasPermission('Create', 'keyword'); |
paul@0 | 20 | kw_edit_link python:kw_edit and db.keyword.list(); |
paul@0 | 21 | columns string:id,activity,title,creator,status; |
paul@0 | 22 | columns_showall string:id,activity,title,creator,assignedto,status; |
paul@0 | 23 | status_notresolved string:-1,1,2,3,4,5,6,7; |
paul@0 | 24 | " |
paul@0 | 25 | > |
paul@0 | 26 | |
paul@2 | 27 | <div id="header"> |
paul@2 | 28 | <div id="logo"><a href="#" tal:attributes="href request/base"><img src="@@file/mercurial-logo.png" alt="Mercurial logo" /></a></div> |
paul@2 | 29 | <div class="controls"> |
paul@2 | 30 | <ul id="navibar"> |
paul@2 | 31 | <li tal:attributes="class python:request.form.getvalue('@template') is None and 'current'" class="" |
paul@2 | 32 | ><a href="#" tal:attributes="href request/base">Home</a></li |
paul@2 | 33 | ><li tal:condition="python:request.user.hasPermission('Create', 'issue')" |
paul@2 | 34 | tal:attributes="class python:request.form.getvalue('@template') == 'item' and 'current'" class="" |
paul@2 | 35 | ><a href="issue?@template=item" i18n:translate="">New issue</a></li |
paul@2 | 36 | ><li tal:attributes="class python:request.form.getvalue('@template') == 'search' and 'current'" class="" |
paul@2 | 37 | ><a href="issue?@template=search" i18n:translate="">Search</a></li |
paul@2 | 38 | ><li tal:condition="python:request.user.username=='anonymous' and request.user.hasPermission('Register', 'user')" |
paul@2 | 39 | tal:attributes="class python:request.form.getvalue('@template') == 'register' and 'current'" class="" |
paul@2 | 40 | ><a href="user?@template=register" i18n:translate="">Register</a></li |
paul@2 | 41 | ><li tal:condition="python:request.user.username != 'anonymous'" |
paul@2 | 42 | i18n:translate=""><a href="user" i18n:name="user" |
paul@2 | 43 | tal:replace="python:request.user.username.plain(escape=1)">username</a></li |
paul@2 | 44 | ><li tal:condition="python:request.user.hasPermission('View', 'issue')" |
paul@2 | 45 | ><form method="POST" tal:attributes="action request/base"><span class="container"> |
paul@2 | 46 | <a href="#" |
paul@2 | 47 | tal:attributes="href python:request.indexargs_url('issue', { |
paul@2 | 48 | '@sort': '-activity', |
paul@2 | 49 | '@group': 'priority', |
paul@2 | 50 | '@filter': 'status', |
paul@2 | 51 | '@columns': columns_showall, |
paul@2 | 52 | '@search_text': '', |
paul@2 | 53 | 'status': status_notresolved, |
paul@2 | 54 | '@dispname': i18n.gettext('Show All'), |
paul@2 | 55 | })" |
paul@2 | 56 | i18n:translate="">Browse</a></span |
paul@2 | 57 | ><input type="hidden" name="@type" value="issue" |
paul@2 | 58 | /><input type="hidden" name="@action" value="show" |
paul@2 | 59 | /></form></li |
paul@2 | 60 | ><li><form id="searchform" action="issue"><span class="container"> |
paul@2 | 61 | <span class="hint" i18n:translate="">Search</span> <input name="@search_text" id="searchinput" type="text" size="20" |
paul@2 | 62 | tal:attributes="value request/search_text | default" /> |
paul@2 | 63 | </span> |
paul@2 | 64 | <input type="hidden" name="@columns" |
paul@2 | 65 | tal:attributes="value columns_showall" |
paul@2 | 66 | value="id,activity,title,creator,assignedto,status" /> |
paul@2 | 67 | <input type="hidden" name="@sort" value="activity" /> |
paul@2 | 68 | <input type="hidden" name="@group" value="priority" /> |
paul@2 | 69 | </form> |
paul@2 | 70 | </li> |
paul@2 | 71 | </ul> |
paul@2 | 72 | </div> |
paul@2 | 73 | <div id="pageline"></div> |
paul@2 | 74 | </div> |
paul@2 | 75 | |
paul@2 | 76 | <h2><span metal:define-slot="body_title">body title</span></h2> |
paul@2 | 77 | |
paul@2 | 78 | <table class="body"> |
paul@0 | 79 | |
paul@0 | 80 | <tr> |
paul@0 | 81 | <td rowspan="2" valign="top" class="sidebar"> |
paul@0 | 82 | <p class="classblock" |
paul@0 | 83 | tal:condition="python:request.user.hasPermission('View', 'query')"> |
paul@0 | 84 | <span i18n:translate="" |
paul@0 | 85 | ><b>Your Queries</b> (<a href="query?@template=edit">edit</a>)</span><br> |
paul@0 | 86 | <tal:block tal:repeat="qs request/user/queries"> |
paul@0 | 87 | <a href="#" tal:attributes="href string:${qs/klass}?${qs/url}&@dispname=${qs/name}" |
paul@0 | 88 | tal:content="qs/name">link</a><br> |
paul@0 | 89 | </tal:block> |
paul@0 | 90 | </p> |
paul@0 | 91 | |
paul@0 | 92 | <p class="classblock" |
paul@0 | 93 | tal:condition="python:kw_edit or kw_create"> |
paul@0 | 94 | <b i18n:translate="">Keywords</b><br> |
paul@0 | 95 | <span tal:condition="python:request.user.hasPermission('Create', 'keyword')"> |
paul@0 | 96 | <a href="keyword?@template=item" i18n:translate="">Create New</a><br> |
paul@0 | 97 | </span> |
paul@0 | 98 | <span tal:condition="kw_edit_link"> |
paul@0 | 99 | <a href="keyword?@template=item" i18n:translate="">Edit Existing</a><br> |
paul@0 | 100 | </span> |
paul@0 | 101 | </p> |
paul@0 | 102 | |
paul@0 | 103 | <p class="classblock" |
paul@0 | 104 | tal:condition="python:request.user.hasPermission('View', 'user')"> |
paul@0 | 105 | <b i18n:translate="">Administration</b><br> |
paul@0 | 106 | <span tal:condition="python:request.user.hasPermission('Edit', None)"> |
paul@0 | 107 | <a href="home?@template=classlist" i18n:translate="">Class List</a><br> |
paul@0 | 108 | </span> |
paul@0 | 109 | <span tal:condition="python:request.user.hasPermission('View', 'user') |
paul@0 | 110 | or request.user.hasPermission('Edit', 'user')"> |
paul@0 | 111 | <a href="user" i18n:translate="">User List</a><br> |
paul@0 | 112 | </span> |
paul@0 | 113 | <a tal:condition="python:request.user.hasPermission('Create', 'user')" |
paul@0 | 114 | href="user?@template=item" i18n:translate="">Add User</a> |
paul@0 | 115 | </p> |
paul@0 | 116 | |
paul@0 | 117 | <form method="POST" tal:condition="python:request.user.username=='anonymous'" |
paul@0 | 118 | tal:attributes="action request/base"> |
paul@0 | 119 | <p class="userblock"> |
paul@0 | 120 | <b i18n:translate="">Login</b><br> |
paul@0 | 121 | <input size="10" name="__login_name"><br> |
paul@0 | 122 | <input size="10" type="password" name="__login_password"><br> |
paul@0 | 123 | <input type="hidden" name="@action" value="Login"> |
paul@0 | 124 | <input type="checkbox" name="remember" id="remember"> |
paul@0 | 125 | <label for="remember" i18n:translate="">Remember me?</label><br> |
paul@0 | 126 | <input type="submit" value="Login" i18n:attributes="value"><br> |
paul@0 | 127 | <input type="hidden" name="__came_from" tal:attributes="value string:${request/base}${request/env/PATH_INFO}"> |
paul@0 | 128 | <span tal:replace="structure request/indexargs_form" /> |
paul@0 | 129 | <a href="user?@template=register" |
paul@0 | 130 | tal:condition="python:request.user.hasPermission('Register', 'user')" |
paul@0 | 131 | i18n:translate="">Register</a><br> |
paul@0 | 132 | <a href="user?@template=forgotten" i18n:translate="">Lost your login?</a><br> |
paul@0 | 133 | </p> |
paul@0 | 134 | </form> |
paul@0 | 135 | |
paul@0 | 136 | <p class="userblock" tal:condition="python:request.user.username != 'anonymous'"> |
paul@0 | 137 | <b i18n:translate="">Hello, <span i18n:name="user" |
paul@0 | 138 | tal:replace="python:request.user.username.plain(escape=1)">username</span></b><br> |
paul@0 | 139 | <a href="#" |
paul@0 | 140 | tal:attributes="href python:request.indexargs_url('issue', { |
paul@0 | 141 | '@sort': '-activity', |
paul@0 | 142 | '@group': 'priority', |
paul@0 | 143 | '@filter': 'status,assignedto', |
paul@0 | 144 | '@columns': 'id,activity,title,creator,status', |
paul@0 | 145 | '@search_text': '', |
paul@0 | 146 | 'status': status_notresolved, |
paul@0 | 147 | 'assignedto': request.user.id, |
paul@0 | 148 | '@dispname': i18n.gettext('Your Issues'), |
paul@0 | 149 | })" |
paul@0 | 150 | i18n:translate="">Your Issues</a><br> |
paul@0 | 151 | <a href="#" tal:attributes="href string:user${request/user/id}" |
paul@0 | 152 | i18n:translate="">Your Details</a><br> |
paul@0 | 153 | <a href="#" tal:attributes="href python:request.indexargs_url('', |
paul@0 | 154 | {'@action':'logout'})" i18n:translate="">Logout</a> |
paul@0 | 155 | </p> |
paul@0 | 156 | <p class="userblock"> |
paul@0 | 157 | <b i18n:translate="">Help</b><br> |
paul@0 | 158 | <a href="http://www.roundup-tracker.org" |
paul@0 | 159 | i18n:translate="">Roundup docs</a> |
paul@0 | 160 | </p> |
paul@0 | 161 | </td> |
paul@0 | 162 | <td> |
paul@0 | 163 | <p tal:condition="options/error_message | nothing" class="error-message" |
paul@0 | 164 | tal:repeat="m options/error_message" tal:content="structure m" /> |
paul@0 | 165 | <p tal:condition="options/ok_message | nothing" class="ok-message"> |
paul@0 | 166 | <span tal:repeat="m options/ok_message" |
paul@0 | 167 | tal:content="structure string:$m <br/ > " /> |
paul@0 | 168 | <a class="form-small" tal:attributes="href request/current_url" |
paul@0 | 169 | i18n:translate="">clear this message</a> |
paul@0 | 170 | </p> |
paul@0 | 171 | </td> |
paul@0 | 172 | </tr> |
paul@0 | 173 | <tr> |
paul@0 | 174 | <td class="content" metal:define-slot="content">Page content goes here</td> |
paul@0 | 175 | </tr> |
paul@0 | 176 | |
paul@0 | 177 | </table> |
paul@0 | 178 | |
paul@0 | 179 | <pre tal:condition="request/form/debug | nothing" tal:content="request"> |
paul@0 | 180 | </pre> |
paul@0 | 181 | |
paul@0 | 182 | </body> |
paul@0 | 183 | </html> |
paul@0 | 184 | </tal:block> |
paul@0 | 185 | |
paul@0 | 186 | <!-- |
paul@0 | 187 | The following macros are intended to be used in search pages. |
paul@0 | 188 | |
paul@0 | 189 | The invoking context must define a "name" variable which names the |
paul@0 | 190 | property being searched. |
paul@0 | 191 | |
paul@0 | 192 | See issue.search.html in the classic template for examples. |
paul@0 | 193 | --> |
paul@0 | 194 | |
paul@0 | 195 | <!-- creates a th and a label: --> |
paul@0 | 196 | <th metal:define-macro="th_label" |
paul@0 | 197 | tal:define="required required | python:[]" |
paul@0 | 198 | tal:attributes="class python:(name in required) and 'required' or nothing"> |
paul@0 | 199 | <label tal:attributes="for name" tal:content="label" i18n:translate="">text</label> |
paul@1 | 200 | <metal:x define-slot="behind_the_label" /> |
paul@0 | 201 | </th> |
paul@0 | 202 | |
paul@0 | 203 | <td metal:define-macro="search_input"> |
paul@0 | 204 | <input tal:attributes="value python:request.form.getvalue(name) or nothing; |
paul@0 | 205 | name name; |
paul@0 | 206 | id name"> |
paul@0 | 207 | </td> |
paul@0 | 208 | |
paul@0 | 209 | <td metal:define-macro="search_date"> |
paul@0 | 210 | <input tal:attributes="value python:request.form.getvalue(name) or nothing; |
paul@0 | 211 | name name; |
paul@0 | 212 | id name"> |
paul@0 | 213 | <a class="classhelp" |
paul@1 | 214 | tal:attributes="href python:'''javascript:help_window('issue?@template=calendar&property=%s&form=itemSynopsis', 300, 200)'''%name">(cal)</a> |
paul@0 | 215 | </td> |
paul@0 | 216 | |
paul@0 | 217 | <td metal:define-macro="search_popup"> |
paul@0 | 218 | <!-- |
paul@0 | 219 | context needs to specify the popup "columns" as a comma-separated |
paul@0 | 220 | string (eg. "id,title" or "id,name,description") as well as name |
paul@0 | 221 | --> |
paul@0 | 222 | <input tal:attributes="value python:request.form.getvalue(name) or nothing; |
paul@0 | 223 | name name; |
paul@0 | 224 | id name"> |
paul@0 | 225 | <span tal:replace="structure python:db.issue.classhelp(columns, |
paul@0 | 226 | property=name)" /> |
paul@0 | 227 | </td> |
paul@0 | 228 | |
paul@0 | 229 | <td metal:define-macro="search_select"> |
paul@0 | 230 | <select tal:attributes="name name; id name" |
paul@0 | 231 | tal:define="value python:request.form.getvalue(name)"> |
paul@0 | 232 | <option value="" i18n:translate="">don't care</option> |
paul@0 | 233 | <metal:slot define-slot="extra_options" /> |
paul@0 | 234 | <option value="" i18n:translate="" disabled="disabled">------------</option> |
paul@0 | 235 | <option tal:repeat="s python:db[db_klass].list()" |
paul@0 | 236 | tal:attributes="value s/id; selected python:value == s.id" |
paul@0 | 237 | tal:content="python:s[db_content]"></option> |
paul@0 | 238 | </select> |
paul@0 | 239 | </td> |
paul@0 | 240 | |
paul@0 | 241 | <!-- like search_select, but translates the further values. |
paul@0 | 242 | Could extend it (METAL 1.1 attribute "extend-macro") |
paul@0 | 243 | --> |
paul@0 | 244 | <td metal:define-macro="search_select_translated"> |
paul@0 | 245 | <select tal:attributes="name name; id name" |
paul@0 | 246 | tal:define="value python:request.form.getvalue(name)"> |
paul@0 | 247 | <option value="" i18n:translate="">don't care</option> |
paul@0 | 248 | <metal:slot define-slot="extra_options" /> |
paul@0 | 249 | <option value="" i18n:translate="" disabled="disabled">------------</option> |
paul@0 | 250 | <option tal:repeat="s python:db[db_klass].list()" |
paul@0 | 251 | tal:attributes="value s/id; selected python:value == s.id" |
paul@1 | 252 | tal:content="python:s[db_content]" |
paul@1 | 253 | i18n:translate=""></option> |
paul@0 | 254 | </select> |
paul@0 | 255 | </td> |
paul@0 | 256 | |
paul@0 | 257 | <!-- currently, there is no convenient API to get a list of all roles --> |
paul@0 | 258 | <td metal:define-macro="search_select_roles" |
paul@1 | 259 | tal:define="onchange onchange | nothing"> |
paul@0 | 260 | <select name=roles id=roles tal:attributes="onchange onchange"> |
paul@0 | 261 | <option value="" i18n:translate="">don't care</option> |
paul@0 | 262 | <option value="" i18n:translate="" disabled="disabled">------------</option> |
paul@0 | 263 | <option value="User">User</option> |
paul@0 | 264 | <option value="Admin">Admin</option> |
paul@0 | 265 | <option value="Anonymous">Anonymous</option> |
paul@0 | 266 | </select> |
paul@0 | 267 | </td> |
paul@0 | 268 | |
paul@0 | 269 | <td metal:define-macro="search_multiselect"> |
paul@0 | 270 | <input tal:attributes="value python:request.form.getvalue(name) or nothing; |
paul@0 | 271 | name name; |
paul@0 | 272 | id name"> |
paul@0 | 273 | <span tal:replace="structure python:db[db_klass].classhelp(db_content, |
paul@0 | 274 | property=name, width='600')" /> |
paul@0 | 275 | </td> |
paul@0 | 276 | |
paul@0 | 277 | <td metal:define-macro="search_checkboxes"> |
paul@0 | 278 | <ul class="search-checkboxes" |
paul@0 | 279 | tal:define="value python:request.form.getvalue(name); |
paul@0 | 280 | values python:value and value.split(',') or []"> |
paul@0 | 281 | <li tal:repeat="s python:db[db_klass].list()"> |
paul@0 | 282 | <input type="checkbox" tal:attributes="name name; id string:$name-${s/id}; |
paul@0 | 283 | value s/id; checked python:s.id in values" /> |
paul@0 | 284 | <label tal:attributes="for string:$name-${s/id}" |
paul@0 | 285 | tal:content="python:s[db_content]" /> |
paul@0 | 286 | </li> |
paul@0 | 287 | <li metal:define-slot="no_value_item"> |
paul@0 | 288 | <input type="checkbox" value="-1" tal:attributes="name name; |
paul@0 | 289 | id string:$name--1; checked python:value == '-1'" /> |
paul@0 | 290 | <label tal:attributes="for string:$name--1" i18n:translate="">no value</label> |
paul@0 | 291 | </li> |
paul@0 | 292 | </ul> |
paul@0 | 293 | </td> |
paul@0 | 294 | |
paul@0 | 295 | <td metal:define-macro="column_input"> |
paul@0 | 296 | <input type="checkbox" name="@columns" |
paul@0 | 297 | tal:attributes="value name; |
paul@0 | 298 | checked python:name in cols"> |
paul@0 | 299 | </td> |
paul@0 | 300 | |
paul@0 | 301 | <td metal:define-macro="sort_input"> |
paul@0 | 302 | <input type="radio" name="@sort" |
paul@0 | 303 | tal:attributes="value name; |
paul@0 | 304 | checked python:name == sort_on"> |
paul@0 | 305 | </td> |
paul@0 | 306 | |
paul@0 | 307 | <td metal:define-macro="group_input"> |
paul@0 | 308 | <input type="radio" name="@group" |
paul@0 | 309 | tal:attributes="value name; |
paul@0 | 310 | checked python:name == group_on"> |
paul@0 | 311 | </td> |
paul@0 | 312 | |
paul@0 | 313 | <!-- |
paul@0 | 314 | The following macros are intended for user editing. |
paul@0 | 315 | |
paul@0 | 316 | The invoking context must define a "name" variable which names the |
paul@0 | 317 | property being searched; the "edit_ok" variable tells whether the |
paul@0 | 318 | current user is allowed to edit. |
paul@0 | 319 | |
paul@0 | 320 | See user.item.html in the classic template for examples. |
paul@0 | 321 | --> |
paul@0 | 322 | <script metal:define-macro="user_utils" type="text/javascript" src="@@file/user_utils.js"></script> |
paul@0 | 323 | |
paul@0 | 324 | <!-- src: value will be re-used for other input fields --> |
paul@0 | 325 | <input metal:define-macro="user_src_input" |
paul@0 | 326 | type="text" tal:attributes="onblur python:edit_ok and 'split_name(this)'; |
paul@0 | 327 | id name; name name; value value; readonly not:edit_ok" |
paul@0 | 328 | value="heinz.kunz"> |
paul@0 | 329 | <!-- normal: no re-using --> |
paul@0 | 330 | <input metal:define-macro="user_normal_input" type="text" |
paul@0 | 331 | tal:attributes="id name; name name; value value; readonly not:edit_ok" |
paul@0 | 332 | value="heinz"> |
paul@0 | 333 | <!-- password: type; no initial value --> |
paul@0 | 334 | <input metal:define-macro="user_pw_input" type="password" |
paul@0 | 335 | tal:attributes="id name; name name; readonly not:edit_ok" value=""> |
paul@0 | 336 | <input metal:define-macro="user_confirm_input" type="password" |
paul@0 | 337 | tal:attributes="id name; name string:@confirm@$name; readonly not:edit_ok" value=""> |
paul@0 | 338 | |