On 9/27/2011 6:05 PM, Endi Sukma Dewata wrote:
On 9/27/2011 4:01 PM, Endi Sukma Dewata wrote:
The adder dialog has been modified to show a confirmation message
after each successful addition.
Ticket #1786
Rebased on top of 286 (because 286 needs to go to ipa-2-1 branch).
Rebased on top of 292.
--
Endi S. Dewata
From a4e93465ca04b932d9f0a410bd217262d2846e81 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/service.js | 2 +-
install/ui/test/data/ipa_init.json | 1 +
ipalib/plugins/internal.py | 1 +
10 files changed, 57 insertions(+), 19 deletions(-)
diff --git a/install/ui/aci.js b/install/ui/aci.js
index caed44baa2d640d61f5dc7d8131afa6e780d69a3..8dcb540b6a030222136e95d5d01b5a11c29acd7f 100644
--- a/install/ui/aci.js
+++ b/install/ui/aci.js
@@ -63,7 +63,7 @@ IPA.entity_factories.permission = function() {
facet_group: 'privilege'
}).
adder_dialog({
- height: 400,
+ height: 450,
sections: [
{
name: 'general',
diff --git a/install/ui/add.js b/install/ui/add.js
index 5a4537ba3c310d27e60a588645dcd49add66f7c2..17418aaba4f0fe623483323a13c3d5cd608f4c71 100644
--- a/install/ui/add.js
+++ b/install/ui/add.js
@@ -115,6 +115,7 @@ IPA.add_dialog = function (spec) {
name: 'add',
label: IPA.messages.buttons.add,
click: function() {
+ that.hide_message();
that.add(
function(data, text_status, xhr) {
var facet = IPA.current_entity.get_facet();
@@ -130,8 +131,14 @@ IPA.add_dialog = function (spec) {
name: 'add_and_add_another',
label: IPA.messages.buttons.add_and_add_another,
click: 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();
@@ -145,6 +152,7 @@ IPA.add_dialog = function (spec) {
name: 'add_and_edit',
label: IPA.messages.buttons.add_and_edit,
click: function() {
+ that.hide_message();
that.add(
function(data, text_status, xhr) {
that.close();
@@ -159,6 +167,7 @@ IPA.add_dialog = function (spec) {
name: 'cancel',
label: IPA.messages.buttons.cancel,
click: function() {
+ that.hide_message();
that.close();
}
});
diff --git a/install/ui/dialog.js b/install/ui/dialog.js
index d291120eadfb4057f5afe356639bee5994d96649..b55cce715d9ba16b9062378603b4210301012872 100644
--- a/install/ui/dialog.js
+++ b/install/ui/dialog.js
@@ -119,11 +119,8 @@ IPA.dialog = function(spec) {
};
that.add_field = function(field) {
- field.dialog = that;
-
var section = that.get_section();
section.add_field(field);
-
return field;
};
@@ -184,6 +181,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];
@@ -198,6 +200,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 ea09e227c8b0a0ed0fc45441adb00b86a8b7b5ee..60505d999d78b8d22331b2a01cb0543cc613f548 100644
--- a/install/ui/dns.js
+++ b/install/ui/dns.js
@@ -231,6 +231,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 || {};
@@ -241,6 +244,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 007d203870eda44a60a41cf7a094f16a31777ee1..758008892e3ba09380f241142418fc0b96e4f064 100644
--- a/install/ui/host.js
+++ b/install/ui/host.js
@@ -120,7 +120,7 @@ IPA.entity_factories.host = function () {
standard_association_facets().
adder_dialog({
factory: IPA.host_adder_dialog,
- height: 250,
+ height: 300,
sections: [
{
factory: IPA.host_fqdn_section,
diff --git a/install/ui/ipa.css b/install/ui/ipa.css
index a59df0b3d2b5f3dd0891d6c0ed6d310e52565f60..8ae9a5f3409cc99e13c87888f837bdd89c744478 100644
--- a/install/ui/ipa.css
+++ b/install/ui/ipa.css
@@ -279,7 +279,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;
@@ -296,7 +296,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;
min-width: 5em;
height: 20px;
@@ -636,7 +636,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");
@@ -660,10 +660,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;
@@ -922,6 +922,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;
@@ -931,13 +940,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 ac9eb20f71d0e6765aaa069fbae27304018511a4..ecda339bbb2d7616fd955a8697385c9d69d7cac1 100644
--- a/install/ui/policy.js
+++ b/install/ui/policy.js
@@ -52,7 +52,7 @@ IPA.entity_factories.pwpolicy = function() {
other_field: 'cn'
},
'cospriority'],
- height: 250
+ height: 300
}).
build();
};
diff --git a/install/ui/service.js b/install/ui/service.js
index 7db8a665760fe6a5f3812191d65375404fc887a8..912642982ed24eb24c16c165ce5f308ba715a8d5 100644
--- a/install/ui/service.js
+++ b/install/ui/service.js
@@ -71,7 +71,7 @@ IPA.entity_factories.service = function() {
standard_association_facets().
adder_dialog({
factory: IPA.service_add_dialog,
- height: 300
+ height: 350
}).
build();
};
diff --git a/install/ui/test/data/ipa_init.json b/install/ui/test/data/ipa_init.json
index 292e80df2f343927da3cac14cfdde4e3bc6e500d..b7ea2d973611d73353449b148c0cd931f16ae0be 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 ce6f2548965846eb1f28ccf1814902958b4f5a26..76a123dccef61b7b8dd45286093d7be21ef06e70 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