Fix emoji on enterprise.

static/ doesn't exist on enterprise, so we can't get the list from the
files there.

(imported from commit ce34a62478abf541feb013da4f970dac3c09d98a)
This commit is contained in:
Kevin Mehall
2013-11-14 10:36:29 -05:00
parent c24addf2d5
commit b469066e66
2 changed files with 12 additions and 3 deletions

View File

@@ -53,6 +53,9 @@ echo $GITID > build_id
echo $version > version
mv update-prod-static.log ..
# We don't need duplicate copies of emoji with hashed paths, and they would break bugdown
find prod-static/serve/third/gemoji/images/emoji/ -regex '.*\.[0-9a-f]+\.png' -delete
cd $TMPDIR
tar --append -f $TARBALL $prefix/prod-static $prefix/build_id $prefix/version

View File

@@ -351,11 +351,17 @@ class Avatar(markdown.inlinepatterns.Pattern):
img.set('alt', email_address)
return img
path_to_emoji = os.path.join(os.path.dirname(__file__), '..', '..', '..',
# This should be the root
'static', 'third', 'gemoji', 'images', 'emoji', '*.png')
if settings.ENTERPRISE:
path_to_emoji = os.path.join(os.path.dirname(__file__), '..', '..', '..',
'prod-static', 'serve', 'third', 'gemoji', 'images', 'emoji', '*.png')
else:
path_to_emoji = os.path.join(os.path.dirname(__file__), '..', '..', '..',
# This should be the root
'static', 'third', 'gemoji', 'images', 'emoji', '*.png')
emoji_list = [os.path.splitext(os.path.basename(fn))[0] for fn in glob.glob(path_to_emoji)]
def make_emoji(emoji_name, src, display_string):
elt = markdown.util.etree.Element('img')
elt.set('src', src)