Skip to content

Commit 567bff0

Browse files
committed
(Finished WIP changes)
Now the theme and class details are shown on the generate as well as print view pages. These are saved in state.drawOptions and passed to print view.
1 parent 93fe3b0 commit 567bff0

File tree

4 files changed

+27
-12
lines changed

4 files changed

+27
-12
lines changed

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

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ angular.module('sm').controller("AppController", function($scope, localStorage,
1717
endTime: 1320,
1818
startDay: 1,
1919
endDay: 6,
20-
bldgStyle: 'code'
20+
bldgStyle: 'code',
21+
theme: 'woc',
22+
classDetails:'NPL'
2123
};
2224

2325
$scope.state.displayOptions = {
@@ -45,9 +47,6 @@ angular.module('sm').controller("AppController", function($scope, localStorage,
4547
stateVersion: $scope.stateVersion,
4648
lastSaved: new Date().getTime()
4749
};
48-
49-
$scope.state.theme = 'woc';
50-
$scope.state.classDetails = 'NPL';
5150
};
5251
$scope.resetState = function() {
5352
$scope.initState();
@@ -85,10 +84,10 @@ angular.module('sm').controller("AppController", function($scope, localStorage,
8584
$scope.state.schedules[count][0].initialIndex = count;
8685
}
8786
}
88-
if (!$scope.state.classDetails) {
87+
if (!$scope.state.drawOptions.classDetails) {
8988
$scope.state.classDetails = 'NPL';
9089
}
91-
if (!$scope.state.theme) {
90+
if (!$scope.state.drawOptions.theme) {
9291
$scope.state.theme = 'woc';
9392
}
9493
} else {

assets/src/modules/sm/Generate/templates/generate.html

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ <h3 class="panel-title">Mobile Display</h3>
275275
</div>
276276
</div>
277277
</div>
278-
<div class="col-md-4">
278+
<div class="col-md-3">
279279
<div class="form-group">
280280
<label for="displayOptions-pageSize" class="col-sm-6 control-label">Page Size:</label>
281281
<div class="col-sm-6">
@@ -290,6 +290,14 @@ <h3 class="panel-title">Mobile Display</h3>
290290
</div>
291291
</div>
292292
</div>
293+
<div class="col-md-5">
294+
<div class="form-group">
295+
<label for="options-theme" class="col-sm-4 control-label">Theme:</label>
296+
<div class="col-sm-8">
297+
<select id="options-theme" class="form-control" ng-model="state.drawOptions.theme" ng-options="opt.value as opt.label for opt in ui.optionLists.themeOptions"></select>
298+
</div>
299+
</div>
300+
</div>
293301
</div>
294302
<div class="row">
295303
<div class="col-md-4">
@@ -303,14 +311,22 @@ <h3 class="panel-title">Mobile Display</h3>
303311
</div>
304312
</div>
305313
</div>
306-
<div class="col-md-4">
314+
<div class="col-md-3">
307315
<div class="form-group">
308316
<label for="displayOptions-creditWarning" class="col-sm-6 control-label">Credits:</label>
309317
<div class="col-sm-6">
310318
<input ng-pattern="/^\d{1,2}$/" type="text" id="displayOptions-creditWarning" class="form-control" ng-model="state.displayOptions.creditWarning" />
311319
</div>
312320
</div>
313321
</div>
322+
<div class="col-md-5">
323+
<div class="form-group">
324+
<label for="options-classDetails" class="col-sm-4 control-label">Class Details:</label>
325+
<div class="col-sm-8">
326+
<select id="options-classDetails" class="form-control" ng-model="state.drawOptions.classDetails" ng-options="opt.value as opt.label for opt in ui.optionLists.classDetailsOptions"></select>
327+
</div>
328+
</div>
329+
</div>
314330
</div>
315331
</div>
316332
<div class="col-md-3">

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

Lines changed: 2 additions & 2 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.theme" ng-options="opt.value as opt.label for opt in ui.optionLists.themeOptions"></select>
23+
<select id="printOptions-theme" class="form-control" ng-model="state.drawOptions.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.classDetails" ng-options="opt.value as opt.label for opt in ui.optionLists.classDetailsOptions"></select>
31+
<select id="printOptions-classDetails" class="form-control" ng-model="state.drawOptions.classDetails" ng-options="opt.value as opt.label for opt in ui.optionLists.classDetailsOptions"></select>
3232
</div>
3333
</div>
3434
</div>

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.theme" schedule-actions>
1+
<div class="panel panel-default" ng-class="state.drawOptions.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.classDetails">
73+
<g ng-switch="state.drawOptions.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)