Skip to content

Commit 93fe3b0

Browse files
committed
Bug fixes for changes to theme and class details options for printing and viewing schedules.
1 parent f2086d1 commit 93fe3b0

File tree

3 files changed

+22
-16
lines changed

3 files changed

+22
-16
lines changed

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

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -71,23 +71,30 @@ angular.module('sm').controller("AppController", function($scope, localStorage,
7171

7272
// Reload the state if it exists
7373
var storedState = localStorage.getItem('state');
74-
if(storedState != null) {
75-
74+
if (storedState != null) {
7675
// Check if state version exists or is correct
77-
if(storedState.hasOwnProperty('meta') && storedState.meta.stateVersion == $scope.stateVersion) {
76+
if (storedState.hasOwnProperty('meta') && storedState.meta.stateVersion == $scope.stateVersion) {
7877
$scope.state = storedState;
79-
if(!$scope.state.displayOptions.hasOwnProperty('creditWarning') || !$scope.state.displayOptions.creditWarning) {
78+
if (!$scope.state.displayOptions.hasOwnProperty('creditWarning') || !$scope.state.displayOptions.creditWarning) {
8079
$scope.state.displayOptions.creditWarning = 18;
8180
}
82-
if($scope.state.schedules.length > 0 && $scope.state.schedules[0].length > 0 && !$scope.state.schedules[0][0].hasOwnProperty('initialIndex')){
81+
82+
// Initialize new values
83+
if ($scope.state.schedules.length > 0 && $scope.state.schedules[0].length > 0 && !$scope.state.schedules[0][0].hasOwnProperty('initialIndex')) {
8384
for (var count = 0; count < $scope.state.schedules.length; count++) {
8485
$scope.state.schedules[count][0].initialIndex = count;
8586
}
8687
}
88+
if (!$scope.state.classDetails) {
89+
$scope.state.classDetails = 'NPL';
90+
}
91+
if (!$scope.state.theme) {
92+
$scope.state.theme = 'woc';
93+
}
8794
} else {
8895

8996
// Before state meta
90-
if(confirm('We need to clear your session in order to update ScheduleMaker, is that ok? \n If you press cancel, you may run into errors.')) {
97+
if (confirm('We need to clear your session in order to update ScheduleMaker, is that ok? \n If you press cancel, you may run into errors.')) {
9198
$scope.resetState();
9299
} else {
93100
$scope.state = storedState;
@@ -103,7 +110,6 @@ angular.module('sm').controller("AppController", function($scope, localStorage,
103110
// Default, images are supported
104111
$scope.imageSupport = true;
105112

106-
107113
var courseNumFilter = $filter('courseNum');
108114

109115
// Course cart tools for non-generate pages.

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

Lines changed: 7 additions & 7 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 div[schedule].bow svg g[svg-schedule-item] rect,
67-
body div[schedule].gow svg g[svg-schedule-item] rect {
66+
body .bow svg g[svg-schedule-item] rect,
67+
body .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 div[schedule].gow svg g[svg-schedule-item] rect {
74+
body .gow svg g[svg-schedule-item] rect {
7575
stroke: #555;
7676
}
7777

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

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

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

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<div class="panel panel-default" ng-class="state.printTheme" schedule-actions>
1+
<div class="panel panel-default" ng-class="state.theme" schedule-actions>
22
<div ng-show="!print" class="panel-heading">
33
<div class="row form-horizontal">
44
<div class="col-xs-12">
@@ -70,7 +70,7 @@ <h2 class="panel-title control-label pull-left smaller-sm">{{saveAction == "crea
7070
<div class="schedule-cont">
7171
<div class="schedule-track" ng-class="mobileTrackClass">
7272
<svg version="1.1" ng-attr-height="{{grid.opts.height}}" width="100%" xmlns="http://www.w3.org/2000/svg"><defs><pattern vector-effect="non-scaling-stroke" id="day{{initialIndex}}" width="100%" x="0" height="40" patternUnits="userSpaceOnUse"><line vector-effect="non-scaling-stroke" x1="0" y1="19.5" x2="100%" y2="19.5" style="stroke:#bbb;stroke-width:1" /></pattern></defs><rect x="0" y="0" width="100%" height="100%" fill="#ffffff" /><g ng-attr-transform="{{grid.opts.pixelAlignment}}" font-family="Roboto" font-size="15"><g class="svg-schedule-hours"><text fill="#aaa" text-anchor="end" ng-repeat="hour in grid.hours track by $index" ng-attr-x="{{print?'41':'5%'}}" ng-attr-y="{{($index * 40) + 25}}">{{hour}}</text></g><g ng-repeat="day in grid.days"><text y="12" ng-attr-x="{{day.offset}}" ng-attr-width="{{grid.opts.daysWidth}}" fill="#aaa" ng-bind="day.name"></text><rect y="19" ng-attr-x="{{day.offset}}" ng-attr-width="{{grid.opts.daysWidth}}" ng-attr-height="{{grid.opts.daysHeight}}" fill="url(#day{{initialIndex}})" /></g><g svg-schedule-item class="item" ng-mouseenter="itemEnter($event)" ng-mouseleave="itemLeave($event)" ng-repeat="item in scheduleItems | orderBy:'-boundry.y'"><rect ng-attr-x="{{item.boundry.x}}" ng-attr-y="{{item.boundry.y}}" ng-attr-width="{{item.boundry.width}}" ng-attr-height="{{item.boundry.height}}" ng-attr-fill="{{item.color}}" fill-opacity="1" /><rect ng-if="item.boundry.shorten != 0" ng-attr-x="{{item.boundry.x}}" ng-attr-y="{{item.boundry.shorten < 0 ?item.boundry.y : item.boundry.y + item.boundry.height - 2}}" ng-attr-width="{{item.boundry.width}}" height="2" fill="#ffff00" /><text svg-text-line="{{item.title}}" ng-attr-x="{{item.boundry.x}}" ng-attr-y="{{item.boundry.y + 16}}" transform="translate(3,0)" font-weight="bold" fill="white"></text>
73-
<g ng-switch="state.printClassDetails">
73+
<g ng-switch="state.classDetails">
7474
<g ng-switch-default>
7575
<text ng-if="item.boundry.height > 32 && item.content.courseNum" svg-text-line="{{item.content.courseNum}}" ng-attr-x="{{item.boundry.x}}" ng-attr-y="{{item.boundry.y + 32}}" transform="translate(3,0)" fill="#fff"></text><text ng-if="item.boundry.height > 48 && item.content.instructor" svg-text-line="{{item.content.instructor}}" ng-attr-x="{{item.boundry.x}}" ng-attr-y="{{item.boundry.y + 48}}" transform="translate(3,0)" fill="#fff"></text><text ng-if="item.boundry.height > 64 && item.content.location" svg-text-line="{{item.content.location}}" ng-attr-x="{{item.boundry.x}}" ng-attr-y="{{item.boundry.y + 64}}" transform="translate(3,0)" fill="#fff"></text>
7676
</g>

0 commit comments

Comments
 (0)