Commit ac7b0334 by Don Mitchell

Code review changes.

parent 0b762fa3
......@@ -352,7 +352,6 @@ def assignment_type_update(request, org, course, category, name):
raise HttpResponseForbidden()
if request.method == 'GET':
# Cannot just do a get w/o knowing the course name :-(
return HttpResponse(json.dumps(CourseGradingModel.get_section_grader_type(location)),
mimetype="application/json")
elif request.method == 'POST': # post or put, doesn't matter.
......
......@@ -37,7 +37,6 @@ CMS.Models.Location = Backbone.Model.extend({
org: this._fieldPattern.exec(payload)[0],
course: this._fieldPattern.exec(payload)[0],
category: this._fieldPattern.exec(payload)[0],
// FIXME handle no trailing /
name: this._fieldPattern.exec(payload)[0]
}
}
......
CMS.Models.AssignmentGrade = Backbone.Model.extend({
idAttribute : "cid", // not sure if this is kosher
defaults : {
graderType : null, // the type label (string). May be "Not Graded" which implies None. I'd like to use id but that's ephemeral
location : null // A location object
......@@ -35,7 +34,7 @@ CMS.Views.OverviewAssignmentGrader = Backbone.View.extend({
this.template = _.template(
// TODO move to a template file
'<h4 class="status-label"><%= assignmentType %></h4>' +
'<a data-tooltip="Mark/unmark this section as graded" class="menu-toggle" href="#">' +
'<a data-tooltip="Mark/unmark this subsection as graded" class="menu-toggle" href="#">' +
'<span class="ss-icon ss-standard">&#x2713;</span>' +
'</a>' +
'<ul class="menu">' +
......
......@@ -124,11 +124,11 @@
<script src="${static.url('js/vendor/timepicker/datepair.js')}"></script>
<script src="${static.url('js/vendor/date.js')}"></script>
<script type="text/javascript">
(function() {
$body = $('body');
$('.gradable-status .menu-toggle').bind('click', showGradeMenu);
$('.gradable-status .menu').bind('click', selectGradeType);
})();
// (function() {
// $body = $('body');
// $('.gradable-status .menu-toggle').bind('click', showGradeMenu);
// $('.gradable-status .menu').bind('click', selectGradeType);
// })();
$(document).ready(function() {
// expand the due-date area if the values are set
......@@ -140,33 +140,25 @@
})
// grading status
function showGradeMenu(e) {
// function selectGradeType(e) {
// e.preventDefault();
$section = $(this).closest('.gradable-status');
e.preventDefault();
$section.toggleClass('is-active');
}
function selectGradeType(e) {
e.preventDefault();
var $section = $(this).closest('.gradable-status');
$section.find('.menu li a').removeClass('is-selected');
// var $section = $(this).closest('.gradable-status');
// $section.find('.menu li a').removeClass('is-selected');
var $target = $(e.target).addClass('is-selected');
var $label = $section.find('.status-label');
// var $target = $(e.target).addClass('is-selected');
// var $label = $section.find('.status-label');
$section.removeClass('is-active');
$label.html($target.html());
// $section.removeClass('is-active');
// $label.html($target.html());
if ($target.hasClass('gradable-status-notgraded')) {
$section.removeClass('is-set');
}
else {
$section.addClass('is-set');
}
}
// if ($target.hasClass('gradable-status-notgraded')) {
// $section.removeClass('is-set');
// }
// else {
// $section.addClass('is-set');
// }
// }
</script>
</%block>
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