Mercurial > p > roundup > code
comparison 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 |
comparison
equal
deleted
inserted
replaced
| 5157:ae2a5d1afdd5 | 5158:63294ed25e84 |
|---|---|
| 159 | 159 |
| 160 <form method="post" tal:attributes="action string:${request/env/PATH_INFO}"> | 160 <form method="post" tal:attributes="action string:${request/env/PATH_INFO}"> |
| 161 | 161 |
| 162 the important part is that the action field **must not** include any query | 162 the important part is that the action field **must not** include any query |
| 163 parameters ('#' includes query params). | 163 parameters ('#' includes query params). |
| 164 | |
| 165 Option to make adding multiple keywords more convenient | |
| 166 ------------------------------------------------------- | |
| 167 | |
| 168 In the classic tracker, after adding a new keyword you are redirected | |
| 169 to the page for the new keyword so you can change the keyword's | |
| 170 name. This is usually not desirable as you usually correctly set the | |
| 171 keyword's name when creating the keyword. The new classic tracker has | |
| 172 a new checkbox (checked by default) that keeps you on the same page so | |
| 173 you can add a new keywords one after the other. | |
| 174 | |
| 175 To add this to your own tracker, add the following code (prefixed with | |
| 176 a +) after the entry box for the new keyword:: | |
| 177 | |
| 178 <tr> | |
| 179 <th i18n:translate="">Keyword</th> | |
| 180 <td tal:content="structure context/name/field">name</td> | |
| 181 + <td tal:condition="not:context/id"> | |
| 182 + <tal:comment tal:replace="nothing"> | |
| 183 + If we get here and do not have an id, we are creating a new | |
| 184 + keyword. It would be nice to provide some mechanism to | |
| 185 + determine the preferred state of the "Continue adding keywords" | |
| 186 + checkbox. By default it is enabled. | |
| 187 + </tal:comment> | |
| 188 + <input type="checkbox" id="continue_new_keyword" | |
| 189 + name="__redirect_to" | |
| 190 + tal:attributes="value | |
| 191 + string:${request/base}${request/env/PATH_INFO}?@template=item; | |
| 192 + checked python:True" /> | |
| 193 + <label for="continue_new_keyword" i18n:translate="">Continue adding keywords.</label> | |
| 194 + </td> | |
| 195 </tr> | |
| 196 | |
| 197 Note remove the leading '+' when adding this to the templates. | |
| 198 | |
| 199 The key component here is support for the '__redirect_to' query | |
| 200 property. It is a url which can be used when creating any new item | |
| 201 (issue, user, keyword ....). It controls the next page displayed after | |
| 202 creating the item. If '__redirect_to' is not set, then you end up on | |
| 203 the page for the newly created item. | |
| 164 | 204 |
| 165 html/_generic.404.html in trackers use page template | 205 html/_generic.404.html in trackers use page template |
| 166 ---------------------------------------------------- | 206 ---------------------------------------------------- |
| 167 | 207 |
| 168 The original generic 404 error pages for many trackers did not use the | 208 The original generic 404 error pages for many trackers did not use the |
