Skip to content

Commit f2086d1

Browse files
committed
WIP changes to theme and class details options for printing and viewing schedules.
1 parent 4437ab3 commit f2086d1

File tree

5 files changed

+40
-48
lines changed

5 files changed

+40
-48
lines changed

assets/src/modules/sm/App/controllers/AppController.js

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ angular.module('sm').controller("AppController", function($scope, localStorage,
1111
$scope.state.courseMap = {};
1212
$scope.state.nonCourses = [];
1313
$scope.state.noCourses = [];
14-
$scope.state.schedules =[];
14+
$scope.state.schedules = [];
1515
$scope.state.drawOptions = {
1616
startTime: 480,
1717
endTime: 1320,
@@ -38,13 +38,16 @@ angular.module('sm').controller("AppController", function($scope, localStorage,
3838
alert_searchFeatures: true,
3939
alert_browseFeatures: true,
4040
alert_labClasses: false,
41-
action_generateSchedules: false,
41+
action_generateSchedules: false
4242
};
4343

4444
$scope.state.meta = {
4545
stateVersion: $scope.stateVersion,
4646
lastSaved: new Date().getTime()
4747
};
48+
49+
$scope.state.theme = 'woc';
50+
$scope.state.classDetails = 'NPL';
4851
};
4952
$scope.resetState = function() {
5053
$scope.initState();
@@ -591,7 +594,30 @@ angular.module('sm').controller("AppController", function($scope, localStorage,
591594
1410: '11:30pm',
592595
1440: '12:00am',
593596
}
594-
}
597+
},
598+
themeOptions: [{
599+
value: 'woc',
600+
label: "Modern Colors"
601+
}, {
602+
value: 'bow',
603+
label: "Classic B&W"
604+
}, {
605+
value: 'gow',
606+
label: "Classic Greyscale"
607+
}, {
608+
value: 'boc',
609+
label: "Black Text & Colors"
610+
}],
611+
classDetailsOptions: [{
612+
value: 'NPL',
613+
label: "Number, Professor, Location"
614+
}, {
615+
value: 'LPN',
616+
label: "Location, Professor, Number"
617+
}, {
618+
value: 'LNP',
619+
label: "Location, Number, Professor"
620+
}]
595621
},
596622
colors:
597623
["#7BA270",

assets/src/modules/sm/App/styles/global.css

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -63,28 +63,28 @@ body.print div[schedule] > .panel {
6363
margin: 0 auto;
6464
}
6565

66-
body.print div[schedule].bow svg g[svg-schedule-item] rect,
67-
body.print div[schedule].gow svg g[svg-schedule-item] rect {
66+
body div[schedule].bow svg g[svg-schedule-item] rect,
67+
body div[schedule].gow svg g[svg-schedule-item] rect {
6868
fill: #FFFFFF !important;
6969
fill-opacity: 1 !important;
7070
stroke: #000;
7171
stroke-width: 1px;
7272
}
7373

74-
body.print div[schedule].gow svg g[svg-schedule-item] rect {
74+
body div[schedule].gow svg g[svg-schedule-item] rect {
7575
stroke: #555;
7676
}
7777

78-
body.print div[schedule].bow text,
79-
body.print div[schedule].boc svg g[svg-schedule-item] text {
78+
body div[schedule].bow text,
79+
body div[schedule].boc svg g[svg-schedule-item] text {
8080
fill: #000000 !important;
8181
}
8282

83-
body.print div[schedule].bow svg line {
83+
body div[schedule].bow svg line {
8484
stroke: #000000 !important;
8585
}
8686

87-
body.print div[schedule].gow svg g[svg-schedule-item] text {
87+
body div[schedule].gow svg g[svg-schedule-item] text {
8888
fill: #333 !important;
8989
}
9090

@@ -113,7 +113,6 @@ body.print header.main {
113113
display: none;
114114
}
115115

116-
117116
body.print footer.main.print {
118117
display: block;
119118
}

assets/src/modules/sm/Schedule/controllers/SchedulePrintController.js

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -25,39 +25,6 @@ angular.module('sm').controller("SchedulePrintController", function($scope, $loc
2525

2626
$scope.heading = "My " + year + "-" + (year+1) + " " + term + " Schedule";
2727
}
28-
29-
if (!$scope.state.printTheme) {
30-
$scope.state.printTheme = 'woc';
31-
}
32-
33-
$scope.printThemeOptions = [{
34-
value: 'woc',
35-
label: "Modern Colors"
36-
}, {
37-
value: 'bow',
38-
label: "Classic B&W"
39-
}, {
40-
value: 'gow',
41-
label: "Classic Greyscale"
42-
}, {
43-
value: 'boc',
44-
label: "Black Text & Colors"
45-
}];
46-
47-
if (!$scope.state.printClassDetails) {
48-
$scope.state.printClassDetails = 'NPL';
49-
}
50-
51-
$scope.printClassDetailsOptions = [{
52-
value: 'NPL',
53-
label: "Number, Professor, Location"
54-
}, {
55-
value: 'LPN',
56-
label: "Location, Professor, Number"
57-
}, {
58-
value: 'LNP',
59-
label: "Location, Number, Professor"
60-
}];
6128

6229
localStorage.setItem("reloadSchedule", null);
6330

assets/src/modules/sm/Schedule/templates/schedule.print.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,15 @@ <h3 class="panel-title">
2020
<div class="form-group">
2121
<label for="printOptions-theme" class="col-sm-4 control-label">Theme:</label>
2222
<div class="col-sm-8">
23-
<select id="printOptions-theme" class="form-control" ng-model="state.printTheme" ng-options="opt.value as opt.label for opt in printThemeOptions"></select>
23+
<select id="printOptions-theme" class="form-control" ng-model="state.theme" ng-options="opt.value as opt.label for opt in ui.optionLists.themeOptions"></select>
2424
</div>
2525
</div>
2626
</div>
2727
<div class="col-sm-9">
2828
<div class="form-group">
2929
<label for="printOptions-classDetails" class="col-sm-3 control-label">Class Details:</label>
3030
<div class="col-sm-7">
31-
<select id="printOptions-classDetails" class="form-control" ng-model="state.printClassDetails" ng-options="opt.value as opt.label for opt in printClassDetailsOptions"></select>
31+
<select id="printOptions-classDetails" class="form-control" ng-model="state.classDetails" ng-options="opt.value as opt.label for opt in ui.optionLists.classDetailsOptions"></select>
3232
</div>
3333
</div>
3434
</div>
@@ -42,4 +42,4 @@ <h3 class="panel-title">
4242
</div>
4343
</div>
4444
<h2 id="print_header" class="center" ng-bind="heading"></h2>
45-
<div ng-class="state.printTheme" schedule print="true"></div>
45+
<div schedule print="true"></div>

assets/src/modules/sm/Schedule/templates/scheduleitem.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<div class="panel panel-default" schedule-actions>
1+
<div class="panel panel-default" ng-class="state.printTheme" schedule-actions>
22
<div ng-show="!print" class="panel-heading">
33
<div class="row form-horizontal">
44
<div class="col-xs-12">

0 commit comments

Comments
 (0)