Mercurial > p > roundup > code
diff doc/upgrading.txt @ 5158:63294ed25e84
issue1842687: Keywords: After creating, stay in "Create New" mode.
Added support for __redirect_to form variable to the new action. If
set the value should be a url. If __redirect_to is present, the user is
directed to the url after the new action has completed successfully.
E.G. when creating new keywords you often want to stay on the create
new keyword page rather than change to the "Edit keyword" page. Setting
__redirect_to to the new keyword creation url lets you keep adding new
keywords.
This mechanism works for any @action=new. So you could keep the user
on an "add new issue" page so they can keep adding issues one after the
other.
Also change the classic tracker keyword.item.html page to have a
checkbox (checked by default) to stay on the "new keyword" page rather
than displaying the newly created keyword item.
| author | John Rouillard <rouilj@ieee.org> |
|---|---|
| date | Fri, 22 Jul 2016 16:32:01 -0400 |
| parents | 882fa4d9bead |
| children | 12190efa30d4 |
line wrap: on
line diff
--- a/doc/upgrading.txt Fri Jul 22 16:10:42 2016 -0400 +++ b/doc/upgrading.txt Fri Jul 22 16:32:01 2016 -0400 @@ -162,6 +162,46 @@ the important part is that the action field **must not** include any query parameters ('#' includes query params). +Option to make adding multiple keywords more convenient +------------------------------------------------------- + +In the classic tracker, after adding a new keyword you are redirected +to the page for the new keyword so you can change the keyword's +name. This is usually not desirable as you usually correctly set the +keyword's name when creating the keyword. The new classic tracker has +a new checkbox (checked by default) that keeps you on the same page so +you can add a new keywords one after the other. + +To add this to your own tracker, add the following code (prefixed with +a +) after the entry box for the new keyword:: + + <tr> + <th i18n:translate="">Keyword</th> + <td tal:content="structure context/name/field">name</td> + + <td tal:condition="not:context/id"> + + <tal:comment tal:replace="nothing"> + + If we get here and do not have an id, we are creating a new + + keyword. It would be nice to provide some mechanism to + + determine the preferred state of the "Continue adding keywords" + + checkbox. By default it is enabled. + + </tal:comment> + + <input type="checkbox" id="continue_new_keyword" + + name="__redirect_to" + + tal:attributes="value + + string:${request/base}${request/env/PATH_INFO}?@template=item; + + checked python:True" /> + + <label for="continue_new_keyword" i18n:translate="">Continue adding keywords.</label> + + </td> + </tr> + +Note remove the leading '+' when adding this to the templates. + +The key component here is support for the '__redirect_to' query +property. It is a url which can be used when creating any new item +(issue, user, keyword ....). It controls the next page displayed after +creating the item. If '__redirect_to' is not set, then you end up on +the page for the newly created item. + html/_generic.404.html in trackers use page template ----------------------------------------------------
