Просмотр исходного кода

Redesigned alert and debug button on view

eduardo-santin 3 лет назад
Родитель
Сommit
a2dd208008

+ 31
- 32
app/views/local/managers/admins/objectives.blade.php Просмотреть файл

@@ -71,23 +71,23 @@
71 71
                     <span class="glyphicon glyphicon-plus">
72 72
                     </span>
73 73
                     Filters
74
-                  </button>
75
-                  <div class='filterSection'>
76
-                {{ Form::open(array('action' => 'Objective2Controller@update')) }}
77
-                <div class="form-group">
78
-                    {{ Form::label('program_id2', 'Associated Program')}}
79
-                    <select id='select-program' class="form-control selectpicker" onchange='fetchAllObjectives("select-program", "assoc_outcomes_fetch")'>
80
-                        @foreach ($programs as $program)
81
-                        <option value='{{$program->id}}' data-subtext="{{$program->code}}">{{$program->name}}</option>
82
-                        @endforeach
83
-                    </select>
84
-                </div>
85
-                <div class="form-group">
86
-                    <label>Associated Outcome</label>
87
-                    {{ Form::select('assoc_outcomes_fetch', $outcomes, null, ['class'=>'form-control selectpicker', 'id'=>'assoc_outcomes_fetch', 'onchange'=>'fetchAllObjectives("select-program", "assoc_outcomes_fetch")']) }}
74
+                </button>
75
+                <div class='filterSection'>
76
+                    {{ Form::open(array('action' => 'Objective2Controller@update')) }}
77
+                    <div class="form-group">
78
+                        {{ Form::label('program_id2', 'Associated Program')}}
79
+                        <select id='select-program' class="form-control selectpicker" onchange='fetchAllObjectives("select-program", "assoc_outcomes_fetch")'>
80
+                            @foreach ($programs as $program)
81
+                            <option value='{{$program->id}}' data-subtext="{{$program->code}}">{{$program->name}}</option>
82
+                            @endforeach
83
+                        </select>
84
+                    </div>
85
+                    <div class="form-group">
86
+                        <label>Associated Outcome</label>
87
+                        {{ Form::select('assoc_outcomes_fetch', $outcomes, null, ['class'=>'form-control selectpicker', 'id'=>'assoc_outcomes_fetch', 'onchange'=>'fetchAllObjectives("select-program", "assoc_outcomes_fetch")']) }}
88 88
 
89
+                    </div>
89 90
                 </div>
90
-                  </div>
91 91
                 <div class="form-group">
92 92
                     {{ Form::label('objective_id', 'Objectives') }}
93 93
                     <select id="select-objective" name="id" class="form-control selectpicker">
@@ -116,10 +116,10 @@
116 116
                         {{ Form::select('outcome[]', $outcomes, null, ['class'=>'form-control selectpicker', 'id'=>'assoc_outcome0']) }}
117 117
 
118 118
                     </div>
119
-                    
119
+
120 120
                 </div>
121
-                
122
-                
121
+
122
+
123 123
                 <button id='button-add-assoc-outcome' class='btn btn-md btn-secondary' onclick='addAssoc()'>
124 124
                     <span class='glyphicon glyphicon-plus'>
125 125
 
@@ -176,19 +176,18 @@
176 176
 </div>
177 177
 <script>
178 178
     $('.filterSection').hide();
179
-    $('.filterButton').on('click', function()
180
-{
181
-  var span = $(this).find('span');
182
-  if(span.attr('class') == 'glyphicon glyphicon-plus'){
183
-    span.attr('class','glyphicon glyphicon-minus');
184
-  } else{
185
-    span.attr('class','glyphicon glyphicon-plus');
186
-  }
187
-  $('.filterSection').toggle(533);
188
-});
179
+    $('.filterButton').on('click', function() {
180
+        var span = $(this).find('span');
181
+        if (span.attr('class') == 'glyphicon glyphicon-plus') {
182
+            span.attr('class', 'glyphicon glyphicon-minus');
183
+        } else {
184
+            span.attr('class', 'glyphicon glyphicon-plus');
185
+        }
186
+        $('.filterSection').toggle(533);
187
+    });
189 188
     var outcomeHTML = document.getElementById('outcomeGroup').innerHTML;
190 189
     var selectOptions = document.getElementById('outcome[0]').innerHTML;
191
-   
190
+
192 191
     function fetchAllObjectives(program, outcome) {
193 192
         var program_id_fetch = $('#' + program).find(':selected').val();
194 193
         var outcome_fetch = $('#' + outcome).find(':selected').val();
@@ -300,7 +299,7 @@
300 299
 
301 300
                 // Select associated outcome
302 301
                 for (var i = counterAssoc; i != 1; i--) {
303
-                    deleteLastAssoc(i-1);
302
+                    deleteLastAssoc(i - 1);
304 303
 
305 304
                 }
306 305
                 $('#assoc_outcome0').val(json.outcome[0].outcome_id);
@@ -327,7 +326,7 @@
327 326
                     var $button = $('<button />', {
328 327
                         'type': 'button',
329 328
                         'class': 'btn btn-primary',
330
-                        'onclick': 'deleteLastAssoc('+i+')'
329
+                        'onclick': 'deleteLastAssoc(' + i + ')'
331 330
                     });
332 331
                     $button.append('X');
333 332
                     $divForButton.append($button);
@@ -463,7 +462,7 @@
463 462
         var $button = $('<button />', {
464 463
             'type': 'button',
465 464
             'class': 'btn btn-primary',
466
-            'onclick': 'deleteLastAssoc('+counterAssoc+')'
465
+            'onclick': 'deleteLastAssoc(' + counterAssoc + ')'
467 466
         });
468 467
         $button.append('X');
469 468
         $divForButton.append($button);

+ 331
- 330
app/views/local/managers/pCoords/criteria.blade.php
Разница между файлами не показана из-за своего большого размера
Просмотреть файл


+ 40
- 38
app/views/local/managers/pCoords/objectives.blade.php Просмотреть файл

@@ -16,7 +16,7 @@
16 16
                 {{ Form::open(array('action' => 'Objective2Controller@create' )) }}
17 17
                 <div id='outcomeGroup'>
18 18
                     <label> Associated Outcome</label>
19
-                    <div class="form-group col-md-11" id='outcomeForm'>
19
+                    <div class="form-group col-md-11" id='outcomeForm='>
20 20
 
21 21
 
22 22
                         {{ Form::select('outcome[0]', $outcomes, null, ['class'=>'form-control selectpicker', 'id' =>'outcome[0]']) }}
@@ -40,7 +40,7 @@
40 40
                     <br>
41 41
 
42 42
 
43
-                    <input type ="hidden" id='{{ $programs[0]->name }}' name="program_id[]" value="{{$programs[0]->id}}">
43
+                    <input type="hidden" id='{{ $programs[0]->name }}' name="program_id[]" value="{{$programs[0]->id}}">
44 44
                     <input type="checkbox" id="{{ $programs[0]->name }}" name="program_id[]" value="{{$programs[0]->id}}" disabled checked>
45 45
                     <label for="{{ $programs[0]->name }}"> {{ $programs[0]->name }} [{{ $programs[0]->school->name }}]</label><br>
46 46
 
@@ -65,18 +65,18 @@
65 65
             <div class="panel-heading">
66 66
                 Edit
67 67
             </div>
68
-            
68
+
69 69
 
70 70
             <div class="panel-body">
71 71
                 <button class="btn btn-md btn-secondary filterButton">
72
-                <span class="glyphicon glyphicon-plus">
73
-                </span>
74
-                Filters
75
-              </button>
72
+                    <span class="glyphicon glyphicon-plus">
73
+                    </span>
74
+                    Filters
75
+                </button>
76 76
                 <div class='filterSection'>
77
-            
77
+
78 78
                     {{ Form::open(array('action' => 'Objective2Controller@update')) }}
79
-                    
79
+
80 80
                     <div class="form-group">
81 81
                         {{ Form::label('program_id2', 'Associated Program')}}
82 82
                         <select id='select-program' class="form-control selectpicker" onchange='fetchAllObjectives("select-program", "assoc_outcomes_fetch")'>
@@ -88,10 +88,10 @@
88 88
                     <div class="form-group">
89 89
                         <label>Associated Outcome</label>
90 90
                         {{ Form::select('assoc_outcome_fetch', $outcomes, null, ['class'=>'form-control selectpicker', 'id'=>'assoc_outcomes_fetch', 'onchange'=>'fetchAllObjectives("select-program", "assoc_outcomes_fetch")']) }}
91
-    
91
+
92 92
                     </div>
93
-                      </div>
94
-                      <hr>
93
+                </div>
94
+                <hr>
95 95
 
96 96
                 <div class="form-group">
97 97
                     {{ Form::label('objective_id', 'Objectives') }}
@@ -118,11 +118,11 @@
118 118
                         <label>Associated Outcome</label>
119 119
 
120 120
                         {{ Form::select("assoc_outcome[]", $outcomes, null, ['class'=>'form-control selectpicker', 'id'=>'assoc_outcome0']) }}
121
-<br><br>
121
+                        <br><br>
122 122
                     </div>
123
-                    
123
+
124 124
                 </div>
125
-                
125
+
126 126
                 <button id='button-add-assoc-outcome' class='btn btn-md btn-secondary' onclick='addAssoc()'>
127 127
                     <span class='glyphicon glyphicon-plus'>
128 128
 
@@ -137,8 +137,8 @@
137 137
                     <br>
138 138
 
139 139
 
140
-                    <input type ="hidden" id='assoc_program_id_{{ $programs[0]->id }}' name="program_id[]" value="{{$programs[0]->id}}">
141
-                   
140
+                    <input type="hidden" id='assoc_program_id_{{ $programs[0]->id }}' name="program_id[]" value="{{$programs[0]->id}}">
141
+
142 142
                     <input type="checkbox" id="{{ $programs[0]->name }}" id="assoc_program_id_{{$programs[0]->id}}" name="program_id[]" value="{{$programs[0]->id}}" disabled checked>
143 143
                     <label for="{{ $programs[0]->name }}"> {{ $programs[0]->name }} [{{ $programs[0]->school->name }}]</label><br>
144 144
 
@@ -168,8 +168,8 @@
168 168
                 {{ Form::close() }}
169 169
 
170 170
                 <form action="/deleteObjective" method="POST" id='deleteObj'>
171
-                
172
-                    
171
+
172
+
173 173
                 </form>
174 174
             </div>
175 175
 
@@ -181,26 +181,24 @@
181 181
     </div>
182 182
 </div>
183 183
 <script>
184
+    $('.filterSection').hide();
184 185
 
185
-$('.filterSection').hide();
186
-	
187
-    $('.filterButton').on('click', function()
188
-{
189
-  var span = $(this).find('span');
190
-  if(span.attr('class') == 'glyphicon glyphicon-plus'){
191
-    span.attr('class','glyphicon glyphicon-minus');
192
-  } else{	
193
-    span.attr('class','glyphicon glyphicon-plus');
194
-	
195
-  }
186
+    $('.filterButton').on('click', function() {
187
+        var span = $(this).find('span');
188
+        if (span.attr('class') == 'glyphicon glyphicon-plus') {
189
+            span.attr('class', 'glyphicon glyphicon-minus');
190
+        } else {
191
+            span.attr('class', 'glyphicon glyphicon-plus');
196 192
 
197
-  $('.filterSection').toggle(533);
193
+        }
198 194
 
199
-});
195
+        $('.filterSection').toggle(533);
196
+
197
+    });
200 198
     var outcomeHTML = document.getElementById('outcomeGroup').innerHTML;
201 199
     var selectOptions = document.getElementById('outcome[0]').innerHTML;
202 200
     var ran = false;
203
-   
201
+
204 202
     function fetchAllObjectives(program, outcome) {
205 203
         var program_id_fetch = $('#' + program).find(':selected').val();
206 204
         var outcome_fetch = $('#' + outcome).find(':selected').val();
@@ -433,15 +431,16 @@ $('.filterSection').hide();
433 431
             'json'
434 432
         );
435 433
     }
436
-   
434
+
437 435
 
438 436
     function deleteLastAssoc() {
439 437
 
440
-        div = document.getElementById('assocOutcomeForm' + (i).toString());
438
+        div = document.getElementById('assocOutcomeForm' + (counterAssoc - 1).toString());
441 439
         div.remove();
442
-        button = document.getElementById('closeAssoc' + (i).toString());
440
+        button = document.getElementById('closeAssoc' + (counterAssoc - 1).toString());
443 441
         button.remove();
444 442
         counterAssoc -= 1;
443
+        $('#counterAssoc').val(counterAssoc);
445 444
 
446 445
     }
447 446
 
@@ -452,7 +451,8 @@ $('.filterSection').hide();
452 451
             'class': "selectpicker form-control",
453 452
             'name': "assoc_outcome[]",
454 453
             'data-live-search': 'true',
455
-            'id': 'assoc_outcome' + counterAssoc.toString()
454
+            'id': 'assoc_outcome' + counterAssoc.toString(),
455
+            'onchange': 'fetchObjectiveForSelect("outcome' + counter + '", this.value, ' + counterAssoc + ')'
456 456
 
457 457
         });
458 458
         var $div = $('<div />', {
@@ -481,6 +481,8 @@ $('.filterSection').hide();
481 481
 
482 482
         ran = true;
483 483
         counterAssoc += 1;
484
+        $('#counterAssoc').val(counterAssoc);
485
+
484 486
 
485 487
 
486 488
     }
@@ -502,7 +504,7 @@ fetchObjectiveForEditing();
502 504
 // setCriterionStatus();
503 505
 
504 506
 
505
- 
507
+
506 508
 fetchAllObjectives("select-program", "assoc_outcomes_fetch")
507 509
 
508 510