Skip to content

Commit b7baa2d

Browse files
committed
Documentation additions by Tom Ekberg to add example of performing
silent submit. Light editing by John Rouillard.
1 parent 694bf16 commit b7baa2d

File tree

1 file changed

+67
-0
lines changed

1 file changed

+67
-0
lines changed

doc/customizing.txt

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5369,6 +5369,73 @@ Setting up a "wizard" (or "druid") for controlled adding of issues
53695369
you're done (the standard context/submit method can do this for you).
53705370

53715371

5372+
Silent Submit
5373+
~~~~~~~~~~~~~
5374+
5375+
When working on an issue, most of the time the people on the nosy list
5376+
need to be notified of changes. There are cases where a user wants to
5377+
add a comment to an issue and not bother other users on the nosy
5378+
list.
5379+
This feature is called Silent Submit because it allows the user to
5380+
silently modify an issue and not tell anyone.
5381+
5382+
There are several parts to this change. The main activity part
5383+
involves editing the stock detectors/nosyreaction.py file in your
5384+
tracker. Insert the following lines near the top of the nosyreaction
5385+
function::
5386+
5387+
# Did user click button to do a silent change?
5388+
try:
5389+
if db.web['submit'] == "silent_change":
5390+
return
5391+
except (AttributeError, KeyError) as err:
5392+
# The web attribute or submit key don't exist.
5393+
# That's fine. We were probably triggered by an email
5394+
# or cli based change.
5395+
pass
5396+
5397+
This checks the submit button to see if it is the silent type. If there
5398+
are exceptions trying to make that determination they are ignored and
5399+
processing continues. You may wonder how db.web gets set. This is done
5400+
by creating an extension. Add the file extensions/edit.py with
5401+
this content::
5402+
5403+
from roundup.cgi.actions import EditItemAction
5404+
5405+
class Edit2Action(EditItemAction):
5406+
def handle(self):
5407+
self.db.web = {} # create the dict
5408+
# populate the dict by getting the value of the submit_button
5409+
# element from the form.
5410+
self.db.web['submit'] = self.form['submit_button'].value
5411+
5412+
# call the core EditItemAction to process the edit.
5413+
EditItemAction.handle(self)
5414+
5415+
def init(instance):
5416+
'''Override the default edit action with this new version'''
5417+
instance.registerAction('edit', Edit2Action)
5418+
5419+
This code is a wrapper for the roundup EditItemAction. It checks the
5420+
form's submit button to save the value element. The rest of the changes
5421+
needed for the Silent Submit feature involves editing
5422+
html/issue.item.html to add the silent submit button. In
5423+
the stock issue.item.html the submit button is on a line that contains
5424+
"submit button". Replace that line with something like the following::
5425+
5426+
<input type="submit" name="submit_button"
5427+
tal:condition="context/is_edit_ok"
5428+
value="Submit Changes">&nbsp;
5429+
<button type="submit" name="submit_button"
5430+
tal:condition="context/is_edit_ok"
5431+
title="Click this to submit but not send nosy email."
5432+
value="silent_change" i18n:translate="">
5433+
Silent Change</button>
5434+
5435+
Note the difference in the value attribute for the two submit buttons.
5436+
The value "silent_change" in the button specification must match the
5437+
string in the nosy reaction function.
5438+
53725439
Debugging Trackers
53735440
==================
53745441

0 commit comments

Comments
 (0)