special casing file uploads in listings
This commit is contained in:
parent
49e8e72b69
commit
5271090f0d
|
@ -127,12 +127,22 @@ class FormPage(Directory):
|
|||
filled = storage.get_storage().retrieve(names, k)
|
||||
"<tr>"
|
||||
link = os.path.join(get_request().environ['SCRIPT_NAME'], 'forms',
|
||||
self.formdef.id, filled.id, 'status')
|
||||
'<td><a href="/%s">☞</a></td>' % link
|
||||
for f in self.formdef.fields:
|
||||
self.formdef.id, filled.id)
|
||||
'<td><a href="/%s/status">☞</a></td>' % link
|
||||
for i, f in enumerate(self.formdef.fields):
|
||||
if f['type'] in ('title', 'subtitle'):
|
||||
continue
|
||||
"<td>%s</td>" % filled.data.get(f['name'], '')
|
||||
if f['type'] == 'bool':
|
||||
'<td>'
|
||||
if filled.data[f['name']]:
|
||||
_('Yes')
|
||||
else:
|
||||
_('No')
|
||||
'</td>'
|
||||
elif f['type'] == 'file':
|
||||
'<td><a href="/%s/download?f=%d">%s</a></td>' % (link, i, filled.data[f['name']])
|
||||
else:
|
||||
"<td>%s</td>" % filled.data.get(f['name'], '')
|
||||
"<td>%s</td>" % _(status_labels[filled.status])
|
||||
"</tr>\n"
|
||||
"</tbody></table>"
|
||||
|
@ -146,7 +156,7 @@ class FormPage(Directory):
|
|||
if not s: return s
|
||||
return s.replace('\n', ' ').replace(';', ',')
|
||||
|
||||
fields = [x for x in self.formdef.fields if x['type'] not in ('title', 'subtitle')]
|
||||
fields = [x for x in self.formdef.fields if x['type'] not in ('title', 'subtitle', 'file')]
|
||||
|
||||
for k in storage.get_storage().keys(names):
|
||||
filled = storage.get_storage().retrieve(names, k)
|
||||
|
|
Loading…
Reference in New Issue