From a2df8385c36f166d65a447aab4e081961abad5a2 Mon Sep 17 00:00:00 2001 From: Guilhem Moulin Date: Sun, 9 Sep 2012 03:14:41 +0200 Subject: Adding a "Cancel" button. --- lib/FPanel/Interface.pm | 12 ++++++++++-- template/add-alias.html | 3 ++- template/add-list.html | 3 ++- template/add-mailbox.html | 3 ++- template/edit-alias.html | 3 ++- template/edit-domain.html | 3 ++- template/edit-list.html | 5 +++-- template/edit-mailbox.html | 3 ++- template/list-domains.html | 2 +- 9 files changed, 26 insertions(+), 11 deletions(-) diff --git a/lib/FPanel/Interface.pm b/lib/FPanel/Interface.pm index 8087cb9..053e1a2 100644 --- a/lib/FPanel/Interface.pm +++ b/lib/FPanel/Interface.pm @@ -149,9 +149,12 @@ sub EditDomain : Runmode { my ($ul,$ud) = split /\@/, $self->authen->username, 2; my $d = (split /\//, $ENV{PATH_INFO}, 3)[1]; - my $fp = Fripost::Schema::->SASLauth( $self->authen->username, %CFG ); my $q = $self->query; + return $self->redirect($q->url .'/') if defined $q->param('cancel'); + + my $fp = Fripost::Schema::->SASLauth( $self->authen->username, %CFG ); + my $error; # Tells whether the change submission has failed. if (defined $q->param('submit')) { # Changes have been submitted: process them @@ -200,9 +203,12 @@ sub EditLocal : Runmode { my ($ul,$ud) = split /\@/, $self->authen->username, 2; my ($null,$d,$l,$crap) = split /\//, $ENV{PATH_INFO}, 4; - my $fp = Fripost::Schema::->SASLauth( $self->authen->username, %CFG ); my $q = $self->query; + return $self->redirect($q->url.'/'.$d.'/') if defined $q->param('cancel'); + + my $fp = Fripost::Schema::->SASLauth( $self->authen->username, %CFG ); + my $error; # Tells whether the change submission has failed. if (defined $q->param('submit')) { # Changes have been submitted: process them @@ -330,6 +336,8 @@ sub AddLocal : Runmode { my $d = (split /\//, $ENV{PATH_INFO}, 3)[1]; my $q = $self->query; + return $self->redirect($q->url.'/'.$d.'/') if defined $q->param('cancel'); + my $t = $q->param('t') // die "Undefined type"; my $error; # Tells whether the change submission has failed. if (defined $q->param('submit')) { diff --git a/template/add-alias.html b/template/add-alias.html index 0055012..c3146ea 100644 --- a/template/add-alias.html +++ b/template/add-alias.html @@ -76,7 +76,8 @@
- + + diff --git a/template/add-list.html b/template/add-list.html index bfe56a9..2ce179c 100644 --- a/template/add-list.html +++ b/template/add-list.html @@ -83,7 +83,8 @@
- + + diff --git a/template/add-mailbox.html b/template/add-mailbox.html index fd7e521..4079da0 100644 --- a/template/add-mailbox.html +++ b/template/add-mailbox.html @@ -93,7 +93,8 @@
- + + diff --git a/template/edit-alias.html b/template/edit-alias.html index 4390652..7539496 100644 --- a/template/edit-alias.html +++ b/template/edit-alias.html @@ -78,7 +78,8 @@
- + + diff --git a/template/edit-domain.html b/template/edit-domain.html index 7e8ba2c..8e2ada3 100644 --- a/template/edit-domain.html +++ b/template/edit-domain.html @@ -80,7 +80,8 @@
- + + diff --git a/template/edit-list.html b/template/edit-list.html index d07f9da..edcdd3f 100644 --- a/template/edit-list.html +++ b/template/edit-list.html @@ -25,7 +25,7 @@ -
+
Your changes have succesfully been submitted.
@@ -65,7 +65,8 @@
- + + diff --git a/template/edit-mailbox.html b/template/edit-mailbox.html index 3dce6e7..ed84558 100644 --- a/template/edit-mailbox.html +++ b/template/edit-mailbox.html @@ -107,7 +107,8 @@
- + + diff --git a/template/list-domains.html b/template/list-domains.html index 561f788..8d89cb7 100644 --- a/template/list-domains.html +++ b/template/list-domains.html @@ -19,7 +19,7 @@
-

Manage domains[add]

+

Manage domains[add]

-- cgit v1.2.3