mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-02 03:55:55 +01:00
This commit is contained in:
@@ -47,7 +47,6 @@
|
|||||||
"topic-locked": "Topic Locked",
|
"topic-locked": "Topic Locked",
|
||||||
"post-edit-duration-expired": "You are only allowed to edit posts for %1 second(s) after posting",
|
"post-edit-duration-expired": "You are only allowed to edit posts for %1 second(s) after posting",
|
||||||
|
|
||||||
"still-uploading": "Please wait for uploads to complete.",
|
|
||||||
"content-too-short": "Please enter a longer post. Posts should contain at least %1 character(s).",
|
"content-too-short": "Please enter a longer post. Posts should contain at least %1 character(s).",
|
||||||
"content-too-long": "Please enter a shorter post. Posts can't be longer than %1 character(s).",
|
"content-too-long": "Please enter a shorter post. Posts can't be longer than %1 character(s).",
|
||||||
"title-too-short": "Please enter a longer title. Titles should contain at least %1 character(s).",
|
"title-too-short": "Please enter a longer title. Titles should contain at least %1 character(s).",
|
||||||
@@ -60,7 +59,9 @@
|
|||||||
"not-enough-tags": "Not enough tags. Topics must have at least %1 tag(s)",
|
"not-enough-tags": "Not enough tags. Topics must have at least %1 tag(s)",
|
||||||
"too-many-tags": "Too many tags. Topics can't have more than %1 tag(s)",
|
"too-many-tags": "Too many tags. Topics can't have more than %1 tag(s)",
|
||||||
|
|
||||||
|
"still-uploading": "Please wait for uploads to complete.",
|
||||||
"file-too-big": "Maximum allowed file size is %1 kB - please upload a smaller file",
|
"file-too-big": "Maximum allowed file size is %1 kB - please upload a smaller file",
|
||||||
|
"guest-upload-disabled": "Guest uploading has been disabled",
|
||||||
|
|
||||||
"already-favourited": "You have already favourited this post",
|
"already-favourited": "You have already favourited this post",
|
||||||
"already-unfavourited": "You have already unfavourited this post",
|
"already-unfavourited": "You have already unfavourited this post",
|
||||||
|
|||||||
@@ -17,9 +17,9 @@ var uploadsController = {};
|
|||||||
uploadsController.upload = function(req, res, filesIterator, next) {
|
uploadsController.upload = function(req, res, filesIterator, next) {
|
||||||
var files = req.files.files;
|
var files = req.files.files;
|
||||||
|
|
||||||
if (!req.user) {
|
if (!req.user && meta.config.allowGuestUploads !== '1') {
|
||||||
deleteTempFiles(files);
|
deleteTempFiles(files);
|
||||||
return res.status(403).json('not allowed');
|
return res.status(403).json('[[error:guest-upload-disabled]]');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!Array.isArray(files)) {
|
if (!Array.isArray(files)) {
|
||||||
@@ -51,10 +51,10 @@ uploadsController.uploadPost = function(req, res, next) {
|
|||||||
return next(err);
|
return next(err);
|
||||||
}
|
}
|
||||||
|
|
||||||
uploadImage(req.user.uid, uploadedFile, next);
|
uploadImage(req.user ? req.user.uid : 0, uploadedFile, next);
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
uploadFile(req.user.uid, uploadedFile, next);
|
uploadFile(req.user ? req.user.uid : 0, uploadedFile, next);
|
||||||
}
|
}
|
||||||
}, next);
|
}, next);
|
||||||
};
|
};
|
||||||
@@ -82,7 +82,7 @@ uploadsController.uploadThumb = function(req, res, next) {
|
|||||||
if (err) {
|
if (err) {
|
||||||
return next(err);
|
return next(err);
|
||||||
}
|
}
|
||||||
uploadImage(req.user.uid, uploadedFile, next);
|
uploadImage(req.user ? req.user.uid : 0, uploadedFile, next);
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
next(new Error('[[error:invalid-file]]'));
|
next(new Error('[[error:invalid-file]]'));
|
||||||
|
|||||||
@@ -31,6 +31,7 @@
|
|||||||
<li><a href="{relative_path}/admin/settings/user">User</a></li>
|
<li><a href="{relative_path}/admin/settings/user">User</a></li>
|
||||||
<li><a href="{relative_path}/admin/settings/group">Group</a></li>
|
<li><a href="{relative_path}/admin/settings/group">Group</a></li>
|
||||||
<li><a href="{relative_path}/admin/settings/guest">Guests</a></li>
|
<li><a href="{relative_path}/admin/settings/guest">Guests</a></li>
|
||||||
|
<li><a href="{relative_path}/admin/settings/uploads">Uploads</a></li>
|
||||||
<li><a href="{relative_path}/admin/settings/post">Post</a></li>
|
<li><a href="{relative_path}/admin/settings/post">Post</a></li>
|
||||||
<li><a href="{relative_path}/admin/settings/chat">Chat</a></li>
|
<li><a href="{relative_path}/admin/settings/chat">Chat</a></li>
|
||||||
<li><a href="{relative_path}/admin/settings/pagination">Pagination</a></li>
|
<li><a href="{relative_path}/admin/settings/pagination">Pagination</a></li>
|
||||||
@@ -181,6 +182,7 @@
|
|||||||
<li><a href="{relative_path}/admin/settings/user">User</a></li>
|
<li><a href="{relative_path}/admin/settings/user">User</a></li>
|
||||||
<li><a href="{relative_path}/admin/settings/group">Group</a></li>
|
<li><a href="{relative_path}/admin/settings/group">Group</a></li>
|
||||||
<li><a href="{relative_path}/admin/settings/guest">Guests</a></li>
|
<li><a href="{relative_path}/admin/settings/guest">Guests</a></li>
|
||||||
|
<li><a href="{relative_path}/admin/settings/uploads">Uploads</a></li>
|
||||||
<li><a href="{relative_path}/admin/settings/post">Post</a></li>
|
<li><a href="{relative_path}/admin/settings/post">Post</a></li>
|
||||||
<li><a href="{relative_path}/admin/settings/chat">Chat</a></li>
|
<li><a href="{relative_path}/admin/settings/chat">Chat</a></li>
|
||||||
<li><a href="{relative_path}/admin/settings/pagination">Pagination</a></li>
|
<li><a href="{relative_path}/admin/settings/pagination">Pagination</a></li>
|
||||||
|
|||||||
@@ -122,53 +122,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-sm-2 col-xs-12 settings-header">Upload Settings</div>
|
|
||||||
<div class="col-sm-10 col-xs-12">
|
|
||||||
<form>
|
|
||||||
<div class="checkbox">
|
|
||||||
<label class="mdl-switch mdl-js-switch mdl-js-ripple-effect">
|
|
||||||
<input class="mdl-switch__input" type="checkbox" data-field="allowFileUploads">
|
|
||||||
<span class="mdl-switch__label"><strong>Allow users to upload regular files</strong></span>
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="checkbox">
|
|
||||||
<label class="mdl-switch mdl-js-switch mdl-js-ripple-effect">
|
|
||||||
<input class="mdl-switch__input" type="checkbox" data-field="privateUploads">
|
|
||||||
<span class="mdl-switch__label"><strong>Make uploaded files private</strong></span>
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="form-group">
|
|
||||||
<label for="maximumFileSize">Maximum File Size</label>
|
|
||||||
<input type="text" class="form-control" value="2048" data-field="maximumFileSize">
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="checkbox">
|
|
||||||
<label class="mdl-switch mdl-js-switch mdl-js-ripple-effect">
|
|
||||||
<input class="mdl-switch__input" type="checkbox" data-field="allowTopicsThumbnail">
|
|
||||||
<span class="mdl-switch__label"><strong>Allow users to upload topic thumbnails</strong></span>
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="form-group">
|
|
||||||
<label for="topicThumbSize">Topic Thumb Size</label>
|
|
||||||
<input type="text" class="form-control" value="120" data-field="topicThumbSize">
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="form-group">
|
|
||||||
<label for="allowedFileExtensions">Allowed File Extensions</label>
|
|
||||||
<input type="text" class="form-control" value="" data-field="allowedFileExtensions" />
|
|
||||||
<p class="help-block">
|
|
||||||
Enter comma-separated list of file extensions here (e.g. <code>pdf,xls,doc</code>).
|
|
||||||
An empty list means all extensions are allowed.
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-sm-2 col-xs-12 settings-header">Composer Settings</div>
|
<div class="col-sm-2 col-xs-12 settings-header">Composer Settings</div>
|
||||||
<div class="col-sm-10 col-xs-12">
|
<div class="col-sm-10 col-xs-12">
|
||||||
|
|||||||
122
src/views/admin/settings/uploads.tpl
Normal file
122
src/views/admin/settings/uploads.tpl
Normal file
@@ -0,0 +1,122 @@
|
|||||||
|
<!-- IMPORT admin/settings/header.tpl -->
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-sm-2 col-xs-12 settings-header">
|
||||||
|
Posts
|
||||||
|
</div>
|
||||||
|
<div class="col-sm-10 col-xs-12">
|
||||||
|
<form>
|
||||||
|
<div class="checkbox">
|
||||||
|
<label class="mdl-switch mdl-js-switch mdl-js-ripple-effect">
|
||||||
|
<input class="mdl-switch__input" type="checkbox" data-field="allowFileUploads">
|
||||||
|
<span class="mdl-switch__label"><strong>Allow users to upload regular files</strong></span>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="checkbox">
|
||||||
|
<label class="mdl-switch mdl-js-switch mdl-js-ripple-effect">
|
||||||
|
<input class="mdl-switch__input" type="checkbox" data-field="privateUploads">
|
||||||
|
<span class="mdl-switch__label"><strong>Make uploaded files private</strong></span>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="checkbox">
|
||||||
|
<label class="mdl-switch mdl-js-switch mdl-js-ripple-effect">
|
||||||
|
<input class="mdl-switch__input" type="checkbox" data-field="allowGuestUploads">
|
||||||
|
<span class="mdl-switch__label"><strong>Allow Guests to Upload Files</strong></span>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="maximumFileSize">Maximum File Size</label>
|
||||||
|
<input type="text" class="form-control" value="2048" data-field="maximumFileSize">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="checkbox">
|
||||||
|
<label class="mdl-switch mdl-js-switch mdl-js-ripple-effect">
|
||||||
|
<input class="mdl-switch__input" type="checkbox" data-field="allowTopicsThumbnail">
|
||||||
|
<span class="mdl-switch__label"><strong>Allow users to upload topic thumbnails</strong></span>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="topicThumbSize">Topic Thumb Size</label>
|
||||||
|
<input type="text" class="form-control" value="120" data-field="topicThumbSize">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="allowedFileExtensions">Allowed File Extensions</label>
|
||||||
|
<input type="text" class="form-control" value="" data-field="allowedFileExtensions" />
|
||||||
|
<p class="help-block">
|
||||||
|
Enter comma-separated list of file extensions here (e.g. <code>pdf,xls,doc</code>).
|
||||||
|
An empty list means all extensions are allowed.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- IMPORT admin/settings/header.tpl -->
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-sm-2 col-xs-12 settings-header">
|
||||||
|
Profile Avatars
|
||||||
|
</div>
|
||||||
|
<div class="col-sm-10 col-xs-12">
|
||||||
|
<form>
|
||||||
|
<div class="checkbox">
|
||||||
|
<label class="mdl-switch mdl-js-switch mdl-js-ripple-effect">
|
||||||
|
<input class="mdl-switch__input" type="checkbox" data-field="allowProfileImageUploads">
|
||||||
|
<span class="mdl-switch__label"><strong>Allow users to upload profile images</strong></span>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="checkbox">
|
||||||
|
<label class="mdl-switch mdl-js-switch mdl-js-ripple-effect">
|
||||||
|
<input class="mdl-switch__input" type="checkbox" data-field="profile:convertProfileImageToPNG">
|
||||||
|
<span class="mdl-switch__label"><strong>Convert profile image uploads to PNG</strong></span>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label>Custom Default Avatar</label>
|
||||||
|
<div class="input-group">
|
||||||
|
<input id="defaultAvatar" type="text" class="form-control" placeholder="A custom image to use instead of user icons" data-field="defaultAvatar" />
|
||||||
|
<span class="input-group-btn">
|
||||||
|
<input data-action="upload" data-target="defaultAvatar" data-route="{config.relative_path}/api/admin/uploadDefaultAvatar" type="button" class="btn btn-default" value="Upload"></input>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="profileImageDimension">Profile Image Dimension</label>
|
||||||
|
<input id="profileImageDimension" type="text" class="form-control" data-field="profileImageDimension" placeholder="128" />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label>Maximum Profile Image File Size</label>
|
||||||
|
<input type="text" class="form-control" placeholder="Maximum size of uploaded user images in kilobytes" data-field="maximumProfileImageSize" />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label>Maximum Cover Image File Size</label>
|
||||||
|
<input type="text" class="form-control" placeholder="Maximum size of uploaded cover images in kilobytes" data-field="maximumCoverImageSize" />
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-sm-2 col-xs-12 settings-header">Profile Covers</div>
|
||||||
|
<div class="col-sm-10 col-xs-12">
|
||||||
|
<form>
|
||||||
|
<label for="profile:defaultCovers"><strong>Default Cover Images</strong></label>
|
||||||
|
<p class="help-block">
|
||||||
|
Add comma-separated default cover images for accounts that don't have an uploaded cover image
|
||||||
|
</p>
|
||||||
|
<input type="text" class="form-control input-lg" id="profile:defaultCovers" data-field="profile:defaultCovers" value="{config.relative_path}/images/cover-default.png" placeholder="https://example.com/group1.png, https://example.com/group2.png" />
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- IMPORT admin/settings/footer.tpl -->
|
||||||
@@ -88,65 +88,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-sm-2 col-xs-12 settings-header">Avatars</div>
|
|
||||||
<div class="col-sm-10 col-xs-12">
|
|
||||||
<form>
|
|
||||||
<div class="checkbox">
|
|
||||||
<label class="mdl-switch mdl-js-switch mdl-js-ripple-effect">
|
|
||||||
<input class="mdl-switch__input" type="checkbox" data-field="allowProfileImageUploads">
|
|
||||||
<span class="mdl-switch__label"><strong>Allow users to upload profile images</strong></span>
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="checkbox">
|
|
||||||
<label class="mdl-switch mdl-js-switch mdl-js-ripple-effect">
|
|
||||||
<input class="mdl-switch__input" type="checkbox" data-field="profile:convertProfileImageToPNG">
|
|
||||||
<span class="mdl-switch__label"><strong>Convert profile image uploads to PNG</strong></span>
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="form-group">
|
|
||||||
<label>Custom Default Avatar</label>
|
|
||||||
<div class="input-group">
|
|
||||||
<input id="defaultAvatar" type="text" class="form-control" placeholder="A custom image to use instead of user icons" data-field="defaultAvatar" />
|
|
||||||
<span class="input-group-btn">
|
|
||||||
<input data-action="upload" data-target="defaultAvatar" data-route="{config.relative_path}/api/admin/uploadDefaultAvatar" type="button" class="btn btn-default" value="Upload"></input>
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="form-group">
|
|
||||||
<label for="profileImageDimension">Profile Image Dimension</label>
|
|
||||||
<input id="profileImageDimension" type="text" class="form-control" data-field="profileImageDimension" placeholder="128" />
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="form-group">
|
|
||||||
<label>Maximum Profile Image File Size</label>
|
|
||||||
<input type="text" class="form-control" placeholder="Maximum size of uploaded user images in kilobytes" data-field="maximumProfileImageSize" />
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="form-group">
|
|
||||||
<label>Maximum Cover Image File Size</label>
|
|
||||||
<input type="text" class="form-control" placeholder="Maximum size of uploaded cover images in kilobytes" data-field="maximumCoverImageSize" />
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-sm-2 col-xs-12 settings-header">Profile Cover Image</div>
|
|
||||||
<div class="col-sm-10 col-xs-12">
|
|
||||||
<form>
|
|
||||||
<label for="profile:defaultCovers"><strong>Default Cover Images</strong></label>
|
|
||||||
<p class="help-block">
|
|
||||||
Add comma-separated default cover images for accounts that don't have an uploaded cover image
|
|
||||||
</p>
|
|
||||||
<input type="text" class="form-control input-lg" id="profile:defaultCovers" data-field="profile:defaultCovers" value="{config.relative_path}/images/cover-default.png" placeholder="https://example.com/group1.png, https://example.com/group2.png" />
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-sm-2 col-xs-12 settings-header">Themes</div>
|
<div class="col-sm-2 col-xs-12 settings-header">Themes</div>
|
||||||
<div class="col-sm-10 col-xs-12">
|
<div class="col-sm-10 col-xs-12">
|
||||||
|
|||||||
Reference in New Issue
Block a user