-
Notifications
You must be signed in to change notification settings - Fork 22
Expand file tree
/
Copy path_new_common.html.erb
More file actions
105 lines (102 loc) · 3.84 KB
/
Copy path_new_common.html.erb
File metadata and controls
105 lines (102 loc) · 3.84 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
<%= f.hidden_field :assignment_id %>
<%= f.hidden_field :user_id %>
<% @accept_inputs = false %>
<% unless @assignment.assignment.nil? || @assignment.assignment.empty? %>
<div class="<%= container_style %>">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">Assignment description</h3>
</div>
<div class="panel-body">
<div class="prose">
<%= raw @assignment.assignment %>
</div>
</div>
</div>
</div>
<% end %>
<div class="<%= container_style %>">
<% if @team.nil? && @assignment.team_subs? %>
<div class="alert alert-danger">
<p>This assignment requires team <%= type[:noun].pluralize(2) %>,
and you are not currently in a team.</p>
<% if @staff_override %>
<p>You need to
<%= link_to "stop impersonating the student and enroll the student in a team",
edit_course_teamset_path(@course, @assignment.teamset) %>
before submitting. (Stopping the impersonation will happen
automatically; you will need to re-impersonate the student before
actually submitting.)</p>
<% else %>
<p>Contact a professor to join a team.</p>
<% end %>
</div>
<% elsif @submission_prohibited %>
<div class="alert alert-danger">
<p><%= @submission_prohibited %></p>
</div>
<% else %>
<% @accept_inputs = true %>
<% if @staff_override %>
<div class="alert alert-info">
<p>
You are <%= type[:gerund] %> on behalf of a student.
<% if DateTime.current > @assignment.effective_due_date(current_user, @team) %>
Should this <%= type[:noun] %> be exempt from lateness penalties?
<%= f.check_box :ignore_late_penalty, :checked => "checked",
data: {toggle: "toggle", on: "Yes", off: "No"} %>
<% else %>
It is before the deadline, so this submission will be
considered on-time.
<% end %>
</p>
<div class="row">
<% if DateTime.current > @assignment.effective_due_date(current_user, @team) %>
<div class="col-sm-6">
<p>If lateness is not ignored, this <%= type[:noun] %> should claim to
have been submitted at:</p>
<%= f.text_field :created_at, class: 'form-control datetime-picker', disabled: "disabled" %>
</div>
<% end %>
<div class="col-sm-6" style="padding-top: 1em;">
<div class="col-md-6">Waive file-size limits?
<%= check_box_tag "override_size", true, false, data: {toggle: "toggle", on: "Yes", off: "No" } %></div>
<div class="col-md-6"> Waive file-count limits?
<%= check_box_tag "override_count", true, false, data: {toggle: "toggle", on: "Yes", off: "No" } %></div>
</div>
<script type="text/javascript">
$(function () {
$('#submission_created_at').datetimepicker({
sideBySide: true,
format: "YYYY/MM/DD h:mm A z",
timeZone: moment.tz.guess(),
minDate: "<%= @course.created_at.beginning_of_day.iso8601 %>",
<% if @course.created_at < DateTime.current %>
defaultDate: "<%= DateTime.current.iso8601 %>"
<% else %>
defaultDate: undefined
<% end %>
});
$('#submission_ignore_late_penalty').on("change", function() {
if ($(this).prop("checked"))
$('#submission_created_at').prop("disabled", true);
else
$('#submission_created_at').prop("disabled", false);
});
});
</script>
</div>
</div>
<% end %>
<% end %>
<% if @accept_inputs %>
<% if @team.nil? %>
<p>This will be an individual <%= type[:noun] %>.</p>
<% else %>
<p>This will be a team <%= type[:noun] %> for <strong><%= @team %></strong>.</p>
<% end %>
<% end %>
</div>
<% if @accept_inputs %>
<%= yield %>
<% end %>