From f578d2a3abbe923b469246fb514770067f5a8987 Mon Sep 17 00:00:00 2001 From: ammendonca Date: Wed, 6 Nov 2013 13:31:36 +0000 Subject: [PATCH] KEYCLOAK-147: Create onoffswitch directive and use it where applicable. --- .../META-INF/resources/admin/js/app.js | 36 +++++++- .../admin/partials/application-detail.html | 12 +-- .../admin/partials/realm-detail.html | 91 ++----------------- .../resources/admin/partials/realm-smtp.html | 33 +------ 4 files changed, 46 insertions(+), 126 deletions(-) diff --git a/admin-ui/src/main/resources/META-INF/resources/admin/js/app.js b/admin-ui/src/main/resources/META-INF/resources/admin/js/app.js index 7025d2ee44..e564dad87b 100755 --- a/admin-ui/src/main/resources/META-INF/resources/admin/js/app.js +++ b/admin-ui/src/main/resources/META-INF/resources/admin/js/app.js @@ -368,10 +368,42 @@ module.directive('collapsed', function() { } }); +/** + * Directive for presenting an ON-OFF switch for checkbox. + * Usage: + */ +module.directive('onoffswitch', function() { + return { + restrict: "EA", + require: 'ngModel', + replace: true, + scope: { + ngModel: '=', + ngBind: '=', + name: '=', + id: '=', + onText: '@onText', + offText: '@offText' + }, + compile: function(element, attrs) { + if (!attrs.onText) { attrs.onText = "ON"; } + if (!attrs.offText) { attrs.offText = "OFF"; } + var html = "
" + + "" + + "" + + "
"; - - + element.replaceWith($(html)); + } + } +}); module.directive('kcInput', function() { diff --git a/admin-ui/src/main/resources/META-INF/resources/admin/partials/application-detail.html b/admin-ui/src/main/resources/META-INF/resources/admin/partials/application-detail.html index 2c11b73c62..e766d57d1e 100755 --- a/admin-ui/src/main/resources/META-INF/resources/admin/partials/application-detail.html +++ b/admin-ui/src/main/resources/META-INF/resources/admin/partials/application-detail.html @@ -44,17 +44,7 @@
-
- - -
+
diff --git a/admin-ui/src/main/resources/META-INF/resources/admin/partials/realm-detail.html b/admin-ui/src/main/resources/META-INF/resources/admin/partials/realm-detail.html index d35d8cdfa4..157bb0ce59 100755 --- a/admin-ui/src/main/resources/META-INF/resources/admin/partials/realm-detail.html +++ b/admin-ui/src/main/resources/META-INF/resources/admin/partials/realm-detail.html @@ -34,113 +34,38 @@
- -
- - -
+
Login Options
-
- - -
+
-
- - -
+
-
- - -
+
-
- - -
+
-
- - -
+
-
- - -
+
-
- - -
+
diff --git a/admin-ui/src/main/resources/META-INF/resources/admin/partials/realm-smtp.html b/admin-ui/src/main/resources/META-INF/resources/admin/partials/realm-smtp.html index 6abd4ee4a5..dd24ea73f6 100755 --- a/admin-ui/src/main/resources/META-INF/resources/admin/partials/realm-smtp.html +++ b/admin-ui/src/main/resources/META-INF/resources/admin/partials/realm-smtp.html @@ -42,45 +42,18 @@
-
- - -
+
-
- - -
+
Authentication
-
- - -
+