Falco
(Falco)
7월 21, 2015, 8:51오후
1
Custom emoji uploaded on a subfolder install point to wrong location, without the subfolder prefix.
diff --git a/app/models/emoji.rb b/app/models/emoji.rb
index d1dcab4..10313e4 100644
--- a/app/models/emoji.rb
+++ b/app/models/emoji.rb
@@ -47,7 +47,7 @@ class Emoji
extension = File.extname(path)
Emoji.new(path).tap do |e|
e.name = File.basename(path, ".*")
- e.url = "/#{base_url}/#{e.name}#{extension}"
+ e.url = "#{base_url}/#{e.name}#{extension}"
end
end
@@ -110,12 +110,12 @@ class Emoji
end
def self.base_directory
- "public/#{base_url}"
+ "public#{base_url}"
end
def self.base_url
db = RailsMultisite::ConnectionManagement.current_db
- "uploads/#{db}/_emoji"
+ "#{Discourse.base_uri}/uploads/#{db}/_emoji"
end
end
The patch above fix it, but I don’t know if they break non-subfolders installs.
3개의 좋아요
Possible this is a bug with subfolders, @neil can you have a look?
1개의 좋아요
neil
(Neil Lalonde)
7월 27, 2015, 8:02오후
3
Even with your fixes, the emoji upload is broken with subfolders. I’ll spend more time on it.
2개의 좋아요
Falco
(Falco)
7월 27, 2015, 10:56오후
4
On a kinda related thing about custom emoji:
Installed discourse on my company
Financial company, lots of old people
Uploaded first custom emoji with company logo
Colleague asks where emoji is on the emoji dialog
After searching a bit I say: in the hankey section
I know I can change it, but maybe use another default?
2개의 좋아요
Hmm yeah, I agree, fine, but what’s a good Emoji that means “Custom goes here?” Suggestions?
1개의 좋아요
sam
(Sam Saffron)
7월 27, 2015, 11:16오후
6
first uploaded emoji (or first non hanky) is probably a reasonable default.
1개의 좋아요
Falco
(Falco)
7월 27, 2015, 11:21오후
7
I like it, maybe put a message before first upload saying this, and we have a deal
sam
(Sam Saffron)
7월 27, 2015, 11:23오후
8
you know we accept PRs for this kind of stuff
1개의 좋아요
Falco
(Falco)
7월 27, 2015, 11:30오후
9
OK, will do this.
Just after The Internacional
1개의 좋아요
OK, I normalized what we have with Slack:
Categories are:
People (smiley)
Nature (leaf)
Food & Drink (hamburger)
Celebration (gift)
Activities (football / soccer ball)
Travel & Places (airplane)
Objects & Symbols (glasses)
I also added a tabicon field to the data structure so we can specify which emoji (by name) should be on the tab.
And I added a fullname which could be used as the tooltip or complete name displayed for the category.
important side effect (which was kinda the point of this, not just to mimic Slack’s categories although they are clearly a bit better) the custom tab finally has only truly custom Emoji…
… not the confusing, weird mish-mash of “not categorized” official unicode Emoji and custom it had before. That was a bug in my opinion.
3개의 좋아요
Ok, @techapj did the last part of this – we can select which emoji is on each tab, and there is a proper category name + tooltip.
2개의 좋아요
neil
(Neil Lalonde)
8월 24, 2015, 8:27오후
12
FYI I added this fix for uploading emoji’s on a subfolder install.
3개의 좋아요
Falco
(Falco)
8월 24, 2015, 10:24오후
13
Just found it here . Good to know that my patch was useful
3개의 좋아요