Merge pull request #76 from dod-ccpo/ui/icons

Icons!
This commit is contained in:
andrewdds
2018-07-18 11:26:10 -04:00
committed by GitHub
30 changed files with 114 additions and 21 deletions

View File

@@ -15,10 +15,10 @@ from atst.handlers.dev import Dev
from atst.home import home
from atst.api_client import ApiClient
from atst.sessions import RedisSessions
from atst import ui_modules
ENV = os.getenv("TORNADO_ENV", "dev")
def make_app(config, deps, **kwargs):
routes = [
@@ -100,6 +100,7 @@ def make_app(config, deps, **kwargs):
static_path=home.child("static"),
cookie_secret=config["default"]["COOKIE_SECRET"],
debug=config["default"].getboolean("DEBUG"),
ui_modules=ui_modules,
**kwargs,
)
app.config = config

7
atst/ui_modules.py Normal file
View File

@@ -0,0 +1,7 @@
from tornado.web import UIModule
class Icon(UIModule):
def render(self, name, classes=''):
with open('static/icons/%s.svg' % name) as svg:
return self.render_string(
"components/icon.html.to", svg=svg.read(), name=name, classes=classes)