Skip to content

Commit f375dc8

Browse files
committed
Closes GitHub Issue #11 (multiple files not uploading) & improves files design
1 parent e6175a0 commit f375dc8

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

main.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -229,14 +229,10 @@ def content(id):
229229
elif '-files-upload-box' in x[1][0]:
230230
print('skipping')
231231
elif '-file-checkbox-' in x[1][0]:
232-
content[int(x[1][0].split('-file-checkbox-')[0])]['value'] = []
232+
if 'value' not in content[int(x[1][0].split('-file-checkbox-')[0])]:
233+
content[int(x[1][0].split('-file-checkbox-')[0])]['value'] = []
233234
if x[1][1] == 'on':
234-
if "value" in content[int(x[1][0].split('-file-checkbox-')[0])]:
235-
content[int(x[1][0].split('-file-checkbox-')[0])
236-
]['value'].append(x[1][0].split('-file-checkbox-')[1])
237-
else:
238-
content[int(x[1][0].split('-file-checkbox-')[0])
239-
]['value'] = [x[1][0].split('-file-checkbox-')[1]]
235+
content[int(x[1][0].split('-file-checkbox-')[0])]['value'].append(x[1][0].split('-file-checkbox-')[1])
240236
elif content[int(x[1][0])]["type"] == 'String Array':
241237
content[int(x[1][0])]['value'] = x[1][1].split(',')
242238
else:

templates/edit.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ <h2 class="text-2xl font-bold">Edit Content</h2>
169169
<small>(Deselect files to delete them.)</small>
170170
<div id="{{item[0]}}-checkbox" class="mt-2">
171171
{% for checkbox in item[1]['value'] %}
172-
<a target="_blank" href="/file/{{checkbox}}">
172+
<a target="_blank" style="display: block;" class="mb-2" href="/file/{{checkbox}}">
173173
<input
174174
type="checkbox"
175175
id="{{item[0]}}-file-checkbox-{{checkbox}}"

0 commit comments

Comments
 (0)