2
0
mirror of https://expo.survex.com/repositories/troggle/.git synced 2025-12-14 23:47:11 +00:00

Bigger buttons, phone compatible

This commit is contained in:
Philip Sargent
2021-05-01 18:35:08 +01:00
parent 100209ea16
commit 3393db0fbc
3 changed files with 90 additions and 32 deletions

View File

@@ -200,8 +200,7 @@ def ajax_test(request):
class MyForm(forms.Form): # not a model-form
title = forms.CharField(max_length=20)
class MyForm(forms.Form): # not a model-form, just a form-form
scanfiles = forms.FileField()
@login_required_if_public
@@ -218,8 +217,13 @@ def scanupload(request, wallet=None):
wallet = "2021:01" # improve this later
year = wallet[:4]
if int(year) < 1977:
year = "1977"
if int(year) > 2050:
year = "2050"
nexty = f'{int(year)+1}'
prevy = f'{int(year)-1}'
wnumber = wallet[5:]
next = f'{int(wnumber)+1:02d}'
prev = f'{int(wnumber)-1:02d}'
@@ -235,11 +239,9 @@ def scanupload(request, wallet=None):
if request.method == 'POST':
form = MyForm(request.POST,request.FILES)
if form.is_valid():
#form.save() # comment out so nothing saved in MEDIA_ROOT/fileuploads
f = request.FILES["scanfiles"]
w = request.POST["title"]
multiple = request.FILES.getlist('scanfiles')
fs = FileSystemStorage(os.path.join(settings.SURVEY_SCANS, year, w))
fs = FileSystemStorage(os.path.join(settings.SURVEY_SCANS, year, wallet))
actual_saved = []
if multiple: