Skip to content

Commit 78ddd51

Browse files
committed
update
1 parent 4c22d97 commit 78ddd51

1 file changed

Lines changed: 10 additions & 32 deletions

File tree

Mailman/Cgi/admindb.py

Lines changed: 10 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -94,34 +94,15 @@ def helds_by_skey(mlist, ssort=SSENDER):
9494

9595

9696
def hacky_radio_buttons(btnname, labels, values, defaults, spacing=3):
97-
"""Create radio buttons with proper table formatting.
98-
99-
This is a hack because we can't use RadioButtonArray here - horizontal placement
100-
can be confusing to the user and vertical placement takes up too much real-estate.
101-
"""
97+
# We can't use a RadioButtonArray here because horizontal placement can be
98+
# confusing to the user and vertical placement takes up too much
99+
# real-estate. This is a hack!
102100
space = ' ' * spacing
103-
btns = Table(cellspacing='5', cellpadding='0', border='0', width='100%')
104-
105-
# Add labels row with proper alignment
106-
label_cells = []
107-
for text in labels:
108-
cell = space + text + space
109-
label_cells.append(cell)
110-
btns.AddRow(label_cells)
111-
112-
# Add radio buttons row with proper alignment and hidden labels
113-
button_cells = []
114-
for label, value, default in zip(labels, values, defaults):
115-
cell = Center(RadioButton(btnname, value, default).Format() +
116-
'<div class="hidden">' + Utils.websafe(label) + '</div>')
117-
button_cells.append(cell)
118-
btns.AddRow(button_cells)
119-
120-
# Set proper alignment for all cells
121-
for row in range(2):
122-
for col in range(len(labels)):
123-
btns.AddCellInfo(row, col, align='center', valign='middle')
124-
101+
btns = Table(cellspacing='5', cellpadding='0')
102+
btns.AddRow([space + text + space for text in labels])
103+
btns.AddRow([Center(RadioButton(btnname, value, default).Format()
104+
+ '<div class=hidden>' + label + '</div>')
105+
for label, value, default in zip(labels, values, defaults)])
125106
return btns
126107

127108

@@ -833,7 +814,7 @@ def show_post_requests(mlist, id, info, total, count, form):
833814
reason = _('Error decoding reason')
834815

835816
# Create the form table with proper encoding
836-
t = Table(cellspacing=0, cellpadding=0, width='100%')
817+
t = Table(cellspacing=0, cellpadding=0)
837818
t.AddRow([Bold(_('From:')), Utils.websafe(sender)])
838819
row, col = t.GetCurrentRowIndex(), t.GetCurrentCellIndex()
839820
t.AddCellInfo(row, col-1, align='right')
@@ -936,8 +917,7 @@ def safe_get(key, default=''):
936917
# Create a form for the overview with proper encoding
937918
form = Form(mlist.GetScriptURL('admindb', absolute=1),
938919
mlist=mlist,
939-
contexts=AUTH_CONTEXTS,
940-
encoding='multipart/form-data')
920+
contexts=AUTH_CONTEXTS)
941921
form.AddItem(Center(SubmitButton('submit', _('Submit All Data'))))
942922

943923
# Get the action from the form data with proper encoding
@@ -948,8 +928,6 @@ def safe_get(key, default=''):
948928
show_pending_unsubs(mlist, form)
949929
show_helds_overview(mlist, form)
950930
doc.AddItem(form)
951-
# Add the footer
952-
doc.AddItem(mlist.GetMailmanFooter())
953931
return
954932

955933
# Process the form submission

0 commit comments

Comments
 (0)