relative path upload fixes #2403

Conflicts:
	src/categories.js
This commit is contained in:
barisusakli
2014-11-13 13:00:36 -05:00
committed by Julian Lam
parent 1943f8fdfa
commit 0cb3a5bd3f
3 changed files with 4 additions and 4 deletions

2
app.js
View File

@@ -94,7 +94,7 @@ function loadConfig() {
nconf.defaults({
base_dir: __dirname,
themes_path: path.join(__dirname, 'node_modules'),
upload_url: '/uploads/',
upload_url: nconf.get('relative_path') + '/uploads/',
views_dir: path.join(__dirname, 'public/templates')
});

View File

@@ -213,7 +213,7 @@ define('composer/uploads', ['composer/preview'], function(preview) {
text = textarea.val(),
uploadForm = postContainer.find('#fileForm');
uploadForm.attr('action', params.route);
uploadForm.attr('action', config.relative_path + params.route);
for(var i = 0; i < files.length; ++i) {
var isImage = files[i].type.match(/image./);
@@ -288,7 +288,7 @@ define('composer/uploads', ['composer/preview'], function(preview) {
spinner = postContainer.find('.topic-thumb-spinner'),
thumbForm = postContainer.find('#thumbForm');
thumbForm.attr('action', params.route);
thumbForm.attr('action', config.relative_path + params.route);
thumbForm.off('submit').submit(function() {
var csrf = $('#csrf').attr('data-csrf');

View File

@@ -320,7 +320,7 @@ var db = require('./database'),
}
category.name = validator.escape(category.name);
category.description = validator.escape(category.description);
category.backgroundImage = category.image ? nconf.get('relative_path') + category.image : '';
category.backgroundImage = category.image;
category.disabled = parseInt(category.disabled, 10) === 1;
next(null, category);