|
@@ -15,33 +15,110 @@
|
15
|
15
|
<div class="row">
|
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, click the 'Save' button at the bottom of the page.</p>
|
18
|
|
- <table class="table table-striped table-condensed editable-table">
|
|
18
|
+ <table class="table table-striped table-condensed editable-table" id='outcomes_table'>
|
19
|
19
|
<thead><tr class="center-text">
|
20
|
20
|
<th class="col-md-4">Learning Outcome</th>
|
21
|
21
|
<th class="col-md-7">Definition</th>
|
22
|
22
|
<th class="col-md-1">Expected Value</th>
|
|
23
|
+ <th class="col-md-2">Activation date</th>
|
|
24
|
+ <th class="col-md-2">Deactivation date</th>
|
|
25
|
+ <th class="col-md-1">Level</th>
|
23
|
26
|
|
24
|
27
|
</thead>
|
25
|
28
|
<tbody>
|
26
|
|
- @foreach ($outcomes as $outcome)
|
27
|
|
- <tr data-id="{{ $outcome->id }}">
|
28
|
|
- <td contenteditable="true" class="name col-md-4" >{{ $outcome->name }}</td>
|
29
|
|
- <td contenteditable="true" data-type="textarea" class="definition col-md-6" >{{ $outcome->definition }}</td>
|
30
|
|
- <td contenteditable="true" class="expected-outcome col-md-1" >{{ $outcome->expected_outcome }}</td>
|
31
|
|
- </tr>
|
32
|
|
- @endforeach
|
|
29
|
+ @foreach ($outcomes as $outcome)
|
|
30
|
+ {{-- @foreach ($semesters as $semester) --}}
|
|
31
|
+ {{-- display an outcome only if it is part of a currently selected semester --}}
|
|
32
|
+ @if ((($outcome->deactivation_date == '0000-00-00') or ($outcome->deactivation_date == ''))
|
|
33
|
+ // and ($outcome->activation_date >= $semester->start && $outcome->activation_date <= $semester->end)
|
|
34
|
+ )
|
|
35
|
+ <tr data-id="{{ $outcome->id }}">
|
|
36
|
+ <td contenteditable="true" class="name col-md-4" >{{ $outcome->name }}</td>
|
|
37
|
+ <td contenteditable="true" data-type="textarea" class="definition col-md-6" >{{ $outcome->definition }}</td>
|
|
38
|
+ <td contenteditable="true" class="expected-outcome col-md-1" >{{ $outcome->expected_outcome }}</td>
|
|
39
|
+ <td contenteditable="true" class="activation-date col-md-2" >{{ $outcome->activation_date }}</td>
|
|
40
|
+ <td contenteditable="true" class="deactivation-date col-md-2" >{{ $outcome->deactivation_date }}</td>
|
|
41
|
+ <td contenteditable="true" class="level col-md-1" >{{ $outcome->level }}</td>
|
|
42
|
+ </tr>
|
|
43
|
+ @endif
|
|
44
|
+ {{-- @endforeach --}}
|
|
45
|
+ @endforeach
|
|
46
|
+ @foreach ($outcomes as $outcome)
|
|
47
|
+ {{-- @foreach ($semesters as $semester) --}}
|
|
48
|
+ {{-- display an outcome only if it is part of a currently selected semester --}}
|
|
49
|
+ @if ((($outcome->deactivation_date != '0000-00-00') and ($outcome->deactivation_date != ''))
|
|
50
|
+ // and ($outcome->deactivation_date != '0000-00-00') and ($outcome->deactivation_date != '')
|
|
51
|
+ )
|
|
52
|
+ <tr data-id="{{ $outcome->id }}">
|
|
53
|
+ <td contenteditable="true" class="name col-md-4" >{{ $outcome->name }}</td>
|
|
54
|
+ <td contenteditable="true" data-type="textarea" class="definition col-md-6" >{{ $outcome->definition }}</td>
|
|
55
|
+ <td contenteditable="true" class="expected-outcome col-md-1" >{{ $outcome->expected_outcome }}</td>
|
|
56
|
+ <td contenteditable="true" class="activation-date col-md-2" >{{ $outcome->activation_date }}</td>
|
|
57
|
+ <td contenteditable="true" class="deactivation-date col-md-2" >{{ $outcome->deactivation_date }}</td>
|
|
58
|
+ <td contenteditable="true" class="level col-md-1" >{{ $outcome->level }}</td>
|
|
59
|
+ </tr>
|
|
60
|
+ @endif
|
|
61
|
+ {{-- @endforeach --}}
|
|
62
|
+ @endforeach
|
33
|
63
|
</tbody>
|
34
|
64
|
</table>
|
35
|
65
|
</div>
|
36
|
66
|
</div>
|
37
|
67
|
<div class="row">
|
38
|
|
- <div class="col-md-12"><button class="btn btn-lg btn-primary center-block">Save</button></div>
|
|
68
|
+ <div class="col-md-6"><button class="btn btn-lg btn-secondary center-block" id='show'>New Outcome</button></div>
|
|
69
|
+ <div class="col-md-6"><button class="btn btn-lg btn-primary center-block" id='save'>Save</button></div>
|
39
|
70
|
</div>
|
|
71
|
+
|
|
72
|
+ <div class="" id='new_outcome_form'>
|
|
73
|
+ <h2>Add a new Learning Outcomes</h2>
|
|
74
|
+ {{-- For for adding a new outcome --}}
|
|
75
|
+ {{ Form::open(array('action' => 'OutcomesController@create')) }}
|
|
76
|
+ <div class="form-group">
|
|
77
|
+ {{ Form::label('name', 'Name') }}
|
|
78
|
+ {{ Form::text('name', '', array('class' => 'form-control', 'id'=>'outcome_name')) }}
|
|
79
|
+ </div>
|
|
80
|
+ <div class="form-group">
|
|
81
|
+ {{ Form::label('definition', 'Definition') }}
|
|
82
|
+ {{ Form::textarea('definition', 'At least 10 characters long', array('class' => 'form-control', 'id'=>'outcome_definition')) }}
|
|
83
|
+ </div>
|
|
84
|
+ Due to technical limitationss, the following must be edited after adding the new Outcome:
|
|
85
|
+ {{-- the technical limitation is: the Outcome Model has to be edited --}}
|
|
86
|
+ <ul>
|
|
87
|
+ <li>Expected Outcome</li>
|
|
88
|
+ <li>Activation Date</li>
|
|
89
|
+ <li>Deactivation Date</li>
|
|
90
|
+ <li>Level</li>
|
|
91
|
+ </ul>
|
|
92
|
+
|
|
93
|
+ <div class="row">
|
|
94
|
+ <div class="col-md-6"><button type="reset" class="btn btn-lg btn-secondary center-block" id='hide'>Hide Form</button></div>
|
|
95
|
+ <div class="col-md-6"><button type="submit" class="btn btn-lg btn-primary center-block">Submit New Outcome</button></div>
|
|
96
|
+ </div>
|
|
97
|
+ {{ Form::close() }}
|
|
98
|
+
|
|
99
|
+ <hr>
|
|
100
|
+ </div>
|
40
|
101
|
@stop
|
41
|
102
|
|
42
|
103
|
@section('javascript')
|
43
|
104
|
|
44
|
|
- $('button').on('click', function(e)
|
|
105
|
+ $('#new_outcome_form').hide();
|
|
106
|
+
|
|
107
|
+ //show form
|
|
108
|
+ $('#show').on('click', function(e)
|
|
109
|
+ {
|
|
110
|
+ $('#new_outcome_form').show();
|
|
111
|
+ $('#show').hide();
|
|
112
|
+ });
|
|
113
|
+
|
|
114
|
+ //hide form
|
|
115
|
+ $('#hide').on('click', function(e)
|
|
116
|
+ {
|
|
117
|
+ $('#new_outcome_form').hide();
|
|
118
|
+ $('#show').show();
|
|
119
|
+ });
|
|
120
|
+
|
|
121
|
+ $('#save').on('click', function(e)
|
45
|
122
|
{
|
46
|
123
|
e.preventDefault();
|
47
|
124
|
|
|
@@ -56,6 +133,9 @@
|
56
|
133
|
outcomeObject.name= $(this).children('.name').text();
|
57
|
134
|
outcomeObject.definition= $(this).children('.definition').text();
|
58
|
135
|
outcomeObject.expected_outcome= $(this).children('.expected-outcome').text();
|
|
136
|
+ outcomeObject.activation_date= $(this).children('.activation-date').text();
|
|
137
|
+ outcomeObject.deactivation_date= $(this).children('.deactivation-date').text();
|
|
138
|
+ outcomeObject.level= $(this).children('.level').text();
|
59
|
139
|
|
60
|
140
|
if($(this).find('.glyphicon-eye-close').length>0)
|
61
|
141
|
{
|
|
@@ -70,7 +150,7 @@
|
70
|
150
|
});
|
71
|
151
|
|
72
|
152
|
$.post(
|
73
|
|
- "{{ URL::action('OutcomesController@update') }}",
|
|
153
|
+ "{{ URL::action('OutcomesController@updateMore') }}",
|
74
|
154
|
{ outcomeArray: JSON.stringify(outcomeArray)},
|
75
|
155
|
function(data)
|
76
|
156
|
{
|