From: Michal Vaner Date: Sun, 31 Aug 2008 11:16:36 +0000 (+0200) Subject: Place menu on the sides of title X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=cdd0c847d6567e79c09dae0a47f8d85603089e61;p=pciids.git Place menu on the sides of title --- diff --git a/PciIds/Html/Changes.pm b/PciIds/Html/Changes.pm index bd721ea..e2899f6 100644 --- a/PciIds/Html/Changes.pm +++ b/PciIds/Html/Changes.pm @@ -15,8 +15,10 @@ sub genNewItemForm( $$$$$$ ) { return NOT_FOUND unless( $ok ); my $prettyAddr = encode( $address->pretty() ); genHtmlHead( $req, "$prettyAddr - add new item", undef ); + print "
\n"; print "

$prettyAddr - add new item

\n"; genLocMenu( $req, $args, [ logItem( $auth ), $address->canDiscuss() ? [ 'Discuss', 'newhistory' ] : (), [ 'Notifications', 'notifications' ], [ 'Help', 'help', 'newitem' ], [ 'ID syntax', 'help', $address->helpName() ] ] ); + print "
\n"; print "
$error
\n" if( defined $error ); print "
\n"; genFormEx( [ [ 'input', 'Id:', 'text', 'id', 'maxlength="50"' ], @@ -64,10 +66,12 @@ sub newItemSubmit( $$$$ ) { my( $result, $comName ) = $tables->submitItem( $data, $auth ); if( $result eq 'exists' ) { genHtmlHead( $req, 'ID collision', undef ); + print "
\n"; print '

ID collision

'; my $addr = PciIds::Address::new( $req->uri() ); genCustomMenu( $req, $addr, $args, [ logItem( $auth ), [ 'Add other item', 'newitem' ], $addr->canDiscuss() ? [ 'Discuss', 'newhistory' ] : () ] ); genPath( $req, $data->{'address'}, 1 ); + print "
\n"; print '

Sorry, this ID already exists.'; genHtmlTail(); return OK; @@ -88,8 +92,10 @@ sub genNewHistoryForm( $$$$$$ ) { return NOT_FOUND unless( $ok ); my $prettyAddr = encode( $address->pretty() ); genHtmlHead( $req, "$prettyAddr - discuss", undef ); + print "

\n"; print "

$prettyAddr - discuss

\n"; genLocMenu( $req, $args, [ logItem( $auth ), $address->canAddItem() ? [ 'Add item', 'newitem' ] : (), [ 'Notifications', 'notifications' ], [ 'Help', 'help', 'newhistory' ] ] ); + print "
\n"; print "
$error
\n" if( defined $error ); print "\n
"; genFormEx( [ [ 'textarea', 'Text:', undef, 'text', 'rows="5" cols="50"' ], diff --git a/PciIds/Html/Help.pm b/PciIds/Html/Help.pm index 4a361d7..bd8c70b 100644 --- a/PciIds/Html/Help.pm +++ b/PciIds/Html/Help.pm @@ -18,13 +18,14 @@ sub getHelp( $$ ) { chomp $head; genHtmlHead( $req, $head, undef ); my $addr = PciIds::Address::new( $req->uri() ); + print "
\n"; print "

$head".( defined $addr ? " (".$addr->pretty().")" : "" )."

\n"; - genMenu( $req, $addr, $args, $auth, undef ); + genMenu( $req, $addr, $args, $auth, [ [ 'Help index', 'help', 'index' ] ] ); genPath( $req, $addr, 1 ); + print "
\n"; my $url = setAddrPrefix( $req->uri(), 'read' ).buildExcept( 'help', $args ).'?help='; delete $args->{'help'}; my %repls = ( 'HELP_URL' => $url, 'AC_URL' => setAddrPrefix( $req->uri(), 'mods' ).buildExcept( 'action', $args ).'?action=' ); - print "\n" if( $helpname ne 'index' ); while( defined( my $line = ) ) { $line =~ s/\$(\w+_URL)\$/$repls{$1}/g; print $line; diff --git a/PciIds/Html/List.pm b/PciIds/Html/List.pm index e8b9a29..f4a0b4d 100644 --- a/PciIds/Html/List.pm +++ b/PciIds/Html/List.pm @@ -24,9 +24,12 @@ sub list( $$$$ ) { return NOT_FOUND unless( $ok ); my $id = $address->pretty(); genHtmlHead( $req, $id, undef ); + print "
\n"; print '

'.encode( $id ).'

'; genMenu( $req, $address, $args, $auth, [ [ 'Help', 'help', 'list' ], $address->helpName() ? [ 'ID syntax', 'help', $address->helpName() ] : () ] ); genPath( $req, $address, 0 ); + print "
\n"; + print ""; print htmlDiv( 'name', '

'.encode( $name ) ) if defined( $name ); print htmlDiv( 'note', '

'.encode( $note ) ) if( defined( $note ) ); my $diss = 0; diff --git a/PciIds/Html/Notifications.pm b/PciIds/Html/Notifications.pm index d3b38f5..1d2e105 100644 --- a/PciIds/Html/Notifications.pm +++ b/PciIds/Html/Notifications.pm @@ -11,8 +11,10 @@ sub genNotifForm( $$$$$$ ) { my( $req, $args, $tables, $auth, $error, $data ) = @_; my $addr = PciIds::Address::new( $req->uri() ); genHtmlHead( $req, $addr->pretty().' - notifications', undef ); + print "

\n"; print "

".$addr->pretty()." - notifications

\n"; genLocMenu( $req, $args, [ logItem( $auth ), $addr->canAddItem() ? [ 'New item', 'newitem' ] : (), $addr->canDiscuss ? [ 'Discuss', 'newhistory' ] : (), [ 'Profile', 'profile' ], [ 'Help', 'help', 'notifications' ] ] ); + print "
\n"; print "
$error
\n" if( defined $error ); my $uri = $addr->get(); my $notifs = $tables->notificationsUser( $auth->{'authid'} ); diff --git a/PciIds/Html/Users.pm b/PciIds/Html/Users.pm index cb57189..06d1ea6 100644 --- a/PciIds/Html/Users.pm +++ b/PciIds/Html/Users.pm @@ -19,8 +19,10 @@ our @EXPORT = qw(&checkLogin ¬LoggedComplaint); sub genRegisterForm( $$$$ ) { my( $req, $args, $error, $values ) = @_; genHtmlHead( $req, 'Register a new user', undef ); + print "
\n"; print '

Register a new user

'; genLocMenu( $req, $args, [ [ 'Log in', 'login' ], [ 'Help', 'help', 'account' ] ] ); + print "
\n"; print '
'.$error.'
' if( defined $error ); print '
'; @@ -62,8 +64,10 @@ sub registerSubmit( $$$ ) {#A registration form has been submited "\nThank you\n". "\n(This is an autogenerated email, do not respond to it)" ); genHtmlHead( $req, 'Registration email sent', undef ); + print "
\n"; print "

Registration email sent

\n"; genLocMenu( $req, $args, [ [ 'Log in', 'login' ], [ 'Help', 'help', 'account' ] ] ); + print "
\n"; print '

An email containing further information has been sent to you. Please follow these instruction to finish the registration process.'; @@ -74,8 +78,10 @@ sub registerSubmit( $$$ ) {#A registration form has been submited sub genConfirmForm( $$$$ ) { my( $req, $args, $error, $values ) = @_; genHtmlHead( $req, 'Confirm registration', undef ); + print "

\n"; print '

Confirm registration

'; genLocMenu( $req, $args, [ [ 'Register', 'register' ], [ 'Help', 'help', 'account' ] ] ); + print "
\n"; print '
'.$error.'
' if( defined $error ); print '

Email address: '.encode( $values->{'email'} ); print ''; @@ -93,8 +99,10 @@ sub genConfirmForm( $$$$ ) { sub usedAddress( $$ ) { my( $req, $args ) = @_; genHtmlHead( $req, 'Used address', undef ); + print "

\n"; print "

Used address

\n"; genLocMenu( $req, $args, [ [ 'Log in', 'login' ], [ 'Reset password', 'respass' ], [ 'Register', 'register' ], [ 'Help', 'help', 'account' ] ] ); + print "
\n"; print '

An account for this address is already registered. @@ -162,8 +170,10 @@ sub confirmSubmit( $$$ ) { return OK; } genHtmlHead( $req, 'Registered', undef ); + print "

\n"; print "

Registered

\n"; genLocMenu( $req, $args, [ [ 'Log in', 'login' ], [ 'Help', 'help', 'account' ] ] ); + print "
\n"; print '

You have registered successfully.'; genHtmlTail(); @@ -174,8 +184,10 @@ sub genLoginForm( $$$$ ) { my( $req, $args, $error, $values ) = @_; $req->headers_out->add( 'Set-Cookie' => new CGI::Cookie( -name => 'cookie-test', -value => 1 ) ); genHtmlHead( $req, 'Login', undef ); + print "

\n"; print '

Login

'; genLocMenu( $req, $args, [ [ 'Register', 'register' ], [ 'Reset password', 'respass' ], [ 'Help', 'help', 'account' ] ] ); + print "
\n"; print '

'.$error.'

' if( defined $error ); print '
'; genForm( [ [ 'Login name or email:', 'text', 'login', 'maxlength="255"' ], @@ -214,8 +226,10 @@ sub loginSubmit( $$$ ) { my $prefix = ( !defined( $args->{'action'} ) or ( $args->{'action'} eq '' ) or ( $args->{'action'} eq 'list' ) ) ? 'read' : 'mods'; my $url = "http://".$req->hostname().setAddrPrefix( $req->uri(), $prefix ).buildExcept( 'redirectaction', $args ); genHtmlHead( $req, 'Logged in', undef ); + print "
\n"; print '

Logged in

'; genPath( $req, PciIds::Address::new( $req->uri() ), 1 ); + print "
\n"; print "

You are logged in" . ( defined $args->{'redirectaction'} ? ", continue with your action.\n" : ".\n" ); print '

'.encode( $last ).'

' if( defined( $last ) ); genHtmlTail(); @@ -252,8 +266,10 @@ sub notLoggedComplaint( $$$ ) { sub genResetPasswdForm( $$$$ ) { my( $req, $args, $error, $values ) = @_; genHtmlHead( $req, 'Reset password', undef ); + print "
\n"; print "

Reset password

\n"; genLocMenu( $req, $args, [ [ 'Log in', 'login' ], [ 'Register', 'register' ], [ 'Help', 'help', 'account' ] ] ); + print "
\n"; print "

If you forgot your password (or didn't create one yet), you can reset it to a new value here.\n"; print "Provide your email address here and further instructions will be sent to you.\n"; print '

'.$error.'
' if( defined $error ); @@ -289,8 +305,10 @@ sub resetPasswdFormSubmit( $$$ ) { "\n\nThank you\n". "\n(This is an autogenerated email, do not respond to it)" ); genHtmlHead( $req, 'Reset password', undef ); + print "
\n"; print "

Reset password

\n"; genLocMenu( $req, $args, [ [ 'Log in', 'login' ], [ 'Help', 'help', 'account' ] ] ); + print "
\n"; print "

An email with information has been sent to your address.\n"; genHtmlTail(); return OK; @@ -303,8 +321,10 @@ sub resetPasswdFormSubmit( $$$ ) { sub genResetPasswdConfigForm( $$$$$$ ) { my( $req, $args, $error, $values, $email, $hash ) = @_; genHtmlHead( $req, 'Reset password', undef ); + print "

\n"; print "

Reset password

\n"; genLocMenu( $req, $args, [ [ 'Log in', 'login' ], [ 'Help', 'help', 'account' ] ] ); + print "
\n"; print '
'.$error.'
' if( defined $error ); print "

You can enter new password here:\n"; print ' @@ -356,8 +376,10 @@ sub resetPasswdConfirmFormSubmit( $$$ ) { if( defined( $myHash ) && ( $myHash eq $hash ) ) { changePasswd( $tables, $id, $data->{'password'}, $email ); genHtmlHead( $req, 'Reset password', undef ); + print "

\n"; print "

Reset password

\n"; genLocMenu( $req, $args, [ [ 'Log in', 'login' ], [ 'Help', 'help', 'account' ] ] ); + print "
\n"; print "

Your password was successfuly changed.\n"; genHtmlTail(); return OK; @@ -373,8 +395,10 @@ sub genProfileForm( $$$$$$ ) { delete $data->{'current_password'}; delete $data->{'confirm_password'}; delete $data->{'password'}; + print "

\n"; print "

User profile

\n"; genLocMenu( $req, $args, [ logItem( $auth ), [ 'Notifications', 'notifications' ], [ 'Help', 'help', 'profile' ] ] ); + print "
\n"; print '

'.$error.'

' if defined $error; print "

$info

\n" if defined $info; print '
'; diff --git a/PciIds/Html/Util.pm b/PciIds/Html/Util.pm index 63f98bf..8149834 100644 --- a/PciIds/Html/Util.pm +++ b/PciIds/Html/Util.pm @@ -143,7 +143,7 @@ sub genPath( $$$ ) { } else { $path = []; } - print "