From a7ebb30ae19b9ccc278ce4d90d96f4ac1110665b Mon Sep 17 00:00:00 2001 From: Muhammad Labeeb Date: Thu, 13 Feb 2025 14:38:17 +0500 Subject: [PATCH] add non store plugins to dashboard --- tutordash/server/app.py | 19 ++++++++++++++----- tutordash/server/static/scss/dash.scss | 5 +++++ 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/tutordash/server/app.py b/tutordash/server/app.py index 0bf30ce..4c0e918 100644 --- a/tutordash/server/app.py +++ b/tutordash/server/app.py @@ -74,16 +74,25 @@ async def plugin_store() -> str: async def installed_plugins() -> str: installed_plugins = tutorclient.Client.installed_plugins() enabled_plugins = tutorclient.Client.enabled_plugins() - plugins: list[dict[str, str]] = [ - { - "name": p.name, + store_plugins: dict[str, dict[str, str]] = { + p.name: { "url": p.url, "index": p.index, "author": p.author.split('<')[0].strip(), "description": markdown(p.description), - "is_enabled": p.name in enabled_plugins, } - for p in tutorclient.Client.plugins_in_store() if p.name in installed_plugins + for p in tutorclient.Client.plugins_in_store() + } + plugins: list[dict[str, str]] = [ + { + "name": plugin_name, + "url": store_plugins[plugin_name]["url"] if plugin_name in store_plugins else "", + "index": store_plugins[plugin_name]["index"] if plugin_name in store_plugins else "", + "author": store_plugins[plugin_name]["author"].split('<')[0].strip() if plugin_name in store_plugins else "", + "description": markdown(store_plugins[plugin_name]["description"]) if plugin_name in store_plugins else "", + "is_enabled": plugin_name in enabled_plugins, + } + for plugin_name in installed_plugins ] return await render_template( "installed_plugins.html", diff --git a/tutordash/server/static/scss/dash.scss b/tutordash/server/static/scss/dash.scss index 05c9734..6484eda 100644 --- a/tutordash/server/static/scss/dash.scss +++ b/tutordash/server/static/scss/dash.scss @@ -187,6 +187,11 @@ body { a { text-decoration: none; text-transform: capitalize; + + &:visited { + text-decoration: none; + color: $blue; + } } } .author {