Mercurial > p > roundup > code
changeset 6464:28461636e249
issue1596345 - filtering user list (need user.search.hml)
Incorporate user search features from issues.roundup-tracker.org
user.index.html into classic template. Devel and responsive templates
already have this feature. Jinja wil get it when somebody who knows
jinja well enough implements it.
| author | John Rouillard <rouilj@ieee.org> |
|---|---|
| date | Tue, 03 Aug 2021 17:35:20 -0400 |
| parents | 8e06194ff0b0 |
| children | bed1313898d4 |
| files | CHANGES.txt doc/upgrading.txt share/roundup/templates/classic/html/user.index.html |
| diffstat | 3 files changed, 70 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/CHANGES.txt Mon Aug 02 23:26:20 2021 -0400 +++ b/CHANGES.txt Tue Aug 03 17:35:20 2021 -0400 @@ -25,6 +25,11 @@ - Change tracker templates adding required to login forms. Invokes browser error reporting if user forgets to fill in a field. (John Rouillard) +- issue1596345 - filtering user list (need + user.search.hml). Incorporate user search features from + issues.roundup-tracker.org into classic template. Devel and + responsive templates already have this feature. + 2021-07-13 2.1.0
--- a/doc/upgrading.txt Mon Aug 02 23:26:20 2021 -0400 +++ b/doc/upgrading.txt Tue Aug 03 17:35:20 2021 -0400 @@ -44,6 +44,13 @@ compression settings as you want. Then replace ``config.ini`` with the ``newconfig.ini`` file. +Search Added to User Index Page +------------------------------- + +A search form and count of number of hits has been added to the +``user.index.html`` template page in the classic template. You may +want to merge the search form and footer into your template. + Migrating from 2.0.0 to 2.1.0 =============================
--- a/share/roundup/templates/classic/html/user.index.html Mon Aug 02 23:26:20 2021 -0400 +++ b/share/roundup/templates/classic/html/user.index.html Tue Aug 03 17:35:20 2021 -0400 @@ -14,7 +14,36 @@ and request.user.hasRole('Anonymous')" i18n:translate="">Please login with your username and password.</span> -<table width="100%" tal:condition="context/is_view_ok" class="list"> +<form tal:condition="context/is_view_ok" method="get" name="itemSynopsis" + tal:attributes="action request/classname"> + +<table class="form" tal:define=" + search_input templates/page/macros/search_input;"> + + <tr><th class="header" colspan="5">Search for users</th></tr> + <tr> + <th class="header">Username</th> + <td tal:define="name string:username"> + <input tal:attributes="value python:request.form.getvalue(name) or nothing; + name name; + id name"/> + </td> + <th class="header">Realname</th> + <td tal:define="name string:realname"> + <input tal:attributes="value python:request.form.getvalue(name) or nothing; + name name; + id name"/> + </td> + + <td><input class="form-small" type="submit" value="Search" i18n:attributes="value"/></td> + </tr> + +</table> + <input type="hidden" name="@action" value="search"/> +</form> + +<table width="100%" tal:condition="context/is_view_ok" class="list" + tal:define="batch request/batch"> <tr> <th i18n:translate="">Username</th> <th i18n:translate="">Real name</th> @@ -23,7 +52,7 @@ <th i18n:translate="">Phone number</th> <th tal:condition="context/is_edit_ok" i18n:translate="">Retire</th> </tr> -<tal:block repeat="user context/list"> +<tal:block repeat="user batch"> <tr tal:attributes="class python:['normal', 'alt'][repeat['user'].index%6//3]"> <td> <a tal:attributes="href string:user${user/id}" @@ -45,6 +74,33 @@ </td> </tr> </tal:block> + <tr tal:condition="batch"> + <th tal:attributes="colspan python:len(request.columns)"> + <table width="100%"> + <tr class="navigation"> + <th> + <a tal:define="prev batch/previous" tal:condition="prev" + tal:attributes="href python:request.indexargs_url(request.classname, + {'@startwith':prev.first, '@pagesize':prev.size})" + i18n:translate=""><< previous</a> + + </th> + <th i18n:translate=""><span tal:replace="batch/start" i18n:name="start" + />..<span tal:replace="python: batch.start + batch.length -1" i18n:name="end" + /> out of <span tal:replace="batch/sequence_length" i18n:name="total" + /></th> + <th> + <a tal:define="next batch/next" tal:condition="next" + tal:attributes="href python:request.indexargs_url(request.classname, + {'@startwith':next.first, '@pagesize':next.size})" + i18n:translate="">next >></a> + + </th> + </tr> + </table> + </th> + </tr> + </table> </td>
