|
@@ -93,7 +93,9 @@
|
93
|
93
|
</script>
|
94
|
94
|
|
95
|
95
|
<div class="row">
|
96
|
|
-
|
|
96
|
+ <div id = "alert_placeholder">
|
|
97
|
+
|
|
98
|
+ </div>
|
97
|
99
|
<div class="col-md-3">
|
98
|
100
|
<input class="form-control" type="text" id="userInput" onkeyup="filterCycles()" placeholder="Search for Cycles..">
|
99
|
101
|
<div class="list-group" id='list'>
|
|
@@ -108,7 +110,6 @@
|
108
|
110
|
<!-- Modal -->
|
109
|
111
|
<div id="three_year" class="modal fade" role="dialog">
|
110
|
112
|
<div class="modal-dialog">
|
111
|
|
-
|
112
|
113
|
<!-- Modal content-->
|
113
|
114
|
<div class="modal-content">
|
114
|
115
|
<div class="modal-header">
|
|
@@ -197,6 +198,7 @@
|
197
|
198
|
</div>
|
198
|
199
|
</div>
|
199
|
200
|
<div class="panel-body" id="section2">
|
|
201
|
+
|
200
|
202
|
<p class="section2-description">Select one or more Objectives that will be evaluated in a given Semester.</p>
|
201
|
203
|
<div>
|
202
|
204
|
<div class="objectives-section-0">
|
|
@@ -790,11 +792,40 @@ $('.go-to-temp').on('click', function(){
|
790
|
792
|
|
791
|
793
|
|
792
|
794
|
// remove an
|
|
795
|
+ // remove an
|
793
|
796
|
$('.delete-selection-0').on('click', function(e)
|
794
|
797
|
{
|
|
798
|
+
|
|
799
|
+
|
795
|
800
|
var options_values = $(this).parent().find('select').val().split('-');
|
796
|
801
|
|
|
802
|
+ //if == 3 then we are in the objective selector
|
797
|
803
|
if (options_values.length == 3){
|
|
804
|
+
|
|
805
|
+ //get count of all objective-selectors in the same semester, plus objective-selector-0
|
|
806
|
+ var count_objective_selectors = $(this).parent().parent().find('.objective-selector').length;
|
|
807
|
+ var count_objective_selectors_0 = $(this).parent().parent().find('.objective-selector-0').length;
|
|
808
|
+ var count_objective_selectors_total = count_objective_selectors + count_objective_selectors_0;
|
|
809
|
+
|
|
810
|
+
|
|
811
|
+ //view count of all objective-selectors in the same semester, plus objective-selector-0
|
|
812
|
+ console.log(count_objective_selectors_total);
|
|
813
|
+
|
|
814
|
+ //variable that holds value of wether the objective-selector-0 is hidden or not
|
|
815
|
+ var objective_selector_0_hidden = $(this).parent().parent().find('.objective-selector-0').is(':hidden');
|
|
816
|
+
|
|
817
|
+ if (count_objective_selectors_total == 1 || (count_objective_selectors_total == 2 && objective_selector_0_hidden)){
|
|
818
|
+ //if there is only one objective-selector,throw an alert and do nothing
|
|
819
|
+
|
|
820
|
+ //html alert with dismiss button in the alert_placeholder div
|
|
821
|
+ $('#alert_placeholder').html('<div class="alert alert-danger alert-dismissible" role="alert"> <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button> <strong>Warning!</strong>You must have at least one Objective per Semester </div>');
|
|
822
|
+
|
|
823
|
+
|
|
824
|
+
|
|
825
|
+ return true;
|
|
826
|
+ }
|
|
827
|
+ //subtract 1 from count_objective_selectors_total
|
|
828
|
+
|
798
|
829
|
var typ_id = $('#table-cycles').data('typ-id');
|
799
|
830
|
var outcome_id = options_values[0];
|
800
|
831
|
var semester_id = options_values[1];
|
|
@@ -805,7 +836,17 @@ $('.go-to-temp').on('click', function(){
|
805
|
836
|
previous_objective_id = "nothing_selected";
|
806
|
837
|
// with the next return, the post shouldnt excecute.
|
807
|
838
|
// im leaving the assignment in the line before this one just in case.
|
808
|
|
- $(this).parent().hide();;
|
|
839
|
+
|
|
840
|
+ //check to see if parent is objective-selector-0
|
|
841
|
+ var x = $(this).parent().parent().attr('class');
|
|
842
|
+ if ($(this).parent().attr('class') == 'objective-selector-0'){
|
|
843
|
+ // if it is then hide it
|
|
844
|
+ $(this).parent().parent().hide();
|
|
845
|
+ return true;
|
|
846
|
+
|
|
847
|
+ }
|
|
848
|
+
|
|
849
|
+ $(this).parent().remove();;
|
809
|
850
|
return true;
|
810
|
851
|
}
|
811
|
852
|
|
|
@@ -824,8 +865,31 @@ $('.go-to-temp').on('click', function(){
|
824
|
865
|
}
|
825
|
866
|
);
|
826
|
867
|
}
|
827
|
|
- else if (options_values.length == 4){
|
828
|
868
|
|
|
869
|
+ //if == 4 then we are in the course selector
|
|
870
|
+ else if (options_values.length == 4 || options_values == "nothing_selected"){
|
|
871
|
+
|
|
872
|
+ //get count of all objective-selectors in the same semester, plus objective-selector-0
|
|
873
|
+ var count_objective_selectors = $(this).parent().parent().find('.objective-selector').length;
|
|
874
|
+ var count_objective_selectors_0 = $(this).parent().parent().find('.objective-selector-0').length;
|
|
875
|
+ var count_objective_selectors_total = count_objective_selectors + count_objective_selectors_0;
|
|
876
|
+
|
|
877
|
+
|
|
878
|
+ //view count of all objective-selectors in the same semester, plus objective-selector-0
|
|
879
|
+ console.log(count_objective_selectors_total);
|
|
880
|
+
|
|
881
|
+ //variable that holds value of wether the objective-selector-0 is hidden or not
|
|
882
|
+ var objective_selector_0_hidden = $(this).parent().parent().find('.objective-selector-0').is(':hidden');
|
|
883
|
+
|
|
884
|
+ if (count_objective_selectors_total == 1 || (count_objective_selectors_total == 2 && objective_selector_0_hidden)){
|
|
885
|
+ //if there is only one objective-selector,throw an alert and do nothing
|
|
886
|
+
|
|
887
|
+ //html alert with dismiss button in the alert-placeholder div
|
|
888
|
+ $('#alert_placeholder').html('<div class="alert alert-danger alert-dismissible" role="alert"> <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button> <strong>Warning!</strong>You must have at least one Course </div>');
|
|
889
|
+ return true;
|
|
890
|
+ }
|
|
891
|
+ //subtract 1 from count_objective_selectors_total
|
|
892
|
+
|
829
|
893
|
var typ_id = $('#table-cycles').data('typ-id');
|
830
|
894
|
var outcome_id = options_values[0];
|
831
|
895
|
var semester_id = options_values[1];
|
|
@@ -833,6 +897,8 @@ $('.go-to-temp').on('click', function(){
|
833
|
897
|
var previous_course_id = options_values[3];
|
834
|
898
|
var new_course_id = 'nothing_selected';
|
835
|
899
|
|
|
900
|
+
|
|
901
|
+
|
836
|
902
|
$.post(
|
837
|
903
|
"{{ URL::action('ThreeYearPlanController@section3_on_change') }}",
|
838
|
904
|
{
|
|
@@ -850,8 +916,18 @@ $('.go-to-temp').on('click', function(){
|
850
|
916
|
);
|
851
|
917
|
}
|
852
|
918
|
|
853
|
|
- $(this).parent().hide();;
|
|
919
|
+ var x = $(this).parent().attr('class');
|
|
920
|
+ if ($(this).parent().attr('class') == 'objective-selector-0'){
|
|
921
|
+ // if it is then hide it
|
|
922
|
+ $(this).parent().parent().hide();
|
|
923
|
+ return;
|
|
924
|
+ }
|
|
925
|
+ //remove the select
|
|
926
|
+ $(this).parent().remove();;
|
854
|
927
|
});
|
855
|
928
|
|
856
|
929
|
|
857
|
930
|
@stop
|
|
931
|
+
|
|
932
|
+
|
|
933
|
+@stop
|