diff doc/customizing.txt @ 7738:ce0c40b6cdc3

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.
author John Rouillard <rouilj@ieee.org>
date Tue, 13 Feb 2024 19:45:44 -0500
parents a072331c843b
children 67438e439da8
line wrap: on
line diff
--- a/doc/customizing.txt	Tue Feb 13 13:07:57 2024 -0500
+++ b/doc/customizing.txt	Tue Feb 13 19:45:44 2024 -0500
@@ -1812,17 +1812,26 @@
 Adding action links to the index page
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
-Add a column to the ``item.index.html`` template.
+Add a column to the ``item.index.html`` template.  In that column add
+a form to trigger the action. Note: the form must use the POST method
+for security.
 
 Resolving the issue::
 
-  <a tal:attributes="href
-     string:issue${i/id}?:status=resolved&:action=edit">resolve</a>
+    <form method="POST" tal:attributes="action string:issue${i/id}">
+      <button tal:replace="structure
+        python:context.submit(label='resolve', action='edit')" />
+      <input type="hidden" name="status" value="resolved">
+    </form>
 
 "Take" the issue::
 
-  <a tal:attributes="href
-     string:issue${i/id}?:assignedto=${request/user/id}&:action=edit">take</a>
+    <form method="POST" tal:attributes="action string:issue${i/id}">
+      <button tal:replace="structure
+        python:context.submit(label='take', action='edit')" />
+      <input type="hidden" name="assignedto"
+        tal:attributes="value request/user/id">
+    </form>
 
 ... and so on.
 

Roundup Issue Tracker: http://roundup-tracker.org/