https://fedorahosted.org/freeipa/ticket/4982
--
Petr Vobornik
From c57d0309b573d97e13e080e9be0f1db7da83c1da Mon Sep 17 00:00:00 2001
From: Petr Vobornik pvobo...@redhat.com
Date: Fri, 17 Apr 2015 17:56:58 +0200
Subject: [PATCH] webui: add pwpolicy link to group details page if group has
associated pwpolicy
https://fedorahosted.org/freeipa/ticket/4982
---
install/ui/src/freeipa/group.js | 10 +-
install/ui/src/freeipa/widget.js | 25 +++--
2 files changed, 24 insertions(+), 11 deletions(-)
diff --git a/install/ui/src/freeipa/group.js b/install/ui/src/freeipa/group.js
index 3961384dc4b2e769ddaa0b2d3f165cc48ad471a1..6f6f13e74737de9c79daa9d7d0ad156365a08214 100644
--- a/install/ui/src/freeipa/group.js
+++ b/install/ui/src/freeipa/group.js
@@ -68,7 +68,15 @@ return {
posixgroup: '@i18n:objects.group.posix'
}
},
-'gidnumber'
+'gidnumber',
+{
+$type: 'link',
+name: 'pwpolicy',
+param: 'cn',
+label: '@mo:pwpolicy.label_singular',
+other_entity: 'pwpolicy',
+require_link: true
+}
]
}
],
diff --git a/install/ui/src/freeipa/widget.js b/install/ui/src/freeipa/widget.js
index 29d320c07fe156a807ad2bf4415b3058a8a71e98..125d499b683557fec9f9ece6007d3560f03ee025 100644
--- a/install/ui/src/freeipa/widget.js
+++ b/install/ui/src/freeipa/widget.js
@@ -4143,6 +4143,12 @@ IPA.link_widget = function(spec) {
*/
that.no_check = spec.no_check;
+/**
+ * Whether value can be displayed even if link is not valid.
+ * @property {boolean}
+ */
+that.require_link = spec.require_link !== undefined ? spec.require_link : false;
+
that.value = '';
that.values = [];
@@ -4182,18 +4188,17 @@ IPA.link_widget = function(spec) {
};
that.update_link = function() {
+
+var link = false;
+var nonlink = false;
+
if (that.value) {
-if(that.is_link) {
-that.link.css('display','');
-that.nonlink.css('display','none');
-} else {
-that.link.css('display','none');
-that.nonlink.css('display','');
-}
-} else {
-that.link.css('display','none');
-that.nonlink.css('display','none');
+link = !!that.is_link;
+nonlink = !that.is_link !that.require_link;
}
+
+that.link.css('display', link ? '' : 'none');
+that.nonlink.css('display', nonlink ? '' : 'none');
};
/**
--
2.1.0
--
Manage your subscription for the Freeipa-devel mailing list:
https://www.redhat.com/mailman/listinfo/freeipa-devel
Contribute to FreeIPA: http://www.freeipa.org/page/Contribute/Code