Skip to content

Commit 974ca28

Browse files
committed
fix: issue2551347 - make _generic.help.html work without property settings
This lets the classhelp() method run in read only mode to provide information on a Link property without updating the property. Updating the property can be done by selecting the proper value using the drop-down. Update classic and minimal templates to allow this to work. Update upgrading and reference docs.
1 parent 84adcf1 commit 974ca28

File tree

5 files changed

+48
-19
lines changed

5 files changed

+48
-19
lines changed

CHANGES.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,12 @@ Features:
190190
parameter. So you can start a demo tracker that is available from
191191
your network using 'roundup-demo ... -B hostname -H hostname'. (John
192192
Rouillard)
193+
- issue2551347 - make _generic.help.html work without property
194+
settings. THis applies to classic or minimal trackers. It allows use
195+
of classhelp without the property seting for informtion only
196+
(e.g. description of what a priority or status means) without being
197+
able to select the property in the classhelper. Good for adding help
198+
for Link properties. (John Rouilllard)
193199

194200
2023-07-13 2.3.0
195201

doc/reference.txt

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2756,9 +2756,16 @@ There are several methods available on these wrapper objects:
27562756

27572757
The popup window is resizable and scrollable.
27582758

2759-
If the "property" arg is given, it's passed through to the
2760-
JavaScript help_window function. This allows updating of a
2761-
property in the calling HTML page.
2759+
If the "property" arg is given, it's passed through to
2760+
the JavaScript help_window function. This allows
2761+
updating of a property in the calling HTML
2762+
page. "property" is optional. If not provided, the
2763+
resulting window will be read only. This is useful for
2764+
Link properties where selection can be done by drop-down,
2765+
but descriptions of the values can be seen in the popup.
2766+
Note that some tracker templates may generate an error
2767+
if the property is missing. Version 2.4.0 of Roundup
2768+
fixed these templates.
27622769

27632770
If the "form" arg is given, it's passed through to the
27642771
JavaScript help_window function - it's the name of the form

doc/upgrading.txt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,20 @@ If you have modified that template, you can follow the analysis in
367367
`issue2551320 <https://issues.roundup-tracker.org/issue2551320>`_
368368
to fix your template.
369369

370+
Update for _generic.help.html (optional)
371+
----------------------------------------
372+
373+
Using the ``_generic.help.html`` template with ``classhelper()`` to
374+
provide information on a property without selecting a property caused
375+
an error when processing the template. Using the help template with
376+
Link properties can provide description or other information that the
377+
user can use to determine the right setting.
378+
379+
If your tracker is based on the minimal or classic tracker and you have
380+
not changed the _generic.help.html file, you can copy it into place
381+
from the template directory.
382+
383+
370384
Fix static_files use of '-' directory (info)
371385
--------------------------------------------
372386

share/roundup/templates/classic/html/_generic.help.html

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2-
<html tal:define="property request/form/property/value" >
2+
<html tal:define="property request/form/property/value | nothing" >
33
<head>
44
<link rel="stylesheet" type="text/css" href="@@file/style.css" />
55
<meta http-equiv="Content-Type"
66
tal:attributes="content string:text/html;; charset=${request/client/charset}" />
77
<tal:block tal:condition="python:'property' in request.form">
88
<title i18n:translate=""><tal:x i18n:name="property"
9-
tal:content="property" i18n:translate="" /> help - <span i18n:name="tracker"
9+
tal:content="property | default" i18n:translate="" /> help - <span i18n:name="tracker"
1010
tal:replace="config/TRACKER_NAME" /></title>
1111
<script language="Javascript" type="text/javascript"
1212
tal:content="structure string:
@@ -23,7 +23,7 @@
2323
tal:define="batch request/batch;
2424
props python:request.form['properties'].value.split(',')">
2525

26-
<div id="classhelp-controls">
26+
<div tal:condition="property" id="classhelp-controls">
2727
<!--input type="button" name="btn_clear"
2828
value="Clear" onClick="clearList()"/ -->
2929
<input type="text" name="text_preview" size="24" class="preview"
@@ -40,7 +40,7 @@
4040
<th>
4141
<a tal:define="prev batch/previous" tal:condition="prev"
4242
tal:attributes="href python:request.indexargs_url(request.classname,
43-
{'@template':'help', 'property': request.form['property'].value,
43+
{'@template':'help', 'property': property,
4444
'properties': request.form['properties'].value,
4545
'form': request.form['form'].value,
4646
'type': request.form['type'].value,
@@ -56,7 +56,7 @@
5656
<th>
5757
<a tal:define="next batch/next" tal:condition="next"
5858
tal:attributes="href python:request.indexargs_url(request.classname,
59-
{'@template':'help', 'property': request.form['property'].value,
59+
{'@template':'help', 'property': property,
6060
'properties': request.form['properties'].value,
6161
'form': request.form['form'].value,
6262
'type': request.form['type'].value,
@@ -69,12 +69,12 @@
6969

7070
<table class="classhelp">
7171
<tr>
72-
<th>&nbsp;<b>x</b></th>
72+
<th tal:condition="property">&nbsp;<b>x</b></th>
7373
<th tal:repeat="prop props" tal:content="prop" i18n:translate=""></th>
7474
</tr>
7575
<tr tal:repeat="item batch">
7676
<tal:block tal:define="attr python:item[props[0]]" >
77-
<td>
77+
<td tal:condition="property">
7878
<input name="check"
7979
onclick="updatePreview();"
8080
tal:attributes="type python:request.form['type'].value;
@@ -88,11 +88,12 @@
8888
</tal:block>
8989
</tr>
9090
<tr>
91-
<th>&nbsp;<b>x</b></th>
91+
<th tal:condition="property">&nbsp;<b>x</b></th>
9292
<th tal:repeat="prop props" tal:content="prop" i18n:translate=""></th>
9393
</tr>
9494
</table>
9595

9696
</form>
9797
</body>
9898
</html>
99+
<!-- SHA: b98bdbeee81ffdf2acc9e9c8b17a6110bf60ac7a -->

share/roundup/templates/minimal/html/_generic.help.html

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2-
<html tal:define="property request/form/property/value" >
2+
<html tal:define="property request/form/property/value | nothing" >
33
<head>
44
<link rel="stylesheet" type="text/css" href="@@file/style.css" />
55
<meta http-equiv="Content-Type"
66
tal:attributes="content string:text/html;; charset=${request/client/charset}" />
77
<tal:block tal:condition="python:'property' in request.form">
88
<title i18n:translate=""><tal:x i18n:name="property"
9-
tal:content="property" i18n:translate="" /> help - <span i18n:name="tracker"
9+
tal:content="property | default" i18n:translate="" /> help - <span i18n:name="tracker"
1010
tal:replace="config/TRACKER_NAME" /></title>
1111
<script language="Javascript" type="text/javascript"
1212
tal:content="structure string:
@@ -23,7 +23,7 @@
2323
tal:define="batch request/batch;
2424
props python:request.form['properties'].value.split(',')">
2525

26-
<div id="classhelp-controls">
26+
<div tal:condition="property" id="classhelp-controls">
2727
<!--input type="button" name="btn_clear"
2828
value="Clear" onClick="clearList()"/ -->
2929
<input type="text" name="text_preview" size="24" class="preview"
@@ -40,7 +40,7 @@
4040
<th>
4141
<a tal:define="prev batch/previous" tal:condition="prev"
4242
tal:attributes="href python:request.indexargs_url(request.classname,
43-
{'@template':'help', 'property': request.form['property'].value,
43+
{'@template':'help', 'property': property,
4444
'properties': request.form['properties'].value,
4545
'form': request.form['form'].value,
4646
'type': request.form['type'].value,
@@ -56,7 +56,7 @@
5656
<th>
5757
<a tal:define="next batch/next" tal:condition="next"
5858
tal:attributes="href python:request.indexargs_url(request.classname,
59-
{'@template':'help', 'property': request.form['property'].value,
59+
{'@template':'help', 'property': property,
6060
'properties': request.form['properties'].value,
6161
'form': request.form['form'].value,
6262
'type': request.form['type'].value,
@@ -69,12 +69,12 @@
6969

7070
<table class="classhelp">
7171
<tr>
72-
<th>&nbsp;<b>x</b></th>
72+
<th tal:condition="property">&nbsp;<b>x</b></th>
7373
<th tal:repeat="prop props" tal:content="prop" i18n:translate=""></th>
7474
</tr>
7575
<tr tal:repeat="item batch">
7676
<tal:block tal:define="attr python:item[props[0]]" >
77-
<td>
77+
<td tal:condition="property">
7878
<input name="check"
7979
onclick="updatePreview();"
8080
tal:attributes="type python:request.form['type'].value;
@@ -88,11 +88,12 @@
8888
</tal:block>
8989
</tr>
9090
<tr>
91-
<th>&nbsp;<b>x</b></th>
91+
<th tal:condition="property">&nbsp;<b>x</b></th>
9292
<th tal:repeat="prop props" tal:content="prop" i18n:translate=""></th>
9393
</tr>
9494
</table>
9595

9696
</form>
9797
</body>
9898
</html>
99+
<!-- SHA: b98bdbeee81ffdf2acc9e9c8b17a6110bf60ac7a -->

0 commit comments

Comments
 (0)