From 3844bebbd6b392765550e2cdfdbc20f86aa84a5c Mon Sep 17 00:00:00 2001 From: Endi S. Dewata Date: Thu, 6 Jan 2011 21:16:05 +0700 Subject: [PATCH] Fixed tooltips in SUDO details page. The title attribute in various HTML elements in SUDO details page has been set to show the proper tooltips. Most of the values are taken from the 'doc' attribute of sudorule parameters. --- install/static/details.js | 10 ++-- install/static/rule.js | 14 ++++- install/static/sudorule.js | 126 ++++++++++++++++++++++++++++++++++++------- 3 files changed, 123 insertions(+), 27 deletions(-) diff --git a/install/static/details.js b/install/static/details.js index 61c5579690897453daf440c4943b33c706bca531..7dfc0043054033242ea1fa03c65f52dbe379a11b 100644 --- a/install/static/details.js +++ b/install/static/details.js @@ -475,8 +475,9 @@ function ipa_details_facet(spec) { var section = that.sections[i]; $('

', { - 'name': section.name, - 'html': that.get_section_header_prefix(true) + ' ' + section.label + name: section.name, + title: section.label, + html: that.get_section_header_prefix(true) + ' ' + section.label }).appendTo(details); var div = $('
', { @@ -579,8 +580,9 @@ function ipa_button(spec) { spec = spec || {}; var button = $('', { - 'id': spec.id, - 'html': spec.label, + id: spec.id, + html: spec.label, + title: spec.title || spec.label, 'class': 'ui-state-default ui-corner-all input_link' }); diff --git a/install/static/rule.js b/install/static/rule.js index 885edaa0a649202a655ad675abeaa885b7be8cb8..96b5ab338645f316b5f8b945e3c71b808d444a69 100755 --- a/install/static/rule.js +++ b/install/static/rule.js @@ -38,7 +38,12 @@ function ipa_rule_details_section(spec){ if (that.text) container.append(that.text); - var span = $('', { 'name': that.field_name }).appendTo(container); + var param_info = ipa_get_param_info(that.entity_name, that.field_name); + + var span = $('', { + name: that.field_name, + title: param_info.doc + }).appendTo(container); if (that.options.length) { for (var i=0; i', { 'name': table.field_name }).appendTo(span); + param_info = ipa_get_param_info(that.entity_name, table.field_name); + + var table_span = $('', { + name: table.field_name, + title: param_info ? param_info.doc : table.field_name + }).appendTo(span); var field = that.get_field(table.field_name); field.create(table_span); diff --git a/install/static/sudorule.js b/install/static/sudorule.js index bc1ba95bfc7476b95fb329103010fe85a8e30206..ec90bf618d731fc1581ff1de1c9449d36c7e2959 100755 --- a/install/static/sudorule.js +++ b/install/static/sudorule.js @@ -435,16 +435,22 @@ function ipa_sudorule_details_general_section(spec){ 'style': 'width: 100%;' }).appendTo(container); + var param_info = ipa_get_param_info(that.entity_name, 'cn'); + var tr = $('').appendTo(table); var td = $('', { - 'style': 'width: 100px; text-align: right;', - 'html': 'Name:' + style: 'width: 100px; text-align: right;', + html: param_info.label+':', + title: param_info ? param_info.doc : 'cn' }).appendTo(tr); td = $('').appendTo(tr); - var span = $('', { 'name': 'cn' }).appendTo(td); + var span = $('', { + name: 'cn', + title: param_info ? param_info.doc : 'cn' + }).appendTo(td); $('', { 'type': 'text', @@ -461,16 +467,22 @@ function ipa_sudorule_details_general_section(spec){ 'html': 'undo' }).appendTo(span); + param_info = ipa_get_param_info(that.entity_name, 'description'); + tr = $('').appendTo(table); td = $('', { - 'style': 'text-align: right; vertical-align: top;', - 'html': 'Description:' + style: 'text-align: right; vertical-align: top;', + html: param_info.label+':', + title: param_info ? param_info.doc : 'description' }).appendTo(tr); td = $('').appendTo(tr); - span = $('', { 'name': 'description' }).appendTo(td); + span = $('', { + name: 'description', + title: param_info ? param_info.doc : 'description' + }).appendTo(td); $('