Browse Source

course dialog

tags/1.0.0
Robin Thoni 8 years ago
parent
commit
e1f79c8924

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

@@ -85,7 +85,18 @@ angular.module('app')
85 85
 
86 86
             $scope.showCourse = function(course)
87 87
             {
88
-                $mdDialog.show(
88
+                $mdDialog.show({
89
+                    controller: 'CourseController',
90
+                    templateUrl: 'views/modals/course.html',
91
+                    parent: angular.element(document.body),
92
+                    targetEvent: null,
93
+                    clickOutsideToClose: true,
94
+                    fullscreen: false,
95
+                    locals: {
96
+                        course: course
97
+                    }
98
+                });
99
+                /*$mdDialog.show(
89 100
                     $mdDialog.alert()
90 101
                         .parent(angular.element(document.querySelector('#popupContainer')))
91 102
                         .clickOutsideToClose(true)
@@ -93,7 +104,7 @@ angular.module('app')
93 104
                         .content("<a href=''>42</a>")
94 105
                         .ariaLabel(course.Name)
95 106
                         .ok('Ok')
96
-                );
107
+                );*/
97 108
             };
98 109
 
99 110
             $scope.onWeekReceived = function(data)

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

@@ -0,0 +1,17 @@
1
+/**
2
+ * Created by robin on 11/1/15.
3
+ */
4
+
5
+angular.module('app')
6
+    .controller('CourseController', ['$scope', '$mdDialog', 'course',
7
+        function($scope, $mdDialog, course) {
8
+
9
+            $scope.course = course;
10
+            $scope.dateFormat = "dd MMM yyyy";
11
+            $scope.hourFormat = "HH'h'mm";
12
+
13
+            $scope.close = function()
14
+            {
15
+                $mdDialog.cancel();
16
+            };
17
+        }]);

+ 1
- 0
app/index.html View File

@@ -46,6 +46,7 @@
46 46
     <script src="controllers/sidebar.controller.js"></script>
47 47
     <script src="controllers/toolbar.controller.js"></script>
48 48
     <script src="controllers/home.controller.js"></script>
49
+    <script src="controllers/modals/course.controller.js"></script>
49 50
 
50 51
     <!-- Modal Controller -->
51 52
 

+ 5
- 0
app/less/app.less View File

@@ -159,3 +159,8 @@ footer {
159 159
   height: 100%;
160 160
   min-height: 75px;
161 161
 }
162
+
163
+
164
+.course-dialog {
165
+  min-width: 400px;
166
+}

+ 26
- 0
app/views/modals/course.html View File

@@ -0,0 +1,26 @@
1
+<md-dialog aria-label="{{course.Name}}"  ng-cloak class="course-dialog">
2
+    <form>
3
+        <md-toolbar>
4
+            <div class="md-toolbar-tools">
5
+                <h2>{{course.Name}}</h2>
6
+                <span flex></span>
7
+            </div>
8
+        </md-toolbar>
9
+        <md-dialog-content>
10
+            <div class="md-dialog-content">
11
+                <div ng-repeat="room in course.RoomList">
12
+                    <span class="day-column-room-name">{{room.Name}}</span>
13
+                </div>
14
+                <div ng-repeat="staff in course.StaffList">
15
+                    <span class="day-column-staff-name">{{staff.Name}}</span>
16
+                </div>
17
+                <span class="day-column-course-hour">{{course.BeginDate | date : hourFormat}} - {{course.EndDate | date : hourFormat}}</span>
18
+            </div>
19
+        </md-dialog-content>
20
+        <md-dialog-actions layout="row">
21
+            <md-button ng-click="close()" style="margin-right:20px;">
22
+                Close
23
+            </md-button>
24
+        </md-dialog-actions>
25
+    </form>
26
+</md-dialog>

Loading…
Cancel
Save