diff --git a/plugin_loader/loader.py b/plugin_loader/loader.py index d74eed51..231fe07b 100644 --- a/plugin_loader/loader.py +++ b/plugin_loader/loader.py @@ -43,7 +43,8 @@ class Loader: web.get("/plugins/iframe", self.plugin_iframe_route), web.get("/plugins/reload", self.reload_plugins), web.post("/plugins/method_call", self.handle_plugin_method_call), - web.get("/plugins/load/{name}", self.load_plugin), + web.get("/plugins/load_main/{name}", self.load_plugin_main_view), + web.get("/plugins/load_tile/{name}", self.load_plugin_tile_view), web.get("/steam_resource/{path:.+}", self.get_steam_resource) ]) @@ -94,7 +95,7 @@ class Loader: except Exception as e: return web.Response(text=str(e), status=400) - async def load_plugin(self, request): + async def load_plugin_main_view(self, request): plugin = self.plugins[request.match_info["name"]] ret = """ @@ -103,6 +104,24 @@ class Loader: """.format(plugin.name, plugin.main_view_html) return web.Response(text=ret, content_type="text/html") + async def load_plugin_tile_view(self, request): + plugin = self.plugins[request.match_info["name"]] + ret = """ + + + + + + + + + + {content} + + + """.format(name=plugin.name, content=plugin.tile_view_html) + return web.Response(text=ret, content_type="text/html") + @template('plugin_view.html') async def plugin_iframe_route(self, request): return {"plugins": self.plugins.values()} diff --git a/plugin_loader/templates/plugin_view.html b/plugin_loader/templates/plugin_view.html index d0275a7a..895931c4 100644 --- a/plugin_loader/templates/plugin_view.html +++ b/plugin_loader/templates/plugin_view.html @@ -1,13 +1,21 @@ - + {% if not plugins|length %} -
+
No plugins installed :( -
+
{% endif %} @@ -15,15 +23,42 @@
{% for plugin in plugins %} {% if plugin.tile_view_html|length %} -
- {{ plugin.tile_view_html|safe }} +
+ +
{% else %}
-
+
- -
+ +
{% endif %}