Browse Source

calendar display staff and hours; color current day

tags/1.0.0
Robin Thoni 8 years ago
parent
commit
8d970767b8
4 changed files with 35 additions and 9 deletions
  1. 0
    2
      app/app.js
  2. 10
    3
      app/controllers/home.controller.js
  3. 17
    2
      app/less/app.less
  4. 8
    2
      app/views/home.html

+ 0
- 2
app/app.js View File

@@ -6,8 +6,6 @@ var app = angular.module('app', [
6 6
     'ui.bootstrap',
7 7
     'ui.router',
8 8
     'LocalStorageModule',
9
-    'ngAria',
10
-    'ngAnimate',
11 9
     'ngMaterial',
12 10
     'appSdk'
13 11
 ]);

+ 10
- 3
app/controllers/home.controller.js View File

@@ -4,7 +4,7 @@ angular.module('app')
4 4
 
5 5
             $scope.DataShareBusiness = DataShareBusiness;
6 6
             $scope.dateFormat = "dd MMM yyyy";
7
-            $scope.hourFormat = "HH:mm";
7
+            $scope.hourFormat = "HH'h'mm";
8 8
             $scope.courses = null;
9 9
             $scope.weekId = {
10 10
                 id: null,
@@ -24,6 +24,13 @@ angular.module('app')
24 24
                 $scope.hours.push(d);
25 25
             }
26 26
 
27
+            $scope.isToday = function(date)
28
+            {
29
+                var today = new Date();
30
+                today.setHours(0, 0, 0, 0);
31
+                return today.getTime() == date.getTime();
32
+            };
33
+
27 34
             $scope.getSheetCount = function()
28 35
             {
29 36
                 var sheetCount = function(group)
@@ -78,8 +85,6 @@ angular.module('app')
78 85
 
79 86
             $scope.showCourse = function(course)
80 87
             {
81
-                console.log(course);
82
-
83 88
                 $mdDialog.show(
84 89
                     $mdDialog.alert()
85 90
                         .parent(angular.element(document.querySelector('#popupContainer')))
@@ -145,4 +150,6 @@ angular.module('app')
145 150
                     $scope.loadWeeks();
146 151
                 }
147 152
             });
153
+
154
+            $scope.setDates($scope.getMonday($scope.selectedDate));
148 155
     }]);

+ 17
- 2
app/less/app.less View File

@@ -64,6 +64,7 @@ footer {
64 64
 
65 65
 @calendar-height: 24*30px;
66 66
 @grey-color: #505050;
67
+@course-font-size: 12px;
67 68
 
68 69
 .day-column {
69 70
   .text-center();
@@ -84,6 +85,10 @@ footer {
84 85
   color: red;
85 86
 }
86 87
 
88
+.day-column-header-today {
89
+  color: green;
90
+}
91
+
87 92
 .day-column-header-day {
88 93
   padding-top: 5px;
89 94
 }
@@ -110,11 +115,21 @@ footer {
110 115
 
111 116
 .day-column-course-name {
112 117
   font-weight: bold;
113
-  font-size: 12px;
118
+  font-size: @course-font-size;
114 119
 }
115 120
 
116 121
 .day-column-room-name {
117
-  font-size: 12px;
122
+  font-size: @course-font-size;
123
+  text-decoration: underline;
124
+}
125
+
126
+.day-column-staff-name {
127
+  font-size: @course-font-size;
128
+  font-style: italic;
129
+}
130
+
131
+.day-column-course-hour {
132
+  font-size: @course-font-size;
118 133
 }
119 134
 
120 135
 .days-container {

+ 8
- 2
app/views/home.html View File

@@ -25,11 +25,13 @@
25 25
             <div ng-repeat="day in days" class="col-sm-1 day-column"
26 26
                 ng-style="{'border-right': $last ? 'solid #505050 1px' : ''}">
27 27
                 <div class="day-column-header day-column-header-day"
28
-                     ng-class="{'day-column-header-current': selectedDate.getTime() == day.date.getTime()}">
28
+                     ng-class="{'day-column-header-current': !isToday(day.date) && selectedDate.getTime() == day.date.getTime(),
29
+                                'day-column-header-today': isToday(day.date)}">
29 30
                     {{ day.day }}
30 31
                 </div>
31 32
                 <div class="day-column-header day-column-header-date"
32
-                     ng-class="{'day-column-header-current': selectedDate.getTime() == day.date.getTime()}">
33
+                     ng-class="{'day-column-header-current': !isToday(day.date) && selectedDate.getTime() == day.date.getTime(),
34
+                                'day-column-header-today': isToday(day.date)}">
33 35
                     {{ day.date | date : dateFormat }}
34 36
                 </div>
35 37
                 <div class="day-column-courses">
@@ -42,6 +44,10 @@
42 44
                         <div ng-repeat="room in course.RoomList">
43 45
                             <span class="day-column-room-name">{{room.Name}}</span>
44 46
                         </div>
47
+                        <div ng-repeat="staff in course.StaffList">
48
+                            <span class="day-column-staff-name">{{staff.Name}}</span>
49
+                        </div>
50
+                        <span class="day-column-course-hour">{{course.BeginDate | date : hourFormat}} - {{course.EndDate | date : hourFormat}}</span>
45 51
                     </div>
46 52
                 </div>
47 53
             </div>

Loading…
Cancel
Save