2011-01-14 11:16:25 -06:00
|
|
|
/*jsl:import ipa.js */
|
HBAC Details Page
The UI framework has been extended to include a collection of widgets:
- ipa_widget: base class
- ipa_text_widget: text field
- ipa_radio_widget: radio button
- ipa_textarea_widget: textarea
- ipa_button_widget: button
- ipa_column_widget: column for table
- ipa_table_widget: table
These widgets can be used to create input controls. They can also be
extended to create custom controls.
The framework has also been enhanced to support custom layouts. This
can be used to change the look of the application without changing
the code. Initially this is only available in details section.
Layout consists of a collection of HTML templates. Each template is a
complete and valid HTML file representing a portion of a page. The
template will be loaded and initialized by the code, then filled with
the data from the server. The layouts are located in
install/static/layouts/<name> folder.
By default, if no templates are used, the fields in the details page
are rendered vertically using dd/dt/dd tags. For pages that require
different layout, a custom UI needs to be developed. There are two ways
to do that:
- write a custom widget to generate the UI dynamically
- create an HTML template and write the initialization code
For components that are quite complex or used frequently, it's might
be better to use the first method. For simple pages that are used only
in one location or need to support customization, the second method
might be preferable. Other benefits of templates:
- cleaner code and UI separation
- more flexibility in customization
- new pages can be developed quickly and require less coding
- multiple templates can be used with the same initialization code
- easier to maintain
The HBAC details page has been implemented using both methods. By
default it will use custom widgets to generate the page. To use a
custom layout, add the following parameter to the URL, then reload
the page:
&layout=<name>
Currently the only available layout is 'default' which produces the
same look as the custom widgets.
The HBAC details page is usable, but it still needs additional work.
The access time is not working yet. There is no undo button, hint,
or validation yet.
The table in the association facet has also been changed to use
ipa_association_widget which is derived from ipa_table_widget.
The Makefile has been updated to include the layouts. The unit tests
have been updated as well.
2010-11-02 20:16:55 -05:00
|
|
|
/* Authors:
|
|
|
|
* Endi Sukma Dewata <edewata@redhat.com>
|
2011-02-01 12:06:58 -06:00
|
|
|
* Adam Young <ayoung@redhat.com>
|
2011-02-02 16:18:35 -06:00
|
|
|
* Pavel Zuna <pzuna@redhat.com>
|
HBAC Details Page
The UI framework has been extended to include a collection of widgets:
- ipa_widget: base class
- ipa_text_widget: text field
- ipa_radio_widget: radio button
- ipa_textarea_widget: textarea
- ipa_button_widget: button
- ipa_column_widget: column for table
- ipa_table_widget: table
These widgets can be used to create input controls. They can also be
extended to create custom controls.
The framework has also been enhanced to support custom layouts. This
can be used to change the look of the application without changing
the code. Initially this is only available in details section.
Layout consists of a collection of HTML templates. Each template is a
complete and valid HTML file representing a portion of a page. The
template will be loaded and initialized by the code, then filled with
the data from the server. The layouts are located in
install/static/layouts/<name> folder.
By default, if no templates are used, the fields in the details page
are rendered vertically using dd/dt/dd tags. For pages that require
different layout, a custom UI needs to be developed. There are two ways
to do that:
- write a custom widget to generate the UI dynamically
- create an HTML template and write the initialization code
For components that are quite complex or used frequently, it's might
be better to use the first method. For simple pages that are used only
in one location or need to support customization, the second method
might be preferable. Other benefits of templates:
- cleaner code and UI separation
- more flexibility in customization
- new pages can be developed quickly and require less coding
- multiple templates can be used with the same initialization code
- easier to maintain
The HBAC details page has been implemented using both methods. By
default it will use custom widgets to generate the page. To use a
custom layout, add the following parameter to the URL, then reload
the page:
&layout=<name>
Currently the only available layout is 'default' which produces the
same look as the custom widgets.
The HBAC details page is usable, but it still needs additional work.
The access time is not working yet. There is no undo button, hint,
or validation yet.
The table in the association facet has also been changed to use
ipa_association_widget which is derived from ipa_table_widget.
The Makefile has been updated to include the layouts. The unit tests
have been updated as well.
2010-11-02 20:16:55 -05:00
|
|
|
*
|
|
|
|
* Copyright (C) 2010 Red Hat
|
|
|
|
* see file 'COPYING' for use and warranty information
|
|
|
|
*
|
2010-12-09 06:59:11 -06:00
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
HBAC Details Page
The UI framework has been extended to include a collection of widgets:
- ipa_widget: base class
- ipa_text_widget: text field
- ipa_radio_widget: radio button
- ipa_textarea_widget: textarea
- ipa_button_widget: button
- ipa_column_widget: column for table
- ipa_table_widget: table
These widgets can be used to create input controls. They can also be
extended to create custom controls.
The framework has also been enhanced to support custom layouts. This
can be used to change the look of the application without changing
the code. Initially this is only available in details section.
Layout consists of a collection of HTML templates. Each template is a
complete and valid HTML file representing a portion of a page. The
template will be loaded and initialized by the code, then filled with
the data from the server. The layouts are located in
install/static/layouts/<name> folder.
By default, if no templates are used, the fields in the details page
are rendered vertically using dd/dt/dd tags. For pages that require
different layout, a custom UI needs to be developed. There are two ways
to do that:
- write a custom widget to generate the UI dynamically
- create an HTML template and write the initialization code
For components that are quite complex or used frequently, it's might
be better to use the first method. For simple pages that are used only
in one location or need to support customization, the second method
might be preferable. Other benefits of templates:
- cleaner code and UI separation
- more flexibility in customization
- new pages can be developed quickly and require less coding
- multiple templates can be used with the same initialization code
- easier to maintain
The HBAC details page has been implemented using both methods. By
default it will use custom widgets to generate the page. To use a
custom layout, add the following parameter to the URL, then reload
the page:
&layout=<name>
Currently the only available layout is 'default' which produces the
same look as the custom widgets.
The HBAC details page is usable, but it still needs additional work.
The access time is not working yet. There is no undo button, hint,
or validation yet.
The table in the association facet has also been changed to use
ipa_association_widget which is derived from ipa_table_widget.
The Makefile has been updated to include the layouts. The unit tests
have been updated as well.
2010-11-02 20:16:55 -05:00
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
2010-12-09 06:59:11 -06:00
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
HBAC Details Page
The UI framework has been extended to include a collection of widgets:
- ipa_widget: base class
- ipa_text_widget: text field
- ipa_radio_widget: radio button
- ipa_textarea_widget: textarea
- ipa_button_widget: button
- ipa_column_widget: column for table
- ipa_table_widget: table
These widgets can be used to create input controls. They can also be
extended to create custom controls.
The framework has also been enhanced to support custom layouts. This
can be used to change the look of the application without changing
the code. Initially this is only available in details section.
Layout consists of a collection of HTML templates. Each template is a
complete and valid HTML file representing a portion of a page. The
template will be loaded and initialized by the code, then filled with
the data from the server. The layouts are located in
install/static/layouts/<name> folder.
By default, if no templates are used, the fields in the details page
are rendered vertically using dd/dt/dd tags. For pages that require
different layout, a custom UI needs to be developed. There are two ways
to do that:
- write a custom widget to generate the UI dynamically
- create an HTML template and write the initialization code
For components that are quite complex or used frequently, it's might
be better to use the first method. For simple pages that are used only
in one location or need to support customization, the second method
might be preferable. Other benefits of templates:
- cleaner code and UI separation
- more flexibility in customization
- new pages can be developed quickly and require less coding
- multiple templates can be used with the same initialization code
- easier to maintain
The HBAC details page has been implemented using both methods. By
default it will use custom widgets to generate the page. To use a
custom layout, add the following parameter to the URL, then reload
the page:
&layout=<name>
Currently the only available layout is 'default' which produces the
same look as the custom widgets.
The HBAC details page is usable, but it still needs additional work.
The access time is not working yet. There is no undo button, hint,
or validation yet.
The table in the association facet has also been changed to use
ipa_association_widget which is derived from ipa_table_widget.
The Makefile has been updated to include the layouts. The unit tests
have been updated as well.
2010-11-02 20:16:55 -05:00
|
|
|
*/
|
|
|
|
|
|
|
|
/* REQUIRES: ipa.js */
|
|
|
|
|
2011-06-01 11:14:53 -05:00
|
|
|
IPA.checkbox_column_width = 22;
|
|
|
|
|
2011-01-12 18:51:22 -06:00
|
|
|
IPA.widget = function(spec) {
|
HBAC Details Page
The UI framework has been extended to include a collection of widgets:
- ipa_widget: base class
- ipa_text_widget: text field
- ipa_radio_widget: radio button
- ipa_textarea_widget: textarea
- ipa_button_widget: button
- ipa_column_widget: column for table
- ipa_table_widget: table
These widgets can be used to create input controls. They can also be
extended to create custom controls.
The framework has also been enhanced to support custom layouts. This
can be used to change the look of the application without changing
the code. Initially this is only available in details section.
Layout consists of a collection of HTML templates. Each template is a
complete and valid HTML file representing a portion of a page. The
template will be loaded and initialized by the code, then filled with
the data from the server. The layouts are located in
install/static/layouts/<name> folder.
By default, if no templates are used, the fields in the details page
are rendered vertically using dd/dt/dd tags. For pages that require
different layout, a custom UI needs to be developed. There are two ways
to do that:
- write a custom widget to generate the UI dynamically
- create an HTML template and write the initialization code
For components that are quite complex or used frequently, it's might
be better to use the first method. For simple pages that are used only
in one location or need to support customization, the second method
might be preferable. Other benefits of templates:
- cleaner code and UI separation
- more flexibility in customization
- new pages can be developed quickly and require less coding
- multiple templates can be used with the same initialization code
- easier to maintain
The HBAC details page has been implemented using both methods. By
default it will use custom widgets to generate the page. To use a
custom layout, add the following parameter to the URL, then reload
the page:
&layout=<name>
Currently the only available layout is 'default' which produces the
same look as the custom widgets.
The HBAC details page is usable, but it still needs additional work.
The access time is not working yet. There is no undo button, hint,
or validation yet.
The table in the association facet has also been changed to use
ipa_association_widget which is derived from ipa_table_widget.
The Makefile has been updated to include the layouts. The unit tests
have been updated as well.
2010-11-02 20:16:55 -05:00
|
|
|
|
|
|
|
spec = spec || {};
|
|
|
|
|
|
|
|
var that = {};
|
|
|
|
|
|
|
|
that.id = spec.id;
|
|
|
|
that.name = spec.name;
|
2010-12-06 13:51:49 -06:00
|
|
|
that.label = spec.label;
|
2011-01-18 11:12:47 -06:00
|
|
|
that.tooltip = spec.tooltip;
|
2011-02-02 10:35:23 -06:00
|
|
|
|
|
|
|
that.disabled = spec.disabled;
|
2011-02-09 10:56:25 -06:00
|
|
|
that.hidden = spec.hidden;
|
2011-05-27 10:32:17 -05:00
|
|
|
that.conditional = spec.conditional;
|
2011-06-27 14:57:40 -05:00
|
|
|
that.optional = spec.optional || false;
|
|
|
|
|
2011-02-02 16:18:35 -06:00
|
|
|
// read_only is set during initialization
|
HBAC Details Page
The UI framework has been extended to include a collection of widgets:
- ipa_widget: base class
- ipa_text_widget: text field
- ipa_radio_widget: radio button
- ipa_textarea_widget: textarea
- ipa_button_widget: button
- ipa_column_widget: column for table
- ipa_table_widget: table
These widgets can be used to create input controls. They can also be
extended to create custom controls.
The framework has also been enhanced to support custom layouts. This
can be used to change the look of the application without changing
the code. Initially this is only available in details section.
Layout consists of a collection of HTML templates. Each template is a
complete and valid HTML file representing a portion of a page. The
template will be loaded and initialized by the code, then filled with
the data from the server. The layouts are located in
install/static/layouts/<name> folder.
By default, if no templates are used, the fields in the details page
are rendered vertically using dd/dt/dd tags. For pages that require
different layout, a custom UI needs to be developed. There are two ways
to do that:
- write a custom widget to generate the UI dynamically
- create an HTML template and write the initialization code
For components that are quite complex or used frequently, it's might
be better to use the first method. For simple pages that are used only
in one location or need to support customization, the second method
might be preferable. Other benefits of templates:
- cleaner code and UI separation
- more flexibility in customization
- new pages can be developed quickly and require less coding
- multiple templates can be used with the same initialization code
- easier to maintain
The HBAC details page has been implemented using both methods. By
default it will use custom widgets to generate the page. To use a
custom layout, add the following parameter to the URL, then reload
the page:
&layout=<name>
Currently the only available layout is 'default' which produces the
same look as the custom widgets.
The HBAC details page is usable, but it still needs additional work.
The access time is not working yet. There is no undo button, hint,
or validation yet.
The table in the association facet has also been changed to use
ipa_association_widget which is derived from ipa_table_widget.
The Makefile has been updated to include the layouts. The unit tests
have been updated as well.
2010-11-02 20:16:55 -05:00
|
|
|
that.read_only = spec.read_only;
|
2011-02-02 10:35:23 -06:00
|
|
|
|
2011-02-02 16:18:35 -06:00
|
|
|
// writable is set during load
|
|
|
|
that.writable = true;
|
|
|
|
|
HBAC Details Page
The UI framework has been extended to include a collection of widgets:
- ipa_widget: base class
- ipa_text_widget: text field
- ipa_radio_widget: radio button
- ipa_textarea_widget: textarea
- ipa_button_widget: button
- ipa_column_widget: column for table
- ipa_table_widget: table
These widgets can be used to create input controls. They can also be
extended to create custom controls.
The framework has also been enhanced to support custom layouts. This
can be used to change the look of the application without changing
the code. Initially this is only available in details section.
Layout consists of a collection of HTML templates. Each template is a
complete and valid HTML file representing a portion of a page. The
template will be loaded and initialized by the code, then filled with
the data from the server. The layouts are located in
install/static/layouts/<name> folder.
By default, if no templates are used, the fields in the details page
are rendered vertically using dd/dt/dd tags. For pages that require
different layout, a custom UI needs to be developed. There are two ways
to do that:
- write a custom widget to generate the UI dynamically
- create an HTML template and write the initialization code
For components that are quite complex or used frequently, it's might
be better to use the first method. For simple pages that are used only
in one location or need to support customization, the second method
might be preferable. Other benefits of templates:
- cleaner code and UI separation
- more flexibility in customization
- new pages can be developed quickly and require less coding
- multiple templates can be used with the same initialization code
- easier to maintain
The HBAC details page has been implemented using both methods. By
default it will use custom widgets to generate the page. To use a
custom layout, add the following parameter to the URL, then reload
the page:
&layout=<name>
Currently the only available layout is 'default' which produces the
same look as the custom widgets.
The HBAC details page is usable, but it still needs additional work.
The access time is not working yet. There is no undo button, hint,
or validation yet.
The table in the association facet has also been changed to use
ipa_association_widget which is derived from ipa_table_widget.
The Makefile has been updated to include the layouts. The unit tests
have been updated as well.
2010-11-02 20:16:55 -05:00
|
|
|
that._entity_name = spec.entity_name;
|
|
|
|
|
2010-12-01 14:51:39 -06:00
|
|
|
that.width = spec.width;
|
|
|
|
that.height = spec.height;
|
|
|
|
|
2010-11-15 11:10:55 -06:00
|
|
|
that.undo = typeof spec.undo == 'undefined' ? true : spec.undo;
|
2011-01-28 09:36:25 -06:00
|
|
|
that.join = spec.join;
|
2010-11-15 11:10:55 -06:00
|
|
|
|
2011-01-12 21:00:38 -06:00
|
|
|
that.param_info = spec.param_info;
|
2011-04-26 16:21:25 -05:00
|
|
|
that.metadata = spec.metadata;
|
|
|
|
|
2011-02-07 22:02:43 -06:00
|
|
|
that.values = [];
|
2011-05-26 17:57:39 -05:00
|
|
|
that.dirty = false;
|
2011-04-26 16:21:25 -05:00
|
|
|
that.valid = true;
|
HBAC Details Page
The UI framework has been extended to include a collection of widgets:
- ipa_widget: base class
- ipa_text_widget: text field
- ipa_radio_widget: radio button
- ipa_textarea_widget: textarea
- ipa_button_widget: button
- ipa_column_widget: column for table
- ipa_table_widget: table
These widgets can be used to create input controls. They can also be
extended to create custom controls.
The framework has also been enhanced to support custom layouts. This
can be used to change the look of the application without changing
the code. Initially this is only available in details section.
Layout consists of a collection of HTML templates. Each template is a
complete and valid HTML file representing a portion of a page. The
template will be loaded and initialized by the code, then filled with
the data from the server. The layouts are located in
install/static/layouts/<name> folder.
By default, if no templates are used, the fields in the details page
are rendered vertically using dd/dt/dd tags. For pages that require
different layout, a custom UI needs to be developed. There are two ways
to do that:
- write a custom widget to generate the UI dynamically
- create an HTML template and write the initialization code
For components that are quite complex or used frequently, it's might
be better to use the first method. For simple pages that are used only
in one location or need to support customization, the second method
might be preferable. Other benefits of templates:
- cleaner code and UI separation
- more flexibility in customization
- new pages can be developed quickly and require less coding
- multiple templates can be used with the same initialization code
- easier to maintain
The HBAC details page has been implemented using both methods. By
default it will use custom widgets to generate the page. To use a
custom layout, add the following parameter to the URL, then reload
the page:
&layout=<name>
Currently the only available layout is 'default' which produces the
same look as the custom widgets.
The HBAC details page is usable, but it still needs additional work.
The access time is not working yet. There is no undo button, hint,
or validation yet.
The table in the association facet has also been changed to use
ipa_association_widget which is derived from ipa_table_widget.
The Makefile has been updated to include the layouts. The unit tests
have been updated as well.
2010-11-02 20:16:55 -05:00
|
|
|
|
|
|
|
that.__defineGetter__("entity_name", function(){
|
|
|
|
return that._entity_name;
|
|
|
|
});
|
|
|
|
|
|
|
|
that.__defineSetter__("entity_name", function(entity_name){
|
|
|
|
that._entity_name = entity_name;
|
|
|
|
});
|
|
|
|
|
2011-07-05 09:35:50 -05:00
|
|
|
|
|
|
|
function meta_validate(meta, value){
|
|
|
|
var message;
|
|
|
|
|
|
|
|
if (meta.type == 'int') {
|
|
|
|
if (!value.match(/^-?\d+$/)) {
|
|
|
|
that.valid = false;
|
|
|
|
that.show_error(IPA.messages.widget.validation.integer);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (meta.minvalue && value < meta.minvalue) {
|
|
|
|
that.valid = false;
|
|
|
|
message = IPA.messages.widget.validation.min_value;
|
|
|
|
message = message.replace('${value}', meta.minvalue);
|
|
|
|
that.show_error(message);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (meta.maxvalue && value > meta.maxvalue) {
|
|
|
|
that.valid = false;
|
|
|
|
message = IPA.messages.widget.validation.max_value;
|
|
|
|
message = message.replace('${value}', meta.maxvalue);
|
|
|
|
that.show_error(message);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (meta.pattern) {
|
|
|
|
var regex = new RegExp(meta.pattern);
|
|
|
|
if (!value.match(regex)) {
|
|
|
|
that.valid = false;
|
|
|
|
that.show_error(meta.pattern_errmsg);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
2011-07-06 14:43:50 -05:00
|
|
|
that.create_error_link = function(container){
|
|
|
|
container.append(' ');
|
2011-07-05 09:35:50 -05:00
|
|
|
|
2011-07-06 14:43:50 -05:00
|
|
|
$('<span/>', {
|
|
|
|
name: 'error_link',
|
|
|
|
html: IPA.messages.widget.validation.error,
|
|
|
|
'class': 'ui-state-error ui-corner-all',
|
|
|
|
style: 'display:none'
|
|
|
|
}).appendTo(container);
|
|
|
|
};
|
2011-04-26 16:21:25 -05:00
|
|
|
|
2011-07-06 14:43:50 -05:00
|
|
|
that.check_required = function(){
|
2011-04-26 16:21:25 -05:00
|
|
|
var values = that.save();
|
2011-07-06 14:43:50 -05:00
|
|
|
if (!values || !values.length || values[0] === '' ) {
|
2011-06-27 14:57:40 -05:00
|
|
|
if (that.param_info &&
|
|
|
|
that.param_info.required &&
|
|
|
|
!that.optional) {
|
|
|
|
that.valid = false;
|
2011-06-30 13:33:33 -05:00
|
|
|
that.show_error(IPA.messages.widget.validation.required);
|
2011-07-06 14:43:50 -05:00
|
|
|
return false;
|
2011-06-27 14:57:40 -05:00
|
|
|
}
|
2011-01-07 09:32:33 -06:00
|
|
|
}
|
2011-07-06 14:43:50 -05:00
|
|
|
return true;
|
|
|
|
};
|
2011-04-26 16:21:25 -05:00
|
|
|
|
2011-07-06 14:43:50 -05:00
|
|
|
/*returns true and clears the error message if the field value passes
|
|
|
|
the validation pattern. If the field value does not pass validation,
|
|
|
|
displays the error message and returns false. */
|
|
|
|
that.validate = function() {
|
|
|
|
hide_error();
|
|
|
|
that.valid = true;
|
|
|
|
|
|
|
|
var values = that.save();
|
2011-07-08 09:15:16 -05:00
|
|
|
if (!values){
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (values.length ===0 ){
|
|
|
|
return;
|
|
|
|
}
|
2011-04-26 16:21:25 -05:00
|
|
|
var value = values[0];
|
|
|
|
if (!value) {
|
2011-01-22 18:41:10 -06:00
|
|
|
return;
|
2011-01-07 09:32:33 -06:00
|
|
|
}
|
2011-04-26 16:21:25 -05:00
|
|
|
|
|
|
|
if (that.metadata) {
|
2011-07-05 09:35:50 -05:00
|
|
|
meta_validate(that.metadata,value);
|
2011-01-07 09:32:33 -06:00
|
|
|
}
|
2011-04-26 16:21:25 -05:00
|
|
|
if (that.param_info) {
|
2011-07-05 09:35:50 -05:00
|
|
|
meta_validate(that.param_info,value);
|
2011-04-26 16:21:25 -05:00
|
|
|
}
|
|
|
|
};
|
2011-01-07 09:32:33 -06:00
|
|
|
|
2011-05-26 17:57:39 -05:00
|
|
|
that.init = function() {
|
2011-01-18 11:12:47 -06:00
|
|
|
if (that.entity_name) {
|
2011-04-27 12:17:13 -05:00
|
|
|
that.entity = IPA.get_entity(that.entity_name);
|
2011-07-08 11:06:30 -05:00
|
|
|
if (!that.param_info){
|
|
|
|
that.param_info =
|
|
|
|
IPA.get_entity_param(that.entity_name, that.name);
|
|
|
|
}
|
2011-01-18 11:12:47 -06:00
|
|
|
if (that.param_info) {
|
|
|
|
|
|
|
|
if (that.label === undefined) {
|
|
|
|
that.label = that.param_info.label;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (that.tooltip === undefined) {
|
|
|
|
that.tooltip = that.param_info.doc;
|
|
|
|
}
|
2010-12-21 14:14:08 -06:00
|
|
|
}
|
2010-12-06 13:51:49 -06:00
|
|
|
}
|
2011-05-26 17:57:39 -05:00
|
|
|
};
|
2011-06-27 17:31:55 -05:00
|
|
|
|
2011-06-16 11:44:47 -05:00
|
|
|
/**
|
|
|
|
* This function compares the original values and the
|
|
|
|
* values entered in the UI. If the values have changed
|
|
|
|
* it will return true.
|
|
|
|
*/
|
2011-06-27 17:31:55 -05:00
|
|
|
that.test_dirty = function() {
|
2011-06-16 11:44:47 -05:00
|
|
|
|
|
|
|
if (that.read_only) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
var values = that.save();
|
|
|
|
|
|
|
|
if (!values) { // ignore null values
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!that.values) {
|
|
|
|
|
|
|
|
if (values instanceof Array) {
|
|
|
|
|
|
|
|
if ((values.length === 0) ||
|
|
|
|
(values.length === 1) &&
|
|
|
|
(values[0] === '')) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (values.length != that.values.length) {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
values.sort();
|
|
|
|
that.values.sort();
|
|
|
|
|
|
|
|
for (var i=0; i<values.length; i++) {
|
|
|
|
if (values[i] != that.values[i]) {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
|
|
|
};
|
2010-11-09 14:22:31 -06:00
|
|
|
|
2011-05-26 17:57:39 -05:00
|
|
|
that.create = function(container) {
|
2011-07-15 12:18:59 -05:00
|
|
|
container.addClass('widget');
|
2011-06-07 20:48:20 -05:00
|
|
|
that.container = container;
|
2011-05-26 17:57:39 -05:00
|
|
|
};
|
HBAC Details Page
The UI framework has been extended to include a collection of widgets:
- ipa_widget: base class
- ipa_text_widget: text field
- ipa_radio_widget: radio button
- ipa_textarea_widget: textarea
- ipa_button_widget: button
- ipa_column_widget: column for table
- ipa_table_widget: table
These widgets can be used to create input controls. They can also be
extended to create custom controls.
The framework has also been enhanced to support custom layouts. This
can be used to change the look of the application without changing
the code. Initially this is only available in details section.
Layout consists of a collection of HTML templates. Each template is a
complete and valid HTML file representing a portion of a page. The
template will be loaded and initialized by the code, then filled with
the data from the server. The layouts are located in
install/static/layouts/<name> folder.
By default, if no templates are used, the fields in the details page
are rendered vertically using dd/dt/dd tags. For pages that require
different layout, a custom UI needs to be developed. There are two ways
to do that:
- write a custom widget to generate the UI dynamically
- create an HTML template and write the initialization code
For components that are quite complex or used frequently, it's might
be better to use the first method. For simple pages that are used only
in one location or need to support customization, the second method
might be preferable. Other benefits of templates:
- cleaner code and UI separation
- more flexibility in customization
- new pages can be developed quickly and require less coding
- multiple templates can be used with the same initialization code
- easier to maintain
The HBAC details page has been implemented using both methods. By
default it will use custom widgets to generate the page. To use a
custom layout, add the following parameter to the URL, then reload
the page:
&layout=<name>
Currently the only available layout is 'default' which produces the
same look as the custom widgets.
The HBAC details page is usable, but it still needs additional work.
The access time is not working yet. There is no undo button, hint,
or validation yet.
The table in the association facet has also been changed to use
ipa_association_widget which is derived from ipa_table_widget.
The Makefile has been updated to include the layouts. The unit tests
have been updated as well.
2010-11-02 20:16:55 -05:00
|
|
|
|
2011-05-26 17:57:39 -05:00
|
|
|
that.setup = function(container) {
|
2010-11-18 20:17:14 -06:00
|
|
|
that.container = container;
|
2011-05-26 17:57:39 -05:00
|
|
|
};
|
HBAC Details Page
The UI framework has been extended to include a collection of widgets:
- ipa_widget: base class
- ipa_text_widget: text field
- ipa_radio_widget: radio button
- ipa_textarea_widget: textarea
- ipa_button_widget: button
- ipa_column_widget: column for table
- ipa_table_widget: table
These widgets can be used to create input controls. They can also be
extended to create custom controls.
The framework has also been enhanced to support custom layouts. This
can be used to change the look of the application without changing
the code. Initially this is only available in details section.
Layout consists of a collection of HTML templates. Each template is a
complete and valid HTML file representing a portion of a page. The
template will be loaded and initialized by the code, then filled with
the data from the server. The layouts are located in
install/static/layouts/<name> folder.
By default, if no templates are used, the fields in the details page
are rendered vertically using dd/dt/dd tags. For pages that require
different layout, a custom UI needs to be developed. There are two ways
to do that:
- write a custom widget to generate the UI dynamically
- create an HTML template and write the initialization code
For components that are quite complex or used frequently, it's might
be better to use the first method. For simple pages that are used only
in one location or need to support customization, the second method
might be preferable. Other benefits of templates:
- cleaner code and UI separation
- more flexibility in customization
- new pages can be developed quickly and require less coding
- multiple templates can be used with the same initialization code
- easier to maintain
The HBAC details page has been implemented using both methods. By
default it will use custom widgets to generate the page. To use a
custom layout, add the following parameter to the URL, then reload
the page:
&layout=<name>
Currently the only available layout is 'default' which produces the
same look as the custom widgets.
The HBAC details page is usable, but it still needs additional work.
The access time is not working yet. There is no undo button, hint,
or validation yet.
The table in the association facet has also been changed to use
ipa_association_widget which is derived from ipa_table_widget.
The Makefile has been updated to include the layouts. The unit tests
have been updated as well.
2010-11-02 20:16:55 -05:00
|
|
|
|
2011-01-29 23:03:30 -06:00
|
|
|
/**
|
|
|
|
* This function stores the entire record and the values
|
|
|
|
* of the field, then invoke reset() to update the UI.
|
|
|
|
*/
|
2011-05-26 17:57:39 -05:00
|
|
|
that.load = function(record) {
|
2010-12-09 14:20:40 -06:00
|
|
|
that.record = record;
|
2011-01-29 23:03:30 -06:00
|
|
|
|
|
|
|
var value = record[that.name];
|
|
|
|
if (value instanceof Array) {
|
|
|
|
that.values = value;
|
|
|
|
} else {
|
|
|
|
that.values = value ? [value] : [];
|
|
|
|
}
|
|
|
|
|
2011-02-02 16:18:35 -06:00
|
|
|
that.writable = true;
|
|
|
|
|
2011-02-03 21:42:50 -06:00
|
|
|
if (that.param_info) {
|
|
|
|
if (that.param_info.primary_key) {
|
|
|
|
that.writable = false;
|
|
|
|
}
|
2011-02-02 16:18:35 -06:00
|
|
|
|
2011-02-03 21:42:50 -06:00
|
|
|
if (that.param_info.flags && 'no_update' in that.param_info.flags) {
|
|
|
|
that.writable = false;
|
|
|
|
}
|
2011-02-02 16:18:35 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
if (that.record.attributelevelrights) {
|
|
|
|
var rights = that.record.attributelevelrights[that.name];
|
|
|
|
if (!rights || rights.indexOf('w') < 0) {
|
|
|
|
that.writable = false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-12-09 14:20:40 -06:00
|
|
|
that.reset();
|
2011-05-26 17:57:39 -05:00
|
|
|
};
|
HBAC Details Page
The UI framework has been extended to include a collection of widgets:
- ipa_widget: base class
- ipa_text_widget: text field
- ipa_radio_widget: radio button
- ipa_textarea_widget: textarea
- ipa_button_widget: button
- ipa_column_widget: column for table
- ipa_table_widget: table
These widgets can be used to create input controls. They can also be
extended to create custom controls.
The framework has also been enhanced to support custom layouts. This
can be used to change the look of the application without changing
the code. Initially this is only available in details section.
Layout consists of a collection of HTML templates. Each template is a
complete and valid HTML file representing a portion of a page. The
template will be loaded and initialized by the code, then filled with
the data from the server. The layouts are located in
install/static/layouts/<name> folder.
By default, if no templates are used, the fields in the details page
are rendered vertically using dd/dt/dd tags. For pages that require
different layout, a custom UI needs to be developed. There are two ways
to do that:
- write a custom widget to generate the UI dynamically
- create an HTML template and write the initialization code
For components that are quite complex or used frequently, it's might
be better to use the first method. For simple pages that are used only
in one location or need to support customization, the second method
might be preferable. Other benefits of templates:
- cleaner code and UI separation
- more flexibility in customization
- new pages can be developed quickly and require less coding
- multiple templates can be used with the same initialization code
- easier to maintain
The HBAC details page has been implemented using both methods. By
default it will use custom widgets to generate the page. To use a
custom layout, add the following parameter to the URL, then reload
the page:
&layout=<name>
Currently the only available layout is 'default' which produces the
same look as the custom widgets.
The HBAC details page is usable, but it still needs additional work.
The access time is not working yet. There is no undo button, hint,
or validation yet.
The table in the association facet has also been changed to use
ipa_association_widget which is derived from ipa_table_widget.
The Makefile has been updated to include the layouts. The unit tests
have been updated as well.
2010-11-02 20:16:55 -05:00
|
|
|
|
2010-12-09 14:20:40 -06:00
|
|
|
that.reset = function() {
|
|
|
|
that.update();
|
2011-07-08 09:15:16 -05:00
|
|
|
that.validate();
|
2011-06-27 17:31:55 -05:00
|
|
|
that.set_dirty(false);
|
2010-12-09 14:20:40 -06:00
|
|
|
};
|
|
|
|
|
2011-05-26 17:57:39 -05:00
|
|
|
that.update = function() {
|
|
|
|
};
|
HBAC Details Page
The UI framework has been extended to include a collection of widgets:
- ipa_widget: base class
- ipa_text_widget: text field
- ipa_radio_widget: radio button
- ipa_textarea_widget: textarea
- ipa_button_widget: button
- ipa_column_widget: column for table
- ipa_table_widget: table
These widgets can be used to create input controls. They can also be
extended to create custom controls.
The framework has also been enhanced to support custom layouts. This
can be used to change the look of the application without changing
the code. Initially this is only available in details section.
Layout consists of a collection of HTML templates. Each template is a
complete and valid HTML file representing a portion of a page. The
template will be loaded and initialized by the code, then filled with
the data from the server. The layouts are located in
install/static/layouts/<name> folder.
By default, if no templates are used, the fields in the details page
are rendered vertically using dd/dt/dd tags. For pages that require
different layout, a custom UI needs to be developed. There are two ways
to do that:
- write a custom widget to generate the UI dynamically
- create an HTML template and write the initialization code
For components that are quite complex or used frequently, it's might
be better to use the first method. For simple pages that are used only
in one location or need to support customization, the second method
might be preferable. Other benefits of templates:
- cleaner code and UI separation
- more flexibility in customization
- new pages can be developed quickly and require less coding
- multiple templates can be used with the same initialization code
- easier to maintain
The HBAC details page has been implemented using both methods. By
default it will use custom widgets to generate the page. To use a
custom layout, add the following parameter to the URL, then reload
the page:
&layout=<name>
Currently the only available layout is 'default' which produces the
same look as the custom widgets.
The HBAC details page is usable, but it still needs additional work.
The access time is not working yet. There is no undo button, hint,
or validation yet.
The table in the association facet has also been changed to use
ipa_association_widget which is derived from ipa_table_widget.
The Makefile has been updated to include the layouts. The unit tests
have been updated as well.
2010-11-02 20:16:55 -05:00
|
|
|
|
2011-01-29 23:03:30 -06:00
|
|
|
/**
|
|
|
|
* This function saves the values entered in the UI.
|
|
|
|
* It returns the values in an array, or null if
|
|
|
|
* the field should not be saved.
|
|
|
|
*/
|
2011-05-26 17:57:39 -05:00
|
|
|
that.save = function() {
|
2011-01-29 23:03:30 -06:00
|
|
|
return that.values;
|
2011-05-26 17:57:39 -05:00
|
|
|
};
|
2010-11-09 14:22:31 -06:00
|
|
|
|
2011-01-29 23:03:30 -06:00
|
|
|
/**
|
|
|
|
* This function compares the original values and the
|
|
|
|
* values entered in the UI. If the values have changed
|
|
|
|
* it will return true.
|
|
|
|
*/
|
2010-12-02 22:12:59 -06:00
|
|
|
that.is_dirty = function() {
|
2011-05-26 17:57:39 -05:00
|
|
|
return that.dirty;
|
2010-11-15 11:10:55 -06:00
|
|
|
};
|
|
|
|
|
2011-01-31 16:29:25 -06:00
|
|
|
that.create_undo = function(container) {
|
2011-02-07 22:02:43 -06:00
|
|
|
that.undo_span =
|
|
|
|
$('<span/>', {
|
|
|
|
name: 'undo',
|
|
|
|
style: 'display: none;',
|
|
|
|
'class': 'ui-state-highlight ui-corner-all undo',
|
|
|
|
html: 'undo'
|
|
|
|
}).appendTo(container);
|
2011-01-31 16:29:25 -06:00
|
|
|
};
|
|
|
|
|
2011-05-26 17:57:39 -05:00
|
|
|
that.set_dirty = function(dirty) {
|
|
|
|
that.dirty = dirty;
|
|
|
|
if (that.undo) {
|
|
|
|
if (dirty) {
|
|
|
|
that.show_undo();
|
|
|
|
} else {
|
|
|
|
that.hide_undo();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2010-11-18 20:17:14 -06:00
|
|
|
that.get_undo = function() {
|
2011-02-07 22:02:43 -06:00
|
|
|
return $(that.undo_span);
|
2010-11-15 11:10:55 -06:00
|
|
|
};
|
|
|
|
|
2010-11-18 20:17:14 -06:00
|
|
|
that.show_undo = function() {
|
2011-02-07 22:02:43 -06:00
|
|
|
$(that.undo_span).css('display', 'inline');
|
2010-11-15 11:10:55 -06:00
|
|
|
};
|
|
|
|
|
2010-11-18 20:17:14 -06:00
|
|
|
that.hide_undo = function() {
|
2011-02-07 22:02:43 -06:00
|
|
|
$(that.undo_span).css('display', 'none');
|
2010-11-15 11:10:55 -06:00
|
|
|
};
|
|
|
|
|
2011-01-07 09:32:33 -06:00
|
|
|
that.get_error_link = function() {
|
|
|
|
return $('span[name="error_link"]', that.container);
|
|
|
|
};
|
|
|
|
|
2011-04-26 16:21:25 -05:00
|
|
|
that.show_error = function(message) {
|
2011-01-07 09:32:33 -06:00
|
|
|
var error_link = that.get_error_link();
|
2011-04-26 16:21:25 -05:00
|
|
|
error_link.html(message);
|
|
|
|
error_link.css('display', 'block');
|
2011-01-07 09:32:33 -06:00
|
|
|
};
|
|
|
|
|
2011-07-06 14:43:50 -05:00
|
|
|
function hide_error() {
|
2011-01-07 09:32:33 -06:00
|
|
|
var error_link = that.get_error_link();
|
|
|
|
error_link.css('display', 'none');
|
2011-07-06 14:43:50 -05:00
|
|
|
}
|
2011-01-07 09:32:33 -06:00
|
|
|
|
2011-01-10 20:51:09 -06:00
|
|
|
that.set_enabled = function() {
|
|
|
|
};
|
2011-01-07 09:32:33 -06:00
|
|
|
|
2010-11-18 20:17:14 -06:00
|
|
|
that.refresh = function() {
|
|
|
|
};
|
|
|
|
|
2010-11-15 11:10:55 -06:00
|
|
|
// methods that should be invoked by subclasses
|
2010-11-18 20:17:14 -06:00
|
|
|
that.widget_init = that.init;
|
2010-11-16 18:10:40 -06:00
|
|
|
that.widget_create = that.create;
|
2010-11-15 11:10:55 -06:00
|
|
|
that.widget_setup = that.setup;
|
2011-02-03 21:42:50 -06:00
|
|
|
that.widget_load = that.load;
|
2011-01-10 20:51:09 -06:00
|
|
|
that.widget_reset = that.reset;
|
2011-02-03 21:42:50 -06:00
|
|
|
that.widget_save = that.save;
|
2011-05-26 17:57:39 -05:00
|
|
|
that.widget_set_dirty = that.set_dirty;
|
2011-06-27 17:31:55 -05:00
|
|
|
that.widget_test_dirty = that.test_dirty;
|
2010-11-15 11:10:55 -06:00
|
|
|
|
HBAC Details Page
The UI framework has been extended to include a collection of widgets:
- ipa_widget: base class
- ipa_text_widget: text field
- ipa_radio_widget: radio button
- ipa_textarea_widget: textarea
- ipa_button_widget: button
- ipa_column_widget: column for table
- ipa_table_widget: table
These widgets can be used to create input controls. They can also be
extended to create custom controls.
The framework has also been enhanced to support custom layouts. This
can be used to change the look of the application without changing
the code. Initially this is only available in details section.
Layout consists of a collection of HTML templates. Each template is a
complete and valid HTML file representing a portion of a page. The
template will be loaded and initialized by the code, then filled with
the data from the server. The layouts are located in
install/static/layouts/<name> folder.
By default, if no templates are used, the fields in the details page
are rendered vertically using dd/dt/dd tags. For pages that require
different layout, a custom UI needs to be developed. There are two ways
to do that:
- write a custom widget to generate the UI dynamically
- create an HTML template and write the initialization code
For components that are quite complex or used frequently, it's might
be better to use the first method. For simple pages that are used only
in one location or need to support customization, the second method
might be preferable. Other benefits of templates:
- cleaner code and UI separation
- more flexibility in customization
- new pages can be developed quickly and require less coding
- multiple templates can be used with the same initialization code
- easier to maintain
The HBAC details page has been implemented using both methods. By
default it will use custom widgets to generate the page. To use a
custom layout, add the following parameter to the URL, then reload
the page:
&layout=<name>
Currently the only available layout is 'default' which produces the
same look as the custom widgets.
The HBAC details page is usable, but it still needs additional work.
The access time is not working yet. There is no undo button, hint,
or validation yet.
The table in the association facet has also been changed to use
ipa_association_widget which is derived from ipa_table_widget.
The Makefile has been updated to include the layouts. The unit tests
have been updated as well.
2010-11-02 20:16:55 -05:00
|
|
|
return that;
|
2011-01-14 11:16:25 -06:00
|
|
|
};
|
HBAC Details Page
The UI framework has been extended to include a collection of widgets:
- ipa_widget: base class
- ipa_text_widget: text field
- ipa_radio_widget: radio button
- ipa_textarea_widget: textarea
- ipa_button_widget: button
- ipa_column_widget: column for table
- ipa_table_widget: table
These widgets can be used to create input controls. They can also be
extended to create custom controls.
The framework has also been enhanced to support custom layouts. This
can be used to change the look of the application without changing
the code. Initially this is only available in details section.
Layout consists of a collection of HTML templates. Each template is a
complete and valid HTML file representing a portion of a page. The
template will be loaded and initialized by the code, then filled with
the data from the server. The layouts are located in
install/static/layouts/<name> folder.
By default, if no templates are used, the fields in the details page
are rendered vertically using dd/dt/dd tags. For pages that require
different layout, a custom UI needs to be developed. There are two ways
to do that:
- write a custom widget to generate the UI dynamically
- create an HTML template and write the initialization code
For components that are quite complex or used frequently, it's might
be better to use the first method. For simple pages that are used only
in one location or need to support customization, the second method
might be preferable. Other benefits of templates:
- cleaner code and UI separation
- more flexibility in customization
- new pages can be developed quickly and require less coding
- multiple templates can be used with the same initialization code
- easier to maintain
The HBAC details page has been implemented using both methods. By
default it will use custom widgets to generate the page. To use a
custom layout, add the following parameter to the URL, then reload
the page:
&layout=<name>
Currently the only available layout is 'default' which produces the
same look as the custom widgets.
The HBAC details page is usable, but it still needs additional work.
The access time is not working yet. There is no undo button, hint,
or validation yet.
The table in the association facet has also been changed to use
ipa_association_widget which is derived from ipa_table_widget.
The Makefile has been updated to include the layouts. The unit tests
have been updated as well.
2010-11-02 20:16:55 -05:00
|
|
|
|
2011-06-18 22:22:48 -05:00
|
|
|
/*uses a browser specific technique to select a range.*/
|
|
|
|
IPA.select_range = function(input,start, end) {
|
|
|
|
input.focus();
|
|
|
|
if (input[0].setSelectionRange) {
|
|
|
|
input[0].setSelectionRange(start, end);
|
|
|
|
} else if (input[0].createTextRange) {
|
|
|
|
var range = input[0].createTextRange();
|
|
|
|
range.collapse(true);
|
|
|
|
range.moveEnd('character', end);
|
|
|
|
range.moveStart('character', start);
|
|
|
|
range.select();
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2011-01-12 18:51:22 -06:00
|
|
|
|
|
|
|
IPA.text_widget = function(spec) {
|
HBAC Details Page
The UI framework has been extended to include a collection of widgets:
- ipa_widget: base class
- ipa_text_widget: text field
- ipa_radio_widget: radio button
- ipa_textarea_widget: textarea
- ipa_button_widget: button
- ipa_column_widget: column for table
- ipa_table_widget: table
These widgets can be used to create input controls. They can also be
extended to create custom controls.
The framework has also been enhanced to support custom layouts. This
can be used to change the look of the application without changing
the code. Initially this is only available in details section.
Layout consists of a collection of HTML templates. Each template is a
complete and valid HTML file representing a portion of a page. The
template will be loaded and initialized by the code, then filled with
the data from the server. The layouts are located in
install/static/layouts/<name> folder.
By default, if no templates are used, the fields in the details page
are rendered vertically using dd/dt/dd tags. For pages that require
different layout, a custom UI needs to be developed. There are two ways
to do that:
- write a custom widget to generate the UI dynamically
- create an HTML template and write the initialization code
For components that are quite complex or used frequently, it's might
be better to use the first method. For simple pages that are used only
in one location or need to support customization, the second method
might be preferable. Other benefits of templates:
- cleaner code and UI separation
- more flexibility in customization
- new pages can be developed quickly and require less coding
- multiple templates can be used with the same initialization code
- easier to maintain
The HBAC details page has been implemented using both methods. By
default it will use custom widgets to generate the page. To use a
custom layout, add the following parameter to the URL, then reload
the page:
&layout=<name>
Currently the only available layout is 'default' which produces the
same look as the custom widgets.
The HBAC details page is usable, but it still needs additional work.
The access time is not working yet. There is no undo button, hint,
or validation yet.
The table in the association facet has also been changed to use
ipa_association_widget which is derived from ipa_table_widget.
The Makefile has been updated to include the layouts. The unit tests
have been updated as well.
2010-11-02 20:16:55 -05:00
|
|
|
|
|
|
|
spec = spec || {};
|
|
|
|
|
2011-01-12 18:51:22 -06:00
|
|
|
var that = IPA.widget(spec);
|
HBAC Details Page
The UI framework has been extended to include a collection of widgets:
- ipa_widget: base class
- ipa_text_widget: text field
- ipa_radio_widget: radio button
- ipa_textarea_widget: textarea
- ipa_button_widget: button
- ipa_column_widget: column for table
- ipa_table_widget: table
These widgets can be used to create input controls. They can also be
extended to create custom controls.
The framework has also been enhanced to support custom layouts. This
can be used to change the look of the application without changing
the code. Initially this is only available in details section.
Layout consists of a collection of HTML templates. Each template is a
complete and valid HTML file representing a portion of a page. The
template will be loaded and initialized by the code, then filled with
the data from the server. The layouts are located in
install/static/layouts/<name> folder.
By default, if no templates are used, the fields in the details page
are rendered vertically using dd/dt/dd tags. For pages that require
different layout, a custom UI needs to be developed. There are two ways
to do that:
- write a custom widget to generate the UI dynamically
- create an HTML template and write the initialization code
For components that are quite complex or used frequently, it's might
be better to use the first method. For simple pages that are used only
in one location or need to support customization, the second method
might be preferable. Other benefits of templates:
- cleaner code and UI separation
- more flexibility in customization
- new pages can be developed quickly and require less coding
- multiple templates can be used with the same initialization code
- easier to maintain
The HBAC details page has been implemented using both methods. By
default it will use custom widgets to generate the page. To use a
custom layout, add the following parameter to the URL, then reload
the page:
&layout=<name>
Currently the only available layout is 'default' which produces the
same look as the custom widgets.
The HBAC details page is usable, but it still needs additional work.
The access time is not working yet. There is no undo button, hint,
or validation yet.
The table in the association facet has also been changed to use
ipa_association_widget which is derived from ipa_table_widget.
The Makefile has been updated to include the layouts. The unit tests
have been updated as well.
2010-11-02 20:16:55 -05:00
|
|
|
|
2010-11-09 14:22:31 -06:00
|
|
|
that.size = spec.size || 30;
|
2011-04-11 20:22:38 -05:00
|
|
|
that.type = spec.type || 'text';
|
2010-11-09 14:22:31 -06:00
|
|
|
|
2011-06-18 22:22:48 -05:00
|
|
|
that.select_range = function(start, end){
|
|
|
|
IPA.select_range(that.input, start, end);
|
|
|
|
};
|
|
|
|
|
2011-07-06 14:43:50 -05:00
|
|
|
|
2010-11-09 14:22:31 -06:00
|
|
|
that.create = function(container) {
|
2010-11-15 11:10:55 -06:00
|
|
|
|
2011-07-15 12:18:59 -05:00
|
|
|
that.widget_create(container);
|
|
|
|
|
|
|
|
container.addClass('text-widget');
|
|
|
|
|
2011-02-03 21:42:50 -06:00
|
|
|
$('<label/>', {
|
|
|
|
name: that.name,
|
|
|
|
style: 'display: none;'
|
|
|
|
}).appendTo(container);
|
|
|
|
|
2010-11-09 14:22:31 -06:00
|
|
|
$('<input/>', {
|
2011-04-11 20:22:38 -05:00
|
|
|
type: that.type,
|
2011-01-18 11:12:47 -06:00
|
|
|
name: that.name,
|
2011-02-02 10:35:23 -06:00
|
|
|
disabled: that.disabled,
|
2011-01-18 11:12:47 -06:00
|
|
|
size: that.size,
|
|
|
|
title: that.tooltip
|
2010-11-09 14:22:31 -06:00
|
|
|
}).appendTo(container);
|
2010-11-15 11:10:55 -06:00
|
|
|
|
2011-01-31 16:29:25 -06:00
|
|
|
if (that.undo) {
|
2011-02-02 10:35:23 -06:00
|
|
|
container.append(' ');
|
2011-01-31 16:29:25 -06:00
|
|
|
that.create_undo(container);
|
|
|
|
}
|
2011-01-07 09:32:33 -06:00
|
|
|
|
2011-07-06 14:43:50 -05:00
|
|
|
that.create_error_link(container);
|
2010-11-15 11:10:55 -06:00
|
|
|
};
|
|
|
|
|
|
|
|
that.setup = function(container) {
|
|
|
|
|
2011-02-02 16:18:35 -06:00
|
|
|
that.widget_setup(container);
|
2010-11-15 11:10:55 -06:00
|
|
|
|
|
|
|
var input = $('input[name="'+that.name+'"]', that.container);
|
|
|
|
input.keyup(function() {
|
2011-06-16 11:44:47 -05:00
|
|
|
that.set_dirty(that.test_dirty());
|
2011-04-26 16:21:25 -05:00
|
|
|
that.validate();
|
2010-11-15 11:10:55 -06:00
|
|
|
});
|
|
|
|
|
2010-11-18 20:17:14 -06:00
|
|
|
var undo = that.get_undo();
|
2010-11-15 11:10:55 -06:00
|
|
|
undo.click(function() {
|
2010-11-18 20:17:14 -06:00
|
|
|
that.reset();
|
2010-11-15 11:10:55 -06:00
|
|
|
});
|
2011-01-28 12:06:34 -06:00
|
|
|
that.input = input;
|
2010-11-09 14:22:31 -06:00
|
|
|
};
|
|
|
|
|
2011-02-03 21:42:50 -06:00
|
|
|
that.update = function() {
|
|
|
|
var value = that.values && that.values.length ? that.values[0] : '';
|
HBAC Details Page
The UI framework has been extended to include a collection of widgets:
- ipa_widget: base class
- ipa_text_widget: text field
- ipa_radio_widget: radio button
- ipa_textarea_widget: textarea
- ipa_button_widget: button
- ipa_column_widget: column for table
- ipa_table_widget: table
These widgets can be used to create input controls. They can also be
extended to create custom controls.
The framework has also been enhanced to support custom layouts. This
can be used to change the look of the application without changing
the code. Initially this is only available in details section.
Layout consists of a collection of HTML templates. Each template is a
complete and valid HTML file representing a portion of a page. The
template will be loaded and initialized by the code, then filled with
the data from the server. The layouts are located in
install/static/layouts/<name> folder.
By default, if no templates are used, the fields in the details page
are rendered vertically using dd/dt/dd tags. For pages that require
different layout, a custom UI needs to be developed. There are two ways
to do that:
- write a custom widget to generate the UI dynamically
- create an HTML template and write the initialization code
For components that are quite complex or used frequently, it's might
be better to use the first method. For simple pages that are used only
in one location or need to support customization, the second method
might be preferable. Other benefits of templates:
- cleaner code and UI separation
- more flexibility in customization
- new pages can be developed quickly and require less coding
- multiple templates can be used with the same initialization code
- easier to maintain
The HBAC details page has been implemented using both methods. By
default it will use custom widgets to generate the page. To use a
custom layout, add the following parameter to the URL, then reload
the page:
&layout=<name>
Currently the only available layout is 'default' which produces the
same look as the custom widgets.
The HBAC details page is usable, but it still needs additional work.
The access time is not working yet. There is no undo button, hint,
or validation yet.
The table in the association facet has also been changed to use
ipa_association_widget which is derived from ipa_table_widget.
The Makefile has been updated to include the layouts. The unit tests
have been updated as well.
2010-11-02 20:16:55 -05:00
|
|
|
|
2011-02-03 21:42:50 -06:00
|
|
|
var label = $('label[name="'+that.name+'"]', that.container);
|
|
|
|
var input = $('input[name="'+that.name+'"]', that.container);
|
2010-11-15 11:10:55 -06:00
|
|
|
|
2011-02-03 21:42:50 -06:00
|
|
|
if (that.read_only || !that.writable) {
|
|
|
|
label.html(value);
|
|
|
|
label.css('display', 'inline');
|
|
|
|
input.css('display', 'none');
|
HBAC Details Page
The UI framework has been extended to include a collection of widgets:
- ipa_widget: base class
- ipa_text_widget: text field
- ipa_radio_widget: radio button
- ipa_textarea_widget: textarea
- ipa_button_widget: button
- ipa_column_widget: column for table
- ipa_table_widget: table
These widgets can be used to create input controls. They can also be
extended to create custom controls.
The framework has also been enhanced to support custom layouts. This
can be used to change the look of the application without changing
the code. Initially this is only available in details section.
Layout consists of a collection of HTML templates. Each template is a
complete and valid HTML file representing a portion of a page. The
template will be loaded and initialized by the code, then filled with
the data from the server. The layouts are located in
install/static/layouts/<name> folder.
By default, if no templates are used, the fields in the details page
are rendered vertically using dd/dt/dd tags. For pages that require
different layout, a custom UI needs to be developed. There are two ways
to do that:
- write a custom widget to generate the UI dynamically
- create an HTML template and write the initialization code
For components that are quite complex or used frequently, it's might
be better to use the first method. For simple pages that are used only
in one location or need to support customization, the second method
might be preferable. Other benefits of templates:
- cleaner code and UI separation
- more flexibility in customization
- new pages can be developed quickly and require less coding
- multiple templates can be used with the same initialization code
- easier to maintain
The HBAC details page has been implemented using both methods. By
default it will use custom widgets to generate the page. To use a
custom layout, add the following parameter to the URL, then reload
the page:
&layout=<name>
Currently the only available layout is 'default' which produces the
same look as the custom widgets.
The HBAC details page is usable, but it still needs additional work.
The access time is not working yet. There is no undo button, hint,
or validation yet.
The table in the association facet has also been changed to use
ipa_association_widget which is derived from ipa_table_widget.
The Makefile has been updated to include the layouts. The unit tests
have been updated as well.
2010-11-02 20:16:55 -05:00
|
|
|
|
|
|
|
} else {
|
2011-02-03 21:42:50 -06:00
|
|
|
$('input[name="'+that.name+'"]', that.container).val(value);
|
|
|
|
label.css('display', 'none');
|
|
|
|
input.css('display', 'inline');
|
HBAC Details Page
The UI framework has been extended to include a collection of widgets:
- ipa_widget: base class
- ipa_text_widget: text field
- ipa_radio_widget: radio button
- ipa_textarea_widget: textarea
- ipa_button_widget: button
- ipa_column_widget: column for table
- ipa_table_widget: table
These widgets can be used to create input controls. They can also be
extended to create custom controls.
The framework has also been enhanced to support custom layouts. This
can be used to change the look of the application without changing
the code. Initially this is only available in details section.
Layout consists of a collection of HTML templates. Each template is a
complete and valid HTML file representing a portion of a page. The
template will be loaded and initialized by the code, then filled with
the data from the server. The layouts are located in
install/static/layouts/<name> folder.
By default, if no templates are used, the fields in the details page
are rendered vertically using dd/dt/dd tags. For pages that require
different layout, a custom UI needs to be developed. There are two ways
to do that:
- write a custom widget to generate the UI dynamically
- create an HTML template and write the initialization code
For components that are quite complex or used frequently, it's might
be better to use the first method. For simple pages that are used only
in one location or need to support customization, the second method
might be preferable. Other benefits of templates:
- cleaner code and UI separation
- more flexibility in customization
- new pages can be developed quickly and require less coding
- multiple templates can be used with the same initialization code
- easier to maintain
The HBAC details page has been implemented using both methods. By
default it will use custom widgets to generate the page. To use a
custom layout, add the following parameter to the URL, then reload
the page:
&layout=<name>
Currently the only available layout is 'default' which produces the
same look as the custom widgets.
The HBAC details page is usable, but it still needs additional work.
The access time is not working yet. There is no undo button, hint,
or validation yet.
The table in the association facet has also been changed to use
ipa_association_widget which is derived from ipa_table_widget.
The Makefile has been updated to include the layouts. The unit tests
have been updated as well.
2010-11-02 20:16:55 -05:00
|
|
|
}
|
2010-11-04 21:42:37 -05:00
|
|
|
};
|
HBAC Details Page
The UI framework has been extended to include a collection of widgets:
- ipa_widget: base class
- ipa_text_widget: text field
- ipa_radio_widget: radio button
- ipa_textarea_widget: textarea
- ipa_button_widget: button
- ipa_column_widget: column for table
- ipa_table_widget: table
These widgets can be used to create input controls. They can also be
extended to create custom controls.
The framework has also been enhanced to support custom layouts. This
can be used to change the look of the application without changing
the code. Initially this is only available in details section.
Layout consists of a collection of HTML templates. Each template is a
complete and valid HTML file representing a portion of a page. The
template will be loaded and initialized by the code, then filled with
the data from the server. The layouts are located in
install/static/layouts/<name> folder.
By default, if no templates are used, the fields in the details page
are rendered vertically using dd/dt/dd tags. For pages that require
different layout, a custom UI needs to be developed. There are two ways
to do that:
- write a custom widget to generate the UI dynamically
- create an HTML template and write the initialization code
For components that are quite complex or used frequently, it's might
be better to use the first method. For simple pages that are used only
in one location or need to support customization, the second method
might be preferable. Other benefits of templates:
- cleaner code and UI separation
- more flexibility in customization
- new pages can be developed quickly and require less coding
- multiple templates can be used with the same initialization code
- easier to maintain
The HBAC details page has been implemented using both methods. By
default it will use custom widgets to generate the page. To use a
custom layout, add the following parameter to the URL, then reload
the page:
&layout=<name>
Currently the only available layout is 'default' which produces the
same look as the custom widgets.
The HBAC details page is usable, but it still needs additional work.
The access time is not working yet. There is no undo button, hint,
or validation yet.
The table in the association facet has also been changed to use
ipa_association_widget which is derived from ipa_table_widget.
The Makefile has been updated to include the layouts. The unit tests
have been updated as well.
2010-11-02 20:16:55 -05:00
|
|
|
|
2010-11-18 20:17:14 -06:00
|
|
|
that.save = function() {
|
2011-02-03 21:42:50 -06:00
|
|
|
if (that.read_only || !that.writable) {
|
2011-02-07 13:12:30 -06:00
|
|
|
return null;
|
|
|
|
|
HBAC Details Page
The UI framework has been extended to include a collection of widgets:
- ipa_widget: base class
- ipa_text_widget: text field
- ipa_radio_widget: radio button
- ipa_textarea_widget: textarea
- ipa_button_widget: button
- ipa_column_widget: column for table
- ipa_table_widget: table
These widgets can be used to create input controls. They can also be
extended to create custom controls.
The framework has also been enhanced to support custom layouts. This
can be used to change the look of the application without changing
the code. Initially this is only available in details section.
Layout consists of a collection of HTML templates. Each template is a
complete and valid HTML file representing a portion of a page. The
template will be loaded and initialized by the code, then filled with
the data from the server. The layouts are located in
install/static/layouts/<name> folder.
By default, if no templates are used, the fields in the details page
are rendered vertically using dd/dt/dd tags. For pages that require
different layout, a custom UI needs to be developed. There are two ways
to do that:
- write a custom widget to generate the UI dynamically
- create an HTML template and write the initialization code
For components that are quite complex or used frequently, it's might
be better to use the first method. For simple pages that are used only
in one location or need to support customization, the second method
might be preferable. Other benefits of templates:
- cleaner code and UI separation
- more flexibility in customization
- new pages can be developed quickly and require less coding
- multiple templates can be used with the same initialization code
- easier to maintain
The HBAC details page has been implemented using both methods. By
default it will use custom widgets to generate the page. To use a
custom layout, add the following parameter to the URL, then reload
the page:
&layout=<name>
Currently the only available layout is 'default' which produces the
same look as the custom widgets.
The HBAC details page is usable, but it still needs additional work.
The access time is not working yet. There is no undo button, hint,
or validation yet.
The table in the association facet has also been changed to use
ipa_association_widget which is derived from ipa_table_widget.
The Makefile has been updated to include the layouts. The unit tests
have been updated as well.
2010-11-02 20:16:55 -05:00
|
|
|
} else {
|
2011-02-03 21:42:50 -06:00
|
|
|
var input = $('input[name="'+that.name+'"]', that.container);
|
2011-03-29 06:24:06 -05:00
|
|
|
var value = input.val();
|
2011-02-03 21:42:50 -06:00
|
|
|
return value === '' ? [] : [value];
|
HBAC Details Page
The UI framework has been extended to include a collection of widgets:
- ipa_widget: base class
- ipa_text_widget: text field
- ipa_radio_widget: radio button
- ipa_textarea_widget: textarea
- ipa_button_widget: button
- ipa_column_widget: column for table
- ipa_table_widget: table
These widgets can be used to create input controls. They can also be
extended to create custom controls.
The framework has also been enhanced to support custom layouts. This
can be used to change the look of the application without changing
the code. Initially this is only available in details section.
Layout consists of a collection of HTML templates. Each template is a
complete and valid HTML file representing a portion of a page. The
template will be loaded and initialized by the code, then filled with
the data from the server. The layouts are located in
install/static/layouts/<name> folder.
By default, if no templates are used, the fields in the details page
are rendered vertically using dd/dt/dd tags. For pages that require
different layout, a custom UI needs to be developed. There are two ways
to do that:
- write a custom widget to generate the UI dynamically
- create an HTML template and write the initialization code
For components that are quite complex or used frequently, it's might
be better to use the first method. For simple pages that are used only
in one location or need to support customization, the second method
might be preferable. Other benefits of templates:
- cleaner code and UI separation
- more flexibility in customization
- new pages can be developed quickly and require less coding
- multiple templates can be used with the same initialization code
- easier to maintain
The HBAC details page has been implemented using both methods. By
default it will use custom widgets to generate the page. To use a
custom layout, add the following parameter to the URL, then reload
the page:
&layout=<name>
Currently the only available layout is 'default' which produces the
same look as the custom widgets.
The HBAC details page is usable, but it still needs additional work.
The access time is not working yet. There is no undo button, hint,
or validation yet.
The table in the association facet has also been changed to use
ipa_association_widget which is derived from ipa_table_widget.
The Makefile has been updated to include the layouts. The unit tests
have been updated as well.
2010-11-02 20:16:55 -05:00
|
|
|
}
|
2010-11-15 11:10:55 -06:00
|
|
|
};
|
HBAC Details Page
The UI framework has been extended to include a collection of widgets:
- ipa_widget: base class
- ipa_text_widget: text field
- ipa_radio_widget: radio button
- ipa_textarea_widget: textarea
- ipa_button_widget: button
- ipa_column_widget: column for table
- ipa_table_widget: table
These widgets can be used to create input controls. They can also be
extended to create custom controls.
The framework has also been enhanced to support custom layouts. This
can be used to change the look of the application without changing
the code. Initially this is only available in details section.
Layout consists of a collection of HTML templates. Each template is a
complete and valid HTML file representing a portion of a page. The
template will be loaded and initialized by the code, then filled with
the data from the server. The layouts are located in
install/static/layouts/<name> folder.
By default, if no templates are used, the fields in the details page
are rendered vertically using dd/dt/dd tags. For pages that require
different layout, a custom UI needs to be developed. There are two ways
to do that:
- write a custom widget to generate the UI dynamically
- create an HTML template and write the initialization code
For components that are quite complex or used frequently, it's might
be better to use the first method. For simple pages that are used only
in one location or need to support customization, the second method
might be preferable. Other benefits of templates:
- cleaner code and UI separation
- more flexibility in customization
- new pages can be developed quickly and require less coding
- multiple templates can be used with the same initialization code
- easier to maintain
The HBAC details page has been implemented using both methods. By
default it will use custom widgets to generate the page. To use a
custom layout, add the following parameter to the URL, then reload
the page:
&layout=<name>
Currently the only available layout is 'default' which produces the
same look as the custom widgets.
The HBAC details page is usable, but it still needs additional work.
The access time is not working yet. There is no undo button, hint,
or validation yet.
The table in the association facet has also been changed to use
ipa_association_widget which is derived from ipa_table_widget.
The Makefile has been updated to include the layouts. The unit tests
have been updated as well.
2010-11-02 20:16:55 -05:00
|
|
|
|
2011-02-03 21:42:50 -06:00
|
|
|
// methods that should be invoked by subclasses
|
|
|
|
that.text_load = that.load;
|
HBAC Details Page
The UI framework has been extended to include a collection of widgets:
- ipa_widget: base class
- ipa_text_widget: text field
- ipa_radio_widget: radio button
- ipa_textarea_widget: textarea
- ipa_button_widget: button
- ipa_column_widget: column for table
- ipa_table_widget: table
These widgets can be used to create input controls. They can also be
extended to create custom controls.
The framework has also been enhanced to support custom layouts. This
can be used to change the look of the application without changing
the code. Initially this is only available in details section.
Layout consists of a collection of HTML templates. Each template is a
complete and valid HTML file representing a portion of a page. The
template will be loaded and initialized by the code, then filled with
the data from the server. The layouts are located in
install/static/layouts/<name> folder.
By default, if no templates are used, the fields in the details page
are rendered vertically using dd/dt/dd tags. For pages that require
different layout, a custom UI needs to be developed. There are two ways
to do that:
- write a custom widget to generate the UI dynamically
- create an HTML template and write the initialization code
For components that are quite complex or used frequently, it's might
be better to use the first method. For simple pages that are used only
in one location or need to support customization, the second method
might be preferable. Other benefits of templates:
- cleaner code and UI separation
- more flexibility in customization
- new pages can be developed quickly and require less coding
- multiple templates can be used with the same initialization code
- easier to maintain
The HBAC details page has been implemented using both methods. By
default it will use custom widgets to generate the page. To use a
custom layout, add the following parameter to the URL, then reload
the page:
&layout=<name>
Currently the only available layout is 'default' which produces the
same look as the custom widgets.
The HBAC details page is usable, but it still needs additional work.
The access time is not working yet. There is no undo button, hint,
or validation yet.
The table in the association facet has also been changed to use
ipa_association_widget which is derived from ipa_table_widget.
The Makefile has been updated to include the layouts. The unit tests
have been updated as well.
2010-11-02 20:16:55 -05:00
|
|
|
|
|
|
|
return that;
|
2011-01-14 11:16:25 -06:00
|
|
|
};
|
HBAC Details Page
The UI framework has been extended to include a collection of widgets:
- ipa_widget: base class
- ipa_text_widget: text field
- ipa_radio_widget: radio button
- ipa_textarea_widget: textarea
- ipa_button_widget: button
- ipa_column_widget: column for table
- ipa_table_widget: table
These widgets can be used to create input controls. They can also be
extended to create custom controls.
The framework has also been enhanced to support custom layouts. This
can be used to change the look of the application without changing
the code. Initially this is only available in details section.
Layout consists of a collection of HTML templates. Each template is a
complete and valid HTML file representing a portion of a page. The
template will be loaded and initialized by the code, then filled with
the data from the server. The layouts are located in
install/static/layouts/<name> folder.
By default, if no templates are used, the fields in the details page
are rendered vertically using dd/dt/dd tags. For pages that require
different layout, a custom UI needs to be developed. There are two ways
to do that:
- write a custom widget to generate the UI dynamically
- create an HTML template and write the initialization code
For components that are quite complex or used frequently, it's might
be better to use the first method. For simple pages that are used only
in one location or need to support customization, the second method
might be preferable. Other benefits of templates:
- cleaner code and UI separation
- more flexibility in customization
- new pages can be developed quickly and require less coding
- multiple templates can be used with the same initialization code
- easier to maintain
The HBAC details page has been implemented using both methods. By
default it will use custom widgets to generate the page. To use a
custom layout, add the following parameter to the URL, then reload
the page:
&layout=<name>
Currently the only available layout is 'default' which produces the
same look as the custom widgets.
The HBAC details page is usable, but it still needs additional work.
The access time is not working yet. There is no undo button, hint,
or validation yet.
The table in the association facet has also been changed to use
ipa_association_widget which is derived from ipa_table_widget.
The Makefile has been updated to include the layouts. The unit tests
have been updated as well.
2010-11-02 20:16:55 -05:00
|
|
|
|
2011-02-02 16:18:35 -06:00
|
|
|
IPA.multivalued_text_widget = function(spec) {
|
|
|
|
|
|
|
|
spec = spec || {};
|
|
|
|
|
|
|
|
var that = IPA.widget(spec);
|
|
|
|
|
|
|
|
that.size = spec.size || 30;
|
|
|
|
|
|
|
|
that.get_undo = function(index) {
|
|
|
|
if (index === undefined) {
|
|
|
|
return $('span[name="undo_all"]', that.container);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
var row = that.get_row(index);
|
|
|
|
return $('span[name="undo"]', row);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2011-06-27 17:31:55 -05:00
|
|
|
that.test_dirty = function(index) {
|
2011-06-16 14:24:48 -05:00
|
|
|
if (index === undefined) {
|
2011-06-27 17:31:55 -05:00
|
|
|
return that.widget_test_dirty();
|
2011-06-16 14:24:48 -05:00
|
|
|
}
|
2011-06-27 17:31:55 -05:00
|
|
|
|
2011-06-16 14:24:48 -05:00
|
|
|
var row = that.get_row(index);
|
2011-06-27 17:31:55 -05:00
|
|
|
var input = $('input[name="'+that.name+'"]', row);
|
2011-06-16 14:24:48 -05:00
|
|
|
|
2011-06-27 17:31:55 -05:00
|
|
|
if (input.is('.strikethrough')) {
|
|
|
|
return true;
|
|
|
|
}
|
2011-06-16 14:24:48 -05:00
|
|
|
|
2011-06-27 17:31:55 -05:00
|
|
|
var value = input.val();
|
|
|
|
if (value !== that.values[index]) {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
2011-06-16 14:24:48 -05:00
|
|
|
};
|
|
|
|
|
2011-05-26 17:57:39 -05:00
|
|
|
that.set_dirty = function(dirty, index) {
|
2011-06-27 17:31:55 -05:00
|
|
|
that.dirty = dirty;
|
|
|
|
|
2011-05-26 17:57:39 -05:00
|
|
|
if (that.undo) {
|
|
|
|
if (dirty) {
|
|
|
|
that.show_undo(index);
|
|
|
|
} else {
|
|
|
|
that.hide_undo(index);
|
|
|
|
}
|
2011-06-27 17:31:55 -05:00
|
|
|
|
|
|
|
if (index !== undefined) {
|
|
|
|
// update undo all
|
|
|
|
that.set_dirty(that.test_dirty());
|
|
|
|
}
|
2011-05-26 17:57:39 -05:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2011-02-02 16:18:35 -06:00
|
|
|
that.show_undo = function(index) {
|
|
|
|
var undo = that.get_undo(index);
|
|
|
|
undo.css('display', 'inline');
|
|
|
|
};
|
|
|
|
|
|
|
|
that.hide_undo = function(index) {
|
|
|
|
var undo = that.get_undo(index);
|
|
|
|
undo.css('display', 'none');
|
|
|
|
};
|
|
|
|
|
|
|
|
that.create = function(container) {
|
|
|
|
|
2011-07-15 12:18:59 -05:00
|
|
|
that.widget_create(container);
|
|
|
|
|
|
|
|
container.addClass('multivalued-text-widget');
|
|
|
|
|
2011-02-02 16:18:35 -06:00
|
|
|
var div = $('<div/>', {
|
|
|
|
name: 'value'
|
2011-02-03 21:42:50 -06:00
|
|
|
}).appendTo(container);
|
2011-02-02 16:18:35 -06:00
|
|
|
|
|
|
|
$('<input/>', {
|
|
|
|
type: 'text',
|
|
|
|
name: that.name,
|
|
|
|
disabled: that.disabled,
|
|
|
|
size: that.size,
|
|
|
|
title: that.tooltip
|
|
|
|
}).appendTo(div);
|
|
|
|
|
|
|
|
div.append(' ');
|
|
|
|
|
|
|
|
$('<a/>', {
|
|
|
|
name: 'remove',
|
|
|
|
href: 'jslink',
|
2011-02-16 12:46:59 -06:00
|
|
|
title: IPA.messages.buttons.remove,
|
|
|
|
html: IPA.messages.buttons.remove
|
2011-02-02 16:18:35 -06:00
|
|
|
}).appendTo(div);
|
|
|
|
|
|
|
|
if (that.undo) {
|
|
|
|
div.append(' ');
|
|
|
|
that.create_undo(div);
|
|
|
|
}
|
|
|
|
|
2011-07-06 14:43:50 -05:00
|
|
|
that.create_error_link(container);
|
2011-02-02 16:18:35 -06:00
|
|
|
|
|
|
|
$('<a/>', {
|
|
|
|
name: 'add',
|
|
|
|
href: 'jslink',
|
2011-02-16 12:46:59 -06:00
|
|
|
title: IPA.messages.buttons.add,
|
|
|
|
html: IPA.messages.buttons.add
|
2011-02-03 21:42:50 -06:00
|
|
|
}).appendTo(container);
|
2011-02-02 16:18:35 -06:00
|
|
|
|
2011-02-03 21:42:50 -06:00
|
|
|
container.append(' ');
|
2011-02-02 16:18:35 -06:00
|
|
|
|
|
|
|
$('<span/>', {
|
|
|
|
name: 'undo_all',
|
|
|
|
style: 'display: none;',
|
|
|
|
'class': 'ui-state-highlight ui-corner-all undo',
|
|
|
|
html: 'undo all'
|
2011-02-03 21:42:50 -06:00
|
|
|
}).appendTo(container);
|
2011-02-02 16:18:35 -06:00
|
|
|
};
|
|
|
|
|
|
|
|
that.setup = function(container) {
|
|
|
|
|
|
|
|
that.widget_setup(container);
|
|
|
|
|
|
|
|
that.template = $('div[name=value]', that.container);
|
|
|
|
that.template.detach();
|
|
|
|
|
|
|
|
var undo = that.get_undo();
|
|
|
|
undo.click(function() {
|
|
|
|
that.reset();
|
|
|
|
});
|
|
|
|
|
|
|
|
var add_link = $('a[name=add]', that.container);
|
|
|
|
add_link.click(function() {
|
|
|
|
that.add_row('');
|
|
|
|
var input = $('input[name="'+that.name+'"]:last', that.container);
|
|
|
|
input.focus();
|
|
|
|
return false;
|
|
|
|
});
|
|
|
|
};
|
|
|
|
|
|
|
|
that.save = function() {
|
|
|
|
var values = [];
|
|
|
|
if (that.read_only || !that.writable) {
|
|
|
|
$('label[name="'+that.name+'"]', that.container).each(function() {
|
|
|
|
var input = $(this);
|
2011-03-29 06:24:06 -05:00
|
|
|
var value = input.html();
|
2011-02-02 16:18:35 -06:00
|
|
|
values.push(value);
|
|
|
|
});
|
|
|
|
|
|
|
|
} else {
|
|
|
|
$('input[name="'+that.name+'"]', that.container).each(function() {
|
|
|
|
var input = $(this);
|
|
|
|
if (input.is('.strikethrough')) return;
|
|
|
|
|
2011-03-29 06:24:06 -05:00
|
|
|
var value = input.val();
|
2011-02-02 16:18:35 -06:00
|
|
|
values.push(value);
|
|
|
|
});
|
|
|
|
}
|
|
|
|
return values;
|
|
|
|
};
|
|
|
|
|
|
|
|
that.add_row = function(value) {
|
|
|
|
|
|
|
|
var add_link = $('a[name=add]', that.container);
|
|
|
|
|
|
|
|
var row = that.template.clone();
|
|
|
|
row.insertBefore(add_link);
|
|
|
|
|
|
|
|
var input = $('input[name="'+that.name+'"]', row);
|
|
|
|
var remove_link = $('a[name=remove]', row);
|
|
|
|
var undo_link = $('span[name=undo]', row);
|
|
|
|
|
|
|
|
if (that.read_only || !that.writable) {
|
|
|
|
var label = $('<label/>', {
|
|
|
|
'name': that.name,
|
|
|
|
'html': value
|
|
|
|
});
|
|
|
|
input.replaceWith(label);
|
|
|
|
|
|
|
|
remove_link.css('display', 'none');
|
|
|
|
|
|
|
|
} else {
|
|
|
|
input.val(value);
|
|
|
|
|
|
|
|
var index = that.row_index(row);
|
|
|
|
if (index >= that.values.length) {
|
|
|
|
// show undo/remove link for new value
|
2011-05-26 17:57:39 -05:00
|
|
|
that.set_dirty(true, index);
|
2011-02-02 16:18:35 -06:00
|
|
|
if (that.undo) {
|
|
|
|
remove_link.css('display', 'none');
|
|
|
|
} else {
|
|
|
|
remove_link.css('display', 'inline');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
input.keyup(function() {
|
|
|
|
var index = that.row_index(row);
|
|
|
|
// uncross removed value
|
|
|
|
input.removeClass('strikethrough');
|
2011-06-27 17:31:55 -05:00
|
|
|
that.set_dirty(that.test_dirty(index), index);
|
2011-02-02 16:18:35 -06:00
|
|
|
if (that.undo) {
|
|
|
|
if (index < that.values.length) {
|
|
|
|
remove_link.css('display', 'inline');
|
|
|
|
}
|
|
|
|
}
|
2011-04-26 16:21:25 -05:00
|
|
|
that.validate();
|
2011-02-02 16:18:35 -06:00
|
|
|
});
|
|
|
|
|
|
|
|
remove_link.click(function() {
|
|
|
|
var index = that.row_index(row);
|
|
|
|
if (index < that.values.length) {
|
|
|
|
// restore old value then cross it out
|
|
|
|
that.update(index);
|
|
|
|
input.addClass('strikethrough');
|
2011-05-26 17:57:39 -05:00
|
|
|
that.set_dirty(true, index);
|
2011-02-02 16:18:35 -06:00
|
|
|
remove_link.css('display', 'none');
|
|
|
|
} else {
|
|
|
|
// remove new value
|
2011-06-27 17:31:55 -05:00
|
|
|
that.remove_row(index);
|
|
|
|
that.set_dirty(that.test_dirty());
|
2011-02-02 16:18:35 -06:00
|
|
|
}
|
|
|
|
return false;
|
|
|
|
});
|
|
|
|
|
|
|
|
undo_link.click(function() {
|
|
|
|
var index = that.row_index(row);
|
|
|
|
if (index < that.values.length) {
|
|
|
|
// restore old value
|
|
|
|
input.removeClass('strikethrough');
|
|
|
|
remove_link.css('display', 'inline');
|
2011-06-27 17:31:55 -05:00
|
|
|
that.reset(index);
|
2011-02-02 16:18:35 -06:00
|
|
|
} else {
|
|
|
|
// remove new value
|
2011-06-27 17:31:55 -05:00
|
|
|
that.remove_row(index);
|
|
|
|
that.set_dirty(that.test_dirty());
|
2011-02-02 16:18:35 -06:00
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
that.remove_row = function(index) {
|
|
|
|
that.get_row(index).remove();
|
|
|
|
};
|
|
|
|
|
2011-06-27 17:31:55 -05:00
|
|
|
that.remove_rows = function() {
|
|
|
|
that.get_rows().remove();
|
|
|
|
};
|
|
|
|
|
2011-02-02 16:18:35 -06:00
|
|
|
that.get_row = function(index) {
|
|
|
|
return $('div[name=value]:eq('+index+')', that.container);
|
|
|
|
};
|
|
|
|
|
|
|
|
that.get_rows = function() {
|
|
|
|
return $('div[name=value]', that.container);
|
|
|
|
};
|
|
|
|
|
|
|
|
that.row_index = function(row) {
|
|
|
|
return that.get_rows().index(row);
|
|
|
|
};
|
|
|
|
|
|
|
|
that.reset = function(index) {
|
|
|
|
that.update(index);
|
2011-06-27 17:31:55 -05:00
|
|
|
that.set_dirty(false, index);
|
2011-02-02 16:18:35 -06:00
|
|
|
};
|
|
|
|
|
|
|
|
that.update = function(index) {
|
|
|
|
|
|
|
|
var value;
|
|
|
|
|
|
|
|
if (index === undefined) {
|
2011-06-27 17:31:55 -05:00
|
|
|
that.remove_rows();
|
2011-02-02 16:18:35 -06:00
|
|
|
|
|
|
|
for (var i=0; i<that.values.length; i++) {
|
|
|
|
value = that.values[i];
|
|
|
|
that.add_row(value);
|
|
|
|
}
|
|
|
|
|
|
|
|
var add_link = $('a[name=add]', that.container);
|
|
|
|
|
|
|
|
if (that.read_only || !that.writable) {
|
|
|
|
add_link.css('display', 'none');
|
|
|
|
} else {
|
|
|
|
add_link.css('display', 'inline');
|
|
|
|
}
|
|
|
|
|
|
|
|
} else {
|
|
|
|
value = that.values[index];
|
|
|
|
var row = that.get_row(index);
|
|
|
|
var input = $('input[name="'+that.name+'"]', row);
|
|
|
|
input.val(value);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
return that;
|
|
|
|
};
|
|
|
|
|
2011-01-12 18:51:22 -06:00
|
|
|
IPA.checkbox_widget = function (spec) {
|
HBAC Details Page
The UI framework has been extended to include a collection of widgets:
- ipa_widget: base class
- ipa_text_widget: text field
- ipa_radio_widget: radio button
- ipa_textarea_widget: textarea
- ipa_button_widget: button
- ipa_column_widget: column for table
- ipa_table_widget: table
These widgets can be used to create input controls. They can also be
extended to create custom controls.
The framework has also been enhanced to support custom layouts. This
can be used to change the look of the application without changing
the code. Initially this is only available in details section.
Layout consists of a collection of HTML templates. Each template is a
complete and valid HTML file representing a portion of a page. The
template will be loaded and initialized by the code, then filled with
the data from the server. The layouts are located in
install/static/layouts/<name> folder.
By default, if no templates are used, the fields in the details page
are rendered vertically using dd/dt/dd tags. For pages that require
different layout, a custom UI needs to be developed. There are two ways
to do that:
- write a custom widget to generate the UI dynamically
- create an HTML template and write the initialization code
For components that are quite complex or used frequently, it's might
be better to use the first method. For simple pages that are used only
in one location or need to support customization, the second method
might be preferable. Other benefits of templates:
- cleaner code and UI separation
- more flexibility in customization
- new pages can be developed quickly and require less coding
- multiple templates can be used with the same initialization code
- easier to maintain
The HBAC details page has been implemented using both methods. By
default it will use custom widgets to generate the page. To use a
custom layout, add the following parameter to the URL, then reload
the page:
&layout=<name>
Currently the only available layout is 'default' which produces the
same look as the custom widgets.
The HBAC details page is usable, but it still needs additional work.
The access time is not working yet. There is no undo button, hint,
or validation yet.
The table in the association facet has also been changed to use
ipa_association_widget which is derived from ipa_table_widget.
The Makefile has been updated to include the layouts. The unit tests
have been updated as well.
2010-11-02 20:16:55 -05:00
|
|
|
|
|
|
|
spec = spec || {};
|
2011-01-12 18:51:22 -06:00
|
|
|
var that = IPA.widget(spec);
|
HBAC Details Page
The UI framework has been extended to include a collection of widgets:
- ipa_widget: base class
- ipa_text_widget: text field
- ipa_radio_widget: radio button
- ipa_textarea_widget: textarea
- ipa_button_widget: button
- ipa_column_widget: column for table
- ipa_table_widget: table
These widgets can be used to create input controls. They can also be
extended to create custom controls.
The framework has also been enhanced to support custom layouts. This
can be used to change the look of the application without changing
the code. Initially this is only available in details section.
Layout consists of a collection of HTML templates. Each template is a
complete and valid HTML file representing a portion of a page. The
template will be loaded and initialized by the code, then filled with
the data from the server. The layouts are located in
install/static/layouts/<name> folder.
By default, if no templates are used, the fields in the details page
are rendered vertically using dd/dt/dd tags. For pages that require
different layout, a custom UI needs to be developed. There are two ways
to do that:
- write a custom widget to generate the UI dynamically
- create an HTML template and write the initialization code
For components that are quite complex or used frequently, it's might
be better to use the first method. For simple pages that are used only
in one location or need to support customization, the second method
might be preferable. Other benefits of templates:
- cleaner code and UI separation
- more flexibility in customization
- new pages can be developed quickly and require less coding
- multiple templates can be used with the same initialization code
- easier to maintain
The HBAC details page has been implemented using both methods. By
default it will use custom widgets to generate the page. To use a
custom layout, add the following parameter to the URL, then reload
the page:
&layout=<name>
Currently the only available layout is 'default' which produces the
same look as the custom widgets.
The HBAC details page is usable, but it still needs additional work.
The access time is not working yet. There is no undo button, hint,
or validation yet.
The table in the association facet has also been changed to use
ipa_association_widget which is derived from ipa_table_widget.
The Makefile has been updated to include the layouts. The unit tests
have been updated as well.
2010-11-02 20:16:55 -05:00
|
|
|
|
2011-01-29 14:25:56 -06:00
|
|
|
that.checked = spec.checked || '';
|
|
|
|
|
2010-11-09 14:22:31 -06:00
|
|
|
that.create = function(container) {
|
2010-11-15 11:10:55 -06:00
|
|
|
|
2011-07-15 12:18:59 -05:00
|
|
|
that.widget_create(container);
|
|
|
|
|
|
|
|
container.addClass('checkbox-widget');
|
|
|
|
|
2010-11-09 14:22:31 -06:00
|
|
|
$('<input/>', {
|
2010-12-23 13:26:12 -06:00
|
|
|
type: 'checkbox',
|
|
|
|
name: that.name,
|
2011-01-29 14:25:56 -06:00
|
|
|
checked : that.checked,
|
2011-01-18 11:12:47 -06:00
|
|
|
title: that.tooltip
|
2010-11-09 14:22:31 -06:00
|
|
|
}).appendTo(container);
|
2010-11-15 11:10:55 -06:00
|
|
|
|
|
|
|
if (that.undo) {
|
2011-01-31 16:29:25 -06:00
|
|
|
that.create_undo(container);
|
2010-11-15 11:10:55 -06:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
that.setup = function(container) {
|
|
|
|
|
|
|
|
that.widget_setup(container);
|
|
|
|
|
|
|
|
var input = $('input[name="'+that.name+'"]', that.container);
|
|
|
|
input.change(function() {
|
2011-06-16 14:37:27 -05:00
|
|
|
that.set_dirty(that.test_dirty());
|
2010-11-15 11:10:55 -06:00
|
|
|
});
|
|
|
|
|
2010-11-18 20:17:14 -06:00
|
|
|
var undo = that.get_undo();
|
2010-11-15 11:10:55 -06:00
|
|
|
undo.click(function() {
|
2010-11-18 20:17:14 -06:00
|
|
|
that.reset();
|
2010-11-15 11:10:55 -06:00
|
|
|
});
|
2010-11-09 14:22:31 -06:00
|
|
|
};
|
HBAC Details Page
The UI framework has been extended to include a collection of widgets:
- ipa_widget: base class
- ipa_text_widget: text field
- ipa_radio_widget: radio button
- ipa_textarea_widget: textarea
- ipa_button_widget: button
- ipa_column_widget: column for table
- ipa_table_widget: table
These widgets can be used to create input controls. They can also be
extended to create custom controls.
The framework has also been enhanced to support custom layouts. This
can be used to change the look of the application without changing
the code. Initially this is only available in details section.
Layout consists of a collection of HTML templates. Each template is a
complete and valid HTML file representing a portion of a page. The
template will be loaded and initialized by the code, then filled with
the data from the server. The layouts are located in
install/static/layouts/<name> folder.
By default, if no templates are used, the fields in the details page
are rendered vertically using dd/dt/dd tags. For pages that require
different layout, a custom UI needs to be developed. There are two ways
to do that:
- write a custom widget to generate the UI dynamically
- create an HTML template and write the initialization code
For components that are quite complex or used frequently, it's might
be better to use the first method. For simple pages that are used only
in one location or need to support customization, the second method
might be preferable. Other benefits of templates:
- cleaner code and UI separation
- more flexibility in customization
- new pages can be developed quickly and require less coding
- multiple templates can be used with the same initialization code
- easier to maintain
The HBAC details page has been implemented using both methods. By
default it will use custom widgets to generate the page. To use a
custom layout, add the following parameter to the URL, then reload
the page:
&layout=<name>
Currently the only available layout is 'default' which produces the
same look as the custom widgets.
The HBAC details page is usable, but it still needs additional work.
The access time is not working yet. There is no undo button, hint,
or validation yet.
The table in the association facet has also been changed to use
ipa_association_widget which is derived from ipa_table_widget.
The Makefile has been updated to include the layouts. The unit tests
have been updated as well.
2010-11-02 20:16:55 -05:00
|
|
|
|
SUDO adjustments
The SUDO rule details facet has been updated to support the latest UI
spec. The facet consists of 5 sections: general, users, hosts, commands,
and run-as.
The general section contains the SUDO rule description and status. If
the status is changed, the sudorule-enable/disable will be invoked.
The other sections contain radio buttons for the association category
and tables for the members. When a member is added or removed, the
category will be adjusted appropriately. If the category is changed to
'all', 'allow', or 'deny', all members will be removed.
The last section is currently not working because backend support is
not yet available.
The adder dialog boxes for users, groups, and hosts has been modified
to accept external identities. The layout for the base adder dialog
was updated. The base dialog class was updated to support templates.
The SUDO dialog boxes were implemented using templates. New CSS
classes were added to ipa.css.
The HBAC rule details facet has been updated as well.
2010-12-07 01:51:51 -06:00
|
|
|
that.load = function(record) {
|
|
|
|
that.values = record[that.name] || [false];
|
2010-11-18 20:17:14 -06:00
|
|
|
that.reset();
|
2010-11-09 14:22:31 -06:00
|
|
|
};
|
HBAC Details Page
The UI framework has been extended to include a collection of widgets:
- ipa_widget: base class
- ipa_text_widget: text field
- ipa_radio_widget: radio button
- ipa_textarea_widget: textarea
- ipa_button_widget: button
- ipa_column_widget: column for table
- ipa_table_widget: table
These widgets can be used to create input controls. They can also be
extended to create custom controls.
The framework has also been enhanced to support custom layouts. This
can be used to change the look of the application without changing
the code. Initially this is only available in details section.
Layout consists of a collection of HTML templates. Each template is a
complete and valid HTML file representing a portion of a page. The
template will be loaded and initialized by the code, then filled with
the data from the server. The layouts are located in
install/static/layouts/<name> folder.
By default, if no templates are used, the fields in the details page
are rendered vertically using dd/dt/dd tags. For pages that require
different layout, a custom UI needs to be developed. There are two ways
to do that:
- write a custom widget to generate the UI dynamically
- create an HTML template and write the initialization code
For components that are quite complex or used frequently, it's might
be better to use the first method. For simple pages that are used only
in one location or need to support customization, the second method
might be preferable. Other benefits of templates:
- cleaner code and UI separation
- more flexibility in customization
- new pages can be developed quickly and require less coding
- multiple templates can be used with the same initialization code
- easier to maintain
The HBAC details page has been implemented using both methods. By
default it will use custom widgets to generate the page. To use a
custom layout, add the following parameter to the URL, then reload
the page:
&layout=<name>
Currently the only available layout is 'default' which produces the
same look as the custom widgets.
The HBAC details page is usable, but it still needs additional work.
The access time is not working yet. There is no undo button, hint,
or validation yet.
The table in the association facet has also been changed to use
ipa_association_widget which is derived from ipa_table_widget.
The Makefile has been updated to include the layouts. The unit tests
have been updated as well.
2010-11-02 20:16:55 -05:00
|
|
|
|
2010-11-18 20:17:14 -06:00
|
|
|
that.save = function() {
|
2010-11-15 11:10:55 -06:00
|
|
|
var value = $('input[name="'+that.name+'"]', that.container).is(':checked');
|
|
|
|
return [value];
|
|
|
|
};
|
2010-11-09 14:22:31 -06:00
|
|
|
|
2010-12-09 14:20:40 -06:00
|
|
|
that.update = function() {
|
|
|
|
var value = that.values && that.values.length ? that.values[0] : false;
|
2011-06-30 12:45:35 -05:00
|
|
|
if (value ==="FALSE"){
|
|
|
|
value = false;
|
|
|
|
}
|
|
|
|
if (value ==="TRUE"){
|
|
|
|
value = true;
|
|
|
|
}
|
|
|
|
|
2010-11-15 11:10:55 -06:00
|
|
|
$('input[name="'+that.name+'"]', that.container).get(0).checked = value;
|
2010-11-09 14:22:31 -06:00
|
|
|
};
|
|
|
|
|
|
|
|
return that;
|
2011-01-14 11:16:25 -06:00
|
|
|
};
|
2010-11-09 14:22:31 -06:00
|
|
|
|
2011-01-29 14:25:56 -06:00
|
|
|
IPA.checkboxes_widget = function (spec) {
|
|
|
|
|
|
|
|
spec = spec || {};
|
2011-02-03 21:42:50 -06:00
|
|
|
|
2011-01-29 14:25:56 -06:00
|
|
|
var that = IPA.widget(spec);
|
|
|
|
|
2011-02-03 21:42:50 -06:00
|
|
|
that.direction = spec.direction || 'vertical';
|
2011-01-29 14:25:56 -06:00
|
|
|
that.options = spec.options || [];
|
|
|
|
|
2011-02-03 21:42:50 -06:00
|
|
|
that.add_option = function(option) {
|
|
|
|
that.options.push(option);
|
|
|
|
};
|
|
|
|
|
2011-01-29 14:25:56 -06:00
|
|
|
that.create = function(container) {
|
|
|
|
|
2011-07-15 12:18:59 -05:00
|
|
|
that.widget_create(container);
|
|
|
|
|
|
|
|
container.addClass('checkboxes-widget');
|
|
|
|
|
2011-02-03 21:42:50 -06:00
|
|
|
var vertical = that.direction === 'vertical';
|
|
|
|
|
2011-01-29 14:25:56 -06:00
|
|
|
for (var i=0; i<that.options.length; i++) {
|
|
|
|
var option = that.options[i];
|
|
|
|
$('<input/>', {
|
|
|
|
type: 'checkbox',
|
|
|
|
name: that.name,
|
|
|
|
value: option.value,
|
|
|
|
title: that.tooltip
|
|
|
|
}).appendTo(container);
|
2011-02-03 21:42:50 -06:00
|
|
|
|
|
|
|
$('<label/>', {
|
|
|
|
text: option.label,
|
|
|
|
title: that.tooltip
|
|
|
|
}).appendTo(container);
|
|
|
|
|
|
|
|
if (vertical) {
|
|
|
|
$('<br/>').appendTo(container);
|
|
|
|
}
|
2011-01-29 14:25:56 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
if (that.undo) {
|
2011-01-31 16:29:25 -06:00
|
|
|
that.create_undo(container);
|
2011-01-29 14:25:56 -06:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
that.setup = function(container) {
|
|
|
|
|
|
|
|
that.widget_setup(container);
|
|
|
|
|
|
|
|
var input = $('input[name="'+that.name+'"]', that.container);
|
|
|
|
input.change(function() {
|
2011-06-16 14:37:27 -05:00
|
|
|
that.set_dirty(that.test_dirty());
|
2011-01-29 14:25:56 -06:00
|
|
|
});
|
|
|
|
|
|
|
|
var undo = that.get_undo();
|
|
|
|
undo.click(function() {
|
|
|
|
that.reset();
|
|
|
|
});
|
|
|
|
};
|
|
|
|
|
|
|
|
that.load = function(record) {
|
|
|
|
that.values = record[that.name] || [];
|
|
|
|
that.reset();
|
|
|
|
};
|
|
|
|
|
|
|
|
that.save = function() {
|
|
|
|
var values = [];
|
|
|
|
|
|
|
|
$('input[name="'+that.name+'"]:checked', that.container).each(function() {
|
|
|
|
values.push($(this).val());
|
|
|
|
});
|
|
|
|
|
|
|
|
return values;
|
|
|
|
};
|
|
|
|
|
|
|
|
that.update = function() {
|
|
|
|
var inputs = $('input[name="'+that.name+'"]', that.container);
|
|
|
|
|
|
|
|
for (var i=0; i<inputs.length; i++) {
|
|
|
|
inputs.get(i).checked = false;
|
|
|
|
}
|
|
|
|
|
2011-02-02 10:35:23 -06:00
|
|
|
for (var j=0; that.values && j<that.values.length; j++) {
|
2011-01-29 14:25:56 -06:00
|
|
|
var value = that.values[j];
|
|
|
|
var input = $('input[name="'+that.name+'"][value="'+value+'"]', that.container);
|
|
|
|
if (!input.length) continue;
|
2011-02-02 10:35:23 -06:00
|
|
|
input.attr('checked', true);
|
2011-01-29 14:25:56 -06:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
// methods that should be invoked by subclasses
|
|
|
|
that.checkboxes_update = that.update;
|
|
|
|
|
|
|
|
return that;
|
|
|
|
};
|
|
|
|
|
2011-01-12 18:51:22 -06:00
|
|
|
IPA.radio_widget = function(spec) {
|
2010-11-09 14:22:31 -06:00
|
|
|
|
|
|
|
spec = spec || {};
|
|
|
|
|
2011-01-12 18:51:22 -06:00
|
|
|
var that = IPA.widget(spec);
|
2010-11-09 14:22:31 -06:00
|
|
|
|
2010-11-18 23:53:14 -06:00
|
|
|
that.options = spec.options;
|
|
|
|
|
|
|
|
that.create = function(container) {
|
|
|
|
|
2011-07-15 12:18:59 -05:00
|
|
|
that.widget_create(container);
|
|
|
|
|
|
|
|
container.addClass('radio-widget');
|
|
|
|
|
2010-11-18 23:53:14 -06:00
|
|
|
for (var i=0; i<that.options.length; i++) {
|
|
|
|
var option = that.options[i];
|
|
|
|
|
|
|
|
$('<input/>', {
|
|
|
|
'type': 'radio',
|
|
|
|
'name': that.name,
|
|
|
|
'value': option.value
|
|
|
|
}).appendTo(container);
|
|
|
|
|
|
|
|
container.append(option.label);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (that.undo) {
|
2011-01-31 16:29:25 -06:00
|
|
|
that.create_undo(container);
|
2010-11-18 23:53:14 -06:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2010-11-15 11:10:55 -06:00
|
|
|
that.setup = function(container) {
|
|
|
|
|
|
|
|
that.widget_setup(container);
|
|
|
|
|
|
|
|
var input = $('input[name="'+that.name+'"]', that.container);
|
|
|
|
input.change(function() {
|
2011-06-16 14:37:27 -05:00
|
|
|
that.set_dirty(that.test_dirty());
|
2010-11-15 11:10:55 -06:00
|
|
|
});
|
|
|
|
|
2010-11-18 20:17:14 -06:00
|
|
|
var undo = that.get_undo();
|
2010-11-15 11:10:55 -06:00
|
|
|
undo.click(function() {
|
2010-11-18 20:17:14 -06:00
|
|
|
that.reset();
|
2010-11-15 11:10:55 -06:00
|
|
|
});
|
|
|
|
};
|
|
|
|
|
SUDO adjustments
The SUDO rule details facet has been updated to support the latest UI
spec. The facet consists of 5 sections: general, users, hosts, commands,
and run-as.
The general section contains the SUDO rule description and status. If
the status is changed, the sudorule-enable/disable will be invoked.
The other sections contain radio buttons for the association category
and tables for the members. When a member is added or removed, the
category will be adjusted appropriately. If the category is changed to
'all', 'allow', or 'deny', all members will be removed.
The last section is currently not working because backend support is
not yet available.
The adder dialog boxes for users, groups, and hosts has been modified
to accept external identities. The layout for the base adder dialog
was updated. The base dialog class was updated to support templates.
The SUDO dialog boxes were implemented using templates. New CSS
classes were added to ipa.css.
The HBAC rule details facet has been updated as well.
2010-12-07 01:51:51 -06:00
|
|
|
that.load = function(record) {
|
2011-02-03 21:42:50 -06:00
|
|
|
that.widget_load(record);
|
|
|
|
if (!that.values.length) {
|
|
|
|
that.values = [''];
|
|
|
|
}
|
2010-11-18 20:17:14 -06:00
|
|
|
that.reset();
|
2010-11-09 14:22:31 -06:00
|
|
|
};
|
|
|
|
|
2010-11-18 20:17:14 -06:00
|
|
|
that.save = function() {
|
SUDO adjustments
The SUDO rule details facet has been updated to support the latest UI
spec. The facet consists of 5 sections: general, users, hosts, commands,
and run-as.
The general section contains the SUDO rule description and status. If
the status is changed, the sudorule-enable/disable will be invoked.
The other sections contain radio buttons for the association category
and tables for the members. When a member is added or removed, the
category will be adjusted appropriately. If the category is changed to
'all', 'allow', or 'deny', all members will be removed.
The last section is currently not working because backend support is
not yet available.
The adder dialog boxes for users, groups, and hosts has been modified
to accept external identities. The layout for the base adder dialog
was updated. The base dialog class was updated to support templates.
The SUDO dialog boxes were implemented using templates. New CSS
classes were added to ipa.css.
The HBAC rule details facet has been updated as well.
2010-12-07 01:51:51 -06:00
|
|
|
var input = $('input[name="'+that.name+'"]:checked', that.container);
|
|
|
|
if (!input.length) return [];
|
|
|
|
return [input.val()];
|
2010-11-15 11:10:55 -06:00
|
|
|
};
|
HBAC Details Page
The UI framework has been extended to include a collection of widgets:
- ipa_widget: base class
- ipa_text_widget: text field
- ipa_radio_widget: radio button
- ipa_textarea_widget: textarea
- ipa_button_widget: button
- ipa_column_widget: column for table
- ipa_table_widget: table
These widgets can be used to create input controls. They can also be
extended to create custom controls.
The framework has also been enhanced to support custom layouts. This
can be used to change the look of the application without changing
the code. Initially this is only available in details section.
Layout consists of a collection of HTML templates. Each template is a
complete and valid HTML file representing a portion of a page. The
template will be loaded and initialized by the code, then filled with
the data from the server. The layouts are located in
install/static/layouts/<name> folder.
By default, if no templates are used, the fields in the details page
are rendered vertically using dd/dt/dd tags. For pages that require
different layout, a custom UI needs to be developed. There are two ways
to do that:
- write a custom widget to generate the UI dynamically
- create an HTML template and write the initialization code
For components that are quite complex or used frequently, it's might
be better to use the first method. For simple pages that are used only
in one location or need to support customization, the second method
might be preferable. Other benefits of templates:
- cleaner code and UI separation
- more flexibility in customization
- new pages can be developed quickly and require less coding
- multiple templates can be used with the same initialization code
- easier to maintain
The HBAC details page has been implemented using both methods. By
default it will use custom widgets to generate the page. To use a
custom layout, add the following parameter to the URL, then reload
the page:
&layout=<name>
Currently the only available layout is 'default' which produces the
same look as the custom widgets.
The HBAC details page is usable, but it still needs additional work.
The access time is not working yet. There is no undo button, hint,
or validation yet.
The table in the association facet has also been changed to use
ipa_association_widget which is derived from ipa_table_widget.
The Makefile has been updated to include the layouts. The unit tests
have been updated as well.
2010-11-02 20:16:55 -05:00
|
|
|
|
2010-12-09 14:20:40 -06:00
|
|
|
that.update = function() {
|
2011-02-01 17:01:19 -06:00
|
|
|
|
2010-11-18 23:53:14 -06:00
|
|
|
$('input[name="'+that.name+'"]', that.container).each(function() {
|
|
|
|
var input = this;
|
|
|
|
input.checked = false;
|
|
|
|
});
|
2011-02-03 21:42:50 -06:00
|
|
|
|
|
|
|
var value = that.values && that.values.length ? that.values[0] : '';
|
|
|
|
var input = $('input[name="'+that.name+'"][value="'+value+'"]', that.container);
|
|
|
|
if (input.length) {
|
|
|
|
input.attr('checked', true);
|
|
|
|
}
|
2010-11-09 14:22:31 -06:00
|
|
|
};
|
HBAC Details Page
The UI framework has been extended to include a collection of widgets:
- ipa_widget: base class
- ipa_text_widget: text field
- ipa_radio_widget: radio button
- ipa_textarea_widget: textarea
- ipa_button_widget: button
- ipa_column_widget: column for table
- ipa_table_widget: table
These widgets can be used to create input controls. They can also be
extended to create custom controls.
The framework has also been enhanced to support custom layouts. This
can be used to change the look of the application without changing
the code. Initially this is only available in details section.
Layout consists of a collection of HTML templates. Each template is a
complete and valid HTML file representing a portion of a page. The
template will be loaded and initialized by the code, then filled with
the data from the server. The layouts are located in
install/static/layouts/<name> folder.
By default, if no templates are used, the fields in the details page
are rendered vertically using dd/dt/dd tags. For pages that require
different layout, a custom UI needs to be developed. There are two ways
to do that:
- write a custom widget to generate the UI dynamically
- create an HTML template and write the initialization code
For components that are quite complex or used frequently, it's might
be better to use the first method. For simple pages that are used only
in one location or need to support customization, the second method
might be preferable. Other benefits of templates:
- cleaner code and UI separation
- more flexibility in customization
- new pages can be developed quickly and require less coding
- multiple templates can be used with the same initialization code
- easier to maintain
The HBAC details page has been implemented using both methods. By
default it will use custom widgets to generate the page. To use a
custom layout, add the following parameter to the URL, then reload
the page:
&layout=<name>
Currently the only available layout is 'default' which produces the
same look as the custom widgets.
The HBAC details page is usable, but it still needs additional work.
The access time is not working yet. There is no undo button, hint,
or validation yet.
The table in the association facet has also been changed to use
ipa_association_widget which is derived from ipa_table_widget.
The Makefile has been updated to include the layouts. The unit tests
have been updated as well.
2010-11-02 20:16:55 -05:00
|
|
|
|
SUDO adjustments
The SUDO rule details facet has been updated to support the latest UI
spec. The facet consists of 5 sections: general, users, hosts, commands,
and run-as.
The general section contains the SUDO rule description and status. If
the status is changed, the sudorule-enable/disable will be invoked.
The other sections contain radio buttons for the association category
and tables for the members. When a member is added or removed, the
category will be adjusted appropriately. If the category is changed to
'all', 'allow', or 'deny', all members will be removed.
The last section is currently not working because backend support is
not yet available.
The adder dialog boxes for users, groups, and hosts has been modified
to accept external identities. The layout for the base adder dialog
was updated. The base dialog class was updated to support templates.
The SUDO dialog boxes were implemented using templates. New CSS
classes were added to ipa.css.
The HBAC rule details facet has been updated as well.
2010-12-07 01:51:51 -06:00
|
|
|
// methods that should be invoked by subclasses
|
|
|
|
that.radio_save = that.save;
|
|
|
|
|
HBAC Details Page
The UI framework has been extended to include a collection of widgets:
- ipa_widget: base class
- ipa_text_widget: text field
- ipa_radio_widget: radio button
- ipa_textarea_widget: textarea
- ipa_button_widget: button
- ipa_column_widget: column for table
- ipa_table_widget: table
These widgets can be used to create input controls. They can also be
extended to create custom controls.
The framework has also been enhanced to support custom layouts. This
can be used to change the look of the application without changing
the code. Initially this is only available in details section.
Layout consists of a collection of HTML templates. Each template is a
complete and valid HTML file representing a portion of a page. The
template will be loaded and initialized by the code, then filled with
the data from the server. The layouts are located in
install/static/layouts/<name> folder.
By default, if no templates are used, the fields in the details page
are rendered vertically using dd/dt/dd tags. For pages that require
different layout, a custom UI needs to be developed. There are two ways
to do that:
- write a custom widget to generate the UI dynamically
- create an HTML template and write the initialization code
For components that are quite complex or used frequently, it's might
be better to use the first method. For simple pages that are used only
in one location or need to support customization, the second method
might be preferable. Other benefits of templates:
- cleaner code and UI separation
- more flexibility in customization
- new pages can be developed quickly and require less coding
- multiple templates can be used with the same initialization code
- easier to maintain
The HBAC details page has been implemented using both methods. By
default it will use custom widgets to generate the page. To use a
custom layout, add the following parameter to the URL, then reload
the page:
&layout=<name>
Currently the only available layout is 'default' which produces the
same look as the custom widgets.
The HBAC details page is usable, but it still needs additional work.
The access time is not working yet. There is no undo button, hint,
or validation yet.
The table in the association facet has also been changed to use
ipa_association_widget which is derived from ipa_table_widget.
The Makefile has been updated to include the layouts. The unit tests
have been updated as well.
2010-11-02 20:16:55 -05:00
|
|
|
return that;
|
2011-01-14 11:16:25 -06:00
|
|
|
};
|
HBAC Details Page
The UI framework has been extended to include a collection of widgets:
- ipa_widget: base class
- ipa_text_widget: text field
- ipa_radio_widget: radio button
- ipa_textarea_widget: textarea
- ipa_button_widget: button
- ipa_column_widget: column for table
- ipa_table_widget: table
These widgets can be used to create input controls. They can also be
extended to create custom controls.
The framework has also been enhanced to support custom layouts. This
can be used to change the look of the application without changing
the code. Initially this is only available in details section.
Layout consists of a collection of HTML templates. Each template is a
complete and valid HTML file representing a portion of a page. The
template will be loaded and initialized by the code, then filled with
the data from the server. The layouts are located in
install/static/layouts/<name> folder.
By default, if no templates are used, the fields in the details page
are rendered vertically using dd/dt/dd tags. For pages that require
different layout, a custom UI needs to be developed. There are two ways
to do that:
- write a custom widget to generate the UI dynamically
- create an HTML template and write the initialization code
For components that are quite complex or used frequently, it's might
be better to use the first method. For simple pages that are used only
in one location or need to support customization, the second method
might be preferable. Other benefits of templates:
- cleaner code and UI separation
- more flexibility in customization
- new pages can be developed quickly and require less coding
- multiple templates can be used with the same initialization code
- easier to maintain
The HBAC details page has been implemented using both methods. By
default it will use custom widgets to generate the page. To use a
custom layout, add the following parameter to the URL, then reload
the page:
&layout=<name>
Currently the only available layout is 'default' which produces the
same look as the custom widgets.
The HBAC details page is usable, but it still needs additional work.
The access time is not working yet. There is no undo button, hint,
or validation yet.
The table in the association facet has also been changed to use
ipa_association_widget which is derived from ipa_table_widget.
The Makefile has been updated to include the layouts. The unit tests
have been updated as well.
2010-11-02 20:16:55 -05:00
|
|
|
|
2011-01-29 14:25:56 -06:00
|
|
|
IPA.select_widget = function(spec) {
|
|
|
|
|
|
|
|
spec = spec || {};
|
|
|
|
|
|
|
|
var that = IPA.widget(spec);
|
|
|
|
|
|
|
|
that.options = spec.options || [];
|
|
|
|
|
|
|
|
that.create = function(container) {
|
|
|
|
|
2011-07-15 12:18:59 -05:00
|
|
|
that.widget_create(container);
|
|
|
|
|
|
|
|
container.addClass('select-widget');
|
|
|
|
|
2011-01-29 14:25:56 -06:00
|
|
|
var select = $('<select/>', {
|
|
|
|
name: that.name
|
|
|
|
}).appendTo(container);
|
|
|
|
|
|
|
|
for (var i=0; i<that.options.length; i++) {
|
|
|
|
var option = that.options[i];
|
|
|
|
|
|
|
|
$('<option/>', {
|
|
|
|
text: option.label,
|
|
|
|
value: option.value
|
|
|
|
}).appendTo(select);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (that.undo) {
|
2011-02-02 10:35:23 -06:00
|
|
|
container.append(' ');
|
2011-01-31 16:29:25 -06:00
|
|
|
that.create_undo(container);
|
2011-01-29 14:25:56 -06:00
|
|
|
}
|
|
|
|
};
|
2011-06-07 12:58:51 -05:00
|
|
|
|
2011-01-29 14:25:56 -06:00
|
|
|
that.setup = function(container) {
|
|
|
|
that.widget_setup(container);
|
|
|
|
|
|
|
|
that.select = $('select[name="'+that.name+'"]', that.container);
|
|
|
|
that.select.change(function() {
|
2011-06-16 14:37:27 -05:00
|
|
|
that.set_dirty(that.test_dirty());
|
2011-01-29 14:25:56 -06:00
|
|
|
});
|
|
|
|
|
|
|
|
var undo = that.get_undo();
|
|
|
|
undo.click(function() {
|
|
|
|
that.reset();
|
|
|
|
});
|
|
|
|
};
|
|
|
|
|
|
|
|
that.load = function(record) {
|
|
|
|
var value = record[that.name];
|
|
|
|
if (value instanceof Array) {
|
|
|
|
that.values = value;
|
|
|
|
} else {
|
|
|
|
that.values = value ? [value] : [''];
|
|
|
|
}
|
|
|
|
that.reset();
|
|
|
|
};
|
|
|
|
|
|
|
|
that.save = function() {
|
|
|
|
var value = that.select.val() || '';
|
|
|
|
return [value];
|
|
|
|
};
|
|
|
|
|
|
|
|
that.update = function() {
|
|
|
|
var value = that.values[0];
|
|
|
|
var option = $('option[value="'+value+'"]', that.select);
|
|
|
|
if (!option.length) return;
|
|
|
|
option.attr('selected', 'selected');
|
|
|
|
};
|
|
|
|
|
|
|
|
that.empty = function() {
|
|
|
|
$('option', that.select).remove();
|
|
|
|
};
|
|
|
|
|
|
|
|
// methods that should be invoked by subclasses
|
|
|
|
that.select_load = that.load;
|
|
|
|
that.select_save = that.save;
|
2011-02-02 10:35:23 -06:00
|
|
|
that.select_update = that.update;
|
2011-01-29 14:25:56 -06:00
|
|
|
|
|
|
|
return that;
|
|
|
|
};
|
|
|
|
|
2011-01-12 18:51:22 -06:00
|
|
|
IPA.textarea_widget = function (spec) {
|
HBAC Details Page
The UI framework has been extended to include a collection of widgets:
- ipa_widget: base class
- ipa_text_widget: text field
- ipa_radio_widget: radio button
- ipa_textarea_widget: textarea
- ipa_button_widget: button
- ipa_column_widget: column for table
- ipa_table_widget: table
These widgets can be used to create input controls. They can also be
extended to create custom controls.
The framework has also been enhanced to support custom layouts. This
can be used to change the look of the application without changing
the code. Initially this is only available in details section.
Layout consists of a collection of HTML templates. Each template is a
complete and valid HTML file representing a portion of a page. The
template will be loaded and initialized by the code, then filled with
the data from the server. The layouts are located in
install/static/layouts/<name> folder.
By default, if no templates are used, the fields in the details page
are rendered vertically using dd/dt/dd tags. For pages that require
different layout, a custom UI needs to be developed. There are two ways
to do that:
- write a custom widget to generate the UI dynamically
- create an HTML template and write the initialization code
For components that are quite complex or used frequently, it's might
be better to use the first method. For simple pages that are used only
in one location or need to support customization, the second method
might be preferable. Other benefits of templates:
- cleaner code and UI separation
- more flexibility in customization
- new pages can be developed quickly and require less coding
- multiple templates can be used with the same initialization code
- easier to maintain
The HBAC details page has been implemented using both methods. By
default it will use custom widgets to generate the page. To use a
custom layout, add the following parameter to the URL, then reload
the page:
&layout=<name>
Currently the only available layout is 'default' which produces the
same look as the custom widgets.
The HBAC details page is usable, but it still needs additional work.
The access time is not working yet. There is no undo button, hint,
or validation yet.
The table in the association facet has also been changed to use
ipa_association_widget which is derived from ipa_table_widget.
The Makefile has been updated to include the layouts. The unit tests
have been updated as well.
2010-11-02 20:16:55 -05:00
|
|
|
|
|
|
|
spec = spec || {};
|
|
|
|
|
2011-01-12 18:51:22 -06:00
|
|
|
var that = IPA.widget(spec);
|
HBAC Details Page
The UI framework has been extended to include a collection of widgets:
- ipa_widget: base class
- ipa_text_widget: text field
- ipa_radio_widget: radio button
- ipa_textarea_widget: textarea
- ipa_button_widget: button
- ipa_column_widget: column for table
- ipa_table_widget: table
These widgets can be used to create input controls. They can also be
extended to create custom controls.
The framework has also been enhanced to support custom layouts. This
can be used to change the look of the application without changing
the code. Initially this is only available in details section.
Layout consists of a collection of HTML templates. Each template is a
complete and valid HTML file representing a portion of a page. The
template will be loaded and initialized by the code, then filled with
the data from the server. The layouts are located in
install/static/layouts/<name> folder.
By default, if no templates are used, the fields in the details page
are rendered vertically using dd/dt/dd tags. For pages that require
different layout, a custom UI needs to be developed. There are two ways
to do that:
- write a custom widget to generate the UI dynamically
- create an HTML template and write the initialization code
For components that are quite complex or used frequently, it's might
be better to use the first method. For simple pages that are used only
in one location or need to support customization, the second method
might be preferable. Other benefits of templates:
- cleaner code and UI separation
- more flexibility in customization
- new pages can be developed quickly and require less coding
- multiple templates can be used with the same initialization code
- easier to maintain
The HBAC details page has been implemented using both methods. By
default it will use custom widgets to generate the page. To use a
custom layout, add the following parameter to the URL, then reload
the page:
&layout=<name>
Currently the only available layout is 'default' which produces the
same look as the custom widgets.
The HBAC details page is usable, but it still needs additional work.
The access time is not working yet. There is no undo button, hint,
or validation yet.
The table in the association facet has also been changed to use
ipa_association_widget which is derived from ipa_table_widget.
The Makefile has been updated to include the layouts. The unit tests
have been updated as well.
2010-11-02 20:16:55 -05:00
|
|
|
|
2010-11-09 14:22:31 -06:00
|
|
|
that.rows = spec.rows || 5;
|
|
|
|
that.cols = spec.cols || 40;
|
HBAC Details Page
The UI framework has been extended to include a collection of widgets:
- ipa_widget: base class
- ipa_text_widget: text field
- ipa_radio_widget: radio button
- ipa_textarea_widget: textarea
- ipa_button_widget: button
- ipa_column_widget: column for table
- ipa_table_widget: table
These widgets can be used to create input controls. They can also be
extended to create custom controls.
The framework has also been enhanced to support custom layouts. This
can be used to change the look of the application without changing
the code. Initially this is only available in details section.
Layout consists of a collection of HTML templates. Each template is a
complete and valid HTML file representing a portion of a page. The
template will be loaded and initialized by the code, then filled with
the data from the server. The layouts are located in
install/static/layouts/<name> folder.
By default, if no templates are used, the fields in the details page
are rendered vertically using dd/dt/dd tags. For pages that require
different layout, a custom UI needs to be developed. There are two ways
to do that:
- write a custom widget to generate the UI dynamically
- create an HTML template and write the initialization code
For components that are quite complex or used frequently, it's might
be better to use the first method. For simple pages that are used only
in one location or need to support customization, the second method
might be preferable. Other benefits of templates:
- cleaner code and UI separation
- more flexibility in customization
- new pages can be developed quickly and require less coding
- multiple templates can be used with the same initialization code
- easier to maintain
The HBAC details page has been implemented using both methods. By
default it will use custom widgets to generate the page. To use a
custom layout, add the following parameter to the URL, then reload
the page:
&layout=<name>
Currently the only available layout is 'default' which produces the
same look as the custom widgets.
The HBAC details page is usable, but it still needs additional work.
The access time is not working yet. There is no undo button, hint,
or validation yet.
The table in the association facet has also been changed to use
ipa_association_widget which is derived from ipa_table_widget.
The Makefile has been updated to include the layouts. The unit tests
have been updated as well.
2010-11-02 20:16:55 -05:00
|
|
|
|
2010-11-09 14:22:31 -06:00
|
|
|
that.create = function(container) {
|
2010-11-15 11:10:55 -06:00
|
|
|
|
2011-07-15 12:18:59 -05:00
|
|
|
that.widget_create(container);
|
|
|
|
|
|
|
|
container.addClass('textarea-widget');
|
|
|
|
|
2010-11-09 14:22:31 -06:00
|
|
|
$('<textarea/>', {
|
2011-02-02 10:35:23 -06:00
|
|
|
name: that.name,
|
2011-01-18 11:12:47 -06:00
|
|
|
rows: that.rows,
|
|
|
|
cols: that.cols,
|
2011-02-02 10:35:23 -06:00
|
|
|
disabled: that.disabled,
|
2011-01-18 11:12:47 -06:00
|
|
|
title: that.tooltip
|
2010-11-09 14:22:31 -06:00
|
|
|
}).appendTo(container);
|
2010-11-15 11:10:55 -06:00
|
|
|
|
|
|
|
if (that.undo) {
|
2011-02-02 10:35:23 -06:00
|
|
|
container.append(' ');
|
2011-01-31 16:29:25 -06:00
|
|
|
that.create_undo(container);
|
2010-11-15 11:10:55 -06:00
|
|
|
}
|
2011-02-01 17:01:19 -06:00
|
|
|
|
2011-07-06 14:43:50 -05:00
|
|
|
that.create_error_link(container);
|
|
|
|
|
2010-11-15 11:10:55 -06:00
|
|
|
};
|
|
|
|
|
|
|
|
that.setup = function(container) {
|
|
|
|
|
|
|
|
that.widget_setup(container);
|
|
|
|
|
|
|
|
var input = $('textarea[name="'+that.name+'"]', that.container);
|
|
|
|
input.keyup(function() {
|
2011-06-16 13:36:04 -05:00
|
|
|
that.set_dirty(that.test_dirty());
|
2011-04-26 16:21:25 -05:00
|
|
|
that.validate();
|
2011-02-01 17:01:19 -06:00
|
|
|
|
2010-11-15 11:10:55 -06:00
|
|
|
});
|
|
|
|
|
2010-11-18 20:17:14 -06:00
|
|
|
var undo = that.get_undo();
|
2010-11-15 11:10:55 -06:00
|
|
|
undo.click(function() {
|
2010-11-18 20:17:14 -06:00
|
|
|
that.reset();
|
2010-11-15 11:10:55 -06:00
|
|
|
});
|
2010-11-09 14:22:31 -06:00
|
|
|
};
|
|
|
|
|
SUDO adjustments
The SUDO rule details facet has been updated to support the latest UI
spec. The facet consists of 5 sections: general, users, hosts, commands,
and run-as.
The general section contains the SUDO rule description and status. If
the status is changed, the sudorule-enable/disable will be invoked.
The other sections contain radio buttons for the association category
and tables for the members. When a member is added or removed, the
category will be adjusted appropriately. If the category is changed to
'all', 'allow', or 'deny', all members will be removed.
The last section is currently not working because backend support is
not yet available.
The adder dialog boxes for users, groups, and hosts has been modified
to accept external identities. The layout for the base adder dialog
was updated. The base dialog class was updated to support templates.
The SUDO dialog boxes were implemented using templates. New CSS
classes were added to ipa.css.
The HBAC rule details facet has been updated as well.
2010-12-07 01:51:51 -06:00
|
|
|
that.load = function(record) {
|
2011-01-29 14:25:56 -06:00
|
|
|
var value = record[that.name];
|
|
|
|
if (value instanceof Array) {
|
|
|
|
that.values = value;
|
|
|
|
} else {
|
|
|
|
that.values = value ? [value] : [''];
|
|
|
|
}
|
2010-11-18 20:17:14 -06:00
|
|
|
that.reset();
|
2010-11-09 14:22:31 -06:00
|
|
|
};
|
HBAC Details Page
The UI framework has been extended to include a collection of widgets:
- ipa_widget: base class
- ipa_text_widget: text field
- ipa_radio_widget: radio button
- ipa_textarea_widget: textarea
- ipa_button_widget: button
- ipa_column_widget: column for table
- ipa_table_widget: table
These widgets can be used to create input controls. They can also be
extended to create custom controls.
The framework has also been enhanced to support custom layouts. This
can be used to change the look of the application without changing
the code. Initially this is only available in details section.
Layout consists of a collection of HTML templates. Each template is a
complete and valid HTML file representing a portion of a page. The
template will be loaded and initialized by the code, then filled with
the data from the server. The layouts are located in
install/static/layouts/<name> folder.
By default, if no templates are used, the fields in the details page
are rendered vertically using dd/dt/dd tags. For pages that require
different layout, a custom UI needs to be developed. There are two ways
to do that:
- write a custom widget to generate the UI dynamically
- create an HTML template and write the initialization code
For components that are quite complex or used frequently, it's might
be better to use the first method. For simple pages that are used only
in one location or need to support customization, the second method
might be preferable. Other benefits of templates:
- cleaner code and UI separation
- more flexibility in customization
- new pages can be developed quickly and require less coding
- multiple templates can be used with the same initialization code
- easier to maintain
The HBAC details page has been implemented using both methods. By
default it will use custom widgets to generate the page. To use a
custom layout, add the following parameter to the URL, then reload
the page:
&layout=<name>
Currently the only available layout is 'default' which produces the
same look as the custom widgets.
The HBAC details page is usable, but it still needs additional work.
The access time is not working yet. There is no undo button, hint,
or validation yet.
The table in the association facet has also been changed to use
ipa_association_widget which is derived from ipa_table_widget.
The Makefile has been updated to include the layouts. The unit tests
have been updated as well.
2010-11-02 20:16:55 -05:00
|
|
|
|
2010-11-18 20:17:14 -06:00
|
|
|
that.save = function() {
|
2010-11-15 11:10:55 -06:00
|
|
|
var value = $('textarea[name="'+that.name+'"]', that.container).val();
|
|
|
|
return [value];
|
|
|
|
};
|
HBAC Details Page
The UI framework has been extended to include a collection of widgets:
- ipa_widget: base class
- ipa_text_widget: text field
- ipa_radio_widget: radio button
- ipa_textarea_widget: textarea
- ipa_button_widget: button
- ipa_column_widget: column for table
- ipa_table_widget: table
These widgets can be used to create input controls. They can also be
extended to create custom controls.
The framework has also been enhanced to support custom layouts. This
can be used to change the look of the application without changing
the code. Initially this is only available in details section.
Layout consists of a collection of HTML templates. Each template is a
complete and valid HTML file representing a portion of a page. The
template will be loaded and initialized by the code, then filled with
the data from the server. The layouts are located in
install/static/layouts/<name> folder.
By default, if no templates are used, the fields in the details page
are rendered vertically using dd/dt/dd tags. For pages that require
different layout, a custom UI needs to be developed. There are two ways
to do that:
- write a custom widget to generate the UI dynamically
- create an HTML template and write the initialization code
For components that are quite complex or used frequently, it's might
be better to use the first method. For simple pages that are used only
in one location or need to support customization, the second method
might be preferable. Other benefits of templates:
- cleaner code and UI separation
- more flexibility in customization
- new pages can be developed quickly and require less coding
- multiple templates can be used with the same initialization code
- easier to maintain
The HBAC details page has been implemented using both methods. By
default it will use custom widgets to generate the page. To use a
custom layout, add the following parameter to the URL, then reload
the page:
&layout=<name>
Currently the only available layout is 'default' which produces the
same look as the custom widgets.
The HBAC details page is usable, but it still needs additional work.
The access time is not working yet. There is no undo button, hint,
or validation yet.
The table in the association facet has also been changed to use
ipa_association_widget which is derived from ipa_table_widget.
The Makefile has been updated to include the layouts. The unit tests
have been updated as well.
2010-11-02 20:16:55 -05:00
|
|
|
|
2010-12-09 14:20:40 -06:00
|
|
|
that.update = function() {
|
|
|
|
var value = that.values && that.values.length ? that.values[0] : '';
|
|
|
|
$('textarea[name="'+that.name+'"]', that.container).val(value);
|
2010-11-09 14:22:31 -06:00
|
|
|
};
|
HBAC Details Page
The UI framework has been extended to include a collection of widgets:
- ipa_widget: base class
- ipa_text_widget: text field
- ipa_radio_widget: radio button
- ipa_textarea_widget: textarea
- ipa_button_widget: button
- ipa_column_widget: column for table
- ipa_table_widget: table
These widgets can be used to create input controls. They can also be
extended to create custom controls.
The framework has also been enhanced to support custom layouts. This
can be used to change the look of the application without changing
the code. Initially this is only available in details section.
Layout consists of a collection of HTML templates. Each template is a
complete and valid HTML file representing a portion of a page. The
template will be loaded and initialized by the code, then filled with
the data from the server. The layouts are located in
install/static/layouts/<name> folder.
By default, if no templates are used, the fields in the details page
are rendered vertically using dd/dt/dd tags. For pages that require
different layout, a custom UI needs to be developed. There are two ways
to do that:
- write a custom widget to generate the UI dynamically
- create an HTML template and write the initialization code
For components that are quite complex or used frequently, it's might
be better to use the first method. For simple pages that are used only
in one location or need to support customization, the second method
might be preferable. Other benefits of templates:
- cleaner code and UI separation
- more flexibility in customization
- new pages can be developed quickly and require less coding
- multiple templates can be used with the same initialization code
- easier to maintain
The HBAC details page has been implemented using both methods. By
default it will use custom widgets to generate the page. To use a
custom layout, add the following parameter to the URL, then reload
the page:
&layout=<name>
Currently the only available layout is 'default' which produces the
same look as the custom widgets.
The HBAC details page is usable, but it still needs additional work.
The access time is not working yet. There is no undo button, hint,
or validation yet.
The table in the association facet has also been changed to use
ipa_association_widget which is derived from ipa_table_widget.
The Makefile has been updated to include the layouts. The unit tests
have been updated as well.
2010-11-02 20:16:55 -05:00
|
|
|
|
|
|
|
return that;
|
2011-01-14 11:16:25 -06:00
|
|
|
};
|
HBAC Details Page
The UI framework has been extended to include a collection of widgets:
- ipa_widget: base class
- ipa_text_widget: text field
- ipa_radio_widget: radio button
- ipa_textarea_widget: textarea
- ipa_button_widget: button
- ipa_column_widget: column for table
- ipa_table_widget: table
These widgets can be used to create input controls. They can also be
extended to create custom controls.
The framework has also been enhanced to support custom layouts. This
can be used to change the look of the application without changing
the code. Initially this is only available in details section.
Layout consists of a collection of HTML templates. Each template is a
complete and valid HTML file representing a portion of a page. The
template will be loaded and initialized by the code, then filled with
the data from the server. The layouts are located in
install/static/layouts/<name> folder.
By default, if no templates are used, the fields in the details page
are rendered vertically using dd/dt/dd tags. For pages that require
different layout, a custom UI needs to be developed. There are two ways
to do that:
- write a custom widget to generate the UI dynamically
- create an HTML template and write the initialization code
For components that are quite complex or used frequently, it's might
be better to use the first method. For simple pages that are used only
in one location or need to support customization, the second method
might be preferable. Other benefits of templates:
- cleaner code and UI separation
- more flexibility in customization
- new pages can be developed quickly and require less coding
- multiple templates can be used with the same initialization code
- easier to maintain
The HBAC details page has been implemented using both methods. By
default it will use custom widgets to generate the page. To use a
custom layout, add the following parameter to the URL, then reload
the page:
&layout=<name>
Currently the only available layout is 'default' which produces the
same look as the custom widgets.
The HBAC details page is usable, but it still needs additional work.
The access time is not working yet. There is no undo button, hint,
or validation yet.
The table in the association facet has also been changed to use
ipa_association_widget which is derived from ipa_table_widget.
The Makefile has been updated to include the layouts. The unit tests
have been updated as well.
2010-11-02 20:16:55 -05:00
|
|
|
|
2010-11-19 14:57:40 -06:00
|
|
|
|
2011-01-12 18:51:22 -06:00
|
|
|
IPA.column = function (spec) {
|
HBAC Details Page
The UI framework has been extended to include a collection of widgets:
- ipa_widget: base class
- ipa_text_widget: text field
- ipa_radio_widget: radio button
- ipa_textarea_widget: textarea
- ipa_button_widget: button
- ipa_column_widget: column for table
- ipa_table_widget: table
These widgets can be used to create input controls. They can also be
extended to create custom controls.
The framework has also been enhanced to support custom layouts. This
can be used to change the look of the application without changing
the code. Initially this is only available in details section.
Layout consists of a collection of HTML templates. Each template is a
complete and valid HTML file representing a portion of a page. The
template will be loaded and initialized by the code, then filled with
the data from the server. The layouts are located in
install/static/layouts/<name> folder.
By default, if no templates are used, the fields in the details page
are rendered vertically using dd/dt/dd tags. For pages that require
different layout, a custom UI needs to be developed. There are two ways
to do that:
- write a custom widget to generate the UI dynamically
- create an HTML template and write the initialization code
For components that are quite complex or used frequently, it's might
be better to use the first method. For simple pages that are used only
in one location or need to support customization, the second method
might be preferable. Other benefits of templates:
- cleaner code and UI separation
- more flexibility in customization
- new pages can be developed quickly and require less coding
- multiple templates can be used with the same initialization code
- easier to maintain
The HBAC details page has been implemented using both methods. By
default it will use custom widgets to generate the page. To use a
custom layout, add the following parameter to the URL, then reload
the page:
&layout=<name>
Currently the only available layout is 'default' which produces the
same look as the custom widgets.
The HBAC details page is usable, but it still needs additional work.
The access time is not working yet. There is no undo button, hint,
or validation yet.
The table in the association facet has also been changed to use
ipa_association_widget which is derived from ipa_table_widget.
The Makefile has been updated to include the layouts. The unit tests
have been updated as well.
2010-11-02 20:16:55 -05:00
|
|
|
|
|
|
|
spec = spec || {};
|
|
|
|
|
2010-11-19 23:52:33 -06:00
|
|
|
var that = {};
|
HBAC Details Page
The UI framework has been extended to include a collection of widgets:
- ipa_widget: base class
- ipa_text_widget: text field
- ipa_radio_widget: radio button
- ipa_textarea_widget: textarea
- ipa_button_widget: button
- ipa_column_widget: column for table
- ipa_table_widget: table
These widgets can be used to create input controls. They can also be
extended to create custom controls.
The framework has also been enhanced to support custom layouts. This
can be used to change the look of the application without changing
the code. Initially this is only available in details section.
Layout consists of a collection of HTML templates. Each template is a
complete and valid HTML file representing a portion of a page. The
template will be loaded and initialized by the code, then filled with
the data from the server. The layouts are located in
install/static/layouts/<name> folder.
By default, if no templates are used, the fields in the details page
are rendered vertically using dd/dt/dd tags. For pages that require
different layout, a custom UI needs to be developed. There are two ways
to do that:
- write a custom widget to generate the UI dynamically
- create an HTML template and write the initialization code
For components that are quite complex or used frequently, it's might
be better to use the first method. For simple pages that are used only
in one location or need to support customization, the second method
might be preferable. Other benefits of templates:
- cleaner code and UI separation
- more flexibility in customization
- new pages can be developed quickly and require less coding
- multiple templates can be used with the same initialization code
- easier to maintain
The HBAC details page has been implemented using both methods. By
default it will use custom widgets to generate the page. To use a
custom layout, add the following parameter to the URL, then reload
the page:
&layout=<name>
Currently the only available layout is 'default' which produces the
same look as the custom widgets.
The HBAC details page is usable, but it still needs additional work.
The access time is not working yet. There is no undo button, hint,
or validation yet.
The table in the association facet has also been changed to use
ipa_association_widget which is derived from ipa_table_widget.
The Makefile has been updated to include the layouts. The unit tests
have been updated as well.
2010-11-02 20:16:55 -05:00
|
|
|
|
2010-11-19 23:52:33 -06:00
|
|
|
that.name = spec.name;
|
|
|
|
that.label = spec.label;
|
2010-12-06 13:51:49 -06:00
|
|
|
that.width = spec.width;
|
2011-06-13 23:18:57 -05:00
|
|
|
|
2010-12-06 13:51:49 -06:00
|
|
|
that.entity_name = spec.entity_name;
|
2011-06-13 23:18:57 -05:00
|
|
|
that.primary_key = spec.primary_key;
|
|
|
|
that.link = spec.link;
|
2010-12-06 13:51:49 -06:00
|
|
|
|
2011-06-13 23:18:57 -05:00
|
|
|
that.format = spec.format;
|
2010-11-09 14:22:31 -06:00
|
|
|
|
2010-12-06 13:51:49 -06:00
|
|
|
that.init = function() {
|
|
|
|
if (that.entity_name && !that.label) {
|
2011-02-16 12:46:59 -06:00
|
|
|
var param_info = IPA.get_entity_param(that.entity_name, that.name);
|
2011-05-06 16:04:09 -05:00
|
|
|
if (param_info) {
|
|
|
|
that.label = param_info.label;
|
2011-06-13 23:18:57 -05:00
|
|
|
} else {
|
2011-06-30 13:33:33 -05:00
|
|
|
alert('Cannot find label for ' + that.entity_name + ' ' +
|
2011-05-06 16:04:09 -05:00
|
|
|
that.name);
|
|
|
|
}
|
2010-12-06 13:51:49 -06:00
|
|
|
}
|
|
|
|
};
|
2010-12-01 14:51:39 -06:00
|
|
|
|
2011-07-05 16:59:05 -05:00
|
|
|
function setup(container, record) {
|
2010-11-19 23:52:33 -06:00
|
|
|
container.empty();
|
|
|
|
|
|
|
|
var value = record[that.name];
|
2011-06-13 23:18:57 -05:00
|
|
|
if (that.format && value) {
|
2011-02-10 15:48:17 -06:00
|
|
|
value = that.format(value);
|
|
|
|
}
|
2010-11-19 23:52:33 -06:00
|
|
|
value = value ? value.toString() : '';
|
|
|
|
|
2011-06-13 23:18:57 -05:00
|
|
|
if (that.link) {
|
|
|
|
$('<a/>', {
|
|
|
|
href: '#'+value,
|
|
|
|
html: value,
|
|
|
|
click: function() {
|
|
|
|
return that.link_handler(value);
|
|
|
|
}
|
|
|
|
}).appendTo(container);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
container.append(value);
|
|
|
|
}
|
2011-07-05 16:59:05 -05:00
|
|
|
}
|
2011-06-13 23:18:57 -05:00
|
|
|
|
2011-07-05 16:59:05 -05:00
|
|
|
that.setup = spec.setup || setup;
|
2011-02-10 15:48:17 -06:00
|
|
|
|
2011-06-13 23:18:57 -05:00
|
|
|
that.link_handler = function(value) {
|
|
|
|
return false;
|
|
|
|
};
|
2010-11-09 14:22:31 -06:00
|
|
|
|
HBAC Details Page
The UI framework has been extended to include a collection of widgets:
- ipa_widget: base class
- ipa_text_widget: text field
- ipa_radio_widget: radio button
- ipa_textarea_widget: textarea
- ipa_button_widget: button
- ipa_column_widget: column for table
- ipa_table_widget: table
These widgets can be used to create input controls. They can also be
extended to create custom controls.
The framework has also been enhanced to support custom layouts. This
can be used to change the look of the application without changing
the code. Initially this is only available in details section.
Layout consists of a collection of HTML templates. Each template is a
complete and valid HTML file representing a portion of a page. The
template will be loaded and initialized by the code, then filled with
the data from the server. The layouts are located in
install/static/layouts/<name> folder.
By default, if no templates are used, the fields in the details page
are rendered vertically using dd/dt/dd tags. For pages that require
different layout, a custom UI needs to be developed. There are two ways
to do that:
- write a custom widget to generate the UI dynamically
- create an HTML template and write the initialization code
For components that are quite complex or used frequently, it's might
be better to use the first method. For simple pages that are used only
in one location or need to support customization, the second method
might be preferable. Other benefits of templates:
- cleaner code and UI separation
- more flexibility in customization
- new pages can be developed quickly and require less coding
- multiple templates can be used with the same initialization code
- easier to maintain
The HBAC details page has been implemented using both methods. By
default it will use custom widgets to generate the page. To use a
custom layout, add the following parameter to the URL, then reload
the page:
&layout=<name>
Currently the only available layout is 'default' which produces the
same look as the custom widgets.
The HBAC details page is usable, but it still needs additional work.
The access time is not working yet. There is no undo button, hint,
or validation yet.
The table in the association facet has also been changed to use
ipa_association_widget which is derived from ipa_table_widget.
The Makefile has been updated to include the layouts. The unit tests
have been updated as well.
2010-11-02 20:16:55 -05:00
|
|
|
return that;
|
2011-01-14 11:16:25 -06:00
|
|
|
};
|
HBAC Details Page
The UI framework has been extended to include a collection of widgets:
- ipa_widget: base class
- ipa_text_widget: text field
- ipa_radio_widget: radio button
- ipa_textarea_widget: textarea
- ipa_button_widget: button
- ipa_column_widget: column for table
- ipa_table_widget: table
These widgets can be used to create input controls. They can also be
extended to create custom controls.
The framework has also been enhanced to support custom layouts. This
can be used to change the look of the application without changing
the code. Initially this is only available in details section.
Layout consists of a collection of HTML templates. Each template is a
complete and valid HTML file representing a portion of a page. The
template will be loaded and initialized by the code, then filled with
the data from the server. The layouts are located in
install/static/layouts/<name> folder.
By default, if no templates are used, the fields in the details page
are rendered vertically using dd/dt/dd tags. For pages that require
different layout, a custom UI needs to be developed. There are two ways
to do that:
- write a custom widget to generate the UI dynamically
- create an HTML template and write the initialization code
For components that are quite complex or used frequently, it's might
be better to use the first method. For simple pages that are used only
in one location or need to support customization, the second method
might be preferable. Other benefits of templates:
- cleaner code and UI separation
- more flexibility in customization
- new pages can be developed quickly and require less coding
- multiple templates can be used with the same initialization code
- easier to maintain
The HBAC details page has been implemented using both methods. By
default it will use custom widgets to generate the page. To use a
custom layout, add the following parameter to the URL, then reload
the page:
&layout=<name>
Currently the only available layout is 'default' which produces the
same look as the custom widgets.
The HBAC details page is usable, but it still needs additional work.
The access time is not working yet. There is no undo button, hint,
or validation yet.
The table in the association facet has also been changed to use
ipa_association_widget which is derived from ipa_table_widget.
The Makefile has been updated to include the layouts. The unit tests
have been updated as well.
2010-11-02 20:16:55 -05:00
|
|
|
|
2011-01-12 18:51:22 -06:00
|
|
|
IPA.table_widget = function (spec) {
|
HBAC Details Page
The UI framework has been extended to include a collection of widgets:
- ipa_widget: base class
- ipa_text_widget: text field
- ipa_radio_widget: radio button
- ipa_textarea_widget: textarea
- ipa_button_widget: button
- ipa_column_widget: column for table
- ipa_table_widget: table
These widgets can be used to create input controls. They can also be
extended to create custom controls.
The framework has also been enhanced to support custom layouts. This
can be used to change the look of the application without changing
the code. Initially this is only available in details section.
Layout consists of a collection of HTML templates. Each template is a
complete and valid HTML file representing a portion of a page. The
template will be loaded and initialized by the code, then filled with
the data from the server. The layouts are located in
install/static/layouts/<name> folder.
By default, if no templates are used, the fields in the details page
are rendered vertically using dd/dt/dd tags. For pages that require
different layout, a custom UI needs to be developed. There are two ways
to do that:
- write a custom widget to generate the UI dynamically
- create an HTML template and write the initialization code
For components that are quite complex or used frequently, it's might
be better to use the first method. For simple pages that are used only
in one location or need to support customization, the second method
might be preferable. Other benefits of templates:
- cleaner code and UI separation
- more flexibility in customization
- new pages can be developed quickly and require less coding
- multiple templates can be used with the same initialization code
- easier to maintain
The HBAC details page has been implemented using both methods. By
default it will use custom widgets to generate the page. To use a
custom layout, add the following parameter to the URL, then reload
the page:
&layout=<name>
Currently the only available layout is 'default' which produces the
same look as the custom widgets.
The HBAC details page is usable, but it still needs additional work.
The access time is not working yet. There is no undo button, hint,
or validation yet.
The table in the association facet has also been changed to use
ipa_association_widget which is derived from ipa_table_widget.
The Makefile has been updated to include the layouts. The unit tests
have been updated as well.
2010-11-02 20:16:55 -05:00
|
|
|
|
|
|
|
spec = spec || {};
|
|
|
|
|
2011-01-12 18:51:22 -06:00
|
|
|
var that = IPA.widget(spec);
|
HBAC Details Page
The UI framework has been extended to include a collection of widgets:
- ipa_widget: base class
- ipa_text_widget: text field
- ipa_radio_widget: radio button
- ipa_textarea_widget: textarea
- ipa_button_widget: button
- ipa_column_widget: column for table
- ipa_table_widget: table
These widgets can be used to create input controls. They can also be
extended to create custom controls.
The framework has also been enhanced to support custom layouts. This
can be used to change the look of the application without changing
the code. Initially this is only available in details section.
Layout consists of a collection of HTML templates. Each template is a
complete and valid HTML file representing a portion of a page. The
template will be loaded and initialized by the code, then filled with
the data from the server. The layouts are located in
install/static/layouts/<name> folder.
By default, if no templates are used, the fields in the details page
are rendered vertically using dd/dt/dd tags. For pages that require
different layout, a custom UI needs to be developed. There are two ways
to do that:
- write a custom widget to generate the UI dynamically
- create an HTML template and write the initialization code
For components that are quite complex or used frequently, it's might
be better to use the first method. For simple pages that are used only
in one location or need to support customization, the second method
might be preferable. Other benefits of templates:
- cleaner code and UI separation
- more flexibility in customization
- new pages can be developed quickly and require less coding
- multiple templates can be used with the same initialization code
- easier to maintain
The HBAC details page has been implemented using both methods. By
default it will use custom widgets to generate the page. To use a
custom layout, add the following parameter to the URL, then reload
the page:
&layout=<name>
Currently the only available layout is 'default' which produces the
same look as the custom widgets.
The HBAC details page is usable, but it still needs additional work.
The access time is not working yet. There is no undo button, hint,
or validation yet.
The table in the association facet has also been changed to use
ipa_association_widget which is derived from ipa_table_widget.
The Makefile has been updated to include the layouts. The unit tests
have been updated as well.
2010-11-02 20:16:55 -05:00
|
|
|
|
2010-12-01 14:51:39 -06:00
|
|
|
that.scrollable = spec.scrollable;
|
2011-06-07 12:58:51 -05:00
|
|
|
that.selectable = spec.selectable === undefined ? true : spec.selectable;
|
|
|
|
that.save_values = spec.save_values === undefined ? true : spec.save_values;
|
2011-06-07 20:48:20 -05:00
|
|
|
that['class'] = spec['class'];
|
HBAC Details Page
The UI framework has been extended to include a collection of widgets:
- ipa_widget: base class
- ipa_text_widget: text field
- ipa_radio_widget: radio button
- ipa_textarea_widget: textarea
- ipa_button_widget: button
- ipa_column_widget: column for table
- ipa_table_widget: table
These widgets can be used to create input controls. They can also be
extended to create custom controls.
The framework has also been enhanced to support custom layouts. This
can be used to change the look of the application without changing
the code. Initially this is only available in details section.
Layout consists of a collection of HTML templates. Each template is a
complete and valid HTML file representing a portion of a page. The
template will be loaded and initialized by the code, then filled with
the data from the server. The layouts are located in
install/static/layouts/<name> folder.
By default, if no templates are used, the fields in the details page
are rendered vertically using dd/dt/dd tags. For pages that require
different layout, a custom UI needs to be developed. There are two ways
to do that:
- write a custom widget to generate the UI dynamically
- create an HTML template and write the initialization code
For components that are quite complex or used frequently, it's might
be better to use the first method. For simple pages that are used only
in one location or need to support customization, the second method
might be preferable. Other benefits of templates:
- cleaner code and UI separation
- more flexibility in customization
- new pages can be developed quickly and require less coding
- multiple templates can be used with the same initialization code
- easier to maintain
The HBAC details page has been implemented using both methods. By
default it will use custom widgets to generate the page. To use a
custom layout, add the following parameter to the URL, then reload
the page:
&layout=<name>
Currently the only available layout is 'default' which produces the
same look as the custom widgets.
The HBAC details page is usable, but it still needs additional work.
The access time is not working yet. There is no undo button, hint,
or validation yet.
The table in the association facet has also been changed to use
ipa_association_widget which is derived from ipa_table_widget.
The Makefile has been updated to include the layouts. The unit tests
have been updated as well.
2010-11-02 20:16:55 -05:00
|
|
|
|
2011-05-27 16:30:41 -05:00
|
|
|
that.current_page = 1;
|
|
|
|
that.total_pages = 1;
|
|
|
|
that.page_length = spec.page_length;
|
2011-06-07 12:58:51 -05:00
|
|
|
|
2011-05-16 22:23:20 -05:00
|
|
|
that.columns = $.ordered_map();
|
HBAC Details Page
The UI framework has been extended to include a collection of widgets:
- ipa_widget: base class
- ipa_text_widget: text field
- ipa_radio_widget: radio button
- ipa_textarea_widget: textarea
- ipa_button_widget: button
- ipa_column_widget: column for table
- ipa_table_widget: table
These widgets can be used to create input controls. They can also be
extended to create custom controls.
The framework has also been enhanced to support custom layouts. This
can be used to change the look of the application without changing
the code. Initially this is only available in details section.
Layout consists of a collection of HTML templates. Each template is a
complete and valid HTML file representing a portion of a page. The
template will be loaded and initialized by the code, then filled with
the data from the server. The layouts are located in
install/static/layouts/<name> folder.
By default, if no templates are used, the fields in the details page
are rendered vertically using dd/dt/dd tags. For pages that require
different layout, a custom UI needs to be developed. There are two ways
to do that:
- write a custom widget to generate the UI dynamically
- create an HTML template and write the initialization code
For components that are quite complex or used frequently, it's might
be better to use the first method. For simple pages that are used only
in one location or need to support customization, the second method
might be preferable. Other benefits of templates:
- cleaner code and UI separation
- more flexibility in customization
- new pages can be developed quickly and require less coding
- multiple templates can be used with the same initialization code
- easier to maintain
The HBAC details page has been implemented using both methods. By
default it will use custom widgets to generate the page. To use a
custom layout, add the following parameter to the URL, then reload
the page:
&layout=<name>
Currently the only available layout is 'default' which produces the
same look as the custom widgets.
The HBAC details page is usable, but it still needs additional work.
The access time is not working yet. There is no undo button, hint,
or validation yet.
The table in the association facet has also been changed to use
ipa_association_widget which is derived from ipa_table_widget.
The Makefile has been updated to include the layouts. The unit tests
have been updated as well.
2010-11-02 20:16:55 -05:00
|
|
|
|
|
|
|
that.get_columns = function() {
|
2011-05-16 22:23:20 -05:00
|
|
|
return that.columns.values;
|
HBAC Details Page
The UI framework has been extended to include a collection of widgets:
- ipa_widget: base class
- ipa_text_widget: text field
- ipa_radio_widget: radio button
- ipa_textarea_widget: textarea
- ipa_button_widget: button
- ipa_column_widget: column for table
- ipa_table_widget: table
These widgets can be used to create input controls. They can also be
extended to create custom controls.
The framework has also been enhanced to support custom layouts. This
can be used to change the look of the application without changing
the code. Initially this is only available in details section.
Layout consists of a collection of HTML templates. Each template is a
complete and valid HTML file representing a portion of a page. The
template will be loaded and initialized by the code, then filled with
the data from the server. The layouts are located in
install/static/layouts/<name> folder.
By default, if no templates are used, the fields in the details page
are rendered vertically using dd/dt/dd tags. For pages that require
different layout, a custom UI needs to be developed. There are two ways
to do that:
- write a custom widget to generate the UI dynamically
- create an HTML template and write the initialization code
For components that are quite complex or used frequently, it's might
be better to use the first method. For simple pages that are used only
in one location or need to support customization, the second method
might be preferable. Other benefits of templates:
- cleaner code and UI separation
- more flexibility in customization
- new pages can be developed quickly and require less coding
- multiple templates can be used with the same initialization code
- easier to maintain
The HBAC details page has been implemented using both methods. By
default it will use custom widgets to generate the page. To use a
custom layout, add the following parameter to the URL, then reload
the page:
&layout=<name>
Currently the only available layout is 'default' which produces the
same look as the custom widgets.
The HBAC details page is usable, but it still needs additional work.
The access time is not working yet. There is no undo button, hint,
or validation yet.
The table in the association facet has also been changed to use
ipa_association_widget which is derived from ipa_table_widget.
The Makefile has been updated to include the layouts. The unit tests
have been updated as well.
2010-11-02 20:16:55 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
that.get_column = function(name) {
|
2011-05-16 22:23:20 -05:00
|
|
|
return that.columns.get(name);
|
HBAC Details Page
The UI framework has been extended to include a collection of widgets:
- ipa_widget: base class
- ipa_text_widget: text field
- ipa_radio_widget: radio button
- ipa_textarea_widget: textarea
- ipa_button_widget: button
- ipa_column_widget: column for table
- ipa_table_widget: table
These widgets can be used to create input controls. They can also be
extended to create custom controls.
The framework has also been enhanced to support custom layouts. This
can be used to change the look of the application without changing
the code. Initially this is only available in details section.
Layout consists of a collection of HTML templates. Each template is a
complete and valid HTML file representing a portion of a page. The
template will be loaded and initialized by the code, then filled with
the data from the server. The layouts are located in
install/static/layouts/<name> folder.
By default, if no templates are used, the fields in the details page
are rendered vertically using dd/dt/dd tags. For pages that require
different layout, a custom UI needs to be developed. There are two ways
to do that:
- write a custom widget to generate the UI dynamically
- create an HTML template and write the initialization code
For components that are quite complex or used frequently, it's might
be better to use the first method. For simple pages that are used only
in one location or need to support customization, the second method
might be preferable. Other benefits of templates:
- cleaner code and UI separation
- more flexibility in customization
- new pages can be developed quickly and require less coding
- multiple templates can be used with the same initialization code
- easier to maintain
The HBAC details page has been implemented using both methods. By
default it will use custom widgets to generate the page. To use a
custom layout, add the following parameter to the URL, then reload
the page:
&layout=<name>
Currently the only available layout is 'default' which produces the
same look as the custom widgets.
The HBAC details page is usable, but it still needs additional work.
The access time is not working yet. There is no undo button, hint,
or validation yet.
The table in the association facet has also been changed to use
ipa_association_widget which is derived from ipa_table_widget.
The Makefile has been updated to include the layouts. The unit tests
have been updated as well.
2010-11-02 20:16:55 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
that.add_column = function(column) {
|
2011-05-16 22:23:20 -05:00
|
|
|
that.columns.put(column.name, column);
|
HBAC Details Page
The UI framework has been extended to include a collection of widgets:
- ipa_widget: base class
- ipa_text_widget: text field
- ipa_radio_widget: radio button
- ipa_textarea_widget: textarea
- ipa_button_widget: button
- ipa_column_widget: column for table
- ipa_table_widget: table
These widgets can be used to create input controls. They can also be
extended to create custom controls.
The framework has also been enhanced to support custom layouts. This
can be used to change the look of the application without changing
the code. Initially this is only available in details section.
Layout consists of a collection of HTML templates. Each template is a
complete and valid HTML file representing a portion of a page. The
template will be loaded and initialized by the code, then filled with
the data from the server. The layouts are located in
install/static/layouts/<name> folder.
By default, if no templates are used, the fields in the details page
are rendered vertically using dd/dt/dd tags. For pages that require
different layout, a custom UI needs to be developed. There are two ways
to do that:
- write a custom widget to generate the UI dynamically
- create an HTML template and write the initialization code
For components that are quite complex or used frequently, it's might
be better to use the first method. For simple pages that are used only
in one location or need to support customization, the second method
might be preferable. Other benefits of templates:
- cleaner code and UI separation
- more flexibility in customization
- new pages can be developed quickly and require less coding
- multiple templates can be used with the same initialization code
- easier to maintain
The HBAC details page has been implemented using both methods. By
default it will use custom widgets to generate the page. To use a
custom layout, add the following parameter to the URL, then reload
the page:
&layout=<name>
Currently the only available layout is 'default' which produces the
same look as the custom widgets.
The HBAC details page is usable, but it still needs additional work.
The access time is not working yet. There is no undo button, hint,
or validation yet.
The table in the association facet has also been changed to use
ipa_association_widget which is derived from ipa_table_widget.
The Makefile has been updated to include the layouts. The unit tests
have been updated as well.
2010-11-02 20:16:55 -05:00
|
|
|
};
|
|
|
|
|
2010-11-19 23:52:33 -06:00
|
|
|
that.set_columns = function(columns) {
|
|
|
|
that.clear_columns();
|
|
|
|
for (var i=0; i<columns.length; i++) {
|
|
|
|
that.add_column(columns[i]);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
that.clear_columns = function() {
|
2011-05-16 22:23:20 -05:00
|
|
|
that.columns.empty();
|
2010-11-19 23:52:33 -06:00
|
|
|
};
|
|
|
|
|
HBAC Details Page
The UI framework has been extended to include a collection of widgets:
- ipa_widget: base class
- ipa_text_widget: text field
- ipa_radio_widget: radio button
- ipa_textarea_widget: textarea
- ipa_button_widget: button
- ipa_column_widget: column for table
- ipa_table_widget: table
These widgets can be used to create input controls. They can also be
extended to create custom controls.
The framework has also been enhanced to support custom layouts. This
can be used to change the look of the application without changing
the code. Initially this is only available in details section.
Layout consists of a collection of HTML templates. Each template is a
complete and valid HTML file representing a portion of a page. The
template will be loaded and initialized by the code, then filled with
the data from the server. The layouts are located in
install/static/layouts/<name> folder.
By default, if no templates are used, the fields in the details page
are rendered vertically using dd/dt/dd tags. For pages that require
different layout, a custom UI needs to be developed. There are two ways
to do that:
- write a custom widget to generate the UI dynamically
- create an HTML template and write the initialization code
For components that are quite complex or used frequently, it's might
be better to use the first method. For simple pages that are used only
in one location or need to support customization, the second method
might be preferable. Other benefits of templates:
- cleaner code and UI separation
- more flexibility in customization
- new pages can be developed quickly and require less coding
- multiple templates can be used with the same initialization code
- easier to maintain
The HBAC details page has been implemented using both methods. By
default it will use custom widgets to generate the page. To use a
custom layout, add the following parameter to the URL, then reload
the page:
&layout=<name>
Currently the only available layout is 'default' which produces the
same look as the custom widgets.
The HBAC details page is usable, but it still needs additional work.
The access time is not working yet. There is no undo button, hint,
or validation yet.
The table in the association facet has also been changed to use
ipa_association_widget which is derived from ipa_table_widget.
The Makefile has been updated to include the layouts. The unit tests
have been updated as well.
2010-11-02 20:16:55 -05:00
|
|
|
that.create_column = function(spec) {
|
2011-01-12 18:51:22 -06:00
|
|
|
var column = IPA.column(spec);
|
HBAC Details Page
The UI framework has been extended to include a collection of widgets:
- ipa_widget: base class
- ipa_text_widget: text field
- ipa_radio_widget: radio button
- ipa_textarea_widget: textarea
- ipa_button_widget: button
- ipa_column_widget: column for table
- ipa_table_widget: table
These widgets can be used to create input controls. They can also be
extended to create custom controls.
The framework has also been enhanced to support custom layouts. This
can be used to change the look of the application without changing
the code. Initially this is only available in details section.
Layout consists of a collection of HTML templates. Each template is a
complete and valid HTML file representing a portion of a page. The
template will be loaded and initialized by the code, then filled with
the data from the server. The layouts are located in
install/static/layouts/<name> folder.
By default, if no templates are used, the fields in the details page
are rendered vertically using dd/dt/dd tags. For pages that require
different layout, a custom UI needs to be developed. There are two ways
to do that:
- write a custom widget to generate the UI dynamically
- create an HTML template and write the initialization code
For components that are quite complex or used frequently, it's might
be better to use the first method. For simple pages that are used only
in one location or need to support customization, the second method
might be preferable. Other benefits of templates:
- cleaner code and UI separation
- more flexibility in customization
- new pages can be developed quickly and require less coding
- multiple templates can be used with the same initialization code
- easier to maintain
The HBAC details page has been implemented using both methods. By
default it will use custom widgets to generate the page. To use a
custom layout, add the following parameter to the URL, then reload
the page:
&layout=<name>
Currently the only available layout is 'default' which produces the
same look as the custom widgets.
The HBAC details page is usable, but it still needs additional work.
The access time is not working yet. There is no undo button, hint,
or validation yet.
The table in the association facet has also been changed to use
ipa_association_widget which is derived from ipa_table_widget.
The Makefile has been updated to include the layouts. The unit tests
have been updated as well.
2010-11-02 20:16:55 -05:00
|
|
|
that.add_column(column);
|
|
|
|
return column;
|
|
|
|
};
|
|
|
|
|
2010-12-06 13:51:49 -06:00
|
|
|
that.init = function() {
|
|
|
|
that.widget_init();
|
|
|
|
|
2011-05-16 22:23:20 -05:00
|
|
|
var columns = that.columns.values;
|
|
|
|
for (var i=0; i<columns.length; i++) {
|
|
|
|
var column = columns[i];
|
2010-12-06 13:51:49 -06:00
|
|
|
column.init();
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2010-11-15 11:10:55 -06:00
|
|
|
that.create = function(container) {
|
HBAC Details Page
The UI framework has been extended to include a collection of widgets:
- ipa_widget: base class
- ipa_text_widget: text field
- ipa_radio_widget: radio button
- ipa_textarea_widget: textarea
- ipa_button_widget: button
- ipa_column_widget: column for table
- ipa_table_widget: table
These widgets can be used to create input controls. They can also be
extended to create custom controls.
The framework has also been enhanced to support custom layouts. This
can be used to change the look of the application without changing
the code. Initially this is only available in details section.
Layout consists of a collection of HTML templates. Each template is a
complete and valid HTML file representing a portion of a page. The
template will be loaded and initialized by the code, then filled with
the data from the server. The layouts are located in
install/static/layouts/<name> folder.
By default, if no templates are used, the fields in the details page
are rendered vertically using dd/dt/dd tags. For pages that require
different layout, a custom UI needs to be developed. There are two ways
to do that:
- write a custom widget to generate the UI dynamically
- create an HTML template and write the initialization code
For components that are quite complex or used frequently, it's might
be better to use the first method. For simple pages that are used only
in one location or need to support customization, the second method
might be preferable. Other benefits of templates:
- cleaner code and UI separation
- more flexibility in customization
- new pages can be developed quickly and require less coding
- multiple templates can be used with the same initialization code
- easier to maintain
The HBAC details page has been implemented using both methods. By
default it will use custom widgets to generate the page. To use a
custom layout, add the following parameter to the URL, then reload
the page:
&layout=<name>
Currently the only available layout is 'default' which produces the
same look as the custom widgets.
The HBAC details page is usable, but it still needs additional work.
The access time is not working yet. There is no undo button, hint,
or validation yet.
The table in the association facet has also been changed to use
ipa_association_widget which is derived from ipa_table_widget.
The Makefile has been updated to include the layouts. The unit tests
have been updated as well.
2010-11-02 20:16:55 -05:00
|
|
|
|
2011-06-07 20:48:20 -05:00
|
|
|
that.widget_create(container);
|
|
|
|
|
2011-07-15 12:18:59 -05:00
|
|
|
container.addClass('table-widget');
|
|
|
|
|
2011-05-27 16:30:41 -05:00
|
|
|
that.table = $('<table/>', {
|
HBAC Details Page
The UI framework has been extended to include a collection of widgets:
- ipa_widget: base class
- ipa_text_widget: text field
- ipa_radio_widget: radio button
- ipa_textarea_widget: textarea
- ipa_button_widget: button
- ipa_column_widget: column for table
- ipa_table_widget: table
These widgets can be used to create input controls. They can also be
extended to create custom controls.
The framework has also been enhanced to support custom layouts. This
can be used to change the look of the application without changing
the code. Initially this is only available in details section.
Layout consists of a collection of HTML templates. Each template is a
complete and valid HTML file representing a portion of a page. The
template will be loaded and initialized by the code, then filled with
the data from the server. The layouts are located in
install/static/layouts/<name> folder.
By default, if no templates are used, the fields in the details page
are rendered vertically using dd/dt/dd tags. For pages that require
different layout, a custom UI needs to be developed. There are two ways
to do that:
- write a custom widget to generate the UI dynamically
- create an HTML template and write the initialization code
For components that are quite complex or used frequently, it's might
be better to use the first method. For simple pages that are used only
in one location or need to support customization, the second method
might be preferable. Other benefits of templates:
- cleaner code and UI separation
- more flexibility in customization
- new pages can be developed quickly and require less coding
- multiple templates can be used with the same initialization code
- easier to maintain
The HBAC details page has been implemented using both methods. By
default it will use custom widgets to generate the page. To use a
custom layout, add the following parameter to the URL, then reload
the page:
&layout=<name>
Currently the only available layout is 'default' which produces the
same look as the custom widgets.
The HBAC details page is usable, but it still needs additional work.
The access time is not working yet. There is no undo button, hint,
or validation yet.
The table in the association facet has also been changed to use
ipa_association_widget which is derived from ipa_table_widget.
The Makefile has been updated to include the layouts. The unit tests
have been updated as well.
2010-11-02 20:16:55 -05:00
|
|
|
'class': 'search-table'
|
2010-11-15 11:10:55 -06:00
|
|
|
}).appendTo(container);
|
HBAC Details Page
The UI framework has been extended to include a collection of widgets:
- ipa_widget: base class
- ipa_text_widget: text field
- ipa_radio_widget: radio button
- ipa_textarea_widget: textarea
- ipa_button_widget: button
- ipa_column_widget: column for table
- ipa_table_widget: table
These widgets can be used to create input controls. They can also be
extended to create custom controls.
The framework has also been enhanced to support custom layouts. This
can be used to change the look of the application without changing
the code. Initially this is only available in details section.
Layout consists of a collection of HTML templates. Each template is a
complete and valid HTML file representing a portion of a page. The
template will be loaded and initialized by the code, then filled with
the data from the server. The layouts are located in
install/static/layouts/<name> folder.
By default, if no templates are used, the fields in the details page
are rendered vertically using dd/dt/dd tags. For pages that require
different layout, a custom UI needs to be developed. There are two ways
to do that:
- write a custom widget to generate the UI dynamically
- create an HTML template and write the initialization code
For components that are quite complex or used frequently, it's might
be better to use the first method. For simple pages that are used only
in one location or need to support customization, the second method
might be preferable. Other benefits of templates:
- cleaner code and UI separation
- more flexibility in customization
- new pages can be developed quickly and require less coding
- multiple templates can be used with the same initialization code
- easier to maintain
The HBAC details page has been implemented using both methods. By
default it will use custom widgets to generate the page. To use a
custom layout, add the following parameter to the URL, then reload
the page:
&layout=<name>
Currently the only available layout is 'default' which produces the
same look as the custom widgets.
The HBAC details page is usable, but it still needs additional work.
The access time is not working yet. There is no undo button, hint,
or validation yet.
The table in the association facet has also been changed to use
ipa_association_widget which is derived from ipa_table_widget.
The Makefile has been updated to include the layouts. The unit tests
have been updated as well.
2010-11-02 20:16:55 -05:00
|
|
|
|
2011-06-07 20:48:20 -05:00
|
|
|
if (that['class']) that.table.addClass(that['class']);
|
|
|
|
|
2010-12-01 14:51:39 -06:00
|
|
|
if (that.scrollable) {
|
2011-05-27 16:30:41 -05:00
|
|
|
that.table.addClass('scrollable');
|
2010-12-01 14:51:39 -06:00
|
|
|
}
|
|
|
|
|
2011-05-27 16:30:41 -05:00
|
|
|
that.thead = $('<thead/>').appendTo(that.table);
|
SUDO adjustments
The SUDO rule details facet has been updated to support the latest UI
spec. The facet consists of 5 sections: general, users, hosts, commands,
and run-as.
The general section contains the SUDO rule description and status. If
the status is changed, the sudorule-enable/disable will be invoked.
The other sections contain radio buttons for the association category
and tables for the members. When a member is added or removed, the
category will be adjusted appropriately. If the category is changed to
'all', 'allow', or 'deny', all members will be removed.
The last section is currently not working because backend support is
not yet available.
The adder dialog boxes for users, groups, and hosts has been modified
to accept external identities. The layout for the base adder dialog
was updated. The base dialog class was updated to support templates.
The SUDO dialog boxes were implemented using templates. New CSS
classes were added to ipa.css.
The HBAC rule details facet has been updated as well.
2010-12-07 01:51:51 -06:00
|
|
|
|
2011-05-27 16:30:41 -05:00
|
|
|
var tr = $('<tr/>').appendTo(that.thead);
|
HBAC Details Page
The UI framework has been extended to include a collection of widgets:
- ipa_widget: base class
- ipa_text_widget: text field
- ipa_radio_widget: radio button
- ipa_textarea_widget: textarea
- ipa_button_widget: button
- ipa_column_widget: column for table
- ipa_table_widget: table
These widgets can be used to create input controls. They can also be
extended to create custom controls.
The framework has also been enhanced to support custom layouts. This
can be used to change the look of the application without changing
the code. Initially this is only available in details section.
Layout consists of a collection of HTML templates. Each template is a
complete and valid HTML file representing a portion of a page. The
template will be loaded and initialized by the code, then filled with
the data from the server. The layouts are located in
install/static/layouts/<name> folder.
By default, if no templates are used, the fields in the details page
are rendered vertically using dd/dt/dd tags. For pages that require
different layout, a custom UI needs to be developed. There are two ways
to do that:
- write a custom widget to generate the UI dynamically
- create an HTML template and write the initialization code
For components that are quite complex or used frequently, it's might
be better to use the first method. For simple pages that are used only
in one location or need to support customization, the second method
might be preferable. Other benefits of templates:
- cleaner code and UI separation
- more flexibility in customization
- new pages can be developed quickly and require less coding
- multiple templates can be used with the same initialization code
- easier to maintain
The HBAC details page has been implemented using both methods. By
default it will use custom widgets to generate the page. To use a
custom layout, add the following parameter to the URL, then reload
the page:
&layout=<name>
Currently the only available layout is 'default' which produces the
same look as the custom widgets.
The HBAC details page is usable, but it still needs additional work.
The access time is not working yet. There is no undo button, hint,
or validation yet.
The table in the association facet has also been changed to use
ipa_association_widget which is derived from ipa_table_widget.
The Makefile has been updated to include the layouts. The unit tests
have been updated as well.
2010-11-02 20:16:55 -05:00
|
|
|
|
2011-06-07 12:58:51 -05:00
|
|
|
var th;
|
HBAC Details Page
The UI framework has been extended to include a collection of widgets:
- ipa_widget: base class
- ipa_text_widget: text field
- ipa_radio_widget: radio button
- ipa_textarea_widget: textarea
- ipa_button_widget: button
- ipa_column_widget: column for table
- ipa_table_widget: table
These widgets can be used to create input controls. They can also be
extended to create custom controls.
The framework has also been enhanced to support custom layouts. This
can be used to change the look of the application without changing
the code. Initially this is only available in details section.
Layout consists of a collection of HTML templates. Each template is a
complete and valid HTML file representing a portion of a page. The
template will be loaded and initialized by the code, then filled with
the data from the server. The layouts are located in
install/static/layouts/<name> folder.
By default, if no templates are used, the fields in the details page
are rendered vertically using dd/dt/dd tags. For pages that require
different layout, a custom UI needs to be developed. There are two ways
to do that:
- write a custom widget to generate the UI dynamically
- create an HTML template and write the initialization code
For components that are quite complex or used frequently, it's might
be better to use the first method. For simple pages that are used only
in one location or need to support customization, the second method
might be preferable. Other benefits of templates:
- cleaner code and UI separation
- more flexibility in customization
- new pages can be developed quickly and require less coding
- multiple templates can be used with the same initialization code
- easier to maintain
The HBAC details page has been implemented using both methods. By
default it will use custom widgets to generate the page. To use a
custom layout, add the following parameter to the URL, then reload
the page:
&layout=<name>
Currently the only available layout is 'default' which produces the
same look as the custom widgets.
The HBAC details page is usable, but it still needs additional work.
The access time is not working yet. There is no undo button, hint,
or validation yet.
The table in the association facet has also been changed to use
ipa_association_widget which is derived from ipa_table_widget.
The Makefile has been updated to include the layouts. The unit tests
have been updated as well.
2010-11-02 20:16:55 -05:00
|
|
|
|
2011-06-07 12:58:51 -05:00
|
|
|
if (that.selectable) {
|
|
|
|
th = $('<th/>', {
|
|
|
|
'style': 'width: 22px;'
|
|
|
|
}).appendTo(tr);
|
|
|
|
|
|
|
|
var select_all_checkbox = $('<input/>', {
|
|
|
|
type: 'checkbox',
|
|
|
|
name: 'select',
|
|
|
|
title: IPA.messages.search.select_all
|
|
|
|
}).appendTo(th);
|
|
|
|
|
|
|
|
select_all_checkbox.change(function() {
|
|
|
|
var checked = select_all_checkbox.is(':checked');
|
|
|
|
select_all_checkbox.attr('title', checked ? IPA.messages.search.unselect_all : IPA.messages.search.select_all);
|
|
|
|
var checkboxes = $('input[name=select]', that.tbody).get();
|
|
|
|
for (var i=0; i<checkboxes.length; i++) {
|
|
|
|
checkboxes[i].checked = checked;
|
|
|
|
}
|
|
|
|
that.select_changed();
|
|
|
|
return false;
|
|
|
|
});
|
|
|
|
}
|
2011-05-27 16:30:41 -05:00
|
|
|
|
2011-05-16 22:23:20 -05:00
|
|
|
var columns = that.columns.values;
|
|
|
|
for (var i=0; i<columns.length; i++) {
|
|
|
|
var column = columns[i];
|
2010-12-01 14:51:39 -06:00
|
|
|
|
HBAC Details Page
The UI framework has been extended to include a collection of widgets:
- ipa_widget: base class
- ipa_text_widget: text field
- ipa_radio_widget: radio button
- ipa_textarea_widget: textarea
- ipa_button_widget: button
- ipa_column_widget: column for table
- ipa_table_widget: table
These widgets can be used to create input controls. They can also be
extended to create custom controls.
The framework has also been enhanced to support custom layouts. This
can be used to change the look of the application without changing
the code. Initially this is only available in details section.
Layout consists of a collection of HTML templates. Each template is a
complete and valid HTML file representing a portion of a page. The
template will be loaded and initialized by the code, then filled with
the data from the server. The layouts are located in
install/static/layouts/<name> folder.
By default, if no templates are used, the fields in the details page
are rendered vertically using dd/dt/dd tags. For pages that require
different layout, a custom UI needs to be developed. There are two ways
to do that:
- write a custom widget to generate the UI dynamically
- create an HTML template and write the initialization code
For components that are quite complex or used frequently, it's might
be better to use the first method. For simple pages that are used only
in one location or need to support customization, the second method
might be preferable. Other benefits of templates:
- cleaner code and UI separation
- more flexibility in customization
- new pages can be developed quickly and require less coding
- multiple templates can be used with the same initialization code
- easier to maintain
The HBAC details page has been implemented using both methods. By
default it will use custom widgets to generate the page. To use a
custom layout, add the following parameter to the URL, then reload
the page:
&layout=<name>
Currently the only available layout is 'default' which produces the
same look as the custom widgets.
The HBAC details page is usable, but it still needs additional work.
The access time is not working yet. There is no undo button, hint,
or validation yet.
The table in the association facet has also been changed to use
ipa_association_widget which is derived from ipa_table_widget.
The Makefile has been updated to include the layouts. The unit tests
have been updated as well.
2010-11-02 20:16:55 -05:00
|
|
|
th = $('<th/>').appendTo(tr);
|
|
|
|
|
2011-06-07 20:48:20 -05:00
|
|
|
if (that.scrollable) {
|
2011-06-01 11:14:53 -05:00
|
|
|
var width;
|
2010-12-01 14:51:39 -06:00
|
|
|
if (column.width) {
|
2011-06-01 11:14:53 -05:00
|
|
|
width = parseInt(
|
2011-05-27 10:32:17 -05:00
|
|
|
column.width.substring(0, column.width.length-2),10);
|
2010-12-01 14:51:39 -06:00
|
|
|
width += 16;
|
2011-06-07 20:48:20 -05:00
|
|
|
} else {
|
2011-06-01 11:14:53 -05:00
|
|
|
/* don't use the checkbox column as part of the overall
|
|
|
|
calculation for column widths. It is so small
|
|
|
|
that it throws off the average. */
|
2011-06-07 12:58:51 -05:00
|
|
|
width = (that.table.width() - (that.selectable ? IPA.checkbox_column_width : 0)) /
|
|
|
|
columns.length;
|
2010-12-01 14:51:39 -06:00
|
|
|
}
|
2011-06-01 11:14:53 -05:00
|
|
|
width += 'px';
|
|
|
|
th.css('width', width);
|
|
|
|
column.width = width;
|
2010-12-01 14:51:39 -06:00
|
|
|
} else {
|
|
|
|
if (column.width) {
|
|
|
|
th.css('width', column.width);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-11-09 14:22:31 -06:00
|
|
|
var label = column.label;
|
|
|
|
|
HBAC Details Page
The UI framework has been extended to include a collection of widgets:
- ipa_widget: base class
- ipa_text_widget: text field
- ipa_radio_widget: radio button
- ipa_textarea_widget: textarea
- ipa_button_widget: button
- ipa_column_widget: column for table
- ipa_table_widget: table
These widgets can be used to create input controls. They can also be
extended to create custom controls.
The framework has also been enhanced to support custom layouts. This
can be used to change the look of the application without changing
the code. Initially this is only available in details section.
Layout consists of a collection of HTML templates. Each template is a
complete and valid HTML file representing a portion of a page. The
template will be loaded and initialized by the code, then filled with
the data from the server. The layouts are located in
install/static/layouts/<name> folder.
By default, if no templates are used, the fields in the details page
are rendered vertically using dd/dt/dd tags. For pages that require
different layout, a custom UI needs to be developed. There are two ways
to do that:
- write a custom widget to generate the UI dynamically
- create an HTML template and write the initialization code
For components that are quite complex or used frequently, it's might
be better to use the first method. For simple pages that are used only
in one location or need to support customization, the second method
might be preferable. Other benefits of templates:
- cleaner code and UI separation
- more flexibility in customization
- new pages can be developed quickly and require less coding
- multiple templates can be used with the same initialization code
- easier to maintain
The HBAC details page has been implemented using both methods. By
default it will use custom widgets to generate the page. To use a
custom layout, add the following parameter to the URL, then reload
the page:
&layout=<name>
Currently the only available layout is 'default' which produces the
same look as the custom widgets.
The HBAC details page is usable, but it still needs additional work.
The access time is not working yet. There is no undo button, hint,
or validation yet.
The table in the association facet has also been changed to use
ipa_association_widget which is derived from ipa_table_widget.
The Makefile has been updated to include the layouts. The unit tests
have been updated as well.
2010-11-02 20:16:55 -05:00
|
|
|
$('<span/>', {
|
|
|
|
'style': 'float: left;',
|
2010-11-09 14:22:31 -06:00
|
|
|
'html': label
|
HBAC Details Page
The UI framework has been extended to include a collection of widgets:
- ipa_widget: base class
- ipa_text_widget: text field
- ipa_radio_widget: radio button
- ipa_textarea_widget: textarea
- ipa_button_widget: button
- ipa_column_widget: column for table
- ipa_table_widget: table
These widgets can be used to create input controls. They can also be
extended to create custom controls.
The framework has also been enhanced to support custom layouts. This
can be used to change the look of the application without changing
the code. Initially this is only available in details section.
Layout consists of a collection of HTML templates. Each template is a
complete and valid HTML file representing a portion of a page. The
template will be loaded and initialized by the code, then filled with
the data from the server. The layouts are located in
install/static/layouts/<name> folder.
By default, if no templates are used, the fields in the details page
are rendered vertically using dd/dt/dd tags. For pages that require
different layout, a custom UI needs to be developed. There are two ways
to do that:
- write a custom widget to generate the UI dynamically
- create an HTML template and write the initialization code
For components that are quite complex or used frequently, it's might
be better to use the first method. For simple pages that are used only
in one location or need to support customization, the second method
might be preferable. Other benefits of templates:
- cleaner code and UI separation
- more flexibility in customization
- new pages can be developed quickly and require less coding
- multiple templates can be used with the same initialization code
- easier to maintain
The HBAC details page has been implemented using both methods. By
default it will use custom widgets to generate the page. To use a
custom layout, add the following parameter to the URL, then reload
the page:
&layout=<name>
Currently the only available layout is 'default' which produces the
same look as the custom widgets.
The HBAC details page is usable, but it still needs additional work.
The access time is not working yet. There is no undo button, hint,
or validation yet.
The table in the association facet has also been changed to use
ipa_association_widget which is derived from ipa_table_widget.
The Makefile has been updated to include the layouts. The unit tests
have been updated as well.
2010-11-02 20:16:55 -05:00
|
|
|
}).appendTo(th);
|
|
|
|
|
2011-05-16 22:23:20 -05:00
|
|
|
if (i == columns.length-1) {
|
2011-07-09 03:01:46 -05:00
|
|
|
that.buttons = $('<span/>', {
|
HBAC Details Page
The UI framework has been extended to include a collection of widgets:
- ipa_widget: base class
- ipa_text_widget: text field
- ipa_radio_widget: radio button
- ipa_textarea_widget: textarea
- ipa_button_widget: button
- ipa_column_widget: column for table
- ipa_table_widget: table
These widgets can be used to create input controls. They can also be
extended to create custom controls.
The framework has also been enhanced to support custom layouts. This
can be used to change the look of the application without changing
the code. Initially this is only available in details section.
Layout consists of a collection of HTML templates. Each template is a
complete and valid HTML file representing a portion of a page. The
template will be loaded and initialized by the code, then filled with
the data from the server. The layouts are located in
install/static/layouts/<name> folder.
By default, if no templates are used, the fields in the details page
are rendered vertically using dd/dt/dd tags. For pages that require
different layout, a custom UI needs to be developed. There are two ways
to do that:
- write a custom widget to generate the UI dynamically
- create an HTML template and write the initialization code
For components that are quite complex or used frequently, it's might
be better to use the first method. For simple pages that are used only
in one location or need to support customization, the second method
might be preferable. Other benefits of templates:
- cleaner code and UI separation
- more flexibility in customization
- new pages can be developed quickly and require less coding
- multiple templates can be used with the same initialization code
- easier to maintain
The HBAC details page has been implemented using both methods. By
default it will use custom widgets to generate the page. To use a
custom layout, add the following parameter to the URL, then reload
the page:
&layout=<name>
Currently the only available layout is 'default' which produces the
same look as the custom widgets.
The HBAC details page is usable, but it still needs additional work.
The access time is not working yet. There is no undo button, hint,
or validation yet.
The table in the association facet has also been changed to use
ipa_association_widget which is derived from ipa_table_widget.
The Makefile has been updated to include the layouts. The unit tests
have been updated as well.
2010-11-02 20:16:55 -05:00
|
|
|
'name': 'buttons',
|
|
|
|
'style': 'float: right;'
|
|
|
|
}).appendTo(th);
|
|
|
|
}
|
2011-06-01 11:14:53 -05:00
|
|
|
if (that.scrollable && !column.width){
|
|
|
|
column.width = th.width() +'px';
|
|
|
|
}
|
HBAC Details Page
The UI framework has been extended to include a collection of widgets:
- ipa_widget: base class
- ipa_text_widget: text field
- ipa_radio_widget: radio button
- ipa_textarea_widget: textarea
- ipa_button_widget: button
- ipa_column_widget: column for table
- ipa_table_widget: table
These widgets can be used to create input controls. They can also be
extended to create custom controls.
The framework has also been enhanced to support custom layouts. This
can be used to change the look of the application without changing
the code. Initially this is only available in details section.
Layout consists of a collection of HTML templates. Each template is a
complete and valid HTML file representing a portion of a page. The
template will be loaded and initialized by the code, then filled with
the data from the server. The layouts are located in
install/static/layouts/<name> folder.
By default, if no templates are used, the fields in the details page
are rendered vertically using dd/dt/dd tags. For pages that require
different layout, a custom UI needs to be developed. There are two ways
to do that:
- write a custom widget to generate the UI dynamically
- create an HTML template and write the initialization code
For components that are quite complex or used frequently, it's might
be better to use the first method. For simple pages that are used only
in one location or need to support customization, the second method
might be preferable. Other benefits of templates:
- cleaner code and UI separation
- more flexibility in customization
- new pages can be developed quickly and require less coding
- multiple templates can be used with the same initialization code
- easier to maintain
The HBAC details page has been implemented using both methods. By
default it will use custom widgets to generate the page. To use a
custom layout, add the following parameter to the URL, then reload
the page:
&layout=<name>
Currently the only available layout is 'default' which produces the
same look as the custom widgets.
The HBAC details page is usable, but it still needs additional work.
The access time is not working yet. There is no undo button, hint,
or validation yet.
The table in the association facet has also been changed to use
ipa_association_widget which is derived from ipa_table_widget.
The Makefile has been updated to include the layouts. The unit tests
have been updated as well.
2010-11-02 20:16:55 -05:00
|
|
|
}
|
|
|
|
|
2011-05-27 16:30:41 -05:00
|
|
|
that.tbody = $('<tbody/>').appendTo(that.table);
|
HBAC Details Page
The UI framework has been extended to include a collection of widgets:
- ipa_widget: base class
- ipa_text_widget: text field
- ipa_radio_widget: radio button
- ipa_textarea_widget: textarea
- ipa_button_widget: button
- ipa_column_widget: column for table
- ipa_table_widget: table
These widgets can be used to create input controls. They can also be
extended to create custom controls.
The framework has also been enhanced to support custom layouts. This
can be used to change the look of the application without changing
the code. Initially this is only available in details section.
Layout consists of a collection of HTML templates. Each template is a
complete and valid HTML file representing a portion of a page. The
template will be loaded and initialized by the code, then filled with
the data from the server. The layouts are located in
install/static/layouts/<name> folder.
By default, if no templates are used, the fields in the details page
are rendered vertically using dd/dt/dd tags. For pages that require
different layout, a custom UI needs to be developed. There are two ways
to do that:
- write a custom widget to generate the UI dynamically
- create an HTML template and write the initialization code
For components that are quite complex or used frequently, it's might
be better to use the first method. For simple pages that are used only
in one location or need to support customization, the second method
might be preferable. Other benefits of templates:
- cleaner code and UI separation
- more flexibility in customization
- new pages can be developed quickly and require less coding
- multiple templates can be used with the same initialization code
- easier to maintain
The HBAC details page has been implemented using both methods. By
default it will use custom widgets to generate the page. To use a
custom layout, add the following parameter to the URL, then reload
the page:
&layout=<name>
Currently the only available layout is 'default' which produces the
same look as the custom widgets.
The HBAC details page is usable, but it still needs additional work.
The access time is not working yet. There is no undo button, hint,
or validation yet.
The table in the association facet has also been changed to use
ipa_association_widget which is derived from ipa_table_widget.
The Makefile has been updated to include the layouts. The unit tests
have been updated as well.
2010-11-02 20:16:55 -05:00
|
|
|
|
2010-12-01 14:51:39 -06:00
|
|
|
if (that.height) {
|
2011-05-27 16:30:41 -05:00
|
|
|
that.tbody.css('height', that.height);
|
2010-12-01 14:51:39 -06:00
|
|
|
}
|
|
|
|
|
2011-05-27 16:30:41 -05:00
|
|
|
that.row = $('<tr/>');
|
HBAC Details Page
The UI framework has been extended to include a collection of widgets:
- ipa_widget: base class
- ipa_text_widget: text field
- ipa_radio_widget: radio button
- ipa_textarea_widget: textarea
- ipa_button_widget: button
- ipa_column_widget: column for table
- ipa_table_widget: table
These widgets can be used to create input controls. They can also be
extended to create custom controls.
The framework has also been enhanced to support custom layouts. This
can be used to change the look of the application without changing
the code. Initially this is only available in details section.
Layout consists of a collection of HTML templates. Each template is a
complete and valid HTML file representing a portion of a page. The
template will be loaded and initialized by the code, then filled with
the data from the server. The layouts are located in
install/static/layouts/<name> folder.
By default, if no templates are used, the fields in the details page
are rendered vertically using dd/dt/dd tags. For pages that require
different layout, a custom UI needs to be developed. There are two ways
to do that:
- write a custom widget to generate the UI dynamically
- create an HTML template and write the initialization code
For components that are quite complex or used frequently, it's might
be better to use the first method. For simple pages that are used only
in one location or need to support customization, the second method
might be preferable. Other benefits of templates:
- cleaner code and UI separation
- more flexibility in customization
- new pages can be developed quickly and require less coding
- multiple templates can be used with the same initialization code
- easier to maintain
The HBAC details page has been implemented using both methods. By
default it will use custom widgets to generate the page. To use a
custom layout, add the following parameter to the URL, then reload
the page:
&layout=<name>
Currently the only available layout is 'default' which produces the
same look as the custom widgets.
The HBAC details page is usable, but it still needs additional work.
The access time is not working yet. There is no undo button, hint,
or validation yet.
The table in the association facet has also been changed to use
ipa_association_widget which is derived from ipa_table_widget.
The Makefile has been updated to include the layouts. The unit tests
have been updated as well.
2010-11-02 20:16:55 -05:00
|
|
|
|
2011-06-07 12:58:51 -05:00
|
|
|
var td;
|
HBAC Details Page
The UI framework has been extended to include a collection of widgets:
- ipa_widget: base class
- ipa_text_widget: text field
- ipa_radio_widget: radio button
- ipa_textarea_widget: textarea
- ipa_button_widget: button
- ipa_column_widget: column for table
- ipa_table_widget: table
These widgets can be used to create input controls. They can also be
extended to create custom controls.
The framework has also been enhanced to support custom layouts. This
can be used to change the look of the application without changing
the code. Initially this is only available in details section.
Layout consists of a collection of HTML templates. Each template is a
complete and valid HTML file representing a portion of a page. The
template will be loaded and initialized by the code, then filled with
the data from the server. The layouts are located in
install/static/layouts/<name> folder.
By default, if no templates are used, the fields in the details page
are rendered vertically using dd/dt/dd tags. For pages that require
different layout, a custom UI needs to be developed. There are two ways
to do that:
- write a custom widget to generate the UI dynamically
- create an HTML template and write the initialization code
For components that are quite complex or used frequently, it's might
be better to use the first method. For simple pages that are used only
in one location or need to support customization, the second method
might be preferable. Other benefits of templates:
- cleaner code and UI separation
- more flexibility in customization
- new pages can be developed quickly and require less coding
- multiple templates can be used with the same initialization code
- easier to maintain
The HBAC details page has been implemented using both methods. By
default it will use custom widgets to generate the page. To use a
custom layout, add the following parameter to the URL, then reload
the page:
&layout=<name>
Currently the only available layout is 'default' which produces the
same look as the custom widgets.
The HBAC details page is usable, but it still needs additional work.
The access time is not working yet. There is no undo button, hint,
or validation yet.
The table in the association facet has also been changed to use
ipa_association_widget which is derived from ipa_table_widget.
The Makefile has been updated to include the layouts. The unit tests
have been updated as well.
2010-11-02 20:16:55 -05:00
|
|
|
|
2011-06-07 12:58:51 -05:00
|
|
|
if (that.selectable) {
|
|
|
|
td = $('<td/>', {
|
|
|
|
'style': 'width: '+ IPA.checkbox_column_width +'px;'
|
|
|
|
}).appendTo(that.row);
|
|
|
|
|
|
|
|
$('<input/>', {
|
|
|
|
'type': 'checkbox',
|
|
|
|
'name': 'select',
|
|
|
|
'value': 'user'
|
|
|
|
}).appendTo(td);
|
|
|
|
}
|
HBAC Details Page
The UI framework has been extended to include a collection of widgets:
- ipa_widget: base class
- ipa_text_widget: text field
- ipa_radio_widget: radio button
- ipa_textarea_widget: textarea
- ipa_button_widget: button
- ipa_column_widget: column for table
- ipa_table_widget: table
These widgets can be used to create input controls. They can also be
extended to create custom controls.
The framework has also been enhanced to support custom layouts. This
can be used to change the look of the application without changing
the code. Initially this is only available in details section.
Layout consists of a collection of HTML templates. Each template is a
complete and valid HTML file representing a portion of a page. The
template will be loaded and initialized by the code, then filled with
the data from the server. The layouts are located in
install/static/layouts/<name> folder.
By default, if no templates are used, the fields in the details page
are rendered vertically using dd/dt/dd tags. For pages that require
different layout, a custom UI needs to be developed. There are two ways
to do that:
- write a custom widget to generate the UI dynamically
- create an HTML template and write the initialization code
For components that are quite complex or used frequently, it's might
be better to use the first method. For simple pages that are used only
in one location or need to support customization, the second method
might be preferable. Other benefits of templates:
- cleaner code and UI separation
- more flexibility in customization
- new pages can be developed quickly and require less coding
- multiple templates can be used with the same initialization code
- easier to maintain
The HBAC details page has been implemented using both methods. By
default it will use custom widgets to generate the page. To use a
custom layout, add the following parameter to the URL, then reload
the page:
&layout=<name>
Currently the only available layout is 'default' which produces the
same look as the custom widgets.
The HBAC details page is usable, but it still needs additional work.
The access time is not working yet. There is no undo button, hint,
or validation yet.
The table in the association facet has also been changed to use
ipa_association_widget which is derived from ipa_table_widget.
The Makefile has been updated to include the layouts. The unit tests
have been updated as well.
2010-11-02 20:16:55 -05:00
|
|
|
|
2011-05-16 22:23:20 -05:00
|
|
|
for (/* var */ i=0; i<columns.length; i++) {
|
|
|
|
/* var */ column = columns[i];
|
2010-12-01 14:51:39 -06:00
|
|
|
|
2011-05-27 16:30:41 -05:00
|
|
|
td = $('<td/>').appendTo(that.row);
|
2010-12-01 14:51:39 -06:00
|
|
|
if (column.width) {
|
|
|
|
td.css('width', column.width);
|
|
|
|
}
|
HBAC Details Page
The UI framework has been extended to include a collection of widgets:
- ipa_widget: base class
- ipa_text_widget: text field
- ipa_radio_widget: radio button
- ipa_textarea_widget: textarea
- ipa_button_widget: button
- ipa_column_widget: column for table
- ipa_table_widget: table
These widgets can be used to create input controls. They can also be
extended to create custom controls.
The framework has also been enhanced to support custom layouts. This
can be used to change the look of the application without changing
the code. Initially this is only available in details section.
Layout consists of a collection of HTML templates. Each template is a
complete and valid HTML file representing a portion of a page. The
template will be loaded and initialized by the code, then filled with
the data from the server. The layouts are located in
install/static/layouts/<name> folder.
By default, if no templates are used, the fields in the details page
are rendered vertically using dd/dt/dd tags. For pages that require
different layout, a custom UI needs to be developed. There are two ways
to do that:
- write a custom widget to generate the UI dynamically
- create an HTML template and write the initialization code
For components that are quite complex or used frequently, it's might
be better to use the first method. For simple pages that are used only
in one location or need to support customization, the second method
might be preferable. Other benefits of templates:
- cleaner code and UI separation
- more flexibility in customization
- new pages can be developed quickly and require less coding
- multiple templates can be used with the same initialization code
- easier to maintain
The HBAC details page has been implemented using both methods. By
default it will use custom widgets to generate the page. To use a
custom layout, add the following parameter to the URL, then reload
the page:
&layout=<name>
Currently the only available layout is 'default' which produces the
same look as the custom widgets.
The HBAC details page is usable, but it still needs additional work.
The access time is not working yet. There is no undo button, hint,
or validation yet.
The table in the association facet has also been changed to use
ipa_association_widget which is derived from ipa_table_widget.
The Makefile has been updated to include the layouts. The unit tests
have been updated as well.
2010-11-02 20:16:55 -05:00
|
|
|
|
|
|
|
$('<span/>', {
|
2010-12-01 14:51:39 -06:00
|
|
|
'name': column.name
|
HBAC Details Page
The UI framework has been extended to include a collection of widgets:
- ipa_widget: base class
- ipa_text_widget: text field
- ipa_radio_widget: radio button
- ipa_textarea_widget: textarea
- ipa_button_widget: button
- ipa_column_widget: column for table
- ipa_table_widget: table
These widgets can be used to create input controls. They can also be
extended to create custom controls.
The framework has also been enhanced to support custom layouts. This
can be used to change the look of the application without changing
the code. Initially this is only available in details section.
Layout consists of a collection of HTML templates. Each template is a
complete and valid HTML file representing a portion of a page. The
template will be loaded and initialized by the code, then filled with
the data from the server. The layouts are located in
install/static/layouts/<name> folder.
By default, if no templates are used, the fields in the details page
are rendered vertically using dd/dt/dd tags. For pages that require
different layout, a custom UI needs to be developed. There are two ways
to do that:
- write a custom widget to generate the UI dynamically
- create an HTML template and write the initialization code
For components that are quite complex or used frequently, it's might
be better to use the first method. For simple pages that are used only
in one location or need to support customization, the second method
might be preferable. Other benefits of templates:
- cleaner code and UI separation
- more flexibility in customization
- new pages can be developed quickly and require less coding
- multiple templates can be used with the same initialization code
- easier to maintain
The HBAC details page has been implemented using both methods. By
default it will use custom widgets to generate the page. To use a
custom layout, add the following parameter to the URL, then reload
the page:
&layout=<name>
Currently the only available layout is 'default' which produces the
same look as the custom widgets.
The HBAC details page is usable, but it still needs additional work.
The access time is not working yet. There is no undo button, hint,
or validation yet.
The table in the association facet has also been changed to use
ipa_association_widget which is derived from ipa_table_widget.
The Makefile has been updated to include the layouts. The unit tests
have been updated as well.
2010-11-02 20:16:55 -05:00
|
|
|
}).appendTo(td);
|
|
|
|
}
|
2010-11-09 14:22:31 -06:00
|
|
|
|
2011-05-27 16:30:41 -05:00
|
|
|
that.tfoot = $('<tfoot/>').appendTo(that.table);
|
2010-11-09 14:22:31 -06:00
|
|
|
|
2011-05-27 16:30:41 -05:00
|
|
|
tr = $('<tr/>').appendTo(that.tfoot);
|
2010-11-09 14:22:31 -06:00
|
|
|
|
2011-06-07 12:58:51 -05:00
|
|
|
td = $('<td/>', {
|
|
|
|
colspan: columns.length + (that.selectable ? 1 : 0)
|
|
|
|
}).appendTo(tr);
|
2010-11-09 14:22:31 -06:00
|
|
|
|
2011-05-27 16:30:41 -05:00
|
|
|
that.summary = $('<span/>', {
|
2010-11-09 14:22:31 -06:00
|
|
|
'name': 'summary'
|
|
|
|
}).appendTo(td);
|
2011-05-27 16:30:41 -05:00
|
|
|
|
|
|
|
that.pagination = $('<span/>', {
|
|
|
|
'name': 'pagination'
|
|
|
|
}).appendTo(td);
|
|
|
|
|
|
|
|
if (that.page_length) {
|
|
|
|
|
|
|
|
$('<a/>', {
|
2011-06-30 13:33:33 -05:00
|
|
|
text: IPA.messages.widget.prev,
|
2011-05-27 16:30:41 -05:00
|
|
|
name: 'prev_page',
|
|
|
|
click: function() {
|
2011-06-16 11:00:01 -05:00
|
|
|
that.prev_page();
|
2011-05-27 16:30:41 -05:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}).appendTo(that.pagination);
|
|
|
|
|
|
|
|
that.pagination.append(' ');
|
|
|
|
|
|
|
|
$('<a/>', {
|
2011-06-30 13:33:33 -05:00
|
|
|
text: IPA.messages.widget.next,
|
2011-05-27 16:30:41 -05:00
|
|
|
name: 'next_page',
|
|
|
|
click: function() {
|
2011-06-16 11:00:01 -05:00
|
|
|
that.next_page();
|
2011-05-27 16:30:41 -05:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}).appendTo(that.pagination);
|
|
|
|
|
2011-06-30 13:33:33 -05:00
|
|
|
that.pagination.append(' ');
|
|
|
|
that.pagination.append(IPA.messages.widget.page);
|
|
|
|
that.pagination.append(': ');
|
2011-05-27 16:30:41 -05:00
|
|
|
|
|
|
|
that.current_page_input = $('<input/>', {
|
|
|
|
type: 'text',
|
|
|
|
name: 'current_page',
|
|
|
|
keypress: function(e) {
|
|
|
|
if (e.which == 13) {
|
2011-06-16 11:00:01 -05:00
|
|
|
var page = parseInt(that.current_page_input.val(), 10) || 1;
|
|
|
|
that.set_page(page);
|
2011-05-27 16:30:41 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}).appendTo(that.pagination);
|
|
|
|
|
|
|
|
that.pagination.append(' / ');
|
|
|
|
|
|
|
|
that.total_pages_span = $('<span/>', {
|
|
|
|
name: 'total_pages'
|
|
|
|
}).appendTo(that.pagination);
|
|
|
|
}
|
2010-11-15 11:10:55 -06:00
|
|
|
};
|
HBAC Details Page
The UI framework has been extended to include a collection of widgets:
- ipa_widget: base class
- ipa_text_widget: text field
- ipa_radio_widget: radio button
- ipa_textarea_widget: textarea
- ipa_button_widget: button
- ipa_column_widget: column for table
- ipa_table_widget: table
These widgets can be used to create input controls. They can also be
extended to create custom controls.
The framework has also been enhanced to support custom layouts. This
can be used to change the look of the application without changing
the code. Initially this is only available in details section.
Layout consists of a collection of HTML templates. Each template is a
complete and valid HTML file representing a portion of a page. The
template will be loaded and initialized by the code, then filled with
the data from the server. The layouts are located in
install/static/layouts/<name> folder.
By default, if no templates are used, the fields in the details page
are rendered vertically using dd/dt/dd tags. For pages that require
different layout, a custom UI needs to be developed. There are two ways
to do that:
- write a custom widget to generate the UI dynamically
- create an HTML template and write the initialization code
For components that are quite complex or used frequently, it's might
be better to use the first method. For simple pages that are used only
in one location or need to support customization, the second method
might be preferable. Other benefits of templates:
- cleaner code and UI separation
- more flexibility in customization
- new pages can be developed quickly and require less coding
- multiple templates can be used with the same initialization code
- easier to maintain
The HBAC details page has been implemented using both methods. By
default it will use custom widgets to generate the page. To use a
custom layout, add the following parameter to the URL, then reload
the page:
&layout=<name>
Currently the only available layout is 'default' which produces the
same look as the custom widgets.
The HBAC details page is usable, but it still needs additional work.
The access time is not working yet. There is no undo button, hint,
or validation yet.
The table in the association facet has also been changed to use
ipa_association_widget which is derived from ipa_table_widget.
The Makefile has been updated to include the layouts. The unit tests
have been updated as well.
2010-11-02 20:16:55 -05:00
|
|
|
|
2011-06-16 11:00:01 -05:00
|
|
|
that.prev_page = function() {
|
|
|
|
if (that.current_page > 1) {
|
|
|
|
that.current_page--;
|
|
|
|
that.refresh();
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
that.next_page = function() {
|
|
|
|
if (that.current_page < that.total_pages) {
|
|
|
|
that.current_page++;
|
|
|
|
that.refresh();
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
that.set_page = function(page) {
|
|
|
|
if (page < 1) {
|
|
|
|
page = 1;
|
|
|
|
} else if (page > that.total_pages) {
|
|
|
|
page = that.total_pages;
|
|
|
|
}
|
|
|
|
that.current_page = page;
|
|
|
|
that.current_page_input.val(page);
|
|
|
|
that.refresh();
|
|
|
|
};
|
|
|
|
|
|
|
|
that.select_changed = function() {
|
2010-11-18 20:17:14 -06:00
|
|
|
};
|
2010-11-15 15:41:21 -06:00
|
|
|
|
2010-11-15 11:10:55 -06:00
|
|
|
that.setup = function(container) {
|
|
|
|
|
|
|
|
that.widget_setup(container);
|
|
|
|
};
|
HBAC Details Page
The UI framework has been extended to include a collection of widgets:
- ipa_widget: base class
- ipa_text_widget: text field
- ipa_radio_widget: radio button
- ipa_textarea_widget: textarea
- ipa_button_widget: button
- ipa_column_widget: column for table
- ipa_table_widget: table
These widgets can be used to create input controls. They can also be
extended to create custom controls.
The framework has also been enhanced to support custom layouts. This
can be used to change the look of the application without changing
the code. Initially this is only available in details section.
Layout consists of a collection of HTML templates. Each template is a
complete and valid HTML file representing a portion of a page. The
template will be loaded and initialized by the code, then filled with
the data from the server. The layouts are located in
install/static/layouts/<name> folder.
By default, if no templates are used, the fields in the details page
are rendered vertically using dd/dt/dd tags. For pages that require
different layout, a custom UI needs to be developed. There are two ways
to do that:
- write a custom widget to generate the UI dynamically
- create an HTML template and write the initialization code
For components that are quite complex or used frequently, it's might
be better to use the first method. For simple pages that are used only
in one location or need to support customization, the second method
might be preferable. Other benefits of templates:
- cleaner code and UI separation
- more flexibility in customization
- new pages can be developed quickly and require less coding
- multiple templates can be used with the same initialization code
- easier to maintain
The HBAC details page has been implemented using both methods. By
default it will use custom widgets to generate the page. To use a
custom layout, add the following parameter to the URL, then reload
the page:
&layout=<name>
Currently the only available layout is 'default' which produces the
same look as the custom widgets.
The HBAC details page is usable, but it still needs additional work.
The access time is not working yet. There is no undo button, hint,
or validation yet.
The table in the association facet has also been changed to use
ipa_association_widget which is derived from ipa_table_widget.
The Makefile has been updated to include the layouts. The unit tests
have been updated as well.
2010-11-02 20:16:55 -05:00
|
|
|
|
2010-12-01 14:51:39 -06:00
|
|
|
that.empty = function() {
|
|
|
|
that.tbody.empty();
|
|
|
|
};
|
|
|
|
|
2010-11-18 20:17:14 -06:00
|
|
|
that.load = function(result) {
|
HBAC Details Page
The UI framework has been extended to include a collection of widgets:
- ipa_widget: base class
- ipa_text_widget: text field
- ipa_radio_widget: radio button
- ipa_textarea_widget: textarea
- ipa_button_widget: button
- ipa_column_widget: column for table
- ipa_table_widget: table
These widgets can be used to create input controls. They can also be
extended to create custom controls.
The framework has also been enhanced to support custom layouts. This
can be used to change the look of the application without changing
the code. Initially this is only available in details section.
Layout consists of a collection of HTML templates. Each template is a
complete and valid HTML file representing a portion of a page. The
template will be loaded and initialized by the code, then filled with
the data from the server. The layouts are located in
install/static/layouts/<name> folder.
By default, if no templates are used, the fields in the details page
are rendered vertically using dd/dt/dd tags. For pages that require
different layout, a custom UI needs to be developed. There are two ways
to do that:
- write a custom widget to generate the UI dynamically
- create an HTML template and write the initialization code
For components that are quite complex or used frequently, it's might
be better to use the first method. For simple pages that are used only
in one location or need to support customization, the second method
might be preferable. Other benefits of templates:
- cleaner code and UI separation
- more flexibility in customization
- new pages can be developed quickly and require less coding
- multiple templates can be used with the same initialization code
- easier to maintain
The HBAC details page has been implemented using both methods. By
default it will use custom widgets to generate the page. To use a
custom layout, add the following parameter to the URL, then reload
the page:
&layout=<name>
Currently the only available layout is 'default' which produces the
same look as the custom widgets.
The HBAC details page is usable, but it still needs additional work.
The access time is not working yet. There is no undo button, hint,
or validation yet.
The table in the association facet has also been changed to use
ipa_association_widget which is derived from ipa_table_widget.
The Makefile has been updated to include the layouts. The unit tests
have been updated as well.
2010-11-02 20:16:55 -05:00
|
|
|
|
2010-12-01 14:51:39 -06:00
|
|
|
that.empty();
|
HBAC Details Page
The UI framework has been extended to include a collection of widgets:
- ipa_widget: base class
- ipa_text_widget: text field
- ipa_radio_widget: radio button
- ipa_textarea_widget: textarea
- ipa_button_widget: button
- ipa_column_widget: column for table
- ipa_table_widget: table
These widgets can be used to create input controls. They can also be
extended to create custom controls.
The framework has also been enhanced to support custom layouts. This
can be used to change the look of the application without changing
the code. Initially this is only available in details section.
Layout consists of a collection of HTML templates. Each template is a
complete and valid HTML file representing a portion of a page. The
template will be loaded and initialized by the code, then filled with
the data from the server. The layouts are located in
install/static/layouts/<name> folder.
By default, if no templates are used, the fields in the details page
are rendered vertically using dd/dt/dd tags. For pages that require
different layout, a custom UI needs to be developed. There are two ways
to do that:
- write a custom widget to generate the UI dynamically
- create an HTML template and write the initialization code
For components that are quite complex or used frequently, it's might
be better to use the first method. For simple pages that are used only
in one location or need to support customization, the second method
might be preferable. Other benefits of templates:
- cleaner code and UI separation
- more flexibility in customization
- new pages can be developed quickly and require less coding
- multiple templates can be used with the same initialization code
- easier to maintain
The HBAC details page has been implemented using both methods. By
default it will use custom widgets to generate the page. To use a
custom layout, add the following parameter to the URL, then reload
the page:
&layout=<name>
Currently the only available layout is 'default' which produces the
same look as the custom widgets.
The HBAC details page is usable, but it still needs additional work.
The access time is not working yet. There is no undo button, hint,
or validation yet.
The table in the association facet has also been changed to use
ipa_association_widget which is derived from ipa_table_widget.
The Makefile has been updated to include the layouts. The unit tests
have been updated as well.
2010-11-02 20:16:55 -05:00
|
|
|
|
SUDO adjustments
The SUDO rule details facet has been updated to support the latest UI
spec. The facet consists of 5 sections: general, users, hosts, commands,
and run-as.
The general section contains the SUDO rule description and status. If
the status is changed, the sudorule-enable/disable will be invoked.
The other sections contain radio buttons for the association category
and tables for the members. When a member is added or removed, the
category will be adjusted appropriately. If the category is changed to
'all', 'allow', or 'deny', all members will be removed.
The last section is currently not working because backend support is
not yet available.
The adder dialog boxes for users, groups, and hosts has been modified
to accept external identities. The layout for the base adder dialog
was updated. The base dialog class was updated to support templates.
The SUDO dialog boxes were implemented using templates. New CSS
classes were added to ipa.css.
The HBAC rule details facet has been updated as well.
2010-12-07 01:51:51 -06:00
|
|
|
that.values = result[that.name];
|
|
|
|
if (!that.values) return;
|
HBAC Details Page
The UI framework has been extended to include a collection of widgets:
- ipa_widget: base class
- ipa_text_widget: text field
- ipa_radio_widget: radio button
- ipa_textarea_widget: textarea
- ipa_button_widget: button
- ipa_column_widget: column for table
- ipa_table_widget: table
These widgets can be used to create input controls. They can also be
extended to create custom controls.
The framework has also been enhanced to support custom layouts. This
can be used to change the look of the application without changing
the code. Initially this is only available in details section.
Layout consists of a collection of HTML templates. Each template is a
complete and valid HTML file representing a portion of a page. The
template will be loaded and initialized by the code, then filled with
the data from the server. The layouts are located in
install/static/layouts/<name> folder.
By default, if no templates are used, the fields in the details page
are rendered vertically using dd/dt/dd tags. For pages that require
different layout, a custom UI needs to be developed. There are two ways
to do that:
- write a custom widget to generate the UI dynamically
- create an HTML template and write the initialization code
For components that are quite complex or used frequently, it's might
be better to use the first method. For simple pages that are used only
in one location or need to support customization, the second method
might be preferable. Other benefits of templates:
- cleaner code and UI separation
- more flexibility in customization
- new pages can be developed quickly and require less coding
- multiple templates can be used with the same initialization code
- easier to maintain
The HBAC details page has been implemented using both methods. By
default it will use custom widgets to generate the page. To use a
custom layout, add the following parameter to the URL, then reload
the page:
&layout=<name>
Currently the only available layout is 'default' which produces the
same look as the custom widgets.
The HBAC details page is usable, but it still needs additional work.
The access time is not working yet. There is no undo button, hint,
or validation yet.
The table in the association facet has also been changed to use
ipa_association_widget which is derived from ipa_table_widget.
The Makefile has been updated to include the layouts. The unit tests
have been updated as well.
2010-11-02 20:16:55 -05:00
|
|
|
|
SUDO adjustments
The SUDO rule details facet has been updated to support the latest UI
spec. The facet consists of 5 sections: general, users, hosts, commands,
and run-as.
The general section contains the SUDO rule description and status. If
the status is changed, the sudorule-enable/disable will be invoked.
The other sections contain radio buttons for the association category
and tables for the members. When a member is added or removed, the
category will be adjusted appropriately. If the category is changed to
'all', 'allow', or 'deny', all members will be removed.
The last section is currently not working because backend support is
not yet available.
The adder dialog boxes for users, groups, and hosts has been modified
to accept external identities. The layout for the base adder dialog
was updated. The base dialog class was updated to support templates.
The SUDO dialog boxes were implemented using templates. New CSS
classes were added to ipa.css.
The HBAC rule details facet has been updated as well.
2010-12-07 01:51:51 -06:00
|
|
|
for (var i=0; i<that.values.length; i++) {
|
HBAC Details Page
The UI framework has been extended to include a collection of widgets:
- ipa_widget: base class
- ipa_text_widget: text field
- ipa_radio_widget: radio button
- ipa_textarea_widget: textarea
- ipa_button_widget: button
- ipa_column_widget: column for table
- ipa_table_widget: table
These widgets can be used to create input controls. They can also be
extended to create custom controls.
The framework has also been enhanced to support custom layouts. This
can be used to change the look of the application without changing
the code. Initially this is only available in details section.
Layout consists of a collection of HTML templates. Each template is a
complete and valid HTML file representing a portion of a page. The
template will be loaded and initialized by the code, then filled with
the data from the server. The layouts are located in
install/static/layouts/<name> folder.
By default, if no templates are used, the fields in the details page
are rendered vertically using dd/dt/dd tags. For pages that require
different layout, a custom UI needs to be developed. There are two ways
to do that:
- write a custom widget to generate the UI dynamically
- create an HTML template and write the initialization code
For components that are quite complex or used frequently, it's might
be better to use the first method. For simple pages that are used only
in one location or need to support customization, the second method
might be preferable. Other benefits of templates:
- cleaner code and UI separation
- more flexibility in customization
- new pages can be developed quickly and require less coding
- multiple templates can be used with the same initialization code
- easier to maintain
The HBAC details page has been implemented using both methods. By
default it will use custom widgets to generate the page. To use a
custom layout, add the following parameter to the URL, then reload
the page:
&layout=<name>
Currently the only available layout is 'default' which produces the
same look as the custom widgets.
The HBAC details page is usable, but it still needs additional work.
The access time is not working yet. There is no undo button, hint,
or validation yet.
The table in the association facet has also been changed to use
ipa_association_widget which is derived from ipa_table_widget.
The Makefile has been updated to include the layouts. The unit tests
have been updated as well.
2010-11-02 20:16:55 -05:00
|
|
|
var record = that.get_record(result, i);
|
2010-12-01 14:51:39 -06:00
|
|
|
that.add_record(record);
|
HBAC Details Page
The UI framework has been extended to include a collection of widgets:
- ipa_widget: base class
- ipa_text_widget: text field
- ipa_radio_widget: radio button
- ipa_textarea_widget: textarea
- ipa_button_widget: button
- ipa_column_widget: column for table
- ipa_table_widget: table
These widgets can be used to create input controls. They can also be
extended to create custom controls.
The framework has also been enhanced to support custom layouts. This
can be used to change the look of the application without changing
the code. Initially this is only available in details section.
Layout consists of a collection of HTML templates. Each template is a
complete and valid HTML file representing a portion of a page. The
template will be loaded and initialized by the code, then filled with
the data from the server. The layouts are located in
install/static/layouts/<name> folder.
By default, if no templates are used, the fields in the details page
are rendered vertically using dd/dt/dd tags. For pages that require
different layout, a custom UI needs to be developed. There are two ways
to do that:
- write a custom widget to generate the UI dynamically
- create an HTML template and write the initialization code
For components that are quite complex or used frequently, it's might
be better to use the first method. For simple pages that are used only
in one location or need to support customization, the second method
might be preferable. Other benefits of templates:
- cleaner code and UI separation
- more flexibility in customization
- new pages can be developed quickly and require less coding
- multiple templates can be used with the same initialization code
- easier to maintain
The HBAC details page has been implemented using both methods. By
default it will use custom widgets to generate the page. To use a
custom layout, add the following parameter to the URL, then reload
the page:
&layout=<name>
Currently the only available layout is 'default' which produces the
same look as the custom widgets.
The HBAC details page is usable, but it still needs additional work.
The access time is not working yet. There is no undo button, hint,
or validation yet.
The table in the association facet has also been changed to use
ipa_association_widget which is derived from ipa_table_widget.
The Makefile has been updated to include the layouts. The unit tests
have been updated as well.
2010-11-02 20:16:55 -05:00
|
|
|
}
|
2010-11-15 11:10:55 -06:00
|
|
|
};
|
HBAC Details Page
The UI framework has been extended to include a collection of widgets:
- ipa_widget: base class
- ipa_text_widget: text field
- ipa_radio_widget: radio button
- ipa_textarea_widget: textarea
- ipa_button_widget: button
- ipa_column_widget: column for table
- ipa_table_widget: table
These widgets can be used to create input controls. They can also be
extended to create custom controls.
The framework has also been enhanced to support custom layouts. This
can be used to change the look of the application without changing
the code. Initially this is only available in details section.
Layout consists of a collection of HTML templates. Each template is a
complete and valid HTML file representing a portion of a page. The
template will be loaded and initialized by the code, then filled with
the data from the server. The layouts are located in
install/static/layouts/<name> folder.
By default, if no templates are used, the fields in the details page
are rendered vertically using dd/dt/dd tags. For pages that require
different layout, a custom UI needs to be developed. There are two ways
to do that:
- write a custom widget to generate the UI dynamically
- create an HTML template and write the initialization code
For components that are quite complex or used frequently, it's might
be better to use the first method. For simple pages that are used only
in one location or need to support customization, the second method
might be preferable. Other benefits of templates:
- cleaner code and UI separation
- more flexibility in customization
- new pages can be developed quickly and require less coding
- multiple templates can be used with the same initialization code
- easier to maintain
The HBAC details page has been implemented using both methods. By
default it will use custom widgets to generate the page. To use a
custom layout, add the following parameter to the URL, then reload
the page:
&layout=<name>
Currently the only available layout is 'default' which produces the
same look as the custom widgets.
The HBAC details page is usable, but it still needs additional work.
The access time is not working yet. There is no undo button, hint,
or validation yet.
The table in the association facet has also been changed to use
ipa_association_widget which is derived from ipa_table_widget.
The Makefile has been updated to include the layouts. The unit tests
have been updated as well.
2010-11-02 20:16:55 -05:00
|
|
|
|
2010-11-18 20:17:14 -06:00
|
|
|
that.save = function() {
|
SUDO adjustments
The SUDO rule details facet has been updated to support the latest UI
spec. The facet consists of 5 sections: general, users, hosts, commands,
and run-as.
The general section contains the SUDO rule description and status. If
the status is changed, the sudorule-enable/disable will be invoked.
The other sections contain radio buttons for the association category
and tables for the members. When a member is added or removed, the
category will be adjusted appropriately. If the category is changed to
'all', 'allow', or 'deny', all members will be removed.
The last section is currently not working because backend support is
not yet available.
The adder dialog boxes for users, groups, and hosts has been modified
to accept external identities. The layout for the base adder dialog
was updated. The base dialog class was updated to support templates.
The SUDO dialog boxes were implemented using templates. New CSS
classes were added to ipa.css.
The HBAC rule details facet has been updated as well.
2010-12-07 01:51:51 -06:00
|
|
|
if (that.save_values) {
|
|
|
|
var values = [];
|
HBAC Details Page
The UI framework has been extended to include a collection of widgets:
- ipa_widget: base class
- ipa_text_widget: text field
- ipa_radio_widget: radio button
- ipa_textarea_widget: textarea
- ipa_button_widget: button
- ipa_column_widget: column for table
- ipa_table_widget: table
These widgets can be used to create input controls. They can also be
extended to create custom controls.
The framework has also been enhanced to support custom layouts. This
can be used to change the look of the application without changing
the code. Initially this is only available in details section.
Layout consists of a collection of HTML templates. Each template is a
complete and valid HTML file representing a portion of a page. The
template will be loaded and initialized by the code, then filled with
the data from the server. The layouts are located in
install/static/layouts/<name> folder.
By default, if no templates are used, the fields in the details page
are rendered vertically using dd/dt/dd tags. For pages that require
different layout, a custom UI needs to be developed. There are two ways
to do that:
- write a custom widget to generate the UI dynamically
- create an HTML template and write the initialization code
For components that are quite complex or used frequently, it's might
be better to use the first method. For simple pages that are used only
in one location or need to support customization, the second method
might be preferable. Other benefits of templates:
- cleaner code and UI separation
- more flexibility in customization
- new pages can be developed quickly and require less coding
- multiple templates can be used with the same initialization code
- easier to maintain
The HBAC details page has been implemented using both methods. By
default it will use custom widgets to generate the page. To use a
custom layout, add the following parameter to the URL, then reload
the page:
&layout=<name>
Currently the only available layout is 'default' which produces the
same look as the custom widgets.
The HBAC details page is usable, but it still needs additional work.
The access time is not working yet. There is no undo button, hint,
or validation yet.
The table in the association facet has also been changed to use
ipa_association_widget which is derived from ipa_table_widget.
The Makefile has been updated to include the layouts. The unit tests
have been updated as well.
2010-11-02 20:16:55 -05:00
|
|
|
|
SUDO adjustments
The SUDO rule details facet has been updated to support the latest UI
spec. The facet consists of 5 sections: general, users, hosts, commands,
and run-as.
The general section contains the SUDO rule description and status. If
the status is changed, the sudorule-enable/disable will be invoked.
The other sections contain radio buttons for the association category
and tables for the members. When a member is added or removed, the
category will be adjusted appropriately. If the category is changed to
'all', 'allow', or 'deny', all members will be removed.
The last section is currently not working because backend support is
not yet available.
The adder dialog boxes for users, groups, and hosts has been modified
to accept external identities. The layout for the base adder dialog
was updated. The base dialog class was updated to support templates.
The SUDO dialog boxes were implemented using templates. New CSS
classes were added to ipa.css.
The HBAC rule details facet has been updated as well.
2010-12-07 01:51:51 -06:00
|
|
|
$('input[name="select"]', that.tbody).each(function() {
|
|
|
|
values.push($(this).val());
|
|
|
|
});
|
HBAC Details Page
The UI framework has been extended to include a collection of widgets:
- ipa_widget: base class
- ipa_text_widget: text field
- ipa_radio_widget: radio button
- ipa_textarea_widget: textarea
- ipa_button_widget: button
- ipa_column_widget: column for table
- ipa_table_widget: table
These widgets can be used to create input controls. They can also be
extended to create custom controls.
The framework has also been enhanced to support custom layouts. This
can be used to change the look of the application without changing
the code. Initially this is only available in details section.
Layout consists of a collection of HTML templates. Each template is a
complete and valid HTML file representing a portion of a page. The
template will be loaded and initialized by the code, then filled with
the data from the server. The layouts are located in
install/static/layouts/<name> folder.
By default, if no templates are used, the fields in the details page
are rendered vertically using dd/dt/dd tags. For pages that require
different layout, a custom UI needs to be developed. There are two ways
to do that:
- write a custom widget to generate the UI dynamically
- create an HTML template and write the initialization code
For components that are quite complex or used frequently, it's might
be better to use the first method. For simple pages that are used only
in one location or need to support customization, the second method
might be preferable. Other benefits of templates:
- cleaner code and UI separation
- more flexibility in customization
- new pages can be developed quickly and require less coding
- multiple templates can be used with the same initialization code
- easier to maintain
The HBAC details page has been implemented using both methods. By
default it will use custom widgets to generate the page. To use a
custom layout, add the following parameter to the URL, then reload
the page:
&layout=<name>
Currently the only available layout is 'default' which produces the
same look as the custom widgets.
The HBAC details page is usable, but it still needs additional work.
The access time is not working yet. There is no undo button, hint,
or validation yet.
The table in the association facet has also been changed to use
ipa_association_widget which is derived from ipa_table_widget.
The Makefile has been updated to include the layouts. The unit tests
have been updated as well.
2010-11-02 20:16:55 -05:00
|
|
|
|
SUDO adjustments
The SUDO rule details facet has been updated to support the latest UI
spec. The facet consists of 5 sections: general, users, hosts, commands,
and run-as.
The general section contains the SUDO rule description and status. If
the status is changed, the sudorule-enable/disable will be invoked.
The other sections contain radio buttons for the association category
and tables for the members. When a member is added or removed, the
category will be adjusted appropriately. If the category is changed to
'all', 'allow', or 'deny', all members will be removed.
The last section is currently not working because backend support is
not yet available.
The adder dialog boxes for users, groups, and hosts has been modified
to accept external identities. The layout for the base adder dialog
was updated. The base dialog class was updated to support templates.
The SUDO dialog boxes were implemented using templates. New CSS
classes were added to ipa.css.
The HBAC rule details facet has been updated as well.
2010-12-07 01:51:51 -06:00
|
|
|
return values;
|
|
|
|
|
|
|
|
} else {
|
|
|
|
return null;
|
|
|
|
}
|
2010-11-15 11:10:55 -06:00
|
|
|
};
|
HBAC Details Page
The UI framework has been extended to include a collection of widgets:
- ipa_widget: base class
- ipa_text_widget: text field
- ipa_radio_widget: radio button
- ipa_textarea_widget: textarea
- ipa_button_widget: button
- ipa_column_widget: column for table
- ipa_table_widget: table
These widgets can be used to create input controls. They can also be
extended to create custom controls.
The framework has also been enhanced to support custom layouts. This
can be used to change the look of the application without changing
the code. Initially this is only available in details section.
Layout consists of a collection of HTML templates. Each template is a
complete and valid HTML file representing a portion of a page. The
template will be loaded and initialized by the code, then filled with
the data from the server. The layouts are located in
install/static/layouts/<name> folder.
By default, if no templates are used, the fields in the details page
are rendered vertically using dd/dt/dd tags. For pages that require
different layout, a custom UI needs to be developed. There are two ways
to do that:
- write a custom widget to generate the UI dynamically
- create an HTML template and write the initialization code
For components that are quite complex or used frequently, it's might
be better to use the first method. For simple pages that are used only
in one location or need to support customization, the second method
might be preferable. Other benefits of templates:
- cleaner code and UI separation
- more flexibility in customization
- new pages can be developed quickly and require less coding
- multiple templates can be used with the same initialization code
- easier to maintain
The HBAC details page has been implemented using both methods. By
default it will use custom widgets to generate the page. To use a
custom layout, add the following parameter to the URL, then reload
the page:
&layout=<name>
Currently the only available layout is 'default' which produces the
same look as the custom widgets.
The HBAC details page is usable, but it still needs additional work.
The access time is not working yet. There is no undo button, hint,
or validation yet.
The table in the association facet has also been changed to use
ipa_association_widget which is derived from ipa_table_widget.
The Makefile has been updated to include the layouts. The unit tests
have been updated as well.
2010-11-02 20:16:55 -05:00
|
|
|
|
2010-12-01 14:51:39 -06:00
|
|
|
that.get_selected_values = function() {
|
HBAC Details Page
The UI framework has been extended to include a collection of widgets:
- ipa_widget: base class
- ipa_text_widget: text field
- ipa_radio_widget: radio button
- ipa_textarea_widget: textarea
- ipa_button_widget: button
- ipa_column_widget: column for table
- ipa_table_widget: table
These widgets can be used to create input controls. They can also be
extended to create custom controls.
The framework has also been enhanced to support custom layouts. This
can be used to change the look of the application without changing
the code. Initially this is only available in details section.
Layout consists of a collection of HTML templates. Each template is a
complete and valid HTML file representing a portion of a page. The
template will be loaded and initialized by the code, then filled with
the data from the server. The layouts are located in
install/static/layouts/<name> folder.
By default, if no templates are used, the fields in the details page
are rendered vertically using dd/dt/dd tags. For pages that require
different layout, a custom UI needs to be developed. There are two ways
to do that:
- write a custom widget to generate the UI dynamically
- create an HTML template and write the initialization code
For components that are quite complex or used frequently, it's might
be better to use the first method. For simple pages that are used only
in one location or need to support customization, the second method
might be preferable. Other benefits of templates:
- cleaner code and UI separation
- more flexibility in customization
- new pages can be developed quickly and require less coding
- multiple templates can be used with the same initialization code
- easier to maintain
The HBAC details page has been implemented using both methods. By
default it will use custom widgets to generate the page. To use a
custom layout, add the following parameter to the URL, then reload
the page:
&layout=<name>
Currently the only available layout is 'default' which produces the
same look as the custom widgets.
The HBAC details page is usable, but it still needs additional work.
The access time is not working yet. There is no undo button, hint,
or validation yet.
The table in the association facet has also been changed to use
ipa_association_widget which is derived from ipa_table_widget.
The Makefile has been updated to include the layouts. The unit tests
have been updated as well.
2010-11-02 20:16:55 -05:00
|
|
|
var values = [];
|
|
|
|
|
|
|
|
$('input[name="select"]:checked', that.tbody).each(function() {
|
|
|
|
values.push($(this).val());
|
|
|
|
});
|
|
|
|
|
|
|
|
return values;
|
|
|
|
};
|
|
|
|
|
2011-05-09 20:46:52 -05:00
|
|
|
that.get_selected_rows = function() {
|
|
|
|
return $('input[name="select"]:checked', that.tbody).closest('tr');
|
|
|
|
};
|
|
|
|
|
HBAC Details Page
The UI framework has been extended to include a collection of widgets:
- ipa_widget: base class
- ipa_text_widget: text field
- ipa_radio_widget: radio button
- ipa_textarea_widget: textarea
- ipa_button_widget: button
- ipa_column_widget: column for table
- ipa_table_widget: table
These widgets can be used to create input controls. They can also be
extended to create custom controls.
The framework has also been enhanced to support custom layouts. This
can be used to change the look of the application without changing
the code. Initially this is only available in details section.
Layout consists of a collection of HTML templates. Each template is a
complete and valid HTML file representing a portion of a page. The
template will be loaded and initialized by the code, then filled with
the data from the server. The layouts are located in
install/static/layouts/<name> folder.
By default, if no templates are used, the fields in the details page
are rendered vertically using dd/dt/dd tags. For pages that require
different layout, a custom UI needs to be developed. There are two ways
to do that:
- write a custom widget to generate the UI dynamically
- create an HTML template and write the initialization code
For components that are quite complex or used frequently, it's might
be better to use the first method. For simple pages that are used only
in one location or need to support customization, the second method
might be preferable. Other benefits of templates:
- cleaner code and UI separation
- more flexibility in customization
- new pages can be developed quickly and require less coding
- multiple templates can be used with the same initialization code
- easier to maintain
The HBAC details page has been implemented using both methods. By
default it will use custom widgets to generate the page. To use a
custom layout, add the following parameter to the URL, then reload
the page:
&layout=<name>
Currently the only available layout is 'default' which produces the
same look as the custom widgets.
The HBAC details page is usable, but it still needs additional work.
The access time is not working yet. There is no undo button, hint,
or validation yet.
The table in the association facet has also been changed to use
ipa_association_widget which is derived from ipa_table_widget.
The Makefile has been updated to include the layouts. The unit tests
have been updated as well.
2010-11-02 20:16:55 -05:00
|
|
|
that.get_record = function(result, index) {
|
2011-05-16 22:23:20 -05:00
|
|
|
|
HBAC Details Page
The UI framework has been extended to include a collection of widgets:
- ipa_widget: base class
- ipa_text_widget: text field
- ipa_radio_widget: radio button
- ipa_textarea_widget: textarea
- ipa_button_widget: button
- ipa_column_widget: column for table
- ipa_table_widget: table
These widgets can be used to create input controls. They can also be
extended to create custom controls.
The framework has also been enhanced to support custom layouts. This
can be used to change the look of the application without changing
the code. Initially this is only available in details section.
Layout consists of a collection of HTML templates. Each template is a
complete and valid HTML file representing a portion of a page. The
template will be loaded and initialized by the code, then filled with
the data from the server. The layouts are located in
install/static/layouts/<name> folder.
By default, if no templates are used, the fields in the details page
are rendered vertically using dd/dt/dd tags. For pages that require
different layout, a custom UI needs to be developed. There are two ways
to do that:
- write a custom widget to generate the UI dynamically
- create an HTML template and write the initialization code
For components that are quite complex or used frequently, it's might
be better to use the first method. For simple pages that are used only
in one location or need to support customization, the second method
might be preferable. Other benefits of templates:
- cleaner code and UI separation
- more flexibility in customization
- new pages can be developed quickly and require less coding
- multiple templates can be used with the same initialization code
- easier to maintain
The HBAC details page has been implemented using both methods. By
default it will use custom widgets to generate the page. To use a
custom layout, add the following parameter to the URL, then reload
the page:
&layout=<name>
Currently the only available layout is 'default' which produces the
same look as the custom widgets.
The HBAC details page is usable, but it still needs additional work.
The access time is not working yet. There is no undo button, hint,
or validation yet.
The table in the association facet has also been changed to use
ipa_association_widget which is derived from ipa_table_widget.
The Makefile has been updated to include the layouts. The unit tests
have been updated as well.
2010-11-02 20:16:55 -05:00
|
|
|
var record = {};
|
2011-05-16 22:23:20 -05:00
|
|
|
|
|
|
|
var columns = that.columns.values;
|
|
|
|
for (var i=0; i<columns.length; i++){
|
|
|
|
var name = columns[i].name;
|
2010-11-09 14:22:31 -06:00
|
|
|
var values = result[name];
|
|
|
|
if (!values) continue;
|
2011-05-16 22:23:20 -05:00
|
|
|
|
2010-10-25 18:55:57 -05:00
|
|
|
if (values instanceof Array){
|
|
|
|
record[name] = values[index];
|
|
|
|
}else{
|
|
|
|
record[name] = values;
|
|
|
|
}
|
HBAC Details Page
The UI framework has been extended to include a collection of widgets:
- ipa_widget: base class
- ipa_text_widget: text field
- ipa_radio_widget: radio button
- ipa_textarea_widget: textarea
- ipa_button_widget: button
- ipa_column_widget: column for table
- ipa_table_widget: table
These widgets can be used to create input controls. They can also be
extended to create custom controls.
The framework has also been enhanced to support custom layouts. This
can be used to change the look of the application without changing
the code. Initially this is only available in details section.
Layout consists of a collection of HTML templates. Each template is a
complete and valid HTML file representing a portion of a page. The
template will be loaded and initialized by the code, then filled with
the data from the server. The layouts are located in
install/static/layouts/<name> folder.
By default, if no templates are used, the fields in the details page
are rendered vertically using dd/dt/dd tags. For pages that require
different layout, a custom UI needs to be developed. There are two ways
to do that:
- write a custom widget to generate the UI dynamically
- create an HTML template and write the initialization code
For components that are quite complex or used frequently, it's might
be better to use the first method. For simple pages that are used only
in one location or need to support customization, the second method
might be preferable. Other benefits of templates:
- cleaner code and UI separation
- more flexibility in customization
- new pages can be developed quickly and require less coding
- multiple templates can be used with the same initialization code
- easier to maintain
The HBAC details page has been implemented using both methods. By
default it will use custom widgets to generate the page. To use a
custom layout, add the following parameter to the URL, then reload
the page:
&layout=<name>
Currently the only available layout is 'default' which produces the
same look as the custom widgets.
The HBAC details page is usable, but it still needs additional work.
The access time is not working yet. There is no undo button, hint,
or validation yet.
The table in the association facet has also been changed to use
ipa_association_widget which is derived from ipa_table_widget.
The Makefile has been updated to include the layouts. The unit tests
have been updated as well.
2010-11-02 20:16:55 -05:00
|
|
|
}
|
2011-05-16 22:23:20 -05:00
|
|
|
|
HBAC Details Page
The UI framework has been extended to include a collection of widgets:
- ipa_widget: base class
- ipa_text_widget: text field
- ipa_radio_widget: radio button
- ipa_textarea_widget: textarea
- ipa_button_widget: button
- ipa_column_widget: column for table
- ipa_table_widget: table
These widgets can be used to create input controls. They can also be
extended to create custom controls.
The framework has also been enhanced to support custom layouts. This
can be used to change the look of the application without changing
the code. Initially this is only available in details section.
Layout consists of a collection of HTML templates. Each template is a
complete and valid HTML file representing a portion of a page. The
template will be loaded and initialized by the code, then filled with
the data from the server. The layouts are located in
install/static/layouts/<name> folder.
By default, if no templates are used, the fields in the details page
are rendered vertically using dd/dt/dd tags. For pages that require
different layout, a custom UI needs to be developed. There are two ways
to do that:
- write a custom widget to generate the UI dynamically
- create an HTML template and write the initialization code
For components that are quite complex or used frequently, it's might
be better to use the first method. For simple pages that are used only
in one location or need to support customization, the second method
might be preferable. Other benefits of templates:
- cleaner code and UI separation
- more flexibility in customization
- new pages can be developed quickly and require less coding
- multiple templates can be used with the same initialization code
- easier to maintain
The HBAC details page has been implemented using both methods. By
default it will use custom widgets to generate the page. To use a
custom layout, add the following parameter to the URL, then reload
the page:
&layout=<name>
Currently the only available layout is 'default' which produces the
same look as the custom widgets.
The HBAC details page is usable, but it still needs additional work.
The access time is not working yet. There is no undo button, hint,
or validation yet.
The table in the association facet has also been changed to use
ipa_association_widget which is derived from ipa_table_widget.
The Makefile has been updated to include the layouts. The unit tests
have been updated as well.
2010-11-02 20:16:55 -05:00
|
|
|
return record;
|
|
|
|
};
|
|
|
|
|
2010-12-01 14:51:39 -06:00
|
|
|
that.add_record = function(record) {
|
HBAC Details Page
The UI framework has been extended to include a collection of widgets:
- ipa_widget: base class
- ipa_text_widget: text field
- ipa_radio_widget: radio button
- ipa_textarea_widget: textarea
- ipa_button_widget: button
- ipa_column_widget: column for table
- ipa_table_widget: table
These widgets can be used to create input controls. They can also be
extended to create custom controls.
The framework has also been enhanced to support custom layouts. This
can be used to change the look of the application without changing
the code. Initially this is only available in details section.
Layout consists of a collection of HTML templates. Each template is a
complete and valid HTML file representing a portion of a page. The
template will be loaded and initialized by the code, then filled with
the data from the server. The layouts are located in
install/static/layouts/<name> folder.
By default, if no templates are used, the fields in the details page
are rendered vertically using dd/dt/dd tags. For pages that require
different layout, a custom UI needs to be developed. There are two ways
to do that:
- write a custom widget to generate the UI dynamically
- create an HTML template and write the initialization code
For components that are quite complex or used frequently, it's might
be better to use the first method. For simple pages that are used only
in one location or need to support customization, the second method
might be preferable. Other benefits of templates:
- cleaner code and UI separation
- more flexibility in customization
- new pages can be developed quickly and require less coding
- multiple templates can be used with the same initialization code
- easier to maintain
The HBAC details page has been implemented using both methods. By
default it will use custom widgets to generate the page. To use a
custom layout, add the following parameter to the URL, then reload
the page:
&layout=<name>
Currently the only available layout is 'default' which produces the
same look as the custom widgets.
The HBAC details page is usable, but it still needs additional work.
The access time is not working yet. There is no undo button, hint,
or validation yet.
The table in the association facet has also been changed to use
ipa_association_widget which is derived from ipa_table_widget.
The Makefile has been updated to include the layouts. The unit tests
have been updated as well.
2010-11-02 20:16:55 -05:00
|
|
|
|
|
|
|
var tr = that.row.clone();
|
|
|
|
tr.appendTo(that.tbody);
|
|
|
|
|
2011-05-27 10:32:17 -05:00
|
|
|
$('input[name="select"]', tr).click(function(){
|
|
|
|
that.select_changed();
|
|
|
|
});
|
|
|
|
|
|
|
|
|
2011-05-16 22:23:20 -05:00
|
|
|
var columns = that.columns.values;
|
|
|
|
for (var i=0; i<columns.length; i++){
|
|
|
|
var column = columns[i];
|
HBAC Details Page
The UI framework has been extended to include a collection of widgets:
- ipa_widget: base class
- ipa_text_widget: text field
- ipa_radio_widget: radio button
- ipa_textarea_widget: textarea
- ipa_button_widget: button
- ipa_column_widget: column for table
- ipa_table_widget: table
These widgets can be used to create input controls. They can also be
extended to create custom controls.
The framework has also been enhanced to support custom layouts. This
can be used to change the look of the application without changing
the code. Initially this is only available in details section.
Layout consists of a collection of HTML templates. Each template is a
complete and valid HTML file representing a portion of a page. The
template will be loaded and initialized by the code, then filled with
the data from the server. The layouts are located in
install/static/layouts/<name> folder.
By default, if no templates are used, the fields in the details page
are rendered vertically using dd/dt/dd tags. For pages that require
different layout, a custom UI needs to be developed. There are two ways
to do that:
- write a custom widget to generate the UI dynamically
- create an HTML template and write the initialization code
For components that are quite complex or used frequently, it's might
be better to use the first method. For simple pages that are used only
in one location or need to support customization, the second method
might be preferable. Other benefits of templates:
- cleaner code and UI separation
- more flexibility in customization
- new pages can be developed quickly and require less coding
- multiple templates can be used with the same initialization code
- easier to maintain
The HBAC details page has been implemented using both methods. By
default it will use custom widgets to generate the page. To use a
custom layout, add the following parameter to the URL, then reload
the page:
&layout=<name>
Currently the only available layout is 'default' which produces the
same look as the custom widgets.
The HBAC details page is usable, but it still needs additional work.
The access time is not working yet. There is no undo button, hint,
or validation yet.
The table in the association facet has also been changed to use
ipa_association_widget which is derived from ipa_table_widget.
The Makefile has been updated to include the layouts. The unit tests
have been updated as well.
2010-11-02 20:16:55 -05:00
|
|
|
|
2010-11-19 23:52:33 -06:00
|
|
|
var value = record[column.name];
|
|
|
|
value = value ? value.toString() : '';
|
HBAC Details Page
The UI framework has been extended to include a collection of widgets:
- ipa_widget: base class
- ipa_text_widget: text field
- ipa_radio_widget: radio button
- ipa_textarea_widget: textarea
- ipa_button_widget: button
- ipa_column_widget: column for table
- ipa_table_widget: table
These widgets can be used to create input controls. They can also be
extended to create custom controls.
The framework has also been enhanced to support custom layouts. This
can be used to change the look of the application without changing
the code. Initially this is only available in details section.
Layout consists of a collection of HTML templates. Each template is a
complete and valid HTML file representing a portion of a page. The
template will be loaded and initialized by the code, then filled with
the data from the server. The layouts are located in
install/static/layouts/<name> folder.
By default, if no templates are used, the fields in the details page
are rendered vertically using dd/dt/dd tags. For pages that require
different layout, a custom UI needs to be developed. There are two ways
to do that:
- write a custom widget to generate the UI dynamically
- create an HTML template and write the initialization code
For components that are quite complex or used frequently, it's might
be better to use the first method. For simple pages that are used only
in one location or need to support customization, the second method
might be preferable. Other benefits of templates:
- cleaner code and UI separation
- more flexibility in customization
- new pages can be developed quickly and require less coding
- multiple templates can be used with the same initialization code
- easier to maintain
The HBAC details page has been implemented using both methods. By
default it will use custom widgets to generate the page. To use a
custom layout, add the following parameter to the URL, then reload
the page:
&layout=<name>
Currently the only available layout is 'default' which produces the
same look as the custom widgets.
The HBAC details page is usable, but it still needs additional work.
The access time is not working yet. There is no undo button, hint,
or validation yet.
The table in the association facet has also been changed to use
ipa_association_widget which is derived from ipa_table_widget.
The Makefile has been updated to include the layouts. The unit tests
have been updated as well.
2010-11-02 20:16:55 -05:00
|
|
|
|
|
|
|
if (column.primary_key) {
|
|
|
|
$('input[name="select"]', tr).val(value);
|
|
|
|
}
|
|
|
|
|
2010-11-19 23:52:33 -06:00
|
|
|
var span = $('span[name="'+column.name+'"]', tr);
|
|
|
|
|
|
|
|
column.setup(span, record);
|
HBAC Details Page
The UI framework has been extended to include a collection of widgets:
- ipa_widget: base class
- ipa_text_widget: text field
- ipa_radio_widget: radio button
- ipa_textarea_widget: textarea
- ipa_button_widget: button
- ipa_column_widget: column for table
- ipa_table_widget: table
These widgets can be used to create input controls. They can also be
extended to create custom controls.
The framework has also been enhanced to support custom layouts. This
can be used to change the look of the application without changing
the code. Initially this is only available in details section.
Layout consists of a collection of HTML templates. Each template is a
complete and valid HTML file representing a portion of a page. The
template will be loaded and initialized by the code, then filled with
the data from the server. The layouts are located in
install/static/layouts/<name> folder.
By default, if no templates are used, the fields in the details page
are rendered vertically using dd/dt/dd tags. For pages that require
different layout, a custom UI needs to be developed. There are two ways
to do that:
- write a custom widget to generate the UI dynamically
- create an HTML template and write the initialization code
For components that are quite complex or used frequently, it's might
be better to use the first method. For simple pages that are used only
in one location or need to support customization, the second method
might be preferable. Other benefits of templates:
- cleaner code and UI separation
- more flexibility in customization
- new pages can be developed quickly and require less coding
- multiple templates can be used with the same initialization code
- easier to maintain
The HBAC details page has been implemented using both methods. By
default it will use custom widgets to generate the page. To use a
custom layout, add the following parameter to the URL, then reload
the page:
&layout=<name>
Currently the only available layout is 'default' which produces the
same look as the custom widgets.
The HBAC details page is usable, but it still needs additional work.
The access time is not working yet. There is no undo button, hint,
or validation yet.
The table in the association facet has also been changed to use
ipa_association_widget which is derived from ipa_table_widget.
The Makefile has been updated to include the layouts. The unit tests
have been updated as well.
2010-11-02 20:16:55 -05:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2010-12-01 14:51:39 -06:00
|
|
|
that.add_rows = function(rows) {
|
|
|
|
for (var i=0; i<rows.length; i++) {
|
|
|
|
that.tbody.append(rows[i]);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
that.remove_selected_rows = function() {
|
|
|
|
var rows = [];
|
|
|
|
that.tbody.children().each(function() {
|
|
|
|
var tr = $(this);
|
|
|
|
if (!$('input[name="select"]', tr).get(0).checked) return;
|
|
|
|
tr.detach();
|
|
|
|
rows.push(tr);
|
|
|
|
});
|
|
|
|
return rows;
|
|
|
|
};
|
|
|
|
|
2011-01-10 20:51:09 -06:00
|
|
|
that.set_enabled = function(enabled) {
|
|
|
|
if (enabled) {
|
|
|
|
$('input[name="select"]', that.table).attr('disabled', false);
|
|
|
|
} else {
|
|
|
|
$('input[name="select"]', that.table).attr('disabled', true);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
HBAC Details Page
The UI framework has been extended to include a collection of widgets:
- ipa_widget: base class
- ipa_text_widget: text field
- ipa_radio_widget: radio button
- ipa_textarea_widget: textarea
- ipa_button_widget: button
- ipa_column_widget: column for table
- ipa_table_widget: table
These widgets can be used to create input controls. They can also be
extended to create custom controls.
The framework has also been enhanced to support custom layouts. This
can be used to change the look of the application without changing
the code. Initially this is only available in details section.
Layout consists of a collection of HTML templates. Each template is a
complete and valid HTML file representing a portion of a page. The
template will be loaded and initialized by the code, then filled with
the data from the server. The layouts are located in
install/static/layouts/<name> folder.
By default, if no templates are used, the fields in the details page
are rendered vertically using dd/dt/dd tags. For pages that require
different layout, a custom UI needs to be developed. There are two ways
to do that:
- write a custom widget to generate the UI dynamically
- create an HTML template and write the initialization code
For components that are quite complex or used frequently, it's might
be better to use the first method. For simple pages that are used only
in one location or need to support customization, the second method
might be preferable. Other benefits of templates:
- cleaner code and UI separation
- more flexibility in customization
- new pages can be developed quickly and require less coding
- multiple templates can be used with the same initialization code
- easier to maintain
The HBAC details page has been implemented using both methods. By
default it will use custom widgets to generate the page. To use a
custom layout, add the following parameter to the URL, then reload
the page:
&layout=<name>
Currently the only available layout is 'default' which produces the
same look as the custom widgets.
The HBAC details page is usable, but it still needs additional work.
The access time is not working yet. There is no undo button, hint,
or validation yet.
The table in the association facet has also been changed to use
ipa_association_widget which is derived from ipa_table_widget.
The Makefile has been updated to include the layouts. The unit tests
have been updated as well.
2010-11-02 20:16:55 -05:00
|
|
|
if (spec.columns) {
|
|
|
|
for (var i=0; i<spec.columns; i++) {
|
|
|
|
that.create_column(spec.columns[i]);
|
|
|
|
}
|
|
|
|
}
|
2010-11-04 21:42:37 -05:00
|
|
|
|
2010-11-15 11:10:55 -06:00
|
|
|
// methods that should be invoked by subclasses
|
2010-11-18 20:17:14 -06:00
|
|
|
that.table_init = that.init;
|
|
|
|
that.table_create = that.create;
|
2010-11-15 11:10:55 -06:00
|
|
|
that.table_setup = that.setup;
|
2011-01-10 20:51:09 -06:00
|
|
|
that.table_set_enabled = that.set_enabled;
|
2011-06-16 11:00:01 -05:00
|
|
|
that.table_prev_page = that.prev_page;
|
|
|
|
that.table_next_page = that.next_page;
|
|
|
|
that.table_set_page = that.set_page;
|
2010-11-15 11:10:55 -06:00
|
|
|
|
2010-11-04 21:42:37 -05:00
|
|
|
return that;
|
2011-01-14 11:16:25 -06:00
|
|
|
};
|
2011-02-02 10:35:23 -06:00
|
|
|
|
2011-07-15 12:18:59 -05:00
|
|
|
IPA.combobox_widget = function(spec) {
|
2011-02-01 12:06:58 -06:00
|
|
|
|
2011-07-15 12:18:59 -05:00
|
|
|
spec = spec || {};
|
2011-02-01 12:06:58 -06:00
|
|
|
|
2011-07-15 12:18:59 -05:00
|
|
|
var that = IPA.widget(spec);
|
2011-02-02 10:35:23 -06:00
|
|
|
|
2011-07-15 12:18:59 -05:00
|
|
|
that.editable = spec.editable;
|
|
|
|
that.searchable = spec.searchable;
|
|
|
|
that.list_size = spec.list_size || 5;
|
2011-02-01 12:06:58 -06:00
|
|
|
|
2011-02-03 21:42:50 -06:00
|
|
|
that.create = function(container) {
|
2011-02-01 12:06:58 -06:00
|
|
|
|
2011-07-15 12:18:59 -05:00
|
|
|
that.widget_create(container);
|
2011-06-18 22:22:48 -05:00
|
|
|
|
2011-07-15 12:18:59 -05:00
|
|
|
container.addClass('combobox-widget');
|
2011-07-06 14:43:50 -05:00
|
|
|
|
2011-07-15 12:18:59 -05:00
|
|
|
$(document).keyup(function(e) {
|
|
|
|
if (e.which == 27) { // Escape
|
|
|
|
that.close();
|
2011-02-01 12:06:58 -06:00
|
|
|
}
|
2011-07-15 12:18:59 -05:00
|
|
|
});
|
|
|
|
|
|
|
|
that.input_container = $('<div/>', {
|
|
|
|
'class': 'combobox-widget-input'
|
2011-02-03 21:42:50 -06:00
|
|
|
}).appendTo(container);
|
2011-02-01 12:06:58 -06:00
|
|
|
|
2011-07-15 12:18:59 -05:00
|
|
|
that.text = $('<label/>', {
|
|
|
|
name: that.name,
|
|
|
|
style: 'display: none;'
|
|
|
|
}).appendTo(that.input_container);
|
|
|
|
|
|
|
|
that.input = $('<input/>', {
|
2011-02-01 12:06:58 -06:00
|
|
|
type: 'text',
|
2011-07-15 12:18:59 -05:00
|
|
|
name: that.name,
|
|
|
|
title: that.tooltip,
|
|
|
|
readonly: !that.editable,
|
|
|
|
keyup: function() {
|
|
|
|
that.validate();
|
|
|
|
},
|
|
|
|
click: function() {
|
|
|
|
if (that.editable) return false;
|
|
|
|
if (that.is_open()) {
|
|
|
|
that.close();
|
|
|
|
} else {
|
|
|
|
that.open();
|
|
|
|
}
|
|
|
|
return false;
|
2011-02-01 12:06:58 -06:00
|
|
|
}
|
2011-07-15 12:18:59 -05:00
|
|
|
}).appendTo(that.input_container);
|
2011-02-01 12:06:58 -06:00
|
|
|
|
2011-07-15 12:18:59 -05:00
|
|
|
that.open_button = IPA.action_button({
|
|
|
|
name: 'open',
|
|
|
|
icon: 'combobox-icon',
|
2011-02-03 21:42:50 -06:00
|
|
|
click: function() {
|
2011-07-15 12:18:59 -05:00
|
|
|
if (that.is_open()) {
|
|
|
|
that.close();
|
|
|
|
} else {
|
|
|
|
that.open();
|
|
|
|
}
|
2011-02-01 12:06:58 -06:00
|
|
|
return false;
|
|
|
|
}
|
2011-07-15 12:18:59 -05:00
|
|
|
}).appendTo(that.input_container);
|
|
|
|
|
|
|
|
that.list_container = $('<div/>', {
|
|
|
|
'class': 'combobox-widget-list'
|
|
|
|
}).appendTo(that.input_container);
|
|
|
|
|
|
|
|
var div = $('<div/>', {
|
|
|
|
style: 'position: relative; width: 100%;'
|
|
|
|
}).appendTo(that.list_container);
|
|
|
|
|
|
|
|
if (that.searchable) {
|
|
|
|
that.filter = $('<input/>', {
|
|
|
|
type: 'text',
|
|
|
|
name: 'filter',
|
|
|
|
keypress: function(e) {
|
|
|
|
if (e.which == 13) { // Enter
|
|
|
|
that.search();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}).appendTo(div);
|
|
|
|
|
|
|
|
that.search_button = IPA.action_button({
|
|
|
|
name: 'search',
|
|
|
|
icon: 'search-icon',
|
|
|
|
click: function() {
|
|
|
|
that.search();
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}).appendTo(div);
|
|
|
|
|
|
|
|
div.append('<br/>');
|
|
|
|
}
|
|
|
|
|
|
|
|
that.list = $('<select/>', {
|
|
|
|
name: 'list',
|
|
|
|
size: that.list_size,
|
|
|
|
style: 'width: 100%',
|
|
|
|
click: function(){
|
|
|
|
that.close();
|
|
|
|
var value = $('option:selected', that.list).val();
|
|
|
|
that.input.val(value);
|
|
|
|
IPA.select_range(that.input, 0, 0);
|
|
|
|
|
|
|
|
that.validate();
|
|
|
|
that.set_dirty(that.test_dirty());
|
|
|
|
}
|
|
|
|
}).appendTo(div);
|
2011-02-01 13:55:55 -06:00
|
|
|
|
|
|
|
if (that.undo) {
|
2011-07-15 12:18:59 -05:00
|
|
|
container.append(' ');
|
2011-02-03 21:42:50 -06:00
|
|
|
that.create_undo(container);
|
2011-07-15 12:18:59 -05:00
|
|
|
|
|
|
|
var undo = that.get_undo();
|
|
|
|
undo.click(function() {
|
|
|
|
that.reset();
|
|
|
|
});
|
2011-02-01 13:55:55 -06:00
|
|
|
}
|
|
|
|
|
2011-07-15 12:18:59 -05:00
|
|
|
that.create_error_link(container);
|
|
|
|
|
|
|
|
that.search();
|
2011-02-01 12:06:58 -06:00
|
|
|
};
|
2011-02-03 21:42:50 -06:00
|
|
|
|
2011-07-15 12:18:59 -05:00
|
|
|
that.open = function() {
|
|
|
|
that.list_container.css('visibility', 'visible');
|
2011-02-01 12:06:58 -06:00
|
|
|
};
|
|
|
|
|
2011-07-15 12:18:59 -05:00
|
|
|
that.close = function() {
|
|
|
|
that.list_container.css('visibility', 'hidden');
|
2011-02-01 12:06:58 -06:00
|
|
|
};
|
|
|
|
|
2011-07-15 12:18:59 -05:00
|
|
|
that.is_open = function() {
|
|
|
|
return that.list_container.css('visibility') == 'visible';
|
|
|
|
};
|
|
|
|
|
|
|
|
that.search = function() {
|
|
|
|
};
|
|
|
|
|
|
|
|
that.update = function() {
|
|
|
|
that.close();
|
|
|
|
if (that.writable) {
|
|
|
|
that.text.css('display', 'none');
|
|
|
|
that.input.css('display', 'inline');
|
|
|
|
that.input.val(that.values[0]);
|
|
|
|
that.open_button.css('display', 'inline');
|
|
|
|
} else {
|
|
|
|
that.text.css('display', 'inline');
|
|
|
|
that.text.html(that.values[0]);
|
|
|
|
that.input.css('display', 'none');
|
|
|
|
that.open_button.css('display', 'none');
|
|
|
|
that.input.val(that.values[0]);
|
2011-06-18 22:22:48 -05:00
|
|
|
}
|
2011-07-15 12:18:59 -05:00
|
|
|
if (that.searchable) {
|
|
|
|
that.filter.empty();
|
|
|
|
that.search();
|
|
|
|
}
|
|
|
|
};
|
2011-06-18 22:22:48 -05:00
|
|
|
|
2011-02-03 21:42:50 -06:00
|
|
|
that.save = function() {
|
2011-07-15 12:18:59 -05:00
|
|
|
var value = that.input.val();
|
|
|
|
return value === '' ? [] : [value];
|
|
|
|
};
|
|
|
|
|
|
|
|
that.create_option = function(text, value) {
|
|
|
|
return $('<option/>', {
|
|
|
|
text: text,
|
|
|
|
value: value
|
|
|
|
}).appendTo(that.list);
|
|
|
|
};
|
|
|
|
|
|
|
|
that.remove_options = function() {
|
|
|
|
that.list.empty();
|
|
|
|
};
|
|
|
|
|
|
|
|
return that;
|
|
|
|
};
|
|
|
|
|
|
|
|
IPA.entity_select_widget = function(spec) {
|
|
|
|
|
|
|
|
spec = spec || {};
|
|
|
|
spec.searchable = spec.searchable === undefined ? true : spec.searchable;
|
|
|
|
|
|
|
|
var that = IPA.combobox_widget(spec);
|
|
|
|
|
|
|
|
that.other_entity = spec.other_entity;
|
|
|
|
that.other_field = spec.other_field;
|
|
|
|
|
2011-07-18 11:42:22 -05:00
|
|
|
that.create_search_command = function() {
|
|
|
|
return IPA.command({
|
2011-07-15 12:18:59 -05:00
|
|
|
entity: that.other_entity,
|
|
|
|
method: 'find',
|
2011-07-18 11:42:22 -05:00
|
|
|
args: [that.filter.val()]
|
2011-07-15 12:18:59 -05:00
|
|
|
});
|
2011-07-18 11:42:22 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
that.search = function() {
|
|
|
|
|
|
|
|
var command = that.create_search_command();
|
2011-07-15 12:18:59 -05:00
|
|
|
|
|
|
|
command.on_success = function(data, text_status, xhr) {
|
|
|
|
|
|
|
|
that.remove_options();
|
|
|
|
|
|
|
|
that.create_option();
|
|
|
|
|
2011-07-18 11:42:22 -05:00
|
|
|
var filter = that.filter.val();
|
2011-07-15 12:18:59 -05:00
|
|
|
var entries = data.result.result;
|
|
|
|
for (var i=0; i<data.result.count; i++) {
|
|
|
|
var entry = entries[i];
|
|
|
|
var values = entry[that.other_field];
|
|
|
|
var value = values[0];
|
|
|
|
|
|
|
|
var option = that.create_option(value, value);
|
|
|
|
|
|
|
|
if (filter === value) {
|
|
|
|
option.attr('selected', 'selected');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
that.set_dirty(that.test_dirty());
|
|
|
|
};
|
|
|
|
|
|
|
|
command.execute();
|
2011-02-01 12:06:58 -06:00
|
|
|
};
|
|
|
|
|
|
|
|
return that;
|
2011-03-29 06:24:06 -05:00
|
|
|
};
|
2011-06-30 16:38:59 -05:00
|
|
|
|
|
|
|
IPA.entity_link_widget = function(spec) {
|
|
|
|
var that = IPA.widget(spec);
|
2011-07-08 11:06:30 -05:00
|
|
|
var other_entity = spec.other_entity;
|
|
|
|
|
|
|
|
function other_pkeys (){
|
|
|
|
return that.entity.get_primary_key();
|
|
|
|
}
|
|
|
|
that.other_pkeys = spec.other_pkeys || other_pkeys;
|
2011-06-30 16:38:59 -05:00
|
|
|
|
|
|
|
that.create = function(container) {
|
2011-07-15 12:18:59 -05:00
|
|
|
that.widget_create(container);
|
2011-06-30 16:38:59 -05:00
|
|
|
that.link =
|
|
|
|
$('<a/>', {
|
|
|
|
href: 'jslink',
|
|
|
|
title: '',
|
|
|
|
html: '',
|
|
|
|
click: function() {
|
2011-07-08 11:06:30 -05:00
|
|
|
IPA.nav.show_entity_page(
|
|
|
|
IPA.get_entity(other_entity),
|
|
|
|
'default',
|
|
|
|
that.other_pkeys());
|
2011-06-30 16:38:59 -05:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}).appendTo(container);
|
|
|
|
|
2011-07-08 11:06:30 -05:00
|
|
|
that.nonlink = $('<label/>').
|
2011-06-30 16:38:59 -05:00
|
|
|
appendTo(container);
|
|
|
|
};
|
|
|
|
|
2011-07-08 11:06:30 -05:00
|
|
|
that.load = function (record){
|
2011-07-15 12:18:59 -05:00
|
|
|
that.widget_load(record);
|
2011-06-30 16:38:59 -05:00
|
|
|
if (that.values || that.values.length > 0){
|
2011-07-08 11:06:30 -05:00
|
|
|
that.nonlink.html(that.values[0]);
|
|
|
|
that.link.html(that.values[0]);
|
|
|
|
that.link.css('display','none');
|
|
|
|
that.nonlink.css('display','inline');
|
2011-06-30 16:38:59 -05:00
|
|
|
}else{
|
|
|
|
that.link.html('');
|
2011-07-08 11:06:30 -05:00
|
|
|
that.nonlink.html('');
|
2011-06-30 16:38:59 -05:00
|
|
|
that.link.css('display','none');
|
2011-07-08 11:06:30 -05:00
|
|
|
that.nonlink.css('display','none');
|
|
|
|
}
|
|
|
|
|
|
|
|
function find_success(result) {
|
|
|
|
if (result.result){
|
|
|
|
that.link.css('display','inline');
|
|
|
|
that.nonlink.css('display','none');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
function find_error(err){
|
2011-06-30 16:38:59 -05:00
|
|
|
}
|
2011-07-08 11:06:30 -05:00
|
|
|
IPA.command({
|
|
|
|
entity: other_entity,
|
|
|
|
method: 'show',
|
|
|
|
args:that.other_pkeys(),
|
|
|
|
options:{},
|
|
|
|
retry:false,
|
|
|
|
on_success:find_success,
|
|
|
|
on_error:find_error
|
|
|
|
}).execute();
|
2011-06-30 16:38:59 -05:00
|
|
|
};
|
|
|
|
|
2011-07-08 11:06:30 -05:00
|
|
|
|
2011-06-30 16:38:59 -05:00
|
|
|
return that;
|
|
|
|
};
|