mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 21:10:17 +08:00
Fix for reply to user avatar and picture uploading not working when editing post with discourse running in a prefix
This commit is contained in:
parent
5273657537
commit
0481fbae8c
|
@ -53,7 +53,7 @@ Discourse.Utilities = {
|
||||||
if (template) {
|
if (template) {
|
||||||
return template.replace(/\{size\}/g, rawSize);
|
return template.replace(/\{size\}/g, rawSize);
|
||||||
}
|
}
|
||||||
return "/users/" + (username.toLowerCase()) + "/avatar/" + rawSize + "?__ws=" + (encodeURIComponent(Discourse.BaseUrl || ""));
|
return Discourse.getURL("/users/") + (username.toLowerCase()) + "/avatar/" + rawSize + "?__ws=" + (encodeURIComponent(Discourse.BaseUrl || ""));
|
||||||
},
|
},
|
||||||
|
|
||||||
avatarImg: function(options) {
|
avatarImg: function(options) {
|
||||||
|
|
|
@ -270,7 +270,7 @@ Discourse.ComposerView = Discourse.View.extend({
|
||||||
$uploadTarget.off();
|
$uploadTarget.off();
|
||||||
|
|
||||||
$uploadTarget.fileupload({
|
$uploadTarget.fileupload({
|
||||||
url: '/uploads',
|
url: Discourse.getURL('/uploads'),
|
||||||
dataType: 'json',
|
dataType: 'json',
|
||||||
timeout: 20000,
|
timeout: 20000,
|
||||||
formData: { topic_id: 1234 }
|
formData: { topic_id: 1234 }
|
||||||
|
|
|
@ -48,7 +48,7 @@ class Upload < ActiveRecord::Base
|
||||||
File.open("#{path}/#{clean_name}", "wb") do |f|
|
File.open("#{path}/#{clean_name}", "wb") do |f|
|
||||||
f.write File.read(file.tempfile)
|
f.write File.read(file.tempfile)
|
||||||
end
|
end
|
||||||
upload.url = "#{url_root}/#{clean_name}"
|
upload.url = Discourse::base_uri + "#{url_root}/#{clean_name}"
|
||||||
upload.save
|
upload.save
|
||||||
|
|
||||||
upload
|
upload
|
||||||
|
|
Loading…
Reference in New Issue
Block a user