2014-04-06 22:45:43 +00:00
|
|
|
# -*- coding: utf-8 -*-
|
2015-07-10 07:27:13 +00:00
|
|
|
from __future__ import unicode_literals, absolute_import
|
2014-04-06 22:45:43 +00:00
|
|
|
|
|
|
|
"""Endpoints for the commenting subsystem."""
|
|
|
|
|
|
|
|
from flask import Blueprint, g
|
|
|
|
|
|
|
|
import rophako.model.emoticons as Emoticons
|
|
|
|
from rophako.utils import template
|
2014-12-04 23:06:44 +00:00
|
|
|
from rophako.settings import Config
|
2014-04-06 22:45:43 +00:00
|
|
|
|
|
|
|
mod = Blueprint("emoticons", __name__, url_prefix="/emoticons")
|
|
|
|
|
|
|
|
|
|
|
|
@mod.route("/")
|
|
|
|
def index():
|
|
|
|
"""List the available emoticons."""
|
|
|
|
theme = Emoticons.load_theme()
|
|
|
|
|
|
|
|
smileys = []
|
|
|
|
for img in sorted(theme["map"]):
|
|
|
|
smileys.append({
|
|
|
|
"img": img,
|
|
|
|
"triggers": theme["map"][img],
|
|
|
|
})
|
|
|
|
|
2014-12-04 23:06:44 +00:00
|
|
|
g.info["theme"] = Config.emoticons.theme
|
2014-04-06 22:45:43 +00:00
|
|
|
g.info["theme_name"] = theme["name"]
|
|
|
|
g.info["smileys"] = smileys
|
2014-12-04 23:06:44 +00:00
|
|
|
return template("emoticons/index.html")
|