diff options
author | Petr Vobornik <pvoborni@redhat.com> | 2015-04-17 17:56:58 +0200 |
---|---|---|
committer | Petr Vobornik <pvoborni@redhat.com> | 2015-05-07 10:43:23 +0200 |
commit | b61f4bc538573fcf76c69b52698045dcb0f99e55 (patch) | |
tree | f9d6ba6e4174aba35ab43f56c38a72ecf3da988c /install/ui | |
parent | d1a0474d1851cd54a1fa7bdf4a0dc0ed452a0090 (diff) | |
download | freeipa-b61f4bc538573fcf76c69b52698045dcb0f99e55.tar.gz freeipa-b61f4bc538573fcf76c69b52698045dcb0f99e55.tar.xz freeipa-b61f4bc538573fcf76c69b52698045dcb0f99e55.zip |
webui: add pwpolicy link to group details page if group has associated pwpolicy
https://fedorahosted.org/freeipa/ticket/4982
Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
Diffstat (limited to 'install/ui')
-rw-r--r-- | install/ui/src/freeipa/group.js | 10 | ||||
-rw-r--r-- | 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 3961384dc..6f6f13e74 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 29d320c07..125d499b6 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'); }; /** |