diff options
author | Petr Vobornik <pvoborni@redhat.com> | 2013-02-22 17:22:30 +0100 |
---|---|---|
committer | Petr Vobornik <pvoborni@redhat.com> | 2013-03-18 15:11:08 +0100 |
commit | 070fc176aecc3c7661cdb085b157d2d4c653fc46 (patch) | |
tree | 10822f0b3f2d466787e5f575a6aa0c28026ac512 /install/ui/src/freeipa/widget.js | |
parent | 5f6310ecc6b5747fd9f8b35786ece5e3b26789d3 (diff) | |
download | freeipa-070fc176aecc3c7661cdb085b157d2d4c653fc46.tar.gz freeipa-070fc176aecc3c7661cdb085b157d2d4c653fc46.tar.xz freeipa-070fc176aecc3c7661cdb085b157d2d4c653fc46.zip |
Web UI:Certificate pages
Following pages were added to Web UI:
* certificated details
* certificate search
Certificate is not regular object so it gets no metadata. Therefore artificial
metadata were created for it to allow usage of search and details facet.
Search and details facet were modified to allow removing of add/remove/update/
reset buttons - certificates have no mod operation and they are not added by
standard means.
User can revoke and restore certificated in details facet.
https://fedorahosted.org/freeipa/ticket/3419
Diffstat (limited to 'install/ui/src/freeipa/widget.js')
-rw-r--r-- | install/ui/src/freeipa/widget.js | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/install/ui/src/freeipa/widget.js b/install/ui/src/freeipa/widget.js index 6472cab97..5ce767e7e 100644 --- a/install/ui/src/freeipa/widget.js +++ b/install/ui/src/freeipa/widget.js @@ -960,6 +960,7 @@ IPA.textarea_widget = function (spec) { that.rows = spec.rows || 5; that.cols = spec.cols || 40; + that.style = spec.style; that.create = function(container) { @@ -972,12 +973,15 @@ IPA.textarea_widget = function (spec) { rows: that.rows, cols: that.cols, disabled: that.disabled, + readOnly: !!that.read_only, title: that.tooltip, keyup: function() { that.on_value_changed(); } }).appendTo(container); + if (that.style) that.input.css(that.style); + that.input.bind('input', function() { that.on_value_changed(); }); @@ -990,11 +994,17 @@ IPA.textarea_widget = function (spec) { }; that.save = function() { + if (that.read_only || !that.writable) { + return null; + } var value = that.input.val(); return [value]; }; that.update = function(values) { + var read_only = that.read_only || !that.writable; + that.input.prop('readOnly', read_only); + var value = values && values.length ? values[0] : ''; that.input.val(value); }; @@ -2947,6 +2957,27 @@ IPA.details_table_section = function(spec) { return that; }; +IPA.hide_empty_row_policy = function (spec) { + + spec = spec || {}; + + var that = IPA.facet_policy(); + that.value_name = spec.value_name || spec.widget; + that.widget_name = spec.widget; + that.section_name = spec.section; + + that.post_load = function(data) { + + var value = data.result.result[that.value_name]; + var visible = !IPA.is_empty(value); + + var section = that.container.widgets.get_widget(that.section_name); + section.set_row_visible(that.widget_name, visible); + }; + + return that; +}; + //non-collabsible section IPA.details_table_section_nc = function(spec) { |