diff --git a/lms/templates/admin/base_site.html b/lms/templates/admin/base_site.html index fa93f9c3e84a..2dfd0bef7a50 100644 --- a/lms/templates/admin/base_site.html +++ b/lms/templates/admin/base_site.html @@ -21,6 +21,6 @@

{{ site_header|default:_('D {% 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 f2a422de2ef8..8d4652282b5f 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 @@ def get_actions(self, request): 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 6a8e2ea92e8c..e881966f146f 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 @@

Join the Open edX Data Sh {% endif %} +