Commit b6f82a94 by Sarina Canelake

Merge pull request #4848 from Stanford-Online/njdupoux/no-pending-instructor-tasks

Instructor Dash: Display message when no tasks running 
parents ccf85a94 93d08850
...@@ -268,7 +268,9 @@ class PendingInstructorTasks ...@@ -268,7 +268,9 @@ class PendingInstructorTasks
### Pending Instructor Tasks Section #### ### Pending Instructor Tasks Section ####
constructor: (@$section) -> constructor: (@$section) ->
# Currently running tasks # Currently running tasks
@$running_tasks_section = find_and_assert @$section, ".running-tasks-section"
@$table_running_tasks = find_and_assert @$section, ".running-tasks-table" @$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 # start polling for task list
# if the list is in the DOM # if the list is in the DOM
...@@ -287,8 +289,14 @@ class PendingInstructorTasks ...@@ -287,8 +289,14 @@ class PendingInstructorTasks
success: (data) => success: (data) =>
if data.tasks.length if data.tasks.length
create_task_list_table @$table_running_tasks, data.tasks create_task_list_table @$table_running_tasks, data.tasks
@$no_tasks_message.hide()
@$running_tasks_section.show()
else else
console.log "No pending instructor tasks to display" 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" error: std_ajax_err => console.error "Error finding pending instructor tasks to display"
### /Pending Instructor Tasks Section #### ### /Pending Instructor Tasks Section ####
......
...@@ -224,6 +224,18 @@ section.instructor-dashboard-content-2 { ...@@ -224,6 +224,18 @@ section.instructor-dashboard-content-2 {
.basic-data { .basic-data {
padding: 6px; padding: 6px;
} }
.running-tasks-section {
display: none;
}
.no-pending-tasks-message {
display: none;
p {
color: #a2a2a2;
font-style: italic;
}
}
} }
} }
......
...@@ -76,10 +76,13 @@ ...@@ -76,10 +76,13 @@
<div class="running-tasks-container action-type-container"> <div class="running-tasks-container action-type-container">
<hr> <hr>
<h2> ${_("Pending Instructor Tasks")} </h2> <h2> ${_("Pending Instructor Tasks")} </h2>
<p>${_("The status for any active tasks appears in a table below.")} </p> <div class="running-tasks-section">
<br /> <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> </div>
%endif %endif
......
...@@ -69,8 +69,11 @@ ...@@ -69,8 +69,11 @@
<div class="running-tasks-container action-type-container"> <div class="running-tasks-container action-type-container">
<hr> <hr>
<h2> ${_("Pending Instructor Tasks")} </h2> <h2> ${_("Pending Instructor Tasks")} </h2>
<p>${_("The status for any active tasks appears in a table below.")} </p> <div class="running-tasks-section">
<br /> <p>${_("The status for any active tasks appears in a table below.")} </p>
<div class="running-tasks-table" data-endpoint="${ section_data['list_instructor_tasks_url'] }"></div> <br />
<div class="running-tasks-table" data-endpoint="${ section_data['list_instructor_tasks_url'] }"></div>
</div>
<div class="no-pending-tasks-message"></div>
</div> </div>
%endif %endif
...@@ -59,10 +59,13 @@ ...@@ -59,10 +59,13 @@
<div class="running-tasks-container action-type-container"> <div class="running-tasks-container action-type-container">
<hr> <hr>
<h2> ${_("Pending Instructor Tasks")} </h2> <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> <div class="running-tasks-section">
<br /> <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> </div>
......
...@@ -117,10 +117,13 @@ ...@@ -117,10 +117,13 @@
<div class="running-tasks-container action-type-container"> <div class="running-tasks-container action-type-container">
<hr> <hr>
<h2> ${_("Pending Instructor Tasks")} </h2> <h2> ${_("Pending Instructor Tasks")} </h2>
<p>${_("The status for any active tasks appears in a table below.")} </p> <div class="running-tasks-section">
<br /> <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> </div>
%endif %endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment