Mercurial > p > roundup > code
comparison doc/upgrading.txt @ 7277:41b2a0e12899
Formatting fixes
Fix some blocks that should be code blocks but weren't.
Use smaller type for larger/wide code blocks by replacing:
stuff::
wide code here
with:
stuff:
.. code::
:class: big-code
wide code here
The big-code class uses a smaller font size so it fits the width of
the page without overflow.
Fix an ordered list that was indented more than it should have been.
| author | John Rouillard <rouilj@ieee.org> |
|---|---|
| date | Mon, 24 Apr 2023 23:26:18 -0400 |
| parents | c5d01886b27d |
| children | 194093011cb7 |
comparison
equal
deleted
inserted
replaced
| 7276:90c70726e882 | 7277:41b2a0e12899 |
|---|---|
| 1096 have a ``detectors/config.ini`` file. (Note this is | 1096 have a ``detectors/config.ini`` file. (Note this is |
| 1097 ``detectors/config.ini`` do not confuse it with the main | 1097 ``detectors/config.ini`` do not confuse it with the main |
| 1098 ``config.ini`` file at the root of the tracker home.) | 1098 ``config.ini`` file at the root of the tracker home.) |
| 1099 | 1099 |
| 1100 This enhancement is disabled by default. Enable it by changing the | 1100 This enhancement is disabled by default. Enable it by changing the |
| 1101 value in ``detectors/config.ini`` from: | 1101 value in ``detectors/config.ini`` from:: |
| 1102 | 1102 |
| 1103 chatting_requires_two_users = False | 1103 chatting_requires_two_users = False |
| 1104 | 1104 |
| 1105 to | 1105 to:: |
| 1106 | 1106 |
| 1107 chatting_requires_two_users = True | 1107 chatting_requires_two_users = True |
| 1108 | 1108 |
| 1109 (the values ``no`` and ``yes`` can also be used). Restart the tracker | 1109 (the values ``no`` and ``yes`` can also be used). Restart the tracker |
| 1110 to enable the change. | 1110 to enable the change. |
| 1140 Jinja template changes | 1140 Jinja template changes |
| 1141 ---------------------- | 1141 ---------------------- |
| 1142 | 1142 |
| 1143 Auto escaping has been enabled in the jinja template engine, this | 1143 Auto escaping has been enabled in the jinja template engine, this |
| 1144 means it is no longer necessary to manually escape dynamic strings | 1144 means it is no longer necessary to manually escape dynamic strings |
| 1145 with "\|e", but strings that should not be escaped need to be marked | 1145 with ``|e``, but strings that should not be escaped need to be marked |
| 1146 with "\|safe" (e.g. "{{ context.history()|u|safe }}"). Also, the i18n | 1146 with ``|safe`` (e.g. ``{{ context.history()|u|safe }}``). Also, the i18n |
| 1147 extension has been enabled and the template has been updated to use | 1147 extension has been enabled and the template has been updated to use |
| 1148 the extension for translatable text instead of explicit "i18n.gettext" | 1148 the extension for translatable text instead of explicit ``i18n.gettext`` |
| 1149 calls: | 1149 calls:: |
| 1150 | 1150 |
| 1151 {% trans %}List of issues{% endtrans %} | 1151 {% trans %}List of issues{% endtrans %} |
| 1152 | 1152 |
| 1153 instead of: | 1153 instead of:: |
| 1154 | 1154 |
| 1155 {{ i18n.gettext('List of issues')|u }} | 1155 {{ i18n.gettext('List of issues')|u }} |
| 1156 | 1156 |
| 1157 The jinja template has been upgraded to use bootstrap 4.1.3 (from | 1157 The jinja template has been upgraded to use bootstrap 4.1.3 (from |
| 1158 2.2.2). You can diff/merge changes into your jinja template based | 1158 2.2.2). You can diff/merge changes into your jinja template based |
| 1183 -------------------------- | 1183 -------------------------- |
| 1184 | 1184 |
| 1185 After installing the new version of roundup, you should | 1185 After installing the new version of roundup, you should |
| 1186 update the ``config.ini`` file for your tracker. To do this: | 1186 update the ``config.ini`` file for your tracker. To do this: |
| 1187 | 1187 |
| 1188 1. backup your existing ``config.ini`` file | 1188 1. backup your existing ``config.ini`` file |
| 1189 2. using the newly installed code, run:: | 1189 2. using the newly installed code, run:: |
| 1190 | 1190 |
| 1191 roundup-admin -i /path/to/tracker updateconfig config.ini.new | 1191 roundup-admin -i /path/to/tracker updateconfig config.ini.new |
| 1192 | 1192 |
| 1193 to create the file config.ini.new. Replace | 1193 to create the file config.ini.new. Replace |
| 1194 ``/path/to/tracker`` with the path to your tracker. | 1194 ``/path/to/tracker`` with the path to your tracker. |
| 1195 3. replace your tracker's config.ini with config.ini.new | 1195 3. replace your tracker's config.ini with config.ini.new |
| 1196 | 1196 |
| 1197 Using updateconfig keeps all the settings from your | 1197 Using updateconfig keeps all the settings from your |
| 1198 tracker's config.ini file and adds settings for all the new | 1198 tracker's config.ini file and adds settings for all the new |
| 1199 options. | 1199 options. |
| 1200 | 1200 |
| 1276 is not true the post is rejected and the user is notified. | 1276 is not true the post is rejected and the user is notified. |
| 1277 | 1277 |
| 1278 The standard context/submit templating item creates CSRF tokens by | 1278 The standard context/submit templating item creates CSRF tokens by |
| 1279 default. If you have forms using the POST method that are not using | 1279 default. If you have forms using the POST method that are not using |
| 1280 the standard submit routine, you should add the following field to all | 1280 the standard submit routine, you should add the following field to all |
| 1281 forms: | 1281 forms:: |
| 1282 | 1282 |
| 1283 <input name="@csrf" type="hidden" | 1283 <input name="@csrf" type="hidden" |
| 1284 tal:attributes="value python:utils.anti_csrf_nonce()"> | 1284 tal:attributes="value python:utils.anti_csrf_nonce()"> |
| 1285 | 1285 |
| 1286 A unique random token is generated by every call to | 1286 A unique random token is generated by every call to |
| 1287 utils.anti_csrf_nonce() and is put in a database to be | 1287 utils.anti_csrf_nonce() and is put in a database to be |
| 1288 retreived if the token is used. Token lifetimes are 2 weeks | 1288 retreived if the token is used. Token lifetimes are 2 weeks |
| 1289 by default but can be configured in config.ini. Roundup will | 1289 by default but can be configured in config.ini. Roundup will |
| 1290 automatically prune old tokens. Calling anti_csrf_nonce with | 1290 automatically prune old tokens. Calling anti_csrf_nonce with |
| 1291 an integer lifetime, for example: | 1291 an integer lifetime, for example:: |
| 1292 | 1292 |
| 1293 <input name="@csrf" type="hidden" | 1293 <input name="@csrf" type="hidden" |
| 1294 tal:attributes="value python:utils.anti_csrf_nonce(lifetime=10)"> | 1294 tal:attributes="value python:utils.anti_csrf_nonce(lifetime=10)"> |
| 1295 | 1295 |
| 1296 sets the lifetime of that nonce to 10 minutes. | 1296 sets the lifetime of that nonce to 10 minutes. |
| 1500 assigned to __came_from must be url encoded/quoted and be under the | 1500 assigned to __came_from must be url encoded/quoted and be under the |
| 1501 tracker's base url. If the base_url uses http, you can set the url to | 1501 tracker's base url. If the base_url uses http, you can set the url to |
| 1502 https. | 1502 https. |
| 1503 | 1503 |
| 1504 Replace the existing code in the tracker's html/page.html page that | 1504 Replace the existing code in the tracker's html/page.html page that |
| 1505 looks similar to (look for name="__came_from"):: | 1505 looks similar to (look for name="__came_from"): |
| 1506 | 1506 |
| 1507 <input type="hidden" name="__came_from" tal:attributes="value string:${request/base}${request/env/PATH_INFO}"> | 1507 .. code:: |
| 1508 | 1508 :class: big-code |
| 1509 with the following:: | 1509 |
| 1510 <input type="hidden" name="__came_from" tal:attributes="value string:${request/base}${request/env/PATH_INFO}"> | |
| 1511 | |
| 1512 with the following: | |
| 1513 | |
| 1514 .. code:: html | |
| 1515 :class: big-code | |
| 1510 | 1516 |
| 1511 <input type="hidden" name="__came_from" | 1517 <input type="hidden" name="__came_from" |
| 1512 tal:condition="exists:request/env/QUERY_STRING" | 1518 tal:condition="exists:request/env/QUERY_STRING" |
| 1513 tal:attributes="value string:${request/base}${request/env/PATH_INFO}?${request/env/QUERY_STRING}"> | 1519 tal:attributes="value string:${request/base}${request/env/PATH_INFO}?${request/env/QUERY_STRING}"> |
| 1514 <input type="hidden" name="__came_from" | 1520 <input type="hidden" name="__came_from" |
| 1550 keyword's name when creating the keyword. The new classic tracker has | 1556 keyword's name when creating the keyword. The new classic tracker has |
| 1551 a new checkbox (checked by default) that keeps you on the same page so | 1557 a new checkbox (checked by default) that keeps you on the same page so |
| 1552 you can add a new keywords one after the other. | 1558 you can add a new keywords one after the other. |
| 1553 | 1559 |
| 1554 To add this to your own tracker, add the following code (prefixed with | 1560 To add this to your own tracker, add the following code (prefixed with |
| 1555 a +) after the entry box for the new keyword in html/keyword.item.html:: | 1561 a +) after the entry box for the new keyword in html/keyword.item.html: |
| 1562 | |
| 1563 .. code:: | |
| 1564 :class: big-code | |
| 1556 | 1565 |
| 1557 <tr> | 1566 <tr> |
| 1558 <th i18n:translate="">Keyword</th> | 1567 <th i18n:translate="">Keyword</th> |
| 1559 <td tal:content="structure context/name/field">name</td> | 1568 <td tal:content="structure context/name/field">name</td> |
| 1560 + <td tal:condition="not:context/id"> | 1569 + <td tal:condition="not:context/id"> |
| 1641 A new method has been added to HTMLStringProperty called url_quote. | 1650 A new method has been added to HTMLStringProperty called url_quote. |
| 1642 The default templates have been updated to use this in the "Your | 1651 The default templates have been updated to use this in the "Your |
| 1643 Query" section of the trackers html/page.html file. You will want to | 1652 Query" section of the trackers html/page.html file. You will want to |
| 1644 change your template. Lines starting with - are the original line and | 1653 change your template. Lines starting with - are the original line and |
| 1645 you want to change it to match the line starting with the + (remove | 1654 you want to change it to match the line starting with the + (remove |
| 1646 the + from the line):: | 1655 the + from the line): |
| 1656 | |
| 1657 .. code:: | |
| 1658 :class: big-code | |
| 1647 | 1659 |
| 1648 <tal:block tal:repeat="qs request/user/queries"> | 1660 <tal:block tal:repeat="qs request/user/queries"> |
| 1649 - <a href="#" tal:attributes="href string:${qs/klass}?${qs/url}&@dispname=${qs/name}" | 1661 - <a href="#" tal:attributes="href string:${qs/klass}?${qs/url}&@dispname=${qs/name}" |
| 1650 + <a href="#" tal:attributes="href string:${qs/klass}?${qs/url}&@dispname=${qs/name/url_quote}" | 1662 + <a href="#" tal:attributes="href string:${qs/klass}?${qs/url}&@dispname=${qs/name/url_quote}" |
| 1651 tal:content="qs/name">link</a><br> | 1663 tal:content="qs/name">link</a><br> |
