From a3b8e9c3c6472f1806a0743cd346d8d440228711 Mon Sep 17 00:00:00 2001 From: Cristhian Garcia Date: Tue, 19 Mar 2024 11:50:39 -0500 Subject: [PATCH] feat: improve CSS of dashboards --- .../static/css/superset.css | 51 ++++++++++++++++++- .../static/html/superset.html | 39 +++++++------- .../static/js/embed_dashboard.js | 1 - .../instructor_dashboard/aspects.html | 2 +- 4 files changed, 72 insertions(+), 21 deletions(-) diff --git a/platform_plugin_aspects/static/css/superset.css b/platform_plugin_aspects/static/css/superset.css index e549ea4..371643a 100644 --- a/platform_plugin_aspects/static/css/superset.css +++ b/platform_plugin_aspects/static/css/superset.css @@ -1,5 +1,52 @@ -.superset-embedded-container > iframe { - height: 720px; +.superset-embedded-container>iframe { + height: 920px; width: 100%; display: block; + border: none; } + +.aspects-tabs { + position: relative; + min-height: 920px; + /* This part sucks */ + clear: both; + margin: 25px 0; +} + +.aspects-tab { + float: left; +} + +.aspects-tab label { + background: #eee; + padding: 10px; + border: 1px solid #ccc; + margin-left: -1px; + position: relative; + left: 1px; +} + +.aspects-tab [type=radio] { + display: none; +} + +.aspects-content { + position: absolute; + top: 28px; + left: 0; + background: white; + right: 0; + bottom: 0; + padding: 0; + border: 1px solid #ccc; +} + +[type=radio]:checked~label { + background: white; + border-bottom: 1px solid white; + z-index: 2; +} + +[type=radio]:checked~label~.aspects-content { + z-index: 1; +} \ No newline at end of file diff --git a/platform_plugin_aspects/static/html/superset.html b/platform_plugin_aspects/static/html/superset.html index c8ec9fe..14191bd 100644 --- a/platform_plugin_aspects/static/html/superset.html +++ b/platform_plugin_aspects/static/html/superset.html @@ -2,29 +2,34 @@ -
+

{{display_name}}

{% if exception %}

{% trans 'Superset is not configured properly. Please contact your system administrator.'%}

-

- {{exception}} -

+

{{exception}}

{% elif not dashboard_uuid and not superset_dashboards %} -

- Dashboard UUID is not set. Please set the dashboard UUID in the Studio. {{dashboard_uuid}} -

- {% elif superset_url and superset_token %} - {% if xblock_id %} -
- {% else %} - {% for dashboard in superset_dashboards %} -
-

{{dashboard.name}}

-
+

Dashboard UUID is not set. Please set the dashboard UUID in the Studio. {{dashboard_uuid}}

+ {% elif superset_url and superset_token %} {% if xblock_id %} +
+ {% else %} +
+ {% for dashboard in superset_dashboards %} +
+ {% if forloop.counter == 1 %} + + {% else %} + + {% endif %} + +
- {% endfor %} - {% endif %} +
+
+ {% endfor %} +
+ {% endif %} +