+# PciIds web database
+# Copyright (C) 2008 Michal Vaner (vorner@ucw.cz)
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# he Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+#
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
package PciIds::Html::Notifications;
use strict;
use warnings;
sub genNotifForm( $$$$$$ ) {
my( $req, $args, $tables, $auth, $error, $data ) = @_;
my $addr = PciIds::Address::new( $req->uri() );
- genHtmlHead( $req, $addr->pretty().' - notifications', undef );
- print "<h1>".$addr->pretty()." - notifications</h1>\n";
+ genHtmlHead( $req, 'Notifications', undef );
+ genCustomHead( $req, $args, $addr, "Notifications", [ $addr->canAddItem() ? [ 'New item', 'newitem' ] : (), $addr->canDiscuss ? [ 'Discuss', 'newhistory' ] : (), [ 'Help', 'help', 'notifications' ], [ '', 'jump' ] ], [ logItem( $auth ), [ 'Profile', 'profile' ] ] );
print "<div class='error'>$error</div>\n" if( defined $error );
my $uri = $addr->get();
my $notifs = $tables->notificationsUser( $auth->{'authid'} );
}
}
print "</ul></div>\n" if( $started );
- print "<form name='notifications' id='notifications' method='POST' action='".setAddrPrefix( $req->uri(), "mods" ).buildExcept( 'action', $args )."?action=notifications'>\n";
+ print "<form name='notifications' id='notifications' method='POST' action=''>\n";
+ print "<h2>Effect range</h2>\n";
print "<p><input type='checkbox' value='recursive' name='recursive'".( $data->{'recursive'} ? " checked='checked'" : "" )."> Recursive\n";
- print "<h3>Notification level</h3>\n";
+ print "<h2>Notification level</h2>\n";
print "<p>\n";
- genRadios( [ [ 'None', '3' ], [ 'Main comment & new subitem', '2' ], [ 'Description', '1' ], [ 'Comment', '0' ] ], 'notification', ( defined $data->{'notification'} ) ? $data->{'notification'} : '3' );
- print "<h3>Notification way</h3>\n";
+ genRadios( [ [ 'None', '3' ], [ 'Main comment & new sub-item', '2' ], [ 'Suggestion', '1' ], [ 'Discussion', '0' ] ], 'notification', ( defined $data->{'notification'} ) ? $data->{'notification'} : '3' );
+ print "<h2>Notification way</h2>\n";
print "<p>\n";
genRadios( [ [ 'Email', '0' ], [ 'Xmpp', '1' ], [ 'Both', '2' ] ], 'way', ( defined $data->{'way'} ) ? $data->{'way'} : '0' );
print "<p><input type='submit' value='Submit' name='submit'>\n";
print "</form>\n";
if( @{$notifs} ) {
- print "<div class='navigation'><h3>All notifications</h3><ul>\n";
+ print "<div class='navigation'><h2>All notifications</h2><ul>\n";
foreach( @{$notifs} ) {
my( $location ) = @{$_};
print "<li><a href='/$location".buildArgs( $args )."'>".PciIds::Address::new( $location )->pretty()."</a>\n";
}
print "</ul></div>\n";
}
- print "<a class='navigation' href='".setAddrPrefix( $req->uri(), 'read' ).buildExcept( 'action', $args )."?action=list'>Back to browsing</a>\n";
- genHtmlTail();
+ genHtmlFooter( 1, $req, $args );
return OK;
}