summaryrefslogtreecommitdiffstats
path: root/install/ui
diff options
context:
space:
mode:
authorEndi S. Dewata <edewata@redhat.com>2011-09-27 09:28:14 -0500
committerMartin Kosek <mkosek@redhat.com>2011-10-05 14:51:50 +0200
commitfe8aeef30773739fe7b17e3c152be5ce858ef9f6 (patch)
treec56212d6214a62f3fb81114e0bb77fac4b10d552 /install/ui
parentf93d71409aa78c4e5c860405cdcc3bc6ffc49280 (diff)
downloadfreeipa-fe8aeef30773739fe7b17e3c152be5ce858ef9f6.tar.gz
freeipa-fe8aeef30773739fe7b17e3c152be5ce858ef9f6.tar.xz
freeipa-fe8aeef30773739fe7b17e3c152be5ce858ef9f6.zip
Added confirmation when adding multiple entries.
The adder dialog has been modified to show a confirmation message after each successful addition. Ticket #1786
Diffstat (limited to 'install/ui')
-rw-r--r--install/ui/aci.js2
-rw-r--r--install/ui/add.js9
-rw-r--r--install/ui/dialog.js16
-rw-r--r--install/ui/dns.js8
-rw-r--r--install/ui/host.js2
-rw-r--r--install/ui/ipa.css33
-rw-r--r--install/ui/policy.js2
-rw-r--r--install/ui/service.js2
-rw-r--r--install/ui/test/data/ipa_init.json1
9 files changed, 56 insertions, 19 deletions
diff --git a/install/ui/aci.js b/install/ui/aci.js
index caed44baa..8dcb540b6 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 5a4537ba3..17418aaba 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 d291120ea..b55cce715 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 ea09e227c..60505d999 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 007d20387..758008892 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 a59df0b3d..8ae9a5f34 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 ac9eb20f7..ecda339bb 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 7db8a6657..912642982 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 292e80df2..b7ea2d973 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.",