diff options
author | Endi Sukma Dewata <edewata@redhat.com> | 2012-01-05 09:10:11 -0600 |
---|---|---|
committer | Petr Vobornik <pvoborni@redhat.com> | 2012-01-06 15:25:43 +0100 |
commit | 2a00393712eb490b23604399ea8318b3b4cca118 (patch) | |
tree | 53af8579d526130441e018fa1e7a13de823e8b40 /install/ui/host.js | |
parent | 1b1aad2b02e57988b2e91a29305bd45f2059b91a (diff) | |
download | freeipa.git-2a00393712eb490b23604399ea8318b3b4cca118.tar.gz freeipa.git-2a00393712eb490b23604399ea8318b3b4cca118.tar.xz freeipa.git-2a00393712eb490b23604399ea8318b3b4cca118.zip |
Added account status into user search facet.
The user search facet has been modified to show the account status.
The IPA.boolean_format has been converted into a class to allow
behavior customization.
Ticket #1996
Diffstat (limited to 'install/ui/host.js')
-rw-r--r-- | install/ui/host.js | 60 |
1 files changed, 36 insertions, 24 deletions
diff --git a/install/ui/host.js b/install/ui/host.js index c23cd996..90e6bde7 100644 --- a/install/ui/host.js +++ b/install/ui/host.js @@ -40,7 +40,7 @@ IPA.host.entity = function(spec) { { name: 'has_keytab', label: IPA.messages.objects.host.enrolled, - format: IPA.boolean_format + format: IPA.boolean_format() } ] }). @@ -466,30 +466,42 @@ IPA.field_factories['host_dnsrecord_entity_link'] = IPA.host_dnsrecord_entity_li IPA.widget_factories['host_dnsrecord_entity_link'] = IPA.link_widget; /* Take an LDAP format date in UTC and format it */ -IPA.utc_date_column_format = function(value){ - if (!value) { - return ""; - } - if (value.length != "20101119025910Z".length){ - return value; - } - /* We only handle GMT */ - if (value.charAt(value.length -1) !== 'Z'){ - return value; - } +IPA.utc_date_column_format = function(spec) { + + spec = spec || {}; + + var that = IPA.format(spec); + + that.format = function(value) { + + if (!value) return ''; + + // verify length + if (value.length != '20101119025910Z'.length) { + return value; + } + + /* We only handle GMT */ + if (value.charAt(value.length -1) !== 'Z') { + return value; + } + + var date = new Date(); + + date.setUTCFullYear( + value.substring(0, 4), // YYYY + value.substring(4, 6)-1, // MM (0-11) + value.substring(6, 8)); // DD (1-31) - var date = new Date(); - - date.setUTCFullYear( - value.substring(0, 4), // YYYY - value.substring(4, 6)-1, // MM (0-11) - value.substring(6, 8)); // DD (1-31) - date.setUTCHours( - value.substring(8, 10), // HH (0-23) - value.substring(10, 12), // MM (0-59) - value.substring(12, 14)); // SS (0-59) - var formated = date.toString(); - return formated; + date.setUTCHours( + value.substring(8, 10), // HH (0-23) + value.substring(10, 12), // MM (0-59) + value.substring(12, 14)); // SS (0-59) + + return date.toString(); + }; + + return that; }; |