Ver código fonte

group search enter validation; added groups in courses display

tags/1.0.0
Robin Thoni 8 anos atrás
pai
commit
ffb9e199e0

+ 10
- 0
app/controllers/sidebar.controller.js Ver arquivo

@@ -49,6 +49,16 @@ angular.module('app')
49 49
                 }
50 50
             };
51 51
 
52
+            $scope.goToFirstMatch = function()
53
+            {
54
+                if ($scope.Search.value.length != 0) {
55
+                    var groups = $scope.search();
56
+                    if (groups.length > 0) {
57
+                        $scope.goTo(groups[0]);
58
+                    }
59
+                }
60
+            };
61
+
52 62
             $scope.isInState = function(state)
53 63
             {
54 64
                 return $state.current.name == state;

+ 4
- 1
app/less/app.less Ver arquivo

@@ -129,6 +129,10 @@
129 129
   font-size: @course-font-size;
130 130
 }
131 131
 
132
+.day-column-group-name {
133
+  font-size: @course-font-size;
134
+}
135
+
132 136
 .days-container {
133 137
   padding-left: 0;
134 138
   width: 90%;
@@ -157,7 +161,6 @@
157 161
   min-height: 75px;
158 162
 }
159 163
 
160
-
161 164
 .course-dialog {
162 165
   min-width: 400px;
163 166
 }

+ 3
- 0
app/views/home.html Ver arquivo

@@ -60,6 +60,9 @@
60 60
                             <span class="day-column-staff-name">{{staff.Name}}</span>
61 61
                         </div>
62 62
                         <span class="day-column-course-hour">{{course.BeginDate | date : timeFormat}} - {{course.EndDate | date : timeFormat}}</span>
63
+                        <div ng-repeat="group in course.GroupList">
64
+                            <span class="day-column-group-name">{{group.Name}}</span>
65
+                        </div>
63 66
                     </div>
64 67
                 </div>
65 68
             </div>

+ 3
- 0
app/views/modals/course.html Ver arquivo

@@ -15,6 +15,9 @@
15 15
                     <span class="day-column-staff-name">{{staff.Name}}</span>
16 16
                 </div>
17 17
                 <span class="day-column-course-hour">{{course.BeginDate | date : timeFormat}} - {{course.EndDate | date : timeFormat}}</span>
18
+                <div ng-repeat="group in course.GroupList">
19
+                    <span class="day-column-group-name">{{group.Name}}</span>
20
+                </div>
18 21
             </div>
19 22
         </md-dialog-content>
20 23
         <md-dialog-actions layout="row">

+ 17
- 15
app/views/sidebar.html Ver arquivo

@@ -11,21 +11,23 @@
11 11
             narrow your display.
12 12
         </p>-->
13 13
         <div lu-busy="sidebar">
14
-            <md-autocomplete
15
-                    md-selected-item="Search.selected"
16
-                    md-search-text="Search.value"
17
-                    md-selected-item-change="goTo(item)"
18
-                    md-items="item in search(ctrl.searchText)"
19
-                    md-item-text="item.Name"
20
-                    md-min-length="1"
21
-                    placeholder="Type a group name...">
22
-                <md-item-template>
23
-                    <span md-highlight-text="ctrl.searchText" md-highlight-flags="^i">{{item.Name}}</span>
24
-                </md-item-template>
25
-                <md-not-found>
26
-                    No groups matching "{{Search.value}}" were found.
27
-                </md-not-found>
28
-            </md-autocomplete>
14
+            <form ng-submit="goToFirstMatch()">
15
+                <md-autocomplete
16
+                        md-selected-item="Search.selected"
17
+                        md-search-text="Search.value"
18
+                        md-selected-item-change="goTo(item)"
19
+                        md-items="item in search(ctrl.searchText)"
20
+                        md-item-text="item.Name"
21
+                        md-min-length="1"
22
+                        placeholder="Type a group name...">
23
+                    <md-item-template>
24
+                        <span md-highlight-text="ctrl.searchText" md-highlight-flags="^i">{{item.Name}}</span>
25
+                    </md-item-template>
26
+                    <md-not-found>
27
+                        No groups matching "{{Search.value}}" were found.
28
+                    </md-not-found>
29
+                </md-autocomplete>
30
+            </form>
29 31
 
30 32
             <ul class="col-sm-12 sidebar-group-list">
31 33
                 <li ng-show="DataShareBusiness.CurrentGroups.length != 0" class="col-xs-12">

Carregando…
Cancelar
Salvar