From 4ff959f55d4aa0a6a832821ed19ecbb9a05dbbbf Mon Sep 17 00:00:00 2001 From: "Endi S. Dewata" Date: Thu, 21 Jul 2011 02:54:07 -0500 Subject: Removed custom layouts using HTML templates. The code for supporting custom layouts using HTML templates has been removed. If it's needed again in the future the code can be restored. Ticket #1501 --- install/ui/Makefile.am | 1 - install/ui/details.js | 24 --- install/ui/dialog.js | 48 ++---- install/ui/hbac.js | 177 ++++++++------------- install/ui/ipa.js | 8 - install/ui/layouts/Makefile.am | 22 --- install/ui/layouts/default/Makefile.am | 30 ---- .../default/hbacrule-details-accesstime.html | 49 ------ .../layouts/default/hbacrule-details-general.html | 57 ------- .../ui/layouts/default/hbacrule-details-host.html | 78 --------- .../layouts/default/hbacrule-details-service.html | 78 --------- .../default/hbacrule-details-sourcehost.html | 78 --------- .../ui/layouts/default/hbacrule-details-user.html | 78 --------- .../layouts/default/sudorule-details-general.html | 49 ------ .../ui/layouts/default/sudorule-group-dialog.html | 110 ------------- .../ui/layouts/default/sudorule-host-dialog.html | 110 ------------- .../layouts/default/sudorule-hostgroup-dialog.html | 110 ------------- .../ui/layouts/default/sudorule-user-dialog.html | 110 ------------- install/ui/rule.js | 2 - install/ui/sudo.js | 32 +--- 20 files changed, 84 insertions(+), 1167 deletions(-) delete mode 100644 install/ui/layouts/Makefile.am delete mode 100644 install/ui/layouts/default/Makefile.am delete mode 100755 install/ui/layouts/default/hbacrule-details-accesstime.html delete mode 100755 install/ui/layouts/default/hbacrule-details-general.html delete mode 100755 install/ui/layouts/default/hbacrule-details-host.html delete mode 100755 install/ui/layouts/default/hbacrule-details-service.html delete mode 100755 install/ui/layouts/default/hbacrule-details-sourcehost.html delete mode 100755 install/ui/layouts/default/hbacrule-details-user.html delete mode 100755 install/ui/layouts/default/sudorule-details-general.html delete mode 100755 install/ui/layouts/default/sudorule-group-dialog.html delete mode 100755 install/ui/layouts/default/sudorule-host-dialog.html delete mode 100755 install/ui/layouts/default/sudorule-hostgroup-dialog.html delete mode 100755 install/ui/layouts/default/sudorule-user-dialog.html (limited to 'install/ui') diff --git a/install/ui/Makefile.am b/install/ui/Makefile.am index b53f439c..138db15e 100644 --- a/install/ui/Makefile.am +++ b/install/ui/Makefile.am @@ -3,7 +3,6 @@ AUTOMAKE_OPTIONS = 1.7 NULL = SUBDIRS = \ - layouts \ $(NULL) appdir = $(IPA_DATA_DIR)/ui diff --git a/install/ui/details.js b/install/ui/details.js index 82804b53..45ffa6f1 100644 --- a/install/ui/details.js +++ b/install/ui/details.js @@ -37,7 +37,6 @@ IPA.details_section = function(spec) { that.name = spec.name || ''; that.label = spec.label || ''; - that.template = spec.template; that._entity_name = spec.entity_name; that.fields = $.ordered_map(); @@ -105,8 +104,6 @@ IPA.details_section = function(spec) { that.create = function(container) { - if (that.template) return; - var fields = that.fields.values; for (var i=0; i', { 'id': that.name, 'class': 'entryattrs' diff --git a/install/ui/dialog.js b/install/ui/dialog.js index 5245ba92..ada30b0f 100644 --- a/install/ui/dialog.js +++ b/install/ui/dialog.js @@ -32,7 +32,6 @@ IPA.dialog = function(spec) { that.name = spec.name; that.title = spec.title; - that.template = spec.template; that._entity_name = spec.entity_name; that.width = spec.width || 400; @@ -254,40 +253,19 @@ IPA.dialog = function(spec) { container.append(that.container); } - if (that.template) { - var template = IPA.get_template(that.template); - that.container.load( - template, - function(data, text_status, xhr) { - that.setup(); - that.container.dialog({ - 'title': that.title, - 'modal': true, - 'width': that.width, - 'height': that.height, - 'buttons': that.buttons, - close: function(event, ui) { - that.close(); - } - }); - } - ); - - } else { - that.create(); - that.setup(); - - that.container.dialog({ - 'title': that.title, - 'modal': true, - 'width': that.width, - 'height': that.height, - 'buttons': that.buttons, - close: function(event, ui) { - that.close(); - } - }); - } + that.create(); + that.setup(); + + that.container.dialog({ + 'title': that.title, + 'modal': true, + 'width': that.width, + 'height': that.height, + 'buttons': that.buttons, + close: function(event, ui) { + that.close(); + } + }); }; that.option = function(name, value) { diff --git a/install/ui/hbac.js b/install/ui/hbac.js index 1e2cefb8..be4e736e 100644 --- a/install/ui/hbac.js +++ b/install/ui/hbac.js @@ -156,22 +156,11 @@ IPA.hbacrule_details_facet = function(spec) { that.init = function() { - var section; - - if (IPA.layout) { - section = that.create_section({ - 'name': 'general', - 'label': IPA.messages.details.general, - 'template': 'hbacrule-details-general.html #contents' - }); - - } else { - section = IPA.hbacrule_details_general_section({ - 'name': 'general', - 'label': IPA.messages.details.general - }); - that.add_section(section); - } + var section = IPA.hbacrule_details_general_section({ + 'name': 'general', + 'label': IPA.messages.details.general + }); + that.add_section(section); section.text({name: 'cn', read_only: true}); section.radio({name: 'accessruletype'}); @@ -180,30 +169,21 @@ IPA.hbacrule_details_facet = function(spec) { var param_info = IPA.get_entity_param('hbacrule', 'usercategory'); - if (IPA.layout) { - section = that.create_section({ - 'name': 'user', - 'label': IPA.messages.objects.hbacrule.user, - 'template': 'hbacrule-details-user.html #contents' - }); - - } else { - section = IPA.rule_details_section({ - 'name': 'user', - 'label': IPA.messages.objects.hbacrule.user, - 'text': param_info.doc+':', - 'field_name': 'usercategory', - 'options': [ - { 'value': 'all', 'label': IPA.messages.objects.hbacrule.anyone }, - { 'value': '', 'label': IPA.messages.objects.hbacrule.specified_users } - ], - 'tables': [ - { 'field_name': 'memberuser_user' }, - { 'field_name': 'memberuser_group' } - ] - }); - that.add_section(section); - } + section = IPA.rule_details_section({ + 'name': 'user', + 'label': IPA.messages.objects.hbacrule.user, + 'text': param_info.doc+':', + 'field_name': 'usercategory', + 'options': [ + { 'value': 'all', 'label': IPA.messages.objects.hbacrule.anyone }, + { 'value': '', 'label': IPA.messages.objects.hbacrule.specified_users } + ], + 'tables': [ + { 'field_name': 'memberuser_user' }, + { 'field_name': 'memberuser_group' } + ] + }); + that.add_section(section); var category = section.add_field(IPA.radio_widget({ name: 'usercategory' @@ -221,30 +201,21 @@ IPA.hbacrule_details_facet = function(spec) { param_info = IPA.get_entity_param('hbacrule', 'hostcategory'); - if (IPA.layout) { - section = that.create_section({ - 'name': 'host', - 'label': IPA.messages.objects.hbacrule.host, - 'template': 'hbacrule-details-host.html #contents' - }); - - } else { - section = IPA.rule_details_section({ - 'name': 'host', - 'label': IPA.messages.objects.hbacrule.host, - 'text': param_info.doc+':', - 'field_name': 'hostcategory', - 'options': [ - { 'value': 'all', 'label': IPA.messages.objects.hbacrule.any_host }, - { 'value': '', 'label': IPA.messages.objects.hbacrule.specified_hosts } - ], - 'tables': [ - { 'field_name': 'memberhost_host' }, - { 'field_name': 'memberhost_hostgroup' } - ] - }); - that.add_section(section); - } + section = IPA.rule_details_section({ + 'name': 'host', + 'label': IPA.messages.objects.hbacrule.host, + 'text': param_info.doc+':', + 'field_name': 'hostcategory', + 'options': [ + { 'value': 'all', 'label': IPA.messages.objects.hbacrule.any_host }, + { 'value': '', 'label': IPA.messages.objects.hbacrule.specified_hosts } + ], + 'tables': [ + { 'field_name': 'memberhost_host' }, + { 'field_name': 'memberhost_hostgroup' } + ] + }); + that.add_section(section); category = section.add_field(IPA.radio_widget({ name: 'hostcategory' @@ -262,30 +233,21 @@ IPA.hbacrule_details_facet = function(spec) { param_info = IPA.get_entity_param('hbacrule', 'servicecategory'); - if (IPA.layout) { - section = that.create_section({ - 'name': 'service', - 'label': IPA.messages.objects.hbacrule.service, - 'template': 'hbacrule-details-service.html #contents' - }); - - } else { - section = IPA.rule_details_section({ - 'name': 'service', - 'label': IPA.messages.objects.hbacrule.service, - 'text': param_info.doc+':', - 'field_name': 'servicecategory', - 'options': [ - { 'value': 'all', 'label': IPA.messages.objects.hbacrule.any_service }, - { 'value': '', 'label': IPA.messages.objects.hbacrule.specified_services } - ], - 'tables': [ - { 'field_name': 'memberservice_hbacsvc' }, - { 'field_name': 'memberservice_hbacsvcgroup' } - ] - }); - that.add_section(section); - } + section = IPA.rule_details_section({ + 'name': 'service', + 'label': IPA.messages.objects.hbacrule.service, + 'text': param_info.doc+':', + 'field_name': 'servicecategory', + 'options': [ + { 'value': 'all', 'label': IPA.messages.objects.hbacrule.any_service }, + { 'value': '', 'label': IPA.messages.objects.hbacrule.specified_services } + ], + 'tables': [ + { 'field_name': 'memberservice_hbacsvc' }, + { 'field_name': 'memberservice_hbacsvcgroup' } + ] + }); + that.add_section(section); category = section.add_field(IPA.radio_widget({ name: 'servicecategory' @@ -303,30 +265,21 @@ IPA.hbacrule_details_facet = function(spec) { param_info = IPA.get_entity_param('hbacrule', 'sourcehostcategory'); - if (IPA.layout) { - section = that.create_section({ - 'name': 'sourcehost', - 'label': IPA.messages.objects.hbacrule.sourcehost, - 'template': 'hbacrule-details-sourcehost.html #contents' - }); - - } else { - section = IPA.rule_details_section({ - 'name': 'sourcehost', - 'label': IPA.messages.objects.hbacrule.sourcehost, - 'text': param_info.doc+':', - 'field_name': 'sourcehostcategory', - 'options': [ - { 'value': 'all', 'label': IPA.messages.objects.hbacrule.any_host }, - { 'value': '', 'label': IPA.messages.objects.hbacrule.specified_hosts } - ], - 'tables': [ - { 'field_name': 'sourcehost_host' }, - { 'field_name': 'sourcehost_hostgroup' } - ] - }); - that.add_section(section); - } + section = IPA.rule_details_section({ + 'name': 'sourcehost', + 'label': IPA.messages.objects.hbacrule.sourcehost, + 'text': param_info.doc+':', + 'field_name': 'sourcehostcategory', + 'options': [ + { 'value': 'all', 'label': IPA.messages.objects.hbacrule.any_host }, + { 'value': '', 'label': IPA.messages.objects.hbacrule.specified_hosts } + ], + 'tables': [ + { 'field_name': 'sourcehost_host' }, + { 'field_name': 'sourcehost_hostgroup' } + ] + }); + that.add_section(section); category = section.add_field(IPA.radio_widget({ name: 'sourcehostcategory' diff --git a/install/ui/ipa.js b/install/ui/ipa.js index 4b505235..a6c9694c 100644 --- a/install/ui/ipa.js +++ b/install/ui/ipa.js @@ -52,16 +52,8 @@ var IPA = ( function () { that.entities = $.ordered_map(); that.entity_factories = {}; - that.layout = $.bbq.getState('layout'); - that.layouts_dir = 'layouts'; - that.network_call_count = 0; - that.get_template = function(path) { - var layout = that.layout || 'default'; - return that.layouts_dir+'/'+layout+'/'+path; - }; - /* initialize the IPA JSON-RPC helper * arguments: * url - JSON-RPC URL to use (optional) */ diff --git a/install/ui/layouts/Makefile.am b/install/ui/layouts/Makefile.am deleted file mode 100644 index 711c236f..00000000 --- a/install/ui/layouts/Makefile.am +++ /dev/null @@ -1,22 +0,0 @@ -AUTOMAKE_OPTIONS = 1.7 - -NULL = - -SUBDIRS = \ - default \ - $(NULL) - -appdir = $(IPA_DATA_DIR)/ui/layouts -app_DATA = \ - $(NULL) - -EXTRA_DIST = \ - $(app_DATA) \ - $(NULL) - -MAINTAINERCLEANFILES = \ - *~ \ - Makefile.in - $(NULL) - -distclean: diff --git a/install/ui/layouts/default/Makefile.am b/install/ui/layouts/default/Makefile.am deleted file mode 100644 index 82a58c7f..00000000 --- a/install/ui/layouts/default/Makefile.am +++ /dev/null @@ -1,30 +0,0 @@ -AUTOMAKE_OPTIONS = 1.7 - -NULL = - -SUBDIRS = \ - $(NULL) - -appdir = $(IPA_DATA_DIR)/ui/layouts/default -app_DATA = \ - hbacrule-details-accesstime.html \ - hbacrule-details-general.html \ - hbacrule-details-host.html \ - hbacrule-details-service.html \ - hbacrule-details-sourcehost.html \ - hbacrule-details-user.html \ - sudorule-details-general.html \ - sudorule-group-dialog.html \ - sudorule-host-dialog.html \ - sudorule-hostgroup-dialog.html \ - sudorule-user-dialog.html \ - $(NULL) - -EXTRA_DIST = \ - $(app_DATA) \ - $(NULL) - -MAINTAINERCLEANFILES = \ - *~ \ - Makefile.in - $(NULL) diff --git a/install/ui/layouts/default/hbacrule-details-accesstime.html b/install/ui/layouts/default/hbacrule-details-accesstime.html deleted file mode 100755 index 8d5e258b..00000000 --- a/install/ui/layouts/default/hbacrule-details-accesstime.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - When - - - - - -
- - Rule applies when access is being requested at: - Any Time - Specified Times - -
- - - - - - - - - - - - - - - -
- - - Access Time - - - - -
- - - time -
-
-
-
- - \ No newline at end of file diff --git a/install/ui/layouts/default/hbacrule-details-general.html b/install/ui/layouts/default/hbacrule-details-general.html deleted file mode 100755 index 97836909..00000000 --- a/install/ui/layouts/default/hbacrule-details-general.html +++ /dev/null @@ -1,57 +0,0 @@ - - - - General - - - - - -
- - - - - - - - - - - - - - -
- Name: - - - - - - - Rule type: - - Allow - Deny - - -
- Description: - - - - - -
- Rule status: - - - Active - Inactive - - -
-
- - diff --git a/install/ui/layouts/default/hbacrule-details-host.html b/install/ui/layouts/default/hbacrule-details-host.html deleted file mode 100755 index 1ba386da..00000000 --- a/install/ui/layouts/default/hbacrule-details-host.html +++ /dev/null @@ -1,78 +0,0 @@ - - - - Accessing - - - - - -
- Rule applies when access is requested to: - - Any Host - Specified Hosts and Groups - - -
- - - - - - - - - - - - - - - -
- - - Host - - - - -
- - - host -
-
- - - - - - - - - - - - - - - -
- - - Host Group - - - - -
- - - hostgroups -
-
-
- - \ No newline at end of file diff --git a/install/ui/layouts/default/hbacrule-details-service.html b/install/ui/layouts/default/hbacrule-details-service.html deleted file mode 100755 index 77e8420d..00000000 --- a/install/ui/layouts/default/hbacrule-details-service.html +++ /dev/null @@ -1,78 +0,0 @@ - - - - Via Service - - - - - -
- Rule applies when access is requested via: - - Any Service - Specified Services and Groups - - -
- - - - - - - - - - - - - - - -
- - - Service - - - - -
- - - service -
-
- - - - - - - - - - - - - - - -
- - - Service Group - - - - -
- - - services -
-
-
- - \ No newline at end of file diff --git a/install/ui/layouts/default/hbacrule-details-sourcehost.html b/install/ui/layouts/default/hbacrule-details-sourcehost.html deleted file mode 100755 index aae1ef38..00000000 --- a/install/ui/layouts/default/hbacrule-details-sourcehost.html +++ /dev/null @@ -1,78 +0,0 @@ - - - - From - - - - - -
- Rule applies when access is being initiated from: - - Any Host - Specified Hosts and Groups - - -
- - - - - - - - - - - - - - - -
- - - Host - - - - -
- - - host -
-
- - - - - - - - - - - - - - - -
- - - Host Group - - - - -
- - - hosts -
-
-
- - \ No newline at end of file diff --git a/install/ui/layouts/default/hbacrule-details-user.html b/install/ui/layouts/default/hbacrule-details-user.html deleted file mode 100755 index 1b58848f..00000000 --- a/install/ui/layouts/default/hbacrule-details-user.html +++ /dev/null @@ -1,78 +0,0 @@ - - - - Who - - - - - -
- Rule applies when access is requested by: - - Anyone - Specified Users and Groups - - -
- - - - - - - - - - - - - - - -
- - - User - - - - -
- - - user -
-
- - - - - - - - - - - - - - - -
- - - User Group - - - - -
- - - users -
-
-
- - \ No newline at end of file diff --git a/install/ui/layouts/default/sudorule-details-general.html b/install/ui/layouts/default/sudorule-details-general.html deleted file mode 100755 index 728ecf11..00000000 --- a/install/ui/layouts/default/sudorule-details-general.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - General - - - - - -
- - - - - - - - - - - - - -
- Name: - - - - - -
- Description: - - - - - -
- Rule status: - - - Active - Inactive - - -
-
- - diff --git a/install/ui/layouts/default/sudorule-group-dialog.html b/install/ui/layouts/default/sudorule-group-dialog.html deleted file mode 100755 index d576f1a1..00000000 --- a/install/ui/layouts/default/sudorule-group-dialog.html +++ /dev/null @@ -1,110 +0,0 @@ - - - - Adder Dialog - - - - - -
- -
- - -
- -
- -
- -
- Available -
- - - - - - - - - - - - - - - - - - - -
- - - Groups -
- - - -
- -
-
- -
-

-

-
- -
- -
- Prospective -
- - - - - - - - - - - - - - - - - - - -
- - - Groups -
- - - -
- -
-
- -
- -
- External -
- - -
- -
-
- - diff --git a/install/ui/layouts/default/sudorule-host-dialog.html b/install/ui/layouts/default/sudorule-host-dialog.html deleted file mode 100755 index 5eec4186..00000000 --- a/install/ui/layouts/default/sudorule-host-dialog.html +++ /dev/null @@ -1,110 +0,0 @@ - - - - Adder Dialog - - - - - -
- -
- - -
- -
- -
- -
- Available -
- - - - - - - - - - - - - - - - - - - -
- - - Hosts -
- - - -
- -
-
- -
-

-

-
- -
- -
- Prospective -
- - - - - - - - - - - - - - - - - - - -
- - - Hosts -
- - - -
- -
-
- -
- -
- External -
- - -
- -
-
- - diff --git a/install/ui/layouts/default/sudorule-hostgroup-dialog.html b/install/ui/layouts/default/sudorule-hostgroup-dialog.html deleted file mode 100755 index 57d72f38..00000000 --- a/install/ui/layouts/default/sudorule-hostgroup-dialog.html +++ /dev/null @@ -1,110 +0,0 @@ - - - - Adder Dialog - - - - - -
- -
- - -
- -
- -
- -
- Available -
- - - - - - - - - - - - - - - - - - - -
- - - Host Groups -
- - - -
- -
-
- -
-

-

-
- -
- -
- Prospective -
- - - - - - - - - - - - - - - - - - - -
- - - Host Groups -
- - - -
- -
-
- -
- -
- External -
- - -
- -
-
- - diff --git a/install/ui/layouts/default/sudorule-user-dialog.html b/install/ui/layouts/default/sudorule-user-dialog.html deleted file mode 100755 index 78687cea..00000000 --- a/install/ui/layouts/default/sudorule-user-dialog.html +++ /dev/null @@ -1,110 +0,0 @@ - - - - Adder Dialog - - - - - -
- -
- - -
- -
- -
- -
- Available -
- - - - - - - - - - - - - - - - - - - -
- - - Users -
- - - -
- -
-
- -
-

-

-
- -
- -
- Prospective -
- - - - - - - - - - - - - - - - - - - -
- - - Users -
- - - -
- -
-
- -
- -
- External -
- - -
- -
-
- - diff --git a/install/ui/rule.js b/install/ui/rule.js index aec86574..40d05c8d 100644 --- a/install/ui/rule.js +++ b/install/ui/rule.js @@ -36,8 +36,6 @@ IPA.rule_details_section = function(spec) { that.create = function(container) { - if (that.template) return; - if (that.text) container.append(that.text); var field = that.get_field(that.field_name); diff --git a/install/ui/sudo.js b/install/ui/sudo.js index fecb0b07..30479fb1 100644 --- a/install/ui/sudo.js +++ b/install/ui/sudo.js @@ -263,21 +263,11 @@ IPA.sudorule_details_facet = function(spec) { var that = IPA.details_facet(spec); - var section; - - if (IPA.layout) { - section = that.create_section({ - 'name': 'general', - 'label': IPA.messages.details.general, - 'template': 'sudorule-details-general.html #contents' - }); - } else { - section = IPA.sudo.rule_details_general_section({ - 'name': 'general', - 'label': IPA.messages.details.general - }); - that.add_section(section); - } + var section = IPA.sudo.rule_details_general_section({ + 'name': 'general', + 'label': IPA.messages.details.general + }); + that.add_section(section); section.text({name: 'cn', read_only: true}); section.textarea({name: 'description'}); @@ -929,8 +919,6 @@ IPA.sudo.rule_details_command_section = function(spec) { that.create = function(container) { - if (that.template) return; - var field = that.get_field('cmdcategory'); var param_info = IPA.get_entity_param(that.entity_name, 'cmdcategory'); @@ -1098,8 +1086,6 @@ IPA.sudo.rule_details_runas_section = function(spec) { that.create = function(container) { - if (that.template) return; - var field = that.get_field('ipasudorunasusercategory'); var param_info = IPA.get_entity_param(that.entity_name, 'ipasudorunasusercategory'); @@ -1287,18 +1273,12 @@ IPA.sudorule_association_table_widget = function(spec) { var label = IPA.metadata.objects[that.other_entity].label; var title = 'Add '+label+' to '+that.entity_name+' '+pkey; - var template; - if (IPA.layout) { - template = 'sudorule-'+that.other_entity+'-dialog.html #contents'; - } - return IPA.sudo.rule_association_adder_dialog({ 'title': title, 'entity_name': that.entity_name, 'pkey': pkey, 'other_entity': that.other_entity, - 'external': that.external, - 'template': template + 'external': that.external }); }; -- cgit