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
     'ui.bootstrap',
6
     'ui.bootstrap',
7
     'ui.router',
7
     'ui.router',
8
     'LocalStorageModule',
8
     'LocalStorageModule',
9
-    'ngAria',
10
-    'ngAnimate',
11
     'ngMaterial',
9
     'ngMaterial',
12
     'appSdk'
10
     'appSdk'
13
 ]);
11
 ]);

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

4
 
4
 
5
             $scope.DataShareBusiness = DataShareBusiness;
5
             $scope.DataShareBusiness = DataShareBusiness;
6
             $scope.dateFormat = "dd MMM yyyy";
6
             $scope.dateFormat = "dd MMM yyyy";
7
-            $scope.hourFormat = "HH:mm";
7
+            $scope.hourFormat = "HH'h'mm";
8
             $scope.courses = null;
8
             $scope.courses = null;
9
             $scope.weekId = {
9
             $scope.weekId = {
10
                 id: null,
10
                 id: null,
24
                 $scope.hours.push(d);
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
             $scope.getSheetCount = function()
34
             $scope.getSheetCount = function()
28
             {
35
             {
29
                 var sheetCount = function(group)
36
                 var sheetCount = function(group)
78
 
85
 
79
             $scope.showCourse = function(course)
86
             $scope.showCourse = function(course)
80
             {
87
             {
81
-                console.log(course);
82
-
83
                 $mdDialog.show(
88
                 $mdDialog.show(
84
                     $mdDialog.alert()
89
                     $mdDialog.alert()
85
                         .parent(angular.element(document.querySelector('#popupContainer')))
90
                         .parent(angular.element(document.querySelector('#popupContainer')))
145
                     $scope.loadWeeks();
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
 
64
 
65
 @calendar-height: 24*30px;
65
 @calendar-height: 24*30px;
66
 @grey-color: #505050;
66
 @grey-color: #505050;
67
+@course-font-size: 12px;
67
 
68
 
68
 .day-column {
69
 .day-column {
69
   .text-center();
70
   .text-center();
84
   color: red;
85
   color: red;
85
 }
86
 }
86
 
87
 
88
+.day-column-header-today {
89
+  color: green;
90
+}
91
+
87
 .day-column-header-day {
92
 .day-column-header-day {
88
   padding-top: 5px;
93
   padding-top: 5px;
89
 }
94
 }
110
 
115
 
111
 .day-column-course-name {
116
 .day-column-course-name {
112
   font-weight: bold;
117
   font-weight: bold;
113
-  font-size: 12px;
118
+  font-size: @course-font-size;
114
 }
119
 }
115
 
120
 
116
 .day-column-room-name {
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
 .days-container {
135
 .days-container {

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

25
             <div ng-repeat="day in days" class="col-sm-1 day-column"
25
             <div ng-repeat="day in days" class="col-sm-1 day-column"
26
                 ng-style="{'border-right': $last ? 'solid #505050 1px' : ''}">
26
                 ng-style="{'border-right': $last ? 'solid #505050 1px' : ''}">
27
                 <div class="day-column-header day-column-header-day"
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
                     {{ day.day }}
30
                     {{ day.day }}
30
                 </div>
31
                 </div>
31
                 <div class="day-column-header day-column-header-date"
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
                     {{ day.date | date : dateFormat }}
35
                     {{ day.date | date : dateFormat }}
34
                 </div>
36
                 </div>
35
                 <div class="day-column-courses">
37
                 <div class="day-column-courses">
42
                         <div ng-repeat="room in course.RoomList">
44
                         <div ng-repeat="room in course.RoomList">
43
                             <span class="day-column-room-name">{{room.Name}}</span>
45
                             <span class="day-column-room-name">{{room.Name}}</span>
44
                         </div>
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
                     </div>
51
                     </div>
46
                 </div>
52
                 </div>
47
             </div>
53
             </div>

Loading…
Cancel
Save