remove dead code
closes CNVS-19322 refs CNVS-15543 Was going to make the datepicker here more accessible, but it looks like we no longer do assignments with a type of 'attendance', so all this code for creating new ones like that is dead and should go away. TEST PLAN: 1) tests should pass 2) /courses/x/attendance should not be broken for any courses that have assignments with a type of "attendance" (only very old courses should have this), but they shouldn't be able to create *new* assignments like this (which is what we removed) Change-Id: I78c3ce794f387e15af8ef4f064cb36fc1b675718 Reviewed-on: https://gerrit.instructure.com/56603 Tested-by: Jenkins Reviewed-by: Simon Williams <simon@instructure.com> QA-Review: Jeremy Putnam <jeremyp@instructure.com> Product-Review: Ethan Vizitei <evizitei@instructure.com>
This commit is contained in:
parent
8436ddc8de
commit
e2dba409f0
|
@ -56,14 +56,6 @@
|
|||
</div>
|
||||
</td>
|
||||
<% end %>
|
||||
<td class="assignment">
|
||||
<div class="assignment_content">
|
||||
<div class="title">
|
||||
<br/>
|
||||
<a href="#" class="add add_assignment_link"><%= t('links.add_column', "Add Column") %></a>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<% @students.each do |student| %>
|
||||
<tr>
|
||||
|
@ -86,41 +78,6 @@
|
|||
</table>
|
||||
</div>
|
||||
<div style="display: none;">
|
||||
<div id="new_assignment_dialog">
|
||||
<h3><%= t('headers.new_column', "New Attendance Column") %></h3>
|
||||
<%= form_for :assignment, :url => context_url(@context, :context_assignments_url), :html => {:id => "add_assignment_form"} do |f| %>
|
||||
<%= f.hidden_field :submission_types, :value => "attendance" %>
|
||||
<table class="formtable">
|
||||
<tr>
|
||||
<td style="vertical-align: top;"><%= f.blabel :due_at, :date, :en => "Date" %></td>
|
||||
<td><%= f.text_field :due_at, :class => "datetime_field", :style => "width: 120px;" %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><%= f.blabel :title, :en => "Title" %></td>
|
||||
<td><%= f.text_field :title, :class => "title" %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><%= f.blabel :points_possible, :possible, :en => "Possible" %></td>
|
||||
<td><%= f.text_field :points_possible, :style => "width: 30px;", :class => "points_possible" %> <%= t(:points_abbrev, "pts") %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><%= f.label :assignment_group_id, :group, :en => "Group" %></td>
|
||||
<td>
|
||||
<%= f.select :assignment_group_id, (@context.assignment_groups.active.map {|g| [g.name, g.id]} << [t(:new_group, "New Group"), "new"]), {:selected => @default_group_id}, :class => "assignment_group_select" %>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<div class="button-container">
|
||||
<button type="submit" class="btn submit_button"><%= t('buttons.add_assignment', "Add Assignment") %></button>
|
||||
<button type="button" class="btn btn button-secondary cancel_button"><%= t('#buttons.cancel', "Cancel") %></button>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<% end %>
|
||||
</div>
|
||||
<%= render :partial => "shared/add_assignment_group" %>
|
||||
<div id="attendance_how_to_dialog">
|
||||
<h3><%= t('headers.mark_attendance', "Mark Attendance") %></h3>
|
||||
<p><%= t(:mark_attendance_info, <<-DETAILS,
|
||||
|
|
|
@ -125,71 +125,8 @@ define([
|
|||
});
|
||||
}
|
||||
};
|
||||
var attachAddAssignmentGroup;
|
||||
$(document).ready(function() {
|
||||
var $blank = $(".blank_attendance:first");
|
||||
var $pass = $(".pass_attendance:first");
|
||||
var $fail = $(".fail_attendance:first");
|
||||
var errorCount = 0;
|
||||
if(attachAddAssignmentGroup) {
|
||||
attachAddAssignmentGroup($("#new_assignment_dialog select.assignment_group_select"));
|
||||
}
|
||||
$(".add_assignment_link").click(function(event) {
|
||||
event.preventDefault();
|
||||
$("#new_assignment_dialog :text:not(.points_possible)").each(function() {
|
||||
$(this).val("");
|
||||
});
|
||||
$("#new_assignment_dialog").dialog({
|
||||
title: I18n.t('titles.new_attendance_column', "New Attendance Column")
|
||||
});
|
||||
});
|
||||
$("#new_assignment_dialog .cancel_button").click(function(event) {
|
||||
$("#new_assignment_dialog").dialog('close');
|
||||
});
|
||||
$("#add_assignment_form").formSubmit({
|
||||
beforeSubmit: function(data) {
|
||||
$(this).find(".submit_button").text(I18n.t('status.adding_assignment', "Adding Assignment..."));
|
||||
$(this).find("button").attr('disabled', true);
|
||||
},
|
||||
success: function(data) {
|
||||
$(this).find(".submit_button").text(I18n.t('status.added_assignment', "Added Assignment"));
|
||||
$(this).find("button").attr('disabled', false);
|
||||
var assignment = data.assignment;
|
||||
location.href = "#assignment_" + assignment.id;
|
||||
location.reload();
|
||||
},
|
||||
error: function(data) {
|
||||
$(this).formErrors(data);
|
||||
$(this).find(".submit_button").text(I18n.t('errors.could_not_add_assignment', "Add Assignment Failed"));
|
||||
$(this).find("button").attr('disabled', false);
|
||||
}
|
||||
});
|
||||
$("#new_assignment_dialog .title").change(function() {
|
||||
var val = $(this).val();
|
||||
if (val && val != defaultTitle()) {
|
||||
$(this).attr('edited', true);
|
||||
} else {
|
||||
$(this).removeAttr('edited');
|
||||
}
|
||||
});
|
||||
function defaultTitle() {
|
||||
var date = $("#new_assignment_dialog .datetime_field").data('date');
|
||||
if (date) {
|
||||
return I18n.t('default_attendance_title', 'Attendance %{date}', {date: I18n.l('#date.formats.default', date)});
|
||||
} else {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
$("#new_assignment_dialog .datetime_field").change(function() {
|
||||
var val = $("#new_assignment_dialog .title").val();
|
||||
var titleEdited = $("#new_assignment_dialog .title").attr('edited');
|
||||
if(!val || !titleEdited) {
|
||||
var date = $(this).data('date');
|
||||
if(date) {
|
||||
$("#new_assignment_dialog .title").val(defaultTitle());
|
||||
}
|
||||
}
|
||||
});
|
||||
$(".datetime_field").datetime_field();
|
||||
$(".help_link").click(function(event) {
|
||||
event.preventDefault();
|
||||
|
|
Loading…
Reference in New Issue