Skip to content

Commit

Permalink
feat: adds "Go to Superset" link to Instructor Dashboard plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
pomegranited committed Mar 13, 2024
1 parent c1c4e11 commit b8a34ac
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 0 deletions.
4 changes: 4 additions & 0 deletions platform_plugin_aspects/conf/locale/en/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ msgid ""
"your system administrator."
msgstr ""

#: templates/instructor_dashboard/aspects.html:10
msgid "Go to Superset"
msgstr ""

#: xblock.py:31 xblock.py:32
msgid "Display name"
msgstr ""
Expand Down
Binary file modified platform_plugin_aspects/conf/locale/eo/LC_MESSAGES/django.mo
Binary file not shown.
4 changes: 4 additions & 0 deletions platform_plugin_aspects/conf/locale/eo/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ msgstr ""
"Süpérsét ïs önlý vïsïßlé tö çöürsé stäff änd ïnstrüçtörs. Pléäsé çöntäçt "
"ýöür sýstém ädmïnïsträtör. Ⱡ'σяєм ιρѕυм ∂σłσя ѕιт αмєт#"

#: templates/instructor_dashboard/aspects.html
msgid "Go to Superset"
msgstr "Gö tö Süpérsét Ⱡ'σяєм ιρѕυм ∂σłσя ѕιт#"

#: xblock.py xblock.py
msgid "Display name"
msgstr "Dïspläý nämé Ⱡ'σяєм ιρѕυм ∂σłσя ѕ#"
Expand Down
1 change: 1 addition & 0 deletions platform_plugin_aspects/extensions/filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ def run_filter(
"section_key": BLOCK_CATEGORY,
"section_display_name": BLOCK_CATEGORY.title(),
"course_id": str(course.id),
"superset_url": str(context.get("superset_url")),
"template_path_prefix": TEMPLATE_ABSOLUTE_PATH,
}
context["sections"].append(section_data)
Expand Down
2 changes: 2 additions & 0 deletions platform_plugin_aspects/extensions/tests/test_filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ def test_run_filter(self, mock_generate_superset_context):
"""
mock_generate_superset_context.return_value = {
"sections": [],
"superset_url": "http://superset.testing",
}

context = self.filter.run_filter(self.context, self.template_name)
Expand All @@ -40,6 +41,7 @@ def test_run_filter(self, mock_generate_superset_context):
"course_id": str(self.context["course"].id),
"section_key": BLOCK_CATEGORY,
"section_display_name": BLOCK_CATEGORY.title(),
"superset_url": "http://superset.testing",
"template_path_prefix": "/instructor_dashboard/",
},
context["context"]["sections"][0],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
<%page args="section_data" expression_filter="h"/>
{% load i18n %}
<%! from openedx.core.djangolib.markup import HTML %>

<%include file="/courseware/xqa_interface.html/"/>

<section class="superset">
{% if section_data.get("superset_url") %}
<div class="superset-link">
<a href="{section_data['superset_url']}">{% trans 'Go to Superset' %}</a>
</div>
{% endif %}
${HTML(section_data['fragment'].body_html())}
</section>

0 comments on commit b8a34ac

Please sign in to comment.