diff --git a/storm/__main__.py b/storm/__main__.py index 8381cac..7f0b323 100644 --- a/storm/__main__.py +++ b/storm/__main__.py @@ -295,7 +295,7 @@ def backup(target_file, config=None): @command('web') @arg('port', nargs='?', default=9002, type=int) -@arg('theme', nargs='?', default="modern") +@arg('theme', nargs='?', default="modern", choices=['modern', 'black', 'storm']) @arg('debug', action='store_true', default=False) def web(port, debug=False, theme="modern", ssh_config=None): """Starts the web UI.""" diff --git a/storm/web.py b/storm/web.py index 8b6133b..2661d90 100644 --- a/storm/web.py +++ b/storm/web.py @@ -11,16 +11,15 @@ app = Flask(__name__) __THEME__ = "modern" + def render(template, theme): static_dir = os.path.dirname(os.path.abspath(__file__)) path = os.path.join(static_dir, 'templates', template) with open(path) as fobj: content = fobj.read() - if 'theme' in request.args: - theme = request.args.get('theme') + content = content.replace('__THEME__', request.args.get('theme', theme)) - content = content.replace("__THEME__", theme) return make_response(content)