Skip to content

Commit a8a0cdf

Browse files
committed
issue2551320: user.help-search.html doesn't respect properties.
Setting url parameter properties when using the classhelp for users now shows the requested properties. Also replaced 'GET' with 'get' in the method used by the classic template. HTML5 seems to prefer lowercase. This also makes all occurances of user.help-search.html identical in the classic, devel and responsive templates. The jinja2 template doesn't implement this. The issue was discovered by the team working on creating a new classhelper web-component at UMass-Boston: team 3 - CS682 Spring 2024. I will update CHANGES.txt with their names when I find out who gets the attribution and how they want to be listed.
1 parent 52132cb commit a8a0cdf

File tree

4 files changed

+18
-7
lines changed

4 files changed

+18
-7
lines changed

CHANGES.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,11 @@ Fixed:
8787
support. Install docs updated to state that FTS5 support is required
8888
when using SQLite for back end. (Found Tonu Mikk, fix John
8989
Rouillard)
90+
- issue2551320: user.help-search.html doesn't respect
91+
properties. Setting url parameter properties when using the
92+
classhelp for users now shows the requested properties. (Found by
93+
team-3 of the UMass-Boston CS682 Spring 2024 class; fix John
94+
Rouillard)
9095

9196
Features:
9297

share/roundup/templates/classic/html/user.help-search.html

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,14 @@
2020
qs python:'&'.join([a for a in qs.split('&') if not a.startswith('@template=')])"
2121
>
2222
<pre tal:content="request/env/QUERY_STRING" tal:condition=false />
23-
<form method="GET" name="itemSynopsis"
23+
<form method="get" name="itemSynopsis"
2424
target="list"
2525
tal:attributes="action request/classname"
2626
tal:define="
2727
property request/form/property/value;
28-
cols python:request.columns or 'id username address realname roles'.split();
28+
props python:('properties' in request.form and request.form['properties'].value.split(',')) or [];
29+
cols python:request.columns or props or
30+
'id username address realname roles'.split();
2931
sort_on request/sort | nothing;
3032
sort_desc python:sort_on and request.sort[0][0] == '-';
3133
sort_on python:sort_on and request.sort[0][1] or 'lastname';
@@ -68,7 +70,7 @@
6870
<input type="hidden" name="@action" value="search">
6971
<input type="submit" value="Search" i18n:attributes="value">
7072
<input type="reset">
71-
<input type="hidden" value="username,realname,phone,organisation,roles" name="properties">
73+
<input type="hidden" tal:attributes="value python:','.join(cols)" name="properties">
7274
<input type="text" name="@pagesize" id="sp-pagesize" value="25" size="2">
7375
<label for="sp-pagesize" i18n:translate="">Pagesize</label>
7476
</td>

share/roundup/templates/devel/html/user.help-search.html

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@
2525
tal:attributes="action request/classname"
2626
tal:define="
2727
property request/form/property/value;
28-
cols python:request.columns or 'id username address realname roles'.split();
28+
props python:('properties' in request.form and request.form['properties'].value.split(',')) or [];
29+
cols python:request.columns or props or
30+
'id username address realname roles'.split();
2931
sort_on request/sort | nothing;
3032
sort_desc python:sort_on and request.sort[0][0] == '-';
3133
sort_on python:sort_on and request.sort[0][1] or 'lastname';
@@ -68,7 +70,7 @@
6870
<input type="hidden" name="@action" value="search">
6971
<input type="submit" value="Search" i18n:attributes="value">
7072
<input type="reset">
71-
<input type="hidden" value="username,realname,phone,organisation,roles" name="properties">
73+
<input type="hidden" tal:attributes="value python:','.join(cols)" name="properties">
7274
<input type="text" name="@pagesize" id="sp-pagesize" value="25" size="2">
7375
<label for="sp-pagesize" i18n:translate="">Pagesize</label>
7476
</td>

share/roundup/templates/responsive/html/user.help-search.html

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@
2525
tal:attributes="action request/classname"
2626
tal:define="
2727
property request/form/property/value;
28-
cols python:request.columns or 'id username address realname roles'.split();
28+
props python:('properties' in request.form and request.form['properties'].value.split(',')) or [];
29+
cols python:request.columns or props or
30+
'id username address realname roles'.split();
2931
sort_on request/sort | nothing;
3032
sort_desc python:sort_on and request.sort[0][0] == '-';
3133
sort_on python:sort_on and request.sort[0][1] or 'lastname';
@@ -68,7 +70,7 @@
6870
<input type="hidden" name="@action" value="search">
6971
<input type="submit" value="Search" i18n:attributes="value">
7072
<input type="reset">
71-
<input type="hidden" value="username,realname,phone,organisation,roles" name="properties">
73+
<input type="hidden" tal:attributes="value python:','.join(cols)" name="properties">
7274
<input type="text" name="@pagesize" id="sp-pagesize" value="25" size="2">
7375
<label for="sp-pagesize" i18n:translate="">Pagesize</label>
7476
</td>

0 commit comments

Comments
 (0)