diff --git a/lms/templates/admin/base_site.html b/lms/templates/admin/base_site.html index fa93f9c3e8..2dfd0bef7a 100644 --- a/lms/templates/admin/base_site.html +++ b/lms/templates/admin/base_site.html @@ -21,6 +21,6 @@ {% endblock %} -{% block header %}{{ block.super }} +{% block messages %}{{ block.super }} {% include "survey_report/admin_banner.html" %} -{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/openedx/features/survey_report/admin.py b/openedx/features/survey_report/admin.py index f2a422de2e..8d4652282b 100644 --- a/openedx/features/survey_report/admin.py +++ b/openedx/features/survey_report/admin.py @@ -21,7 +21,7 @@ class SurveyReportAdmin(admin.ModelAdmin): ) list_display = ( - 'id', 'summary', 'created_at', 'state' + 'id', 'summary', 'created_at', 'report_state' ) actions = ['send_report'] @@ -80,4 +80,16 @@ class SurveyReportAdmin(admin.ModelAdmin): del actions['delete_selected'] return actions + def report_state(self, obj): + """ + Method to define the custom State column with the new "send" state, + to avoid modifying the current models. + """ + try: + if obj.surveyreportupload_set.last().is_uploaded(): + return "Sent" + except AttributeError: + return obj.state.capitalize() + report_state.short_description = 'State' + admin.site.register(SurveyReport, SurveyReportAdmin) diff --git a/openedx/features/survey_report/templates/survey_report/admin_banner.html b/openedx/features/survey_report/templates/survey_report/admin_banner.html index 6a8e2ea92e..e881966f14 100644 --- a/openedx/features/survey_report/templates/survey_report/admin_banner.html +++ b/openedx/features/survey_report/templates/survey_report/admin_banner.html @@ -1,5 +1,6 @@ {% block survey_report_banner %} {% if show_survey_report_banner %} +{% load static %}

Join the Open edX Data Sharing Initiative and shape the future of learning

@@ -31,6 +32,7 @@ {% endif %} +