Merge pull request #34110 from openedx/revert-34033-ase/refactor-survey-report
Revert "refactor: changed survey report message location and added a new info…"
This commit is contained in:
@@ -21,6 +21,6 @@
|
||||
|
||||
{% endblock %}
|
||||
|
||||
{% block messages %}{{ block.super }}
|
||||
{% block header %}{{ block.super }}
|
||||
{% include "survey_report/admin_banner.html" %}
|
||||
{% endblock %}
|
||||
{% endblock %}
|
||||
@@ -21,7 +21,7 @@ class SurveyReportAdmin(admin.ModelAdmin):
|
||||
)
|
||||
|
||||
list_display = (
|
||||
'id', 'summary', 'created_at', 'report_state'
|
||||
'id', 'summary', 'created_at', 'state'
|
||||
)
|
||||
|
||||
actions = ['send_report']
|
||||
@@ -80,16 +80,4 @@ 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)
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
{% block survey_report_banner %}
|
||||
{% if show_survey_report_banner %}
|
||||
{% load static %}
|
||||
<div id="originalContent" style="border: 3px solid #06405d; margin-bottom: 50px; rgb(0 0 0 / 18%) 0px 3px 5px;">
|
||||
<div style="background-color: #06405d;padding: 17px 37px;">
|
||||
<h1 style="margin: 0; color: #FFFF; font-weight: 600;">Join the Open edX Data Sharing Initiative and shape the future of learning</h1>
|
||||
@@ -32,7 +31,6 @@
|
||||
{% endif %}
|
||||
|
||||
<!-- The original content of the block -->
|
||||
<script type="text/javascript" src="{% static 'common/js/vendor/jquery.js' %}"></script>
|
||||
<script>
|
||||
$(document).ready(function(){
|
||||
$('#dismissButton').click(function() {
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<li>
|
||||
<form method="POST" action="{% url 'openedx.generate_survey_report' %}" class="inline">
|
||||
{% csrf_token %}
|
||||
<input type="submit" value="Generate and Send Report" class="default" name="_sendreport">
|
||||
<input type="submit" value="Generate Report" class="default" name="_generatereport">
|
||||
</form>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
Reference in New Issue
Block a user