Browse Source

begin free room; centralized date/hour format

tags/1.0.0
Robin Thoni 8 years ago
parent
commit
7a5492c50e

+ 7
- 5
app/app.js View File

32
             }
32
             }
33
         };
33
         };
34
     }])
34
     }])
35
-    .run(['$rootScope', '$state', '$location', 'DataShareBusiness', 'GroupsBusiness',
36
-        function ($rootScope, $state, $location, DataShareBusiness, GroupsBusiness) {
37
-            $rootScope.$on('$stateChangeError', function (e, curr, prev) {
38
-                //$state.go('/');
39
-            });
35
+    .run(['$rootScope', '$state', '$location', 'DataShareBusiness', 'GroupsBusiness', '$mdDateLocale', '$filter',
36
+        function ($rootScope, $state, $location, DataShareBusiness, GroupsBusiness, $mdDateLocale, $filter) {
40
 
37
 
41
             $rootScope.$watch(function(){ return Object.keys($location.search())[0] }, function(){
38
             $rootScope.$watch(function(){ return Object.keys($location.search())[0] }, function(){
42
                 if (DataShareBusiness.Groups != null) {
39
                 if (DataShareBusiness.Groups != null) {
53
             {
50
             {
54
                 DataShareBusiness.setFromSearchString(Object.keys($location.search())[0]);
51
                 DataShareBusiness.setFromSearchString(Object.keys($location.search())[0]);
55
             });
52
             });
53
+
54
+            $mdDateLocale.firstDayOfWeek = 1;
55
+            $mdDateLocale.formatDate = function(date) {
56
+                return $filter("date")(date, DataShareBusiness.DateFormat);
57
+            };
56
     }]);
58
     }]);

+ 2
- 11
app/controllers/home.controller.js View File

3
         function($scope, $state, DataShareBusiness, WeeksBusiness, $mdDialog) {
3
         function($scope, $state, DataShareBusiness, WeeksBusiness, $mdDialog) {
4
 
4
 
5
             $scope.DataShareBusiness = DataShareBusiness;
5
             $scope.DataShareBusiness = DataShareBusiness;
6
-            $scope.dateFormat = "dd MMM yyyy";
7
-            $scope.hourFormat = "HH'h'mm";
6
+            $scope.dateFormat = DataShareBusiness.DateFormat;
7
+            $scope.hourFormat = DataShareBusiness.HourFormat;
8
             $scope.courses = null;
8
             $scope.courses = null;
9
             $scope.weekId = {
9
             $scope.weekId = {
10
                 id: null,
10
                 id: null,
96
                         course: course
96
                         course: course
97
                     }
97
                     }
98
                 });
98
                 });
99
-                /*$mdDialog.show(
100
-                    $mdDialog.alert()
101
-                        .parent(angular.element(document.querySelector('#popupContainer')))
102
-                        .clickOutsideToClose(true)
103
-                        .title(course.Name)
104
-                        .content("<a href=''>42</a>")
105
-                        .ariaLabel(course.Name)
106
-                        .ok('Ok')
107
-                );*/
108
             };
99
             };
109
 
100
 
110
             $scope.onWeekReceived = function(data)
101
             $scope.onWeekReceived = function(data)

+ 17
- 0
app/controllers/modals/freeroom.controller.js View File

1
+/**
2
+ * Created by robin on 11/1/15.
3
+ */
4
+
5
+angular.module('app')
6
+    .controller('FreeRoomController', ['$scope', '$mdDialog',
7
+        function($scope, $mdDialog) {
8
+
9
+            $scope.course = course;
10
+            $scope.dateFormat = DataShareBusiness.DateFormat;
11
+            $scope.hourFormat = DataShareBusiness.HourFormat;
12
+
13
+            $scope.close = function()
14
+            {
15
+                $mdDialog.cancel();
16
+            };
17
+        }]);

+ 8
- 1
app/controllers/sidebar.controller.js View File

50
 
50
 
51
             $scope.findFreeRoom = function()
51
             $scope.findFreeRoom = function()
52
             {
52
             {
53
-
53
+                $mdDialog.show({
54
+                    controller: 'FreeRoomController',
55
+                    templateUrl: 'views/modals/freeroom.html',
56
+                    parent: angular.element(document.body),
57
+                    targetEvent: null,
58
+                    clickOutsideToClose: true,
59
+                    fullscreen: false
60
+                });
54
             };
61
             };
55
         }]);
62
         }]);

+ 4
- 0
sdk/Business/DataShareBusiness.js View File

10
 
10
 
11
                 CurrentGroups: [],
11
                 CurrentGroups: [],
12
 
12
 
13
+                DateFormat: "dd MMM yyyy",
14
+
15
+                HourFormat: "HH'h'mm",
16
+
13
                 setCurrentGroup: function(group)
17
                 setCurrentGroup: function(group)
14
                 {
18
                 {
15
                     data.CurrentGroups = [];
19
                     data.CurrentGroups = [];

Loading…
Cancel
Save