mirror of
https://github.com/wekan/wekan.git
synced 2025-12-17 16:00:13 +01:00
Bugfix, Avatar upload message "avatar-too-big" shows now the configured max filesize
This commit is contained in:
parent
07926386ea
commit
7de50c0f4b
3 changed files with 6 additions and 3 deletions
|
|
@ -134,7 +134,7 @@
|
||||||
"attachmentDeletePopup-title": "Anhang löschen?",
|
"attachmentDeletePopup-title": "Anhang löschen?",
|
||||||
"attachments": "Anhänge",
|
"attachments": "Anhänge",
|
||||||
"auto-watch": "Neue Boards nach Erstellung automatisch beobachten",
|
"auto-watch": "Neue Boards nach Erstellung automatisch beobachten",
|
||||||
"avatar-too-big": "Das Profilbild ist zu groß (520KB max)",
|
"avatar-too-big": "Das Profilbild ist zu groß (__size__ max)",
|
||||||
"back": "Zurück",
|
"back": "Zurück",
|
||||||
"board-change-color": "Farbe ändern",
|
"board-change-color": "Farbe ändern",
|
||||||
"show-at-all-boards-page": "Zeige auf \"Alle Boards\" Seite",
|
"show-at-all-boards-page": "Zeige auf \"Alle Boards\" Seite",
|
||||||
|
|
|
||||||
|
|
@ -134,7 +134,7 @@
|
||||||
"attachmentDeletePopup-title": "Delete Attachment?",
|
"attachmentDeletePopup-title": "Delete Attachment?",
|
||||||
"attachments": "Attachments",
|
"attachments": "Attachments",
|
||||||
"auto-watch": "Automatically watch boards when they are created",
|
"auto-watch": "Automatically watch boards when they are created",
|
||||||
"avatar-too-big": "The avatar is too large (520KB max)",
|
"avatar-too-big": "The avatar is too large (__size__ max)",
|
||||||
"back": "Back",
|
"back": "Back",
|
||||||
"board-change-color": "Change color",
|
"board-change-color": "Change color",
|
||||||
"show-at-all-boards-page" : "Show at All Boards page",
|
"show-at-all-boards-page" : "Show at All Boards page",
|
||||||
|
|
|
||||||
|
|
@ -3,10 +3,13 @@ import { FilesCollection } from 'meteor/ostrio:files';
|
||||||
import { formatFleURL } from 'meteor/ostrio:files/lib';
|
import { formatFleURL } from 'meteor/ostrio:files/lib';
|
||||||
import { isFileValid } from './fileValidation';
|
import { isFileValid } from './fileValidation';
|
||||||
import { createBucket } from './lib/grid/createBucket';
|
import { createBucket } from './lib/grid/createBucket';
|
||||||
|
import { TAPi18n } from '/imports/i18n';
|
||||||
import fs from 'fs';
|
import fs from 'fs';
|
||||||
import path from 'path';
|
import path from 'path';
|
||||||
import FileStoreStrategyFactory, { FileStoreStrategyFilesystem, FileStoreStrategyGridFs, STORAGE_NAME_FILESYSTEM } from '/models/lib/fileStoreStrategy';
|
import FileStoreStrategyFactory, { FileStoreStrategyFilesystem, FileStoreStrategyGridFs, STORAGE_NAME_FILESYSTEM } from '/models/lib/fileStoreStrategy';
|
||||||
|
|
||||||
|
const filesize = require('filesize');
|
||||||
|
|
||||||
let avatarsUploadExternalProgram;
|
let avatarsUploadExternalProgram;
|
||||||
let avatarsUploadMimeTypes = [];
|
let avatarsUploadMimeTypes = [];
|
||||||
let avatarsUploadSize = 72000;
|
let avatarsUploadSize = 72000;
|
||||||
|
|
@ -84,7 +87,7 @@ Avatars = new FilesCollection({
|
||||||
if (file.size <= avatarsUploadSize && file.type.startsWith('image/')) {
|
if (file.size <= avatarsUploadSize && file.type.startsWith('image/')) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return 'avatar-too-big';
|
return TAPi18n.__('avatar-too-big', {size: filesize(avatarsUploadSize)});
|
||||||
},
|
},
|
||||||
onAfterUpload(fileObj) {
|
onAfterUpload(fileObj) {
|
||||||
// current storage is the filesystem, update object and database
|
// current storage is the filesystem, update object and database
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue