Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: changed survey report message location and added a new info… #34033

Merged
merged 4 commits into from
Jan 16, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lms/templates/admin/base_site.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ <h1 id="site-name"><a href="{% url 'admin:index' %}">{{ site_header|default:_('D

{% endblock %}

{% block header %}{{ block.super }}
{% block messages %}{{ block.super }}
{% include "survey_report/admin_banner.html" %}
{% endblock %}
8 changes: 7 additions & 1 deletion openedx/features/survey_report/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class SurveyReportAdmin(admin.ModelAdmin):
)

list_display = (
'id', 'summary', 'created_at', 'state'
'id', 'summary', 'created_at', 'report_state'
)

actions = ['send_report']
Expand Down Expand Up @@ -80,4 +80,10 @@ def get_actions(self, request):
del actions['delete_selected']
return actions

def report_state(self, obj):
if obj.surveyreportupload_set.last().is_uploaded():
return "Sent"
return obj.state.capitalize()
report_state.short_description = 'State'

admin.site.register(SurveyReport, SurveyReportAdmin)
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ <h1 style="margin: 0; color: #FFFF; font-weight: 600;">Join the Open edX Data Sh
{% endif %}

<!-- The original content of the block -->
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<script>
$(document).ready(function(){
$('#dismissButton').click(function() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<li>
<form method="POST" action="{% url 'openedx.generate_survey_report' %}" class="inline">
{% csrf_token %}
<input type="submit" value="Generate Report" class="default" name="_generatereport">
<input type="submit" value="Generate and Send Report" class="default" name="_sendreport">
</form>
</li>
</ul>
Expand Down