Change default expiry, add file size hint

This commit is contained in:
Christian Cueni 2023-01-09 16:38:20 +01:00
parent 579758037e
commit 660c288f6f
3 changed files with 7 additions and 7 deletions

View File

@ -84,13 +84,12 @@ function showFileInformation() {
{{ $t("circlePage.documents.fileLabel") }} {{ $t("circlePage.documents.fileLabel") }}
</label> </label>
<div <div
class="btn-secondary mt-4 text-xl relative cursor-pointer" class="mb-4 btn-secondary mt-4 text-xl relative cursor-pointer"
:class="{ 'mb-8': !showFileInformation(), 'mb-4': showFileInformation() }"
> >
<input @change="fileChange" id="upload" type="file" class="absolute opacity-0" /> <input @change="fileChange" id="upload" type="file" class="absolute opacity-0" />
{{ $t("circlePage.documents.modalAction") }} {{ $t("circlePage.documents.modalAction") }}
</div> </div>
<div v-if="showFileInformation()" class="mb-8"> <div v-if="showFileInformation()" class="mb-4">
<div v-if="formData.file"> <div v-if="formData.file">
<p>{{ formData.file.name }}</p> <p>{{ formData.file.name }}</p>
</div> </div>
@ -98,7 +97,7 @@ function showFileInformation() {
<p class="text-red-700">{{ $t("circlePage.documents.selectFile") }}</p> <p class="text-red-700">{{ $t("circlePage.documents.selectFile") }}</p>
</div> </div>
</div> </div>
<!--p>{{ $t("circlePage.documentsModalInformation") }}</p--> <p class="mb-8">{{ $t("circlePage.documents.maxFileSize") }}</p>
<div class="mb-8"> <div class="mb-8">
<label class="block text-bold mb-4" for="name"> <label class="block text-bold mb-4" for="name">
{{ $t("circlePage.documents.modalFileName") }} {{ $t("circlePage.documents.modalFileName") }}

View File

@ -48,7 +48,8 @@
"selectFile": "Bitte wähle eine Datei aus", "selectFile": "Bitte wähle eine Datei aus",
"chooseName": "Bitte wähle einen Namen", "chooseName": "Bitte wähle einen Namen",
"chooseLearningSequence": "Bitte wähle eine Lernsequenz aus", "chooseLearningSequence": "Bitte wähle eine Lernsequenz aus",
"uploadErrorMessage": "Beim Hochladen ist ein Fehler aufgetreten. Bitte versuche es erneut." "uploadErrorMessage": "Beim Hochladen ist ein Fehler aufgetreten. Bitte versuche es erneut.",
"maxFileSize": "Maximale Dateigrösse: 20 MB"
} }
}, },
"learningContent": { "learningContent": {

View File

@ -589,12 +589,12 @@ if FILE_UPLOAD_STORAGE == "s3":
AWS_STORAGE_BUCKET_NAME = env("AWS_STORAGE_BUCKET_NAME") AWS_STORAGE_BUCKET_NAME = env("AWS_STORAGE_BUCKET_NAME")
AWS_S3_REGION_NAME = env("AWS_S3_REGION_NAME") AWS_S3_REGION_NAME = env("AWS_S3_REGION_NAME")
AWS_S3_SIGNATURE_VERSION = env("AWS_S3_SIGNATURE_VERSION", default="s3v4") AWS_S3_SIGNATURE_VERSION = env("AWS_S3_SIGNATURE_VERSION", default="s3v4")
FILE_MAX_SIZE = env.int("FILE_MAX_SIZE", default=5242880) # 5MB FILE_MAX_SIZE = env.int("FILE_MAX_SIZE", default=20971520) # 20MB
# https://docs.aws.amazon.com/AmazonS3/latest/userguide/acl-overview.html#canned-acl # https://docs.aws.amazon.com/AmazonS3/latest/userguide/acl-overview.html#canned-acl
AWS_DEFAULT_ACL = env("AWS_DEFAULT_ACL", default="private") AWS_DEFAULT_ACL = env("AWS_DEFAULT_ACL", default="private")
AWS_PRESIGNED_EXPIRY = env.int("AWS_PRESIGNED_EXPIRY", default=60) # seconds AWS_PRESIGNED_EXPIRY = env.int("AWS_PRESIGNED_EXPIRY", default=300) # seconds
if APP_ENVIRONMENT == "development": if APP_ENVIRONMENT == "development":
# http://whitenoise.evans.io/en/latest/django.html#using-whitenoise-in-development # http://whitenoise.evans.io/en/latest/django.html#using-whitenoise-in-development