diff options
author | Adam Young <ayoung@redhat.com> | 2011-06-22 13:21:40 -0400 |
---|---|---|
committer | Adam Young <ayoung@redhat.com> | 2011-06-23 20:24:14 -0400 |
commit | cbffe1d65df222acf6eb26cdaa121932a01f9ba7 (patch) | |
tree | e73a874433ce34fbef98f5ddf7a8109ad223188c /install/ui/automount.js | |
parent | 8810758c11df8afb5fb7ddf97a71c55a431edfd2 (diff) | |
download | freeipa-cbffe1d65df222acf6eb26cdaa121932a01f9ba7.tar.gz freeipa-cbffe1d65df222acf6eb26cdaa121932a01f9ba7.tar.xz freeipa-cbffe1d65df222acf6eb26cdaa121932a01f9ba7.zip |
automountkey details
Adds hooks for navigation to the show page due to the unusual way that keys are accessed.
https://fedorahosted.org/freeipa/ticket/1257
Diffstat (limited to 'install/ui/automount.js')
-rw-r--r-- | install/ui/automount.js | 75 |
1 files changed, 71 insertions, 4 deletions
diff --git a/install/ui/automount.js b/install/ui/automount.js index 3e031769c..6ef970544 100644 --- a/install/ui/automount.js +++ b/install/ui/automount.js @@ -66,8 +66,15 @@ IPA.entity_factories.automountmap = function() { label : IPA.metadata.objects.automountkey.label, name: 'keys', get_values: IPA.get_option_values, - columns:['automountkey','automountinformation'], - back_link_text: 'Back to Locations' + back_link_text: 'Back to Locations', + columns:[ + { + factory: IPA.automount_key_column, + name:'automountkey', + label:IPA.get_entity_param('automountkey', 'automountkey'). + label + }, + 'automountinformation'] }). details_facet({ sections:[ @@ -114,17 +121,77 @@ IPA.entity_factories.automountkey = function() { { name:'identity', label: IPA.messages.details.identity, - fields:['automountkey','automountinformation','description'] + fields:[ + { + factory: IPA.text_widget, + read_only: true, + name: 'automountkey' + }, + 'automountinformation'] } ], - back_link_text: 'Back to Locations' + disable_breadcrumb: false, + back_link_text: 'Back to Locations', + pre_execute_hook : function (command){ + var entity_name = this.entity_name; + var info = IPA.nav.get_state(entity_name + '-info'); + var key = IPA.nav.get_state(entity_name + '-pkey'); + + + if (command.args.length ==3){ + command.args.pop(); + } + if (command.method === 'mod'){ + command.options['newautomountinformation'] = + command.options['automountinformation']; + + } + command.options['automountkey'] = key; + command.options['automountinformation'] = info; + } }). adder_dialog({ + show_edit_page : function(entity_name, result){ + var key = result.automountkey[0]; + var info = result.automountinformation[0]; + var state = IPA.nav.get_path_state(entity_name); + state[entity_name + '-facet'] = 'default'; + state[entity_name + '-info'] = info; + state[entity_name + '-pkey'] = key; + IPA.nav.push_state(state); + return false; + }, fields:['automountkey','automountinformation'] }). build(); }; +IPA.automount_key_column = function(spec){ + var that = IPA.column(spec); + + that.setup = function(container, record) { + container.empty(); + var key = record.automountkey; + var info = record.automountinformation; + + $('<a/>', { + href: '#'+key, + html: key, + click: function() { + var state = IPA.nav.get_path_state(that.entity_name); + state[that.entity_name + '-facet'] = 'default'; + state[that.entity_name + '-info'] = info; + state[that.entity_name + '-pkey'] = key; + IPA.nav.push_state(state); + return false; + } + }).appendTo(container); + + }; + + return that; +}; + IPA.automountmap_adder_dialog = function(spec){ var that = IPA.add_dialog(spec); |