Skip to content

Commit

Permalink
issue2551320: user.help-search.html doesn't respect properties.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
rouilj committed Feb 28, 2024
1 parent 52132cb commit a8a0cdf
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 7 deletions.
5 changes: 5 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,11 @@ Fixed:
support. Install docs updated to state that FTS5 support is required
when using SQLite for back end. (Found Tonu Mikk, fix John
Rouillard)
- issue2551320: user.help-search.html doesn't respect
properties. Setting url parameter properties when using the
classhelp for users now shows the requested properties. (Found by
team-3 of the UMass-Boston CS682 Spring 2024 class; fix John
Rouillard)

Features:

Expand Down
8 changes: 5 additions & 3 deletions share/roundup/templates/classic/html/user.help-search.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,14 @@
qs python:'&'.join([a for a in qs.split('&') if not a.startswith('@template=')])"
>
<pre tal:content="request/env/QUERY_STRING" tal:condition=false />
<form method="GET" name="itemSynopsis"
<form method="get" name="itemSynopsis"
target="list"
tal:attributes="action request/classname"
tal:define="
property request/form/property/value;
cols python:request.columns or 'id username address realname roles'.split();
props python:('properties' in request.form and request.form['properties'].value.split(',')) or [];
cols python:request.columns or props or
'id username address realname roles'.split();
sort_on request/sort | nothing;
sort_desc python:sort_on and request.sort[0][0] == '-';
sort_on python:sort_on and request.sort[0][1] or 'lastname';
Expand Down Expand Up @@ -68,7 +70,7 @@
<input type="hidden" name="@action" value="search">
<input type="submit" value="Search" i18n:attributes="value">
<input type="reset">
<input type="hidden" value="username,realname,phone,organisation,roles" name="properties">
<input type="hidden" tal:attributes="value python:','.join(cols)" name="properties">
<input type="text" name="@pagesize" id="sp-pagesize" value="25" size="2">
<label for="sp-pagesize" i18n:translate="">Pagesize</label>
</td>
Expand Down
6 changes: 4 additions & 2 deletions share/roundup/templates/devel/html/user.help-search.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@
tal:attributes="action request/classname"
tal:define="
property request/form/property/value;
cols python:request.columns or 'id username address realname roles'.split();
props python:('properties' in request.form and request.form['properties'].value.split(',')) or [];
cols python:request.columns or props or
'id username address realname roles'.split();
sort_on request/sort | nothing;
sort_desc python:sort_on and request.sort[0][0] == '-';
sort_on python:sort_on and request.sort[0][1] or 'lastname';
Expand Down Expand Up @@ -68,7 +70,7 @@
<input type="hidden" name="@action" value="search">
<input type="submit" value="Search" i18n:attributes="value">
<input type="reset">
<input type="hidden" value="username,realname,phone,organisation,roles" name="properties">
<input type="hidden" tal:attributes="value python:','.join(cols)" name="properties">
<input type="text" name="@pagesize" id="sp-pagesize" value="25" size="2">
<label for="sp-pagesize" i18n:translate="">Pagesize</label>
</td>
Expand Down
6 changes: 4 additions & 2 deletions share/roundup/templates/responsive/html/user.help-search.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@
tal:attributes="action request/classname"
tal:define="
property request/form/property/value;
cols python:request.columns or 'id username address realname roles'.split();
props python:('properties' in request.form and request.form['properties'].value.split(',')) or [];
cols python:request.columns or props or
'id username address realname roles'.split();
sort_on request/sort | nothing;
sort_desc python:sort_on and request.sort[0][0] == '-';
sort_on python:sort_on and request.sort[0][1] or 'lastname';
Expand Down Expand Up @@ -68,7 +70,7 @@
<input type="hidden" name="@action" value="search">
<input type="submit" value="Search" i18n:attributes="value">
<input type="reset">
<input type="hidden" value="username,realname,phone,organisation,roles" name="properties">
<input type="hidden" tal:attributes="value python:','.join(cols)" name="properties">
<input type="text" name="@pagesize" id="sp-pagesize" value="25" size="2">
<label for="sp-pagesize" i18n:translate="">Pagesize</label>
</td>
Expand Down

0 comments on commit a8a0cdf

Please sign in to comment.