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 @@
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 @@