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