-
Notifications
You must be signed in to change notification settings - Fork 31
Expand file tree
/
Copy pathassignments.blade.php
More file actions
150 lines (145 loc) · 6.99 KB
/
assignments.blade.php
File metadata and controls
150 lines (145 loc) · 6.99 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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
@include('core.header')
<div class="row">
<div class="col-lg-12">
<h3><i class="fa fa-map-signs fa-fw"></i> Assignments</h3>
</div>
</div>
<div class="row" style="margin-top: 10px;">
<div class="col-lg-12">
<h4>Requested Hours Per Week: <strong>{{{ Auth::user()->hours }}}</strong></h4>
<h4>Requested Units: <strong>{{{ Auth::user()->units }}}</strong></h4>
</div>
</div>
<div class="row" style="margin-top: 20px;">
<div class="col-lg-12" >
<button id="submitAvailabilityBtn" class="btn btn-info" @if ($allowSectionSignups == 0) disabled="disabled" @endif><i class="fa fa-plus fa-fw"></i> Choose Sections</button> @if ($allowSectionSignups == 0) <span class="label label-default">(disabled)</span> @endif
</div>
</div>
@if ($allowSectionSignups == 1)
<div id="submitAvailabilityDiv" class="row" style="display: none; margin-top: 20px;">
<div class="col-lg-12" >
<form action="{{{ route("doassignments") }}}" method="POST">
<input type="hidden" name="_token" value="{{{ csrf_token() }}}" />
<div class="well">
<div class="form-group">
<label for="inputHours">
Hours Per Week <small>(multiples of 3 per unit. E.g 1 unit = 3 hours)</small>:
</label>
<input class="form-control" type="text" id="inputHours" name="inputHours" value="{{{ Auth::user()->hours }}}" placeholder="Ex: 3" />
</div>
<div class="form-group">
<label for="inputUnits">Units</label>
<input class="form-control" type="number" id="inputUnits" name="inputUnits" value="{{{ Auth::user()->units }}}" placeholder="Ex: 1" />
</div>
<hr />
<p>Select the available section or sections you will attend.</p>
<div class="table-responsive">
<table id="sectionPreferencesSelectionTable" class="table table-hover table-bordered table-striped">
<thead>
<tr>
<th>Choose</th><th>Lab Assistants</th><th>Type</th><th>Location</th><th>GSI</th><th>Days</th><th>Start Time</th><th>End Time</th>
</tr>
</thead>
<tbody>
@foreach ($sections as $section)
<tr>
<td>
<input name="inputSections[]" value="{{{ $section->id }}}" type="checkbox" @if (in_array($section->id, $assignmentSids)) checked="checked" @elseif($section->max_las != -1 && count($section->assigned) >= $section->max_las) disabled="disabled" @endif />
</td>
<td>
<strong>{{{ count($section->assigned) }}}/@if ($section->max_las == -1)∞@else{{{ $section->max_las }}} @if (count($section->assigned) >= $section->max_las) <span class="label label-warning">Full</span> @endif @endif</strong>
</td>
<td>
{{{ $section->category->name }}}
</td>
<td>
{{{ $section->location }}}
</td>
<td>
<span class="label label-danger"><i class="fa fa-bookmark fa-fw"></i> {{{ $section->ta->name }}}</span>
@if ($section->second_gsi != -1)
<span class="label label-danger"><i class="fa fa-bookmark fa-fw"></i> {{{ $section->ta2->name }}}</span>
@endif
</td>
<td>
{{{ App\Section::daysToString($section) }}}
</td>
<td>
{{{ $section->start_time }}}
</td>
<td>
{{{ $section->end_time }}}
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
<hr />
<input type="submit" class="btn btn-success" value="Save Sections" />
</form>
</div>
</div>
</div>
@endif
<div class="row" style="margin-top: 20px;">
<div class="col-lg-12">
<h4>Your Assignments: </h4>
<div class="table-responsive">
<table class="table table-bordered table-hover table-striped">
<thead>
<tr>
<th>Type</th>
<th>Location</th>
<th>GSI</th>
<th>Days</th>
<th>Start Time</th>
<th>End Time</th>
</tr>
</thead>
<tbody>
@if (count($assignments) == 0)
<tr>
<td colspan="6" style="text-align: center;">No Assignments Found</td>
</tr>
@else
@foreach ($assignments as $assignment)
<tr>
<td>
{{{ $assignment->sec->category->name }}}
</td>
<td>
{{{ $assignment->sec->location }}}
</td>
<td>
<span class="label label-danger"><i class="fa fa-bookmark fa-fw"></i> {{{ $assignment->sec->ta->name }}}</span>
@if ($assignment->sec->second_gsi != -1)
<span class="label label-danger"><i class="fa fa-bookmark fa-fw"></i> {{{ $assignment->sec->ta2->name }}}</span>
@endif
</td>
<td>
{{{ App\Section::daysToString($assignment->sec) }}}
</td>
<td>
{{{ $assignment->sec->start_time }}}
</td>
<td>
{{{ $assignment->sec->end_time }}}
</td>
</tr>
@endforeach
@endif
</tbody>
</table>
</div>
</div>
</div>
@section('js')
$('#submitAvailabilityBtn').on('click', function() {
$('#submitAvailabilityDiv').slideToggle();
});
$('#sectionPreferencesSelectionTable').DataTable({
paging: false
});
@endsection
@include('core.footer')