diff options
author | Yorhel <git@yorhel.nl> | 2010-02-05 09:28:56 +0100 |
---|---|---|
committer | Yorhel <git@yorhel.nl> | 2010-02-05 09:28:56 +0100 |
commit | 004d60b64d80506944fd069c89c589302b5ae313 (patch) | |
tree | dcc525169fe60e8ff56d00417d23fe695f649197 /lib/VNDB/Handler/Users.pm | |
parent | 3cd6626fefaed0461d27377e2a349871c49e7154 (diff) |
Notifications: Added 'dbedit' notification
And added a settings window where you can disable this notification,
which is something you really want to do if you're an active
contributor...
Diffstat (limited to 'lib/VNDB/Handler/Users.pm')
-rw-r--r-- | lib/VNDB/Handler/Users.pm | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/lib/VNDB/Handler/Users.pm b/lib/VNDB/Handler/Users.pm index 13d4c55e..e7822f6e 100644 --- a/lib/VNDB/Handler/Users.pm +++ b/lib/VNDB/Handler/Users.pm @@ -533,7 +533,20 @@ sub notifies { ); return 404 if $f->{_err}; - if($self->reqMethod() eq 'POST') { + # changing the notification settings + my $saved; + if($self->reqMethod() eq 'POST' && $self->reqParam('set')) { + my $frm = $self->formValidate( + { name => 'notify_dbedit', required => 0 } + ); + return 404 if $frm->{_err}; + $frm->{notify_dbedit} = $frm->{notify_dbedit} ? 1 : 0; + $self->authInfo->{notify_dbedit} = $frm->{notify_dbedit}; + $self->dbUserEdit($uid, %$frm); + $saved = 1; + + # updating notifications + } elsif($self->reqMethod() eq 'POST') { my $frm = $self->formValidate( { name => 'notifysel', multi => 1, required => 0, template => 'int' }, { name => 'markread', required => 0 }, @@ -609,6 +622,20 @@ sub notifies { ); end; } + + form method => 'post', action => "/u$uid/notifies"; + div class => 'mainbox'; + h1 mt '_usern_set_title'; + div class => 'notice', mt '_usern_set_saved' if $saved; + p; + input type => 'checkbox', name => 'notify_dbedit', id => 'notify_dbedit', value => 1, + $self->authInfo->{notify_dbedit} ? (checked => 'checked') : (); + label for => 'notify_dbedit', ' '.mt('_usern_set_dbedit'); + br; + input type => 'submit', name => 'set', value => mt '_usern_set_submit'; + end; + end; + end; $self->htmlFooter; } |