Commit b315b4d7 by Carlos de la Guardia Committed by cewing

MIT: CCX. Fixes for issues identified in code review

Switch to font awesome icons, to fix issue with toggling collapsible sections of the schedule in ccx coach dashboard

Ensure access check takes place after descriptor is bound to the user, or field override checks will never happen
parent 9ddee934
...@@ -675,12 +675,6 @@ def get_module_for_descriptor_internal(user, descriptor, field_data_cache, cours ...@@ -675,12 +675,6 @@ def get_module_for_descriptor_internal(user, descriptor, field_data_cache, cours
request_token (str): A unique token for this request, used to isolate xblock rendering request_token (str): A unique token for this request, used to isolate xblock rendering
""" """
# Do not check access when it's a noauth request.
if getattr(user, 'known', True):
# Short circuit--if the user shouldn't have access, bail without doing any work
if not has_access(user, 'load', descriptor, course_id):
return None
(system, student_data) = get_module_system_for_user( (system, student_data) = get_module_system_for_user(
user=user, user=user,
field_data_cache=field_data_cache, # These have implicit user bindings, the rest of args are considered not to field_data_cache=field_data_cache, # These have implicit user bindings, the rest of args are considered not to
......
...@@ -292,13 +292,13 @@ var edx = edx || {}; ...@@ -292,13 +292,13 @@ var edx = edx || {};
var children = self.get_children(row); var children = self.get_children(row);
if (row.is('.expanded')) { if (row.is('.expanded')) {
$(this).removeClass('icon-caret-down').addClass('icon-caret-right'); $(this).removeClass('fa-caret-down').addClass('fa-caret-right');
row.removeClass('expanded').addClass('collapsed'); row.removeClass('expanded').addClass('collapsed');
children.hide(); children.hide();
} }
else { else {
$(this).removeClass('icon-caret-right').addClass('icon-caret-down'); $(this).removeClass('fa-caret-right').addClass('fa-caret-down');
row.removeClass('collapsed').addClass('expanded'); row.removeClass('collapsed').addClass('expanded');
children.filter('.collapsed').each(function() { children.filter('.collapsed').each(function() {
children = children.not(self.get_children(this)); children = children.not(self.get_children(this));
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
<section id="enter-date-modal" class="modal" aria-hidden="true"> <section id="enter-date-modal" class="modal" aria-hidden="true">
<div class="inner-wrapper" role="dialog"> <div class="inner-wrapper" role="dialog">
<button class="close-modal"> <button class="close-modal">
<i class="icon-remove"></i> <i class="fa-remove"></i>
<span class="sr"> <span class="sr">
${_("Close")} ${_("Close")}
</span> </span>
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<th><%- gettext('Start Date') %></th> <th><%- gettext('Start Date') %></th>
<th><%- gettext('Due Date') %></th> <th><%- gettext('Due Date') %></th>
<th><a href="#" id="remove-all"> <th><a href="#" id="remove-all">
<i class="icon-remove-sign icon"></i> <%- gettext('remove all') %> <i class="fa fa-remove"></i> <%- gettext('remove all') %>
</a></th> </a></th>
</tr> </tr>
</thead> </thead>
...@@ -13,26 +13,26 @@ ...@@ -13,26 +13,26 @@
<% _.each(chapters, function(chapter) { %> <% _.each(chapters, function(chapter) { %>
<tr class="chapter collapsed" data-location="<%= chapter.location %>" data-depth="1"> <tr class="chapter collapsed" data-location="<%= chapter.location %>" data-depth="1">
<td class="unit"> <td class="unit">
<a href="#"><i class="icon-caret-right icon toggle-collapse"></i></a> <a href="#"><i class="fa fa-caret-right toggle-collapse"></i></a>
<%= chapter.display_name %> <%= chapter.display_name %>
</td> </td>
<td class="date start-date"><a><%= chapter.start %></a></td> <td class="date start-date"><a><%= chapter.start %></a></td>
<td class="date due-date"><a><%= chapter.due %></a></td> <td class="date due-date"><a><%= chapter.due %></a></td>
<td><a href="#" class="remove-unit"> <td><a href="#" class="remove-unit">
<i class="icon-remove-sign icon"></i> <%- gettext('remove') %> <i class="fa fa-remove"></i> <%- gettext('remove') %>
</a></td> </a></td>
</tr> </tr>
<% _.each(chapter.children, function(child) { %> <% _.each(chapter.children, function(child) { %>
<tr class="sequential collapsed" data-depth="2" <tr class="sequential collapsed" data-depth="2"
data-location="<%= chapter.location %> <%= child.location %>"> data-location="<%= chapter.location %> <%= child.location %>">
<td class="unit"> <td class="unit">
<a href="#"><i class="icon-caret-right icon toggle-collapse"></i></a> <a href="#"><i class="fa fa-caret-right toggle-collapse"></i></a>
<%= child.display_name %> <%= child.display_name %>
</td> </td>
<td class="date start-date"><a><%= child.start %></a></td> <td class="date start-date"><a><%= child.start %></a></td>
<td class="date due-date"><a><%= child.due %></a></td> <td class="date due-date"><a><%= child.due %></a></td>
<td><a href="#" class="remove-unit"> <td><a href="#" class="remove-unit">
<i class="icon-remove-sign icon"></i> <%- gettext('remove') %> <i class="fa fa-remove"></i> <%- gettext('remove') %>
</a></td> </a></td>
</tr> </tr>
<% _.each(child.children, function(subchild) { %> <% _.each(child.children, function(subchild) { %>
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
<td class="date start-date"><a><%= subchild.start %></a></td> <td class="date start-date"><a><%= subchild.start %></a></td>
<td class="date due-date"><a><%= subchild.due %></a></td> <td class="date due-date"><a><%= subchild.due %></a></td>
<td><a href="#" class="remove-unit"> <td><a href="#" class="remove-unit">
<i class="icon-remove-sign icon"></i> <%- gettext('remove') %> <i class="fa fa-remove"></i> <%- gettext('remove') %>
</a></td> </a></td>
<% }); %> <% }); %>
<% }); %> <% }); %>
......
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