Commit 0b762fa3 by Don Mitchell

Remove ability to set gradability at the section level (commented out

until we decide the inheritance) 
Remove Policy from subsection editor
Commented out Graded as: _____ from subsection settings 
Fix menu dismissa
Fix ambiguous selection
parent 0fc16dff
......@@ -28,7 +28,7 @@ CMS.Views.OverviewAssignmentGrader = Backbone.View.extend({
// instantiate w/ { graders : CourseGraderCollection, el : <the gradable-status div> }
events : {
"click .menu-toggle" : "showGradeMenu",
"click .menu" : "selectGradeType"
"click .menu li" : "selectGradeType"
},
initialize : function() {
// call template w/ {assignmentType : formatname, graders : CourseGraderCollection instance }
......@@ -49,6 +49,13 @@ CMS.Views.OverviewAssignmentGrader = Backbone.View.extend({
graderType : this.$el.data('initial-status')});
// TODO throw exception if graders is null
this.graders = this.options['graders'];
var cachethis = this;
// defining here to get closure around this
this.removeMenu = function(e) {
e.preventDefault();
cachethis.$el.removeClass('is-active');
$(document).off('click', cachethis.removeMenu);
}
this.render();
},
render : function() {
......@@ -62,12 +69,16 @@ CMS.Views.OverviewAssignmentGrader = Backbone.View.extend({
},
showGradeMenu : function(e) {
e.preventDefault();
this.$el.toggleClass('is-active');
// I sure hope this doesn't break anything but it's needed to keep the removeMenu from activating
e.stopPropagation();
// nasty global event trap :-(
$(document).on('click', this.removeMenu);
this.$el.addClass('is-active');
},
selectGradeType : function(e) {
e.preventDefault();
this.$el.toggleClass('is-active');
this.removeMenu(e);
// TODO I'm not happy with this string fetch via the html for what should be an id. I'd rather use the id attr
// of the CourseGradingPolicy model or null for Not Graded (NOTE, change template's if check for is-selected accordingly)
......
......@@ -31,21 +31,6 @@
<label>Units:</label>
${units.enum_units(subsection, subsection_units=subsection_units)}
</div>
<div>
<label>Policy:</label>
<ol class='policy-list'>
% for policy_name in policy_metadata.keys():
<li class="policy-list-element">
<input type="text" class="policy-list-name" name="${policy_name}" value="${policy_name}" disabled size="15"/>:&nbsp;<input type="text" class="policy-list-value" name="${policy_metadata[policy_name]}" value="${policy_metadata[policy_name]}" size="40"/>
<a href="#" class="cancel-button">Cancel</a>
<a href="#" class="delete-icon remove-policy-data"></a>
</li>
% endfor
<a href="#" class="new-policy-item add-policy-data">
<span class="plus-icon-small"></span>New Policy Data
</a>
</ol>
</div>
</article>
</div>
......@@ -85,7 +70,7 @@
% endif
</div>
<div class="row gradable">
<!-- <div class="row gradable">
<label>Graded as:</label>
<div class="gradable-status">
......@@ -104,7 +89,7 @@
<li><a class="gradable-status-notgraded" href="#">Not Graded</a></li>
</ul>
</div>
</div>
</div> -->
<div class="due-date-input row">
<label>Due date:</label>
......
......@@ -152,8 +152,9 @@
</div>
</div>
<!-- temporarily disable until we figure out inheritance
<div class="gradable-status" data-initial-status="${section.metadata.get('format', 'Not Graded')}">
</div>
</div> -->
<div class="item-actions">
<a href="#" data-tooltip="Delete this section" class="delete-button delete-section-button"><span class="delete-icon"></span></a>
......
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