|
@@ -16,54 +16,55 @@
|
16
|
16
|
<div class="col-md-12">
|
17
|
17
|
<p>Click on the values you want to change. Invalid values will be rejected automatically. To save your changes,
|
18
|
18
|
click the 'Save' button at the bottom of the page.</p>
|
|
19
|
+
|
19
|
20
|
<table class="table table-striped table-condensed editable-table" id='outcomes_table'>
|
20
|
21
|
<thead>
|
21
|
22
|
<tr class="center-text">
|
|
23
|
+ <th class="col-md-1">ID</th>
|
22
|
24
|
<th class="col-md-4">Learning Outcome</th>
|
23
|
|
- <th class="col-md-7">Definition</th>
|
|
25
|
+ <th class="col-md-6">Definition</th>
|
24
|
26
|
<th class="col-md-1">Expected Value</th>
|
25
|
27
|
<th class="col-md-2">Activation date</th>
|
26
|
28
|
<th class="col-md-2">Deactivation date</th>
|
27
|
|
- <th class="col-md-1">Level</th>
|
|
29
|
+ <th class="col-md-1">Level<br><font size="-5">1:undergrad, 2:grad, 3:both</font></th>
|
|
30
|
+ <th class="col-md-1">Equivalent to</th>
|
28
|
31
|
|
29
|
32
|
</thead>
|
30
|
33
|
<tbody>
|
31
|
34
|
@foreach ($outcomes as $outcome)
|
32
|
35
|
{{-- @foreach ($semesters as $semester) --}}
|
33
|
36
|
{{-- display an outcome only if it is part of a currently selected semester --}}
|
34
|
|
- @if ($outcome->deactivation_date == '0000-00-00' or $outcome->deactivation_date == '';
|
35
|
|
- // and ($outcome->activation_date >= $semester->start && $outcome->activation_date <= $semester->end))
|
|
37
|
+ @if ($outcome->deactivation_date == '0000-00-00' or $outcome->deactivation_date == '')
|
|
38
|
+ {{-- and ($outcome->activation_date >= $semester->start && $outcome->activation_date <= $semester->end)) --}}
|
36
|
39
|
<tr data-id="{{ $outcome->id }}">
|
|
40
|
+ <td class="id col-md-1">{{ $outcome->id }}</td>
|
37
|
41
|
<td contenteditable="true" class="name col-md-4">{{ $outcome->name }}</td>
|
38
|
|
- <td contenteditable="true" data-type="textarea" class="definition col-md-6">
|
39
|
|
- {{ $outcome->definition }}</td>
|
40
|
|
- <td contenteditable="true" class="expected-outcome col-md-1">
|
41
|
|
- {{ $outcome->expected_outcome }}</td>
|
42
|
|
- <td contenteditable="true" class="activation-date col-md-2">
|
43
|
|
- {{ $outcome->activation_date }}</td>
|
44
|
|
- <td contenteditable="true" class="deactivation-date col-md-2">
|
45
|
|
- {{ $outcome->deactivation_date }}</td>
|
|
42
|
+ <td contenteditable="true" data-type="textarea" class="definition col-md-6">{{ $outcome->definition }}</td>
|
|
43
|
+ <td contenteditable="true" class="expected-outcome col-md-1">{{ $outcome->expected_outcome }}</td>
|
|
44
|
+ <td contenteditable="true" class="activation-date col-md-2">{{ $outcome->activation_date }}</td>
|
|
45
|
+ <td contenteditable="true" class="deactivation-date col-md-2">{{ $outcome->deactivation_date }}</td>
|
46
|
46
|
<td contenteditable="true" class="level col-md-1">{{ $outcome->level }}</td>
|
47
|
|
- </tr>
|
|
47
|
+ <td></td>
|
|
48
|
+ <td><button class="btn btn-sm btn-primary center-block del" id='del{{ $outcome->id }}'>Del</button></td>
|
|
49
|
+ </tr>
|
48
|
50
|
@endif
|
49
|
51
|
{{-- @endforeach --}}
|
50
|
52
|
@endforeach
|
51
|
53
|
@foreach ($outcomes as $outcome)
|
52
|
54
|
{{-- @foreach ($semesters as $semester) --}}
|
53
|
55
|
{{-- display an outcome only if it is part of a currently selected semester --}}
|
54
|
|
- @if ($outcome->deactivation_date != '0000-00-00' and $outcome->deactivation_date != '';
|
55
|
|
- // and ($outcome->deactivation_date != '0000-00-00') and ($outcome->deactivation_date != ''))
|
|
56
|
+ @if ($outcome->deactivation_date != '0000-00-00' and $outcome->deactivation_date != '')
|
|
57
|
+ {{-- and ($outcome->deactivation_date != '0000-00-00') and ($outcome->deactivation_date != '')) --}}
|
56
|
58
|
<tr data-id="{{ $outcome->id }}">
|
|
59
|
+ <td class="id col-md-1">{{ $outcome->id }}</td>
|
57
|
60
|
<td contenteditable="true" class="name col-md-4">{{ $outcome->name }}</td>
|
58
|
|
- <td contenteditable="true" data-type="textarea" class="definition col-md-6">
|
59
|
|
- {{ $outcome->definition }}</td>
|
60
|
|
- <td contenteditable="true" class="expected-outcome col-md-1">
|
61
|
|
- {{ $outcome->expected_outcome }}</td>
|
62
|
|
- <td contenteditable="true" class="activation-date col-md-2">
|
63
|
|
- {{ $outcome->activation_date }}</td>
|
64
|
|
- <td contenteditable="true" class="deactivation-date col-md-2">
|
65
|
|
- {{ $outcome->deactivation_date }}</td>
|
|
61
|
+ <td contenteditable="true" data-type="textarea" class="definition col-md-6">{{ $outcome->definition }}</td>
|
|
62
|
+ <td contenteditable="true" class="expected-outcome col-md-1">{{ $outcome->expected_outcome }}</td>
|
|
63
|
+ <td contenteditable="true" class="activation-date col-md-2">{{ $outcome->activation_date }}</td>
|
|
64
|
+ <td contenteditable="true" class="deactivation-date col-md-2">{{ $outcome->deactivation_date }}</td>
|
66
|
65
|
<td contenteditable="true" class="level col-md-1">{{ $outcome->level }}</td>
|
|
66
|
+ <td contenteditable="true" class="new_outcome_id col-md-1">{{ $outcome->new_outcome_id }}</td>
|
|
67
|
+ <td><button class="btn btn-sm btn-primary center-block del" id='del{{ $outcome->id }}'>Del</button></td>
|
67
|
68
|
</tr>
|
68
|
69
|
@endif
|
69
|
70
|
{{-- @endforeach --}}
|
|
@@ -112,6 +113,40 @@
|
112
|
113
|
@stop
|
113
|
114
|
|
114
|
115
|
@section('javascript')
|
|
116
|
+@foreach ($outcomes as $outcome)
|
|
117
|
+ $('#del{{ $outcome->id }}').on('click', function(e)
|
|
118
|
+ {
|
|
119
|
+ e.preventDefault();
|
|
120
|
+ //outcomeObject.id= $(this).data('id');
|
|
121
|
+ if(confirm("Are you sure you want to delete the outcome with id {{ $outcome->id }}"))
|
|
122
|
+ {
|
|
123
|
+ console.log("si");
|
|
124
|
+ var outcomeObject = new Object();
|
|
125
|
+
|
|
126
|
+ outcomeObject.id= {{ $outcome->id }};
|
|
127
|
+ outcomeObject.delete=1;
|
|
128
|
+ console.log("algo"+JSON.stringify({{ $outcome->id }}));
|
|
129
|
+ console.log("algo"+JSON.stringify(outcomeObject));
|
|
130
|
+ var clone = jQuery.extend({}, outcomeObject);
|
|
131
|
+ // outcomeArray.push(clone);
|
|
132
|
+ // console.log("algo"+JSON.stringify(outcomeArray));
|
|
133
|
+ $.post(
|
|
134
|
+ "{{ URL::action('OutcomesController@delete') }}",
|
|
135
|
+ { outcomeArray: JSON.stringify(outcomeObject)},
|
|
136
|
+ function(data)
|
|
137
|
+ {
|
|
138
|
+ location.reload();
|
|
139
|
+ }
|
|
140
|
+ );
|
|
141
|
+
|
|
142
|
+ }
|
|
143
|
+ else
|
|
144
|
+ {
|
|
145
|
+ console.log("no");
|
|
146
|
+// outcomeObject.delete=0;
|
|
147
|
+ }
|
|
148
|
+ });
|
|
149
|
+@endforeach
|
115
|
150
|
|
116
|
151
|
$('#new_outcome_form').hide();
|
117
|
152
|
|
|
@@ -129,6 +164,7 @@
|
129
|
164
|
$('#show').show();
|
130
|
165
|
});
|
131
|
166
|
|
|
167
|
+
|
132
|
168
|
$('#save').on('click', function(e)
|
133
|
169
|
{
|
134
|
170
|
e.preventDefault();
|
|
@@ -147,15 +183,17 @@
|
147
|
183
|
outcomeObject.activation_date= $(this).children('.activation-date').text();
|
148
|
184
|
outcomeObject.deactivation_date= $(this).children('.deactivation-date').text();
|
149
|
185
|
outcomeObject.level= $(this).children('.level').text();
|
|
186
|
+ if($(this).children('.new_outcome_id').text()!="")outcomeObject.new_outcome_id= $(this).children('.new_outcome_id').text();
|
150
|
187
|
|
151
|
188
|
if($(this).find('.glyphicon-eye-close').length>0)
|
152
|
189
|
{
|
153
|
|
- outcomeObject.delete=1;
|
|
190
|
+ outcomeObject.delete=1;
|
154
|
191
|
}
|
155
|
192
|
|
156
|
193
|
else
|
157
|
|
- outcomeObject.delete=0;
|
158
|
|
-
|
|
194
|
+ {
|
|
195
|
+ outcomeObject.delete=0;
|
|
196
|
+ }
|
159
|
197
|
var clone = jQuery.extend({}, outcomeObject);
|
160
|
198
|
outcomeArray.push(clone);
|
161
|
199
|
});
|