The adder dialog has been modified to show a confirmation message after each successful addition.
Ticket #1786 -- Endi S. Dewata
From 1d56e6010e36abc14adfb8b20a1b87d5deaf11c8 Mon Sep 17 00:00:00 2001 From: Endi S. Dewata <edew...@redhat.com> Date: Tue, 27 Sep 2011 09:28:14 -0500 Subject: [PATCH] Added confirmation when adding multiple entries. The adder dialog has been modified to show a confirmation message after each successful addition. Ticket #1786 --- install/ui/aci.js | 2 +- install/ui/add.js | 9 +++++++++ install/ui/dialog.js | 16 +++++++++++++--- install/ui/dns.js | 8 ++++++++ install/ui/host.js | 2 +- install/ui/ipa.css | 33 +++++++++++++++++++++------------ install/ui/policy.js | 2 +- install/ui/test/data/ipa_init.json | 1 + ipalib/plugins/internal.py | 1 + 9 files changed, 56 insertions(+), 18 deletions(-) diff --git a/install/ui/aci.js b/install/ui/aci.js index 676f5df3e63032dd6c6f32279314545608fbcc28..a2ed76ac6c719df543e1046d07f79ef6619a94e7 100644 --- a/install/ui/aci.js +++ b/install/ui/aci.js @@ -64,7 +64,7 @@ IPA.entity_factories.permission = function() { }). adder_dialog({ width: 500, - height: 400, + height: 450, sections: [ { name: 'general', diff --git a/install/ui/add.js b/install/ui/add.js index 21707df13a553586e7610a42fd038aecdad344ff..1d229fd57fe0ceddbeae8a1a22e8858f6e2f2b3a 100644 --- a/install/ui/add.js +++ b/install/ui/add.js @@ -112,6 +112,7 @@ IPA.add_dialog = function (spec) { /*dialog initialization*/ that.add_button(IPA.messages.buttons.add, function() { + that.hide_message(); that.add( function(data, text_status, xhr) { var facet = IPA.current_entity.get_facet(); @@ -123,8 +124,14 @@ IPA.add_dialog = function (spec) { }); that.add_button(IPA.messages.buttons.add_and_add_another, function() { + that.hide_message(); that.add( function(data, text_status, xhr) { + var label = that.entity.metadata.label_singular; + var message = IPA.messages.dialogs.add_confirmation; + message = message.replace('${entity}', label); + that.show_message(message); + var facet = IPA.current_entity.get_facet(); var table = facet.table; table.refresh(); @@ -134,6 +141,7 @@ IPA.add_dialog = function (spec) { }); that.add_button(IPA.messages.buttons.add_and_edit, function() { + that.hide_message(); that.add( function(data, text_status, xhr) { that.close(); @@ -144,6 +152,7 @@ IPA.add_dialog = function (spec) { }); that.add_button(IPA.messages.buttons.cancel, function() { + that.hide_message(); that.close(); }); diff --git a/install/ui/dialog.js b/install/ui/dialog.js index f594a6c27fdce960de8d5f5a478d65f9d16e76a5..81cf3f6828e7a64a9b4a50b6f53fe998e93584b1 100644 --- a/install/ui/dialog.js +++ b/install/ui/dialog.js @@ -80,11 +80,8 @@ IPA.dialog = function(spec) { }; that.add_field = function(field) { - field.dialog = that; - var section = that.get_section(); section.add_field(field); - return field; }; @@ -145,6 +142,11 @@ IPA.dialog = function(spec) { */ that.create = function() { + that.message_container = $('<div/>', { + style: 'display: none', + 'class': 'dialog-message ui-state-highlight ui-corner-all' + }).appendTo(that.container); + var sections = that.sections.values; for (var i=0; i<sections.length; i++) { var section = sections[i]; @@ -159,6 +161,14 @@ IPA.dialog = function(spec) { }; + that.show_message = function(message) { + that.message_container.text(message); + that.message_container.css('display', ''); + }; + + that.hide_message = function() { + that.message_container.css('display', 'none'); + }; /** * Open dialog diff --git a/install/ui/dns.js b/install/ui/dns.js index f823523a07d0429bac2e4b3dcd0532905def858a..5513e8ea5d9a5af861a459f2435f85eea064959b 100644 --- a/install/ui/dns.js +++ b/install/ui/dns.js @@ -232,6 +232,9 @@ IPA.dnszone_details_facet = function(spec) { return that; }; +// TODO: Remove the custom create() by moving the fields into sections. +// The idnsname and name_from_ip should be moved into a custom section. +// The idnssoamname, idnssoarname, and force into a standard section. IPA.dnszone_adder_dialog = function(spec) { spec = spec || {}; @@ -242,6 +245,11 @@ IPA.dnszone_adder_dialog = function(spec) { that.container.addClass('dnszone-adder-dialog'); + that.message_container = $('<div/>', { + style: 'display: none', + 'class': 'dialog-message ui-state-highlight ui-corner-all' + }).appendTo(that.container); + var table = $('<table/>').appendTo(that.container); var field = that.get_field('idnsname'); diff --git a/install/ui/host.js b/install/ui/host.js index 6c5b44392838045c02f38bd97b0baa15b607928e..b6eb1a38c43949d1d3ef516c88a91c1a9f6d2a1d 100644 --- a/install/ui/host.js +++ b/install/ui/host.js @@ -121,7 +121,7 @@ IPA.entity_factories.host = function () { adder_dialog({ factory: IPA.host_adder_dialog, width: 400, - height: 250, + height: 300, sections: [ { factory: IPA.host_fqdn_section, diff --git a/install/ui/ipa.css b/install/ui/ipa.css index a838195c042ed0e236306e3a15a241c141152a48..69f725310ffa300e95b3a08f636763310427adb8 100644 --- a/install/ui/ipa.css +++ b/install/ui/ipa.css @@ -272,7 +272,7 @@ div.tabs { .tabs1 > .ui-tabs-nav li { -moz-border-radius: 0 !important; - -webkit-border-radius: 0 !important; + -webkit-border-radius: 0 !important; background-image: url("Mainnav-offtab.png"); margin: 0 0.4em 0 0; border-width: 0; @@ -289,7 +289,7 @@ div.tabs { .tabs1 > .ui-tabs-nav > li > a { -moz-border-radius: 0 !important; - -webkit-border-radius: 0 !important; + -webkit-border-radius: 0 !important; font-family: "Overpass Bold","Liberation Sans", Arial, sans-serif; width: 5em; height: 20px; @@ -629,7 +629,7 @@ span.main-nav-off > a:visited { float: right; width: 215px; -moz-border-radius: 15px !important; - -webkit-border-radius: 15px !important; + -webkit-border-radius: 15px !important; border-radius: 15px !important; border: 1px solid #9f9e9e; background: url("search-bg.png"); @@ -653,10 +653,10 @@ span.main-nav-off > a:visited { .search-controls { -moz-border-radius: .7em .7em 0 0; - -webkit-border-radius: .7em .7em 0 0; + -webkit-border-radius: .7em .7em 0 0; height:2.5em; background: -moz-linear-gradient(top, #eeeeee, #dfdfdf); - background: -webkit-gradient(linear, left top, left bottom, from(#eeeeee), to(#dfdfdf)); + background: -webkit-gradient(linear, left top, left bottom, from(#eeeeee), to(#dfdfdf)); position: relative; padding: 1em 1.5em; margin-top: .8em; @@ -913,6 +913,15 @@ a, .ui-widget-content a { } */ +.dialog-message { + margin: 5px 5px 10px; + padding: 10px; + -moz-border-radius: 5px; + -webkit-border-radius: 5px; + border-radius: 5px; + text-align: center; +} + .ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: "Liberation Sans", Arial, sans-serif; @@ -922,13 +931,13 @@ a, .ui-widget-content a { .ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default, #content .ui-state-default { -moz-border-radius: .3em; - -webkit-border-radius: .3em; - background: -moz-linear-gradient(top, #959595, #5e5e5e); - background: -webkit-gradient(linear, left top, left bottom, from(#959595), to(#5e5e5e)); - border: 1px solid #777777; - color: #fff; - font-weight: normal; - padding: 0.4em 1em; + -webkit-border-radius: .3em; + background: -moz-linear-gradient(top, #959595, #5e5e5e); + background: -webkit-gradient(linear, left top, left bottom, from(#959595), to(#5e5e5e)); + border: 1px solid #777777; + color: #fff; + font-weight: normal; + padding: 0.4em 1em; } [title=">>"] { diff --git a/install/ui/policy.js b/install/ui/policy.js index 4c4733dc0529c5440eae2db3c941a8018cada99c..7c473de7a40d8cadcb0e5bdf608d187dea36f6f3 100644 --- a/install/ui/policy.js +++ b/install/ui/policy.js @@ -53,7 +53,7 @@ IPA.entity_factories.pwpolicy = function() { }, 'cospriority'], width: 400, - height: 250 + height: 300 }). build(); }; diff --git a/install/ui/test/data/ipa_init.json b/install/ui/test/data/ipa_init.json index 96339a8490c96ece4a9ebb7ff50906a98fe453e6..5de6525edef0a4057729fe1d5a53139dae78efd6 100644 --- a/install/ui/test/data/ipa_init.json +++ b/install/ui/test/data/ipa_init.json @@ -16761,6 +16761,7 @@ "to_top": "Back to Top" }, "dialogs": { + "add_confirmation": "${entity} successfully added", "add_title": "Add ${entity}", "available": "Available", "batch_error_message": "Some operations failed.", diff --git a/ipalib/plugins/internal.py b/ipalib/plugins/internal.py index b87fa27a38785f9a8034dafafd02f3ddda900173..b973e5f637e849523f4ab75d418f1166749592ee 100644 --- a/ipalib/plugins/internal.py +++ b/ipalib/plugins/internal.py @@ -156,6 +156,7 @@ class i18n_messages(Command): "to_top": _("Back to Top") }, "dialogs": { + "add_confirmation": _("${entity} successfully added"), "add_title": _("Add ${entity}"), "available": _("Available"), "batch_error_message": _("Some operations failed."), -- 1.7.5.1
_______________________________________________ Freeipa-devel mailing list Freeipa-devel@redhat.com https://www.redhat.com/mailman/listinfo/freeipa-devel