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({ ...@@ -28,7 +28,7 @@ CMS.Views.OverviewAssignmentGrader = Backbone.View.extend({
// instantiate w/ { graders : CourseGraderCollection, el : <the gradable-status div> } // instantiate w/ { graders : CourseGraderCollection, el : <the gradable-status div> }
events : { events : {
"click .menu-toggle" : "showGradeMenu", "click .menu-toggle" : "showGradeMenu",
"click .menu" : "selectGradeType" "click .menu li" : "selectGradeType"
}, },
initialize : function() { initialize : function() {
// call template w/ {assignmentType : formatname, graders : CourseGraderCollection instance } // call template w/ {assignmentType : formatname, graders : CourseGraderCollection instance }
...@@ -49,6 +49,13 @@ CMS.Views.OverviewAssignmentGrader = Backbone.View.extend({ ...@@ -49,6 +49,13 @@ CMS.Views.OverviewAssignmentGrader = Backbone.View.extend({
graderType : this.$el.data('initial-status')}); graderType : this.$el.data('initial-status')});
// TODO throw exception if graders is null // TODO throw exception if graders is null
this.graders = this.options['graders']; 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(); this.render();
}, },
render : function() { render : function() {
...@@ -62,12 +69,16 @@ CMS.Views.OverviewAssignmentGrader = Backbone.View.extend({ ...@@ -62,12 +69,16 @@ CMS.Views.OverviewAssignmentGrader = Backbone.View.extend({
}, },
showGradeMenu : function(e) { showGradeMenu : function(e) {
e.preventDefault(); 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) { selectGradeType : function(e) {
e.preventDefault(); 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 // 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) // of the CourseGradingPolicy model or null for Not Graded (NOTE, change template's if check for is-selected accordingly)
......
...@@ -31,21 +31,6 @@ ...@@ -31,21 +31,6 @@
<label>Units:</label> <label>Units:</label>
${units.enum_units(subsection, subsection_units=subsection_units)} ${units.enum_units(subsection, subsection_units=subsection_units)}
</div> </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> </article>
</div> </div>
...@@ -85,7 +70,7 @@ ...@@ -85,7 +70,7 @@
% endif % endif
</div> </div>
<div class="row gradable"> <!-- <div class="row gradable">
<label>Graded as:</label> <label>Graded as:</label>
<div class="gradable-status"> <div class="gradable-status">
...@@ -104,7 +89,7 @@ ...@@ -104,7 +89,7 @@
<li><a class="gradable-status-notgraded" href="#">Not Graded</a></li> <li><a class="gradable-status-notgraded" href="#">Not Graded</a></li>
</ul> </ul>
</div> </div>
</div> </div> -->
<div class="due-date-input row"> <div class="due-date-input row">
<label>Due date:</label> <label>Due date:</label>
......
...@@ -152,8 +152,9 @@ ...@@ -152,8 +152,9 @@
</div> </div>
</div> </div>
<!-- temporarily disable until we figure out inheritance
<div class="gradable-status" data-initial-status="${section.metadata.get('format', 'Not Graded')}"> <div class="gradable-status" data-initial-status="${section.metadata.get('format', 'Not Graded')}">
</div> </div> -->
<div class="item-actions"> <div class="item-actions">
<a href="#" data-tooltip="Delete this section" class="delete-button delete-section-button"><span class="delete-icon"></span></a> <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