Merge pull request #4848 from Stanford-Online/njdupoux/no-pending-instructor-tasks
Instructor Dash: Display message when no tasks running
This commit is contained in:
@@ -268,7 +268,9 @@ class PendingInstructorTasks
|
||||
### Pending Instructor Tasks Section ####
|
||||
constructor: (@$section) ->
|
||||
# Currently running tasks
|
||||
@$running_tasks_section = find_and_assert @$section, ".running-tasks-section"
|
||||
@$table_running_tasks = find_and_assert @$section, ".running-tasks-table"
|
||||
@$no_tasks_message = find_and_assert @$section, ".no-pending-tasks-message"
|
||||
|
||||
# start polling for task list
|
||||
# if the list is in the DOM
|
||||
@@ -287,8 +289,14 @@ class PendingInstructorTasks
|
||||
success: (data) =>
|
||||
if data.tasks.length
|
||||
create_task_list_table @$table_running_tasks, data.tasks
|
||||
@$no_tasks_message.hide()
|
||||
@$running_tasks_section.show()
|
||||
else
|
||||
console.log "No pending instructor tasks to display"
|
||||
@$running_tasks_section.hide()
|
||||
@$no_tasks_message.empty()
|
||||
@$no_tasks_message.append $('<p>').text gettext("No tasks currently running.")
|
||||
@$no_tasks_message.show()
|
||||
error: std_ajax_err => console.error "Error finding pending instructor tasks to display"
|
||||
### /Pending Instructor Tasks Section ####
|
||||
|
||||
|
||||
@@ -224,6 +224,18 @@ section.instructor-dashboard-content-2 {
|
||||
.basic-data {
|
||||
padding: 6px;
|
||||
}
|
||||
|
||||
.running-tasks-section {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.no-pending-tasks-message {
|
||||
display: none;
|
||||
p {
|
||||
color: #a2a2a2;
|
||||
font-style: italic;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -76,10 +76,13 @@
|
||||
<div class="running-tasks-container action-type-container">
|
||||
<hr>
|
||||
<h2> ${_("Pending Instructor Tasks")} </h2>
|
||||
<p>${_("The status for any active tasks appears in a table below.")} </p>
|
||||
<br />
|
||||
<div class="running-tasks-section">
|
||||
<p>${_("The status for any active tasks appears in a table below.")} </p>
|
||||
<br />
|
||||
|
||||
<div class="running-tasks-table" data-endpoint="${ section_data['list_instructor_tasks_url'] }"></div>
|
||||
<div class="running-tasks-table" data-endpoint="${ section_data['list_instructor_tasks_url'] }"></div>
|
||||
</div>
|
||||
<div class="no-pending-tasks-message"></div>
|
||||
</div>
|
||||
|
||||
%endif
|
||||
|
||||
@@ -69,8 +69,11 @@
|
||||
<div class="running-tasks-container action-type-container">
|
||||
<hr>
|
||||
<h2> ${_("Pending Instructor Tasks")} </h2>
|
||||
<p>${_("The status for any active tasks appears in a table below.")} </p>
|
||||
<br />
|
||||
<div class="running-tasks-table" data-endpoint="${ section_data['list_instructor_tasks_url'] }"></div>
|
||||
<div class="running-tasks-section">
|
||||
<p>${_("The status for any active tasks appears in a table below.")} </p>
|
||||
<br />
|
||||
<div class="running-tasks-table" data-endpoint="${ section_data['list_instructor_tasks_url'] }"></div>
|
||||
</div>
|
||||
<div class="no-pending-tasks-message"></div>
|
||||
</div>
|
||||
%endif
|
||||
|
||||
@@ -59,10 +59,13 @@
|
||||
<div class="running-tasks-container action-type-container">
|
||||
<hr>
|
||||
<h2> ${_("Pending Instructor Tasks")} </h2>
|
||||
<p>${_("Email actions run in the background. The status for any active tasks - including email tasks - appears in a table below.")} </p>
|
||||
<br />
|
||||
<div class="running-tasks-section">
|
||||
<p>${_("Email actions run in the background. The status for any active tasks - including email tasks - appears in a table below.")} </p>
|
||||
<br />
|
||||
|
||||
<div class="running-tasks-table" data-endpoint="${ section_data['list_instructor_tasks_url'] }"></div>
|
||||
<div class="running-tasks-table" data-endpoint="${ section_data['list_instructor_tasks_url'] }"></div>
|
||||
</div>
|
||||
<div class="no-pending-tasks-message"></div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
@@ -117,10 +117,13 @@
|
||||
<div class="running-tasks-container action-type-container">
|
||||
<hr>
|
||||
<h2> ${_("Pending Instructor Tasks")} </h2>
|
||||
<p>${_("The status for any active tasks appears in a table below.")} </p>
|
||||
<br />
|
||||
<div class="running-tasks-section">
|
||||
<p>${_("The status for any active tasks appears in a table below.")} </p>
|
||||
<br />
|
||||
|
||||
<div class="running-tasks-table" data-endpoint="${ section_data['list_instructor_tasks_url'] }"></div>
|
||||
<div class="running-tasks-table" data-endpoint="${ section_data['list_instructor_tasks_url'] }"></div>
|
||||
</div>
|
||||
<div class="no-pending-tasks-message"></div>
|
||||
</div>
|
||||
|
||||
%endif
|
||||
|
||||
Reference in New Issue
Block a user