Browse Source

ui fixes

tags/0.1.3^0
Robin Thoni 9 years ago
parent
commit
8ef396ba2a

+ 1
- 1
dist/luticate-utils.min.js
File diff suppressed because it is too large
View File


+ 0
- 7
src/lubasictable.css View File

1
-.lu-basic-table-pagination-current {
2
-    font-weight: bold;
3
-}
4
-
5
-.lu-basic-table-pagination-not-current {
6
-
7
-}

+ 15
- 6
src/lubasictable.js View File

14
                 link: function ($scope, element, attrs) {
14
                 link: function ($scope, element, attrs) {
15
                     $scope.items = [];
15
                     $scope.items = [];
16
                     $scope.pages = [];
16
                     $scope.pages = [];
17
+                    $scope.maxPage = 1;
17
 
18
 
18
                     $scope.tableOptions = $scope.options();
19
                     $scope.tableOptions = $scope.options();
19
                     $scope.tableOptions.luBasicTableScope = $scope;
20
                     $scope.tableOptions.luBasicTableScope = $scope;
85
                     }
86
                     }
86
 
87
 
87
                     $scope.loadPage = function (page) {
88
                     $scope.loadPage = function (page) {
89
+                        if (page < 0 || page >= $scope.maxPage) {
90
+                            return;
91
+                        }
88
                         $scope.tableOptions.checkedItems = [];
92
                         $scope.tableOptions.checkedItems = [];
89
                         var promiseLoadItems = {
93
                         var promiseLoadItems = {
90
                             id: "promiseLoadItems_" + $scope.$id,
94
                             id: "promiseLoadItems_" + $scope.$id,
96
                                 $scope.tableOptions.page = page;
100
                                 $scope.tableOptions.page = page;
97
                                 $scope.items = items;
101
                                 $scope.items = items;
98
                                 $scope.pages = [];
102
                                 $scope.pages = [];
103
+                                $scope.maxPage = Math.max(items.Count / $scope.tableOptions.perPage, 1);
99
                                 var start = Math.max(0, $scope.tableOptions.page - 5);
104
                                 var start = Math.max(0, $scope.tableOptions.page - 5);
100
-                                var end = Math.min(start + 10, (items.Count / $scope.tableOptions.perPage)
101
-                                    + (items.Count % $scope.tableOptions.perPage == 0 ? -1 : 0));
105
+                                var end = Math.min(start + 10, $scope.maxPage);
102
                                 for (var i = start; i < end; ++i) {
106
                                 for (var i = start; i < end; ++i) {
103
                                     $scope.pages.push(i);
107
                                     $scope.pages.push(i);
104
                                 }
108
                                 }
193
 '</tbody>' +
197
 '</tbody>' +
194
 '</table>' +
198
 '</table>' +
195
 
199
 
196
-'<div class="col-sm-12 text-center">' +
197
-'    <a class="{{ p == tableOptions.page ? \'lu-basic-table-pagination-current\' : \'lu-basic-table-pagination-not-current\'}}"' +
198
-        'href="" ng-repeat="p in pages" ng-click="loadPage(p)">{{ p + 1 }}&nbsp;</a>' +
199
-'</div>' +
200
+        '<div class="col-sm-12 text-center">' +
201
+'<div class="pagination"><ul>' +
202
+'    <li class="previous">' +
203
+'        <a href="" class="fui-arrow-left" ng-click="loadPage(tableOptions.page - 1)"></a></li>' +
204
+'    <li ng-repeat="p in pages" ng-class="{ \'active\' : p == tableOptions.page}">' +
205
+'        <a href="" ng-click="loadPage(p)">{{ p + 1 }}</a></li>' +
206
+'    <li class="next">' +
207
+'        <a href="" class="fui-arrow-right" ng-click="loadPage(tableOptions.page + 1)"></a></li>' +
208
+'</ul></div></div>' +
200
 '    </div>');
209
 '    </div>');
201
 }]);
210
 }]);

+ 6
- 6
src/lupermissionsedit.js View File

117
     $templateCache.put('/luticate/lupermissionedit.html', '<div class="col-sm-12">' +
117
     $templateCache.put('/luticate/lupermissionedit.html', '<div class="col-sm-12">' +
118
 '        <div class="form-group col-sm-12"  lu-busy="permissionList">' +
118
 '        <div class="form-group col-sm-12"  lu-busy="permissionList">' +
119
 '    <div class="col-sm-6" ng-repeat="permission in permissions" lu-busy="{group: \'permission_\' + permission.Name}">' +
119
 '    <div class="col-sm-6" ng-repeat="permission in permissions" lu-busy="{group: \'permission_\' + permission.Name}">' +
120
-'    <label class="col-sm-6 control-label">{{ permission.Name }}</label>' +
120
+'    <label class="col-sm-6 control-label" title="{{ permission.Name }}">{{ permission.Name }}</label>' +
121
 '<div class="col-sm-6">' +
121
 '<div class="col-sm-6">' +
122
 '    <div class="btn-group">' +
122
 '    <div class="btn-group">' +
123
-'    <button class="btn btn-default dropdown-toggle btn-select" data-toggle="dropdown" href="" lu-enable-permission="{{ luModelOptions.permissions.edit }}">' +
123
+'    <button class="btn btn-primary dropdown-toggle btn-select" data-toggle="dropdown" href="" lu-enable-permission="{{ luModelOptions.permissions.edit }}">' +
124
 '    {{ permission.Value ? \'Allow\' : \'Disallow\' }} <span class="caret"></span>' +
124
 '    {{ permission.Value ? \'Allow\' : \'Disallow\' }} <span class="caret"></span>' +
125
 '    </button>' +
125
 '    </button>' +
126
 '    <ul class="dropdown-menu">' +
126
 '    <ul class="dropdown-menu">' +
129
 '</ul>' +
129
 '</ul>' +
130
 '</div>' +
130
 '</div>' +
131
 '<div class="btn-group">' +
131
 '<div class="btn-group">' +
132
-'    <button type="button" class="btn btn-default" ng-click="delPermission(permission)" lu-show-permission="{{ luModelOptions.permissions.del }}">' +
132
+'    <button type="button" class="btn btn-danger" ng-click="delPermission(permission)" lu-show-permission="{{ luModelOptions.permissions.del }}">' +
133
 '    <span class="glyphicon glyphicon-remove" aria-hidden="true"></span>' +
133
 '    <span class="glyphicon glyphicon-remove" aria-hidden="true"></span>' +
134
 '    </button>' +
134
 '    </button>' +
135
 '    </div>' +
135
 '    </div>' +
139
 '    <div class="clearfix"></div>' +
139
 '    <div class="clearfix"></div>' +
140
 '    <div class="col-sm-12" lu-busy="permission_add" lu-show-permission="{{ luModelOptions.permissions.add }}">' +
140
 '    <div class="col-sm-12" lu-busy="permission_add" lu-show-permission="{{ luModelOptions.permissions.add }}">' +
141
 '    <div class="btn-group">' +
141
 '    <div class="btn-group">' +
142
-'    <button class="btn btn-default dropdown-toggle btn-select" data-toggle="dropdown" href="">' +
142
+'    <button class="btn btn-primary dropdown-toggle btn-select" data-toggle="dropdown" href="">' +
143
 '    {{ tmpPermission.Name }} <span class="caret"></span>' +
143
 '    {{ tmpPermission.Name }} <span class="caret"></span>' +
144
 '    </button>' +
144
 '    </button>' +
145
 '    <ul class="dropdown-menu">' +
145
 '    <ul class="dropdown-menu">' +
149
 '</ul>' +
149
 '</ul>' +
150
 '</div>' +
150
 '</div>' +
151
 '<div class="btn-group">' +
151
 '<div class="btn-group">' +
152
-'    <button class="btn btn-default dropdown-toggle btn-select" data-toggle="dropdown" href="">' +
152
+'    <button class="btn btn-primary dropdown-toggle btn-select" data-toggle="dropdown" href="">' +
153
 '    {{ tmpPermission.Value ? \'Allow\' : \'Disallow\' }} <span class="caret"></span>' +
153
 '    {{ tmpPermission.Value ? \'Allow\' : \'Disallow\' }} <span class="caret"></span>' +
154
 '    </button>' +
154
 '    </button>' +
155
 '    <ul class="dropdown-menu">' +
155
 '    <ul class="dropdown-menu">' +
157
 '<li><a href="" ng-click="tmpPermission.Value = true">Allow</a></li>' +
157
 '<li><a href="" ng-click="tmpPermission.Value = true">Allow</a></li>' +
158
 '</ul>' +
158
 '</ul>' +
159
 '</div>' +
159
 '</div>' +
160
-'<button type="button" class="btn btn-default" ng-click="addPermission(tmpPermission)" ng-disabled="allPermissionsCleared.length == 0">' +
160
+'<button type="button" class="btn btn-primary" ng-click="addPermission(tmpPermission)" ng-disabled="allPermissionsCleared.length == 0">' +
161
 '    <span class="glyphicon glyphicon-plus" aria-hidden="true"></span> Add' +
161
 '    <span class="glyphicon glyphicon-plus" aria-hidden="true"></span> Add' +
162
 '    </button>' +
162
 '    </button>' +
163
 '    </div>' +
163
 '    </div>' +

+ 1
- 1
src/modals/dialogclose.js View File

37
              '</span>' +*/
37
              '</span>' +*/
38
         '</div>' +
38
         '</div>' +
39
         '<div class="modal-footer">' +
39
         '<div class="modal-footer">' +
40
-        '    <button type="button" class="btn btn-default" ng-click="__close()">Close</button>' +
40
+        '    <button type="button" class="btn btn-inverse" ng-click="__close()">Close</button>' +
41
         '    </div>' +
41
         '    </div>' +
42
         '    </div>')
42
         '    </div>')
43
 }]);
43
 }]);

+ 3
- 3
src/modals/dialogerrorhelper.js View File

39
         '        <div class="clearfix"></div>' +
39
         '        <div class="clearfix"></div>' +
40
         '        </div>' +
40
         '        </div>' +
41
         '        <div class="modal-footer">' +
41
         '        <div class="modal-footer">' +
42
-        '        <button type="submit" class="btn btn-pink" ng-click="$close()" ng-show="!showLogin">Close</button>' +
43
-        '        <button type="submit" class="btn btn-default" ng-click="$close()" ng-show="showLogin">Cancel</button>' +
44
-        '        <button type="button" class="btn btn-pink" ng-click="reconnect()" ng-show="showLogin">Login</button>' +
42
+        '        <button type="submit" class="btn btn-inverse" ng-click="$close()" ng-show="!showLogin">Close</button>' +
43
+        '        <button type="submit" class="btn btn-inverse" ng-click="$close()" ng-show="showLogin">Cancel</button>' +
44
+        '        <button type="button" class="btn btn-primary" ng-click="reconnect()" ng-show="showLogin">Login</button>' +
45
         '        </div>' +
45
         '        </div>' +
46
         '        </div>')
46
         '        </div>')
47
 }]);
47
 }]);

+ 1
- 1
src/modals/dialogokcancel.js View File

80
 '</span>' +*/
80
 '</span>' +*/
81
 '</div>' +
81
 '</div>' +
82
 '<div class="modal-footer">' +
82
 '<div class="modal-footer">' +
83
-'    <button type="button" class="btn btn-default" ng-click="__cancel()">Cancel</button>' +
83
+'    <button type="button" class="btn btn-inverse" ng-click="__cancel()">Cancel</button>' +
84
 '    <button type="submit" class="btn btn-primary" ng-enabled="!pending">OK</button>' +
84
 '    <button type="submit" class="btn btn-primary" ng-enabled="!pending">OK</button>' +
85
 '    </div>' +
85
 '    </div>' +
86
 '    </form>' +
86
 '    </form>' +

Loading…
Cancel
Save