Commit bb7eed58 by Carlos de la Guardia Committed by cewing

MIT: CCX. Refactore using backbone.js

parent 96ca1da0
...@@ -317,6 +317,16 @@ def get_poc_schedule(course, poc): ...@@ -317,6 +317,16 @@ def get_poc_schedule(course, poc):
@ensure_csrf_cookie @ensure_csrf_cookie
@cache_control(no_cache=True, no_store=True, must_revalidate=True) @cache_control(no_cache=True, no_store=True, must_revalidate=True)
@coach_dashboard @coach_dashboard
def poc_schedule(request, course):
poc = get_poc_for_coach(course, request.user)
schedule = get_poc_schedule(course, poc)
json_schedule = json.dumps(schedule, indent=4)
return HttpResponse(json_schedule, mimetype='application/json')
@ensure_csrf_cookie
@cache_control(no_cache=True, no_store=True, must_revalidate=True)
@coach_dashboard
def poc_invite(request, course): def poc_invite(request, course):
""" """
Invite users to new poc Invite users to new poc
......
...@@ -1203,6 +1203,8 @@ reverify_js = [ ...@@ -1203,6 +1203,8 @@ reverify_js = [
'js/verify_student/incourse_reverify.js', 'js/verify_student/incourse_reverify.js',
] ]
pocs_js = sorted(rooted_glob(PROJECT_ROOT / 'static', 'js/pocs/**/*.js'))
PIPELINE_CSS = { PIPELINE_CSS = {
'style-vendor': { 'style-vendor': {
'source_filenames': [ 'source_filenames': [
...@@ -1396,6 +1398,10 @@ PIPELINE_JS = { ...@@ -1396,6 +1398,10 @@ PIPELINE_JS = {
'reverify': { 'reverify': {
'source_filenames': reverify_js, 'source_filenames': reverify_js,
'output_filename': 'js/reverify.js' 'output_filename': 'js/reverify.js'
},
'pocs': {
'source_filenames': pocs_js,
'output_filename': 'js/pocs.js'
} }
} }
......
...@@ -14,16 +14,6 @@ ...@@ -14,16 +14,6 @@
<%static:css group='style-course'/> <%static:css group='style-course'/>
</%block> </%block>
<%block name="jsextra">
<script src="${static.url('js/vendor/timepicker/jquery.timepicker.js')}"></script>
<link rel="stylesheet" type="text/css" href="${static.url('js/vendor/timepicker/jquery.timepicker.css')}" />
<style>
.ui-timepicker-list { z-index: 100000; }
.ui-datepicker { z-index: 100000 !important; }
input.date, input.time { width: auto !important; display: inline !important; }
</style>
</%block>
<%include file="/courseware/course_navigation.html" args="active_page='poc_coach'" /> <%include file="/courseware/course_navigation.html" args="active_page='poc_coach'" />
<section class="container"> <section class="container">
...@@ -148,5 +138,4 @@ ...@@ -148,5 +138,4 @@
$(setup_tabs); $(setup_tabs);
$(setup_management_form) $(setup_management_form)
</script> </script>
<table class="poc-schedule">
<thead>
<tr>
<th><%- gettext('Unit') %></th>
<th><%- gettext('Start Date') %></th>
<th><%- gettext('Due Date') %></th>
<th><a href="#" id="remove-all">
<i class="icon-remove-sign icon"></i> <%- gettext('remove all') %>
</a></th>
</tr>
</thead>
<tbody>
<% _.each(chapters, function(chapter) { %>
<tr class="chapter collapsed" data-location="<%= chapter.location %>" data-depth="1">
<td class="unit">
<a href="#"><i class="icon-caret-right icon toggle-collapse"></i></a>
<%= chapter.display_name %>
</td>
<td class="date start-date"><a><%= chapter.start %></a></td>
<td class="date due-date"><a><%= chapter.due %></a></td>
<td><a href="#" class="remove-unit">
<i class="icon-remove-sign icon"></i> <%- gettext('remove') %>
</a></td>
</tr>
<% _.each(chapter.children, function(child) { %>
<tr class="sequential collapsed" data-depth="2"
data-location="<%= chapter.location %> <%= child.location %>">
<td class="unit">
<a href="#"><i class="icon-caret-right icon toggle-collapse"></i></a>
<%= child.display_name %>
</td>
<td class="date start-date"><a><%= child.start %></a></td>
<td class="date due-date"><a><%= child.due %></a></td>
<td><a href="#" class="remove-unit">
<i class="icon-remove-sign icon"></i> <%- gettext('remove') %>
</a></td>
</tr>
<% _.each(child.children, function(subchild) { %>
<tr class="vertical" data-dapth="3"
data-location="<%= chapter.location %> <%= child.location %> <%= subchild.location %>">
<td class="unit">&nbsp;<%= subchild.display_name %></td>
<td class="date start-date"><a><%= subchild.start %></a></td>
<td class="date due-date"><a><%= subchild.due %></a></td>
<td><a href="#" class="remove-unit">
<i class="icon-remove-sign icon"></i> <%- gettext('remove') %>
</a></td>
<% }); %>
<% }); %>
<% }); %>
</tbody>
</table>
...@@ -351,6 +351,8 @@ if settings.COURSEWARE_ENABLED: ...@@ -351,6 +351,8 @@ if settings.COURSEWARE_ENABLED:
'pocs.views.save_poc', name='save_poc'), 'pocs.views.save_poc', name='save_poc'),
url(r'^courses/{}/poc_invite$'.format(settings.COURSE_ID_PATTERN), url(r'^courses/{}/poc_invite$'.format(settings.COURSE_ID_PATTERN),
'pocs.views.poc_invite', name='poc_invite'), 'pocs.views.poc_invite', name='poc_invite'),
url(r'^courses/{}/poc_schedule$'.format(settings.COURSE_ID_PATTERN),
'pocs.views.poc_schedule', name='poc_schedule'),
url(r'^courses/{}/poc_manage_student$'.format(settings.COURSE_ID_PATTERN), url(r'^courses/{}/poc_manage_student$'.format(settings.COURSE_ID_PATTERN),
'pocs.views.poc_student_management', name='poc_manage_student'), 'pocs.views.poc_student_management', name='poc_manage_student'),
url(r'^courses/{}/poc_gradebook$'.format(settings.COURSE_ID_PATTERN), url(r'^courses/{}/poc_gradebook$'.format(settings.COURSE_ID_PATTERN),
......
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