Skip to content

Commit 5d95bb9

Browse files
committed
doc: replace URL action example with form
The example to provide a link to take or resolve an item was broken. Roundup has required a POST not GET for changes to the database for a while. This example was never fixed. Replaced a link using GET with a POSTed form. This changes the activating element from a link to a button. The button could be restyled as a link using CSS I think. The original example was also not canonical. It used :action rather than the canonical @action.
1 parent be0d9f8 commit 5d95bb9

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

doc/customizing.txt

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1812,17 +1812,26 @@ Changes to the Web User Interface
18121812
Adding action links to the index page
18131813
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
18141814

1815-
Add a column to the ``item.index.html`` template.
1815+
Add a column to the ``item.index.html`` template. In that column add
1816+
a form to trigger the action. Note: the form must use the POST method
1817+
for security.
18161818

18171819
Resolving the issue::
18181820

1819-
<a tal:attributes="href
1820-
string:issue${i/id}?:status=resolved&:action=edit">resolve</a>
1821+
<form method="POST" tal:attributes="action string:issue${i/id}">
1822+
<button tal:replace="structure
1823+
python:context.submit(label='resolve', action='edit')" />
1824+
<input type="hidden" name="status" value="resolved">
1825+
</form>
18211826

18221827
"Take" the issue::
18231828

1824-
<a tal:attributes="href
1825-
string:issue${i/id}?:assignedto=${request/user/id}&:action=edit">take</a>
1829+
<form method="POST" tal:attributes="action string:issue${i/id}">
1830+
<button tal:replace="structure
1831+
python:context.submit(label='take', action='edit')" />
1832+
<input type="hidden" name="assignedto"
1833+
tal:attributes="value request/user/id">
1834+
</form>
18261835

18271836
... and so on.
18281837

0 commit comments

Comments
 (0)