Skip to content

Commit 8efc6f2

Browse files
committed
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.
1 parent 364ff3f commit 8efc6f2

File tree

3 files changed

+70
-2
lines changed

3 files changed

+70
-2
lines changed

CHANGES.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@ Features:
2525
- Change tracker templates adding required to login forms. Invokes
2626
browser error reporting if user forgets to fill in a field.
2727
(John Rouillard)
28+
- issue1596345 - filtering user list (need
29+
user.search.hml). Incorporate user search features from
30+
issues.roundup-tracker.org into classic template. Devel and
31+
responsive templates already have this feature.
32+
2833

2934
2021-07-13 2.1.0
3035

doc/upgrading.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,13 @@ merge any local comments from the tracker's ``config.ini`` into
4444
compression settings as you want. Then replace ``config.ini`` with the
4545
``newconfig.ini`` file.
4646

47+
Search Added to User Index Page
48+
-------------------------------
49+
50+
A search form and count of number of hits has been added to the
51+
``user.index.html`` template page in the classic template. You may
52+
want to merge the search form and footer into your template.
53+
4754

4855
Migrating from 2.0.0 to 2.1.0
4956
=============================

share/roundup/templates/classic/html/user.index.html

Lines changed: 58 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,36 @@
1414
and request.user.hasRole('Anonymous')"
1515
i18n:translate="">Please login with your username and password.</span>
1616

17-
<table width="100%" tal:condition="context/is_view_ok" class="list">
17+
<form tal:condition="context/is_view_ok" method="get" name="itemSynopsis"
18+
tal:attributes="action request/classname">
19+
20+
<table class="form" tal:define="
21+
search_input templates/page/macros/search_input;">
22+
23+
<tr><th class="header" colspan="5">Search for users</th></tr>
24+
<tr>
25+
<th class="header">Username</th>
26+
<td tal:define="name string:username">
27+
<input tal:attributes="value python:request.form.getvalue(name) or nothing;
28+
name name;
29+
id name"/>
30+
</td>
31+
<th class="header">Realname</th>
32+
<td tal:define="name string:realname">
33+
<input tal:attributes="value python:request.form.getvalue(name) or nothing;
34+
name name;
35+
id name"/>
36+
</td>
37+
38+
<td><input class="form-small" type="submit" value="Search" i18n:attributes="value"/></td>
39+
</tr>
40+
41+
</table>
42+
<input type="hidden" name="@action" value="search"/>
43+
</form>
44+
45+
<table width="100%" tal:condition="context/is_view_ok" class="list"
46+
tal:define="batch request/batch">
1847
<tr>
1948
<th i18n:translate="">Username</th>
2049
<th i18n:translate="">Real name</th>
@@ -23,7 +52,7 @@
2352
<th i18n:translate="">Phone number</th>
2453
<th tal:condition="context/is_edit_ok" i18n:translate="">Retire</th>
2554
</tr>
26-
<tal:block repeat="user context/list">
55+
<tal:block repeat="user batch">
2756
<tr tal:attributes="class python:['normal', 'alt'][repeat['user'].index%6//3]">
2857
<td>
2958
<a tal:attributes="href string:user${user/id}"
@@ -45,6 +74,33 @@
4574
</td>
4675
</tr>
4776
</tal:block>
77+
<tr tal:condition="batch">
78+
<th tal:attributes="colspan python:len(request.columns)">
79+
<table width="100%">
80+
<tr class="navigation">
81+
<th>
82+
<a tal:define="prev batch/previous" tal:condition="prev"
83+
tal:attributes="href python:request.indexargs_url(request.classname,
84+
{'@startwith':prev.first, '@pagesize':prev.size})"
85+
i18n:translate="">&lt;&lt; previous</a>
86+
&nbsp;
87+
</th>
88+
<th i18n:translate=""><span tal:replace="batch/start" i18n:name="start"
89+
/>..<span tal:replace="python: batch.start + batch.length -1" i18n:name="end"
90+
/> out of <span tal:replace="batch/sequence_length" i18n:name="total"
91+
/></th>
92+
<th>
93+
<a tal:define="next batch/next" tal:condition="next"
94+
tal:attributes="href python:request.indexargs_url(request.classname,
95+
{'@startwith':next.first, '@pagesize':next.size})"
96+
i18n:translate="">next &gt;&gt;</a>
97+
&nbsp;
98+
</th>
99+
</tr>
100+
</table>
101+
</th>
102+
</tr>
103+
48104
</table>
49105
</td>
50106

0 commit comments

Comments
 (0)