Update of /cvsroot/mailman/mailman/Mailman/Cgi
In directory usw-pr-cvs1:/tmp/cvs-serv14490/Mailman/Cgi
Modified Files:
admin.py
Log Message:
show_results(): Add support for the emergency hold button. When
enabled, it lights up a rude solo light, so there's no missing it.
UI changes to make this work better: the form now includes the links
table to pick up the emergency checkbox, which shows on all admin
pages. Get rid of the duplicated links at the bottom of the page -- I
didn't like them much anyway.
change_options(): Look for the emergency form variable and enable
mlist.emergency if found.
Index: admin.py
===================================================================
RCS file: /cvsroot/mailman/mailman/Mailman/Cgi/admin.py,v
retrieving revision 2.64
retrieving revision 2.65
diff -C2 -d -r2.64 -r2.65
*** admin.py 14 Mar 2002 04:59:24 -0000 2.64
--- admin.py 15 Mar 2002 03:53:34 -0000 2.65
***************
*** 385,393 ****
'%(realname)s mailing list administration<br>%(label)s Section'))))
doc.AddItem('<hr>')
# This holds the two columns of links
linktable = Table(valign='top', width='100%')
linktable.AddRow([Center(Bold(_("Configuration Categories"))),
Center(Bold(_("Other Administrative Activities")))])
- linktable.AddCellInfo(linktable.GetCurrentRowIndex(), 0, colspan=2)
# The `other links' are stuff in the right column.
otherlinks = UnorderedList()
--- 385,403 ----
'%(realname)s mailing list administration<br>%(label)s Section'))))
doc.AddItem('<hr>')
+ # Now we need to craft the form that will be submitted, which will contain
+ # all the variable settings, etc. This is a bit of a kludge because we
+ # know that the autoreply and members categories supports file uploads.
+ encoding = None
+ if category in ('autoreply', 'members'):
+ encoding = 'multipart/form-data'
+ if subcat:
+ form = Form('%s/%s/%s' % (adminurl, category, subcat),
+ encoding=encoding)
+ else:
+ form = Form('%s/%s' % (adminurl, category), encoding=encoding)
# This holds the two columns of links
linktable = Table(valign='top', width='100%')
linktable.AddRow([Center(Bold(_("Configuration Categories"))),
Center(Bold(_("Other Administrative Activities")))])
# The `other links' are stuff in the right column.
otherlinks = UnorderedList()
***************
*** 450,470 ****
categorylinks_2 = categorylinks = UnorderedList()
counter = -len(categorykeys)
# Add all the links to the links table...
! linktable.AddRow([categorylinks_1, categorylinks_2, otherlinks])
! linktable.AddRowInfo(linktable.GetCurrentRowIndex(), valign='top')
! # ...and add the links table to the document.
! doc.AddItem(linktable)
! doc.AddItem('<hr>')
! # Now we need to craft the form that will be submitted, which will contain
! # all the variable settings, etc. This is a bit of a kludge because we
! # know that the autoreply and members categories supports file uploads.
! encoding = None
! if category in ('autoreply', 'members'):
! encoding = 'multipart/form-data'
! if subcat:
! form = Form('%s/%s/%s' % (adminurl, category, subcat),
! encoding=encoding)
else:
! form = Form('%s/%s' % (adminurl, category), encoding=encoding)
form.AddItem(
_('''Make your changes in the following section, then submit them
--- 460,484 ----
categorylinks_2 = categorylinks = UnorderedList()
counter = -len(categorykeys)
+ # Make the emergency stop switch a rude solo light
+ etable = Table()
# Add all the links to the links table...
! etable.AddRow([categorylinks_1, categorylinks_2])
! etable.AddRowInfo(etable.GetCurrentRowIndex(), valign='top')
! label = _('Emergency moderation of all list traffic:')
! if mlist.emergency:
! label = Bold(label).Format()
! etable.AddRow([' ', ' '])
! etable.AddRow([Center(label + CheckBox('emergency', 1,
! mlist.emergency).Format())])
! if mlist.emergency:
! color = mm_cfg.WEB_ERROR_COLOR
else:
! color = mm_cfg.WEB_BG_COLOR
! etable.AddCellInfo(etable.GetCurrentRowIndex(), 0,
! colspan=2, bgcolor=color)
! linktable.AddRow([etable, otherlinks])
! # ...and add the links table to the document.
! form.AddItem(linktable)
! form.AddItem('<hr>')
form.AddItem(
_('''Make your changes in the following section, then submit them
***************
*** 518,526 ****
form.AddItem(show_variables(mlist, category, subcat, cgidata, doc))
form.AddItem(Center(submit_button()))
- # Add the separator
- form.AddItem('<hr>')
# And add the form
doc.AddItem(form)
- doc.AddItem(linktable)
doc.AddItem(mlist.GetMailmanFooter())
--- 532,537 ----
***************
*** 1164,1167 ****
--- 1175,1183 ----
def change_options(mlist, category, subcat, cgidata, doc):
+ def safeint(formvar, defaultval=None):
+ try:
+ return int(cgidata.getvalue(formvar))
+ except (ValueError, TypeError):
+ return defaultval
confirmed = 0
# Handle changes to the list moderator password. Do this before checking
***************
*** 1186,1189 ****
--- 1202,1207 ----
else:
doc.addError(_('Administator passwords did not match'))
+ # Handle the emergency stop button
+ mlist.emergency = safeint('emergency', 0)
# Give the individual gui item a chance to process the form data
categories = mlist.GetConfigCategories()
***************
*** 1198,1206 ****
if subscribers:
entries = filter(None, [n.strip() for n in subscribers.splitlines()])
- def safeint(formvar, defaultval=None):
- try:
- return int(cgidata.getvalue(formvar))
- except (ValueError, TypeError):
- return defaultval
send_welcome_msg = safeint('send_welcome_msg_to_this_batch',
mlist.send_welcome_msg)
--- 1216,1219 ----
_______________________________________________
Mailman-checkins mailing list
[EMAIL PROTECTED]
http://mail.python.org/mailman/listinfo/mailman-checkins