]> mj.ucw.cz Git - pciids.git/commitdiff
Place menu on the sides of title
authorMichal Vaner <vorner@ucw.cz>
Sun, 31 Aug 2008 11:16:36 +0000 (13:16 +0200)
committerMichal Vaner <vorner@ucw.cz>
Sun, 31 Aug 2008 11:16:36 +0000 (13:16 +0200)
PciIds/Html/Changes.pm
PciIds/Html/Help.pm
PciIds/Html/List.pm
PciIds/Html/Notifications.pm
PciIds/Html/Users.pm
PciIds/Html/Util.pm
help/list
static/print.css
static/screen.css

index bd721ea4f48acc646d718587b90f48909802c24b..e2899f65abcd0224335d5cb48d7b0d06dbeb8a25 100644 (file)
@@ -15,8 +15,10 @@ sub genNewItemForm( $$$$$$ ) {
        return NOT_FOUND unless( $ok );
        my $prettyAddr = encode( $address->pretty() );
        genHtmlHead( $req, "$prettyAddr - add new item", undef );
+       print "<div class='top'>\n";
        print "<h1>$prettyAddr - add new item</h1>\n";
        genLocMenu( $req, $args, [ logItem( $auth ), $address->canDiscuss() ? [ 'Discuss', 'newhistory' ] : (), [ 'Notifications', 'notifications' ], [ 'Help', 'help', 'newitem' ], [ 'ID syntax', 'help', $address->helpName() ] ] );
+       print "<div class='clear'></div></div>\n";
        print "<div class='error'>$error</div>\n" if( defined $error );
        print "<form name='newitem' id='newitem' method='POST' action=''>\n<table>";
        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 "<div class='top'>\n";
                        print '<h1>ID collision</h1>';
                        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 "<div class='clear'></div></div>\n";
                        print '<p>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 "<div class='top'>\n";
        print "<h1>$prettyAddr - discuss</h1>\n";
        genLocMenu( $req, $args, [ logItem( $auth ), $address->canAddItem() ? [ 'Add item', 'newitem' ] : (), [ 'Notifications', 'notifications' ], [ 'Help', 'help', 'newhistory' ] ] );
+       print "<div class='clear'></div></div>\n";
        print "<div class='error'>$error</div>\n" if( defined $error );
        print "<form name='newhistory' id='newhistory' method='POST' action=''>\n<table>";
        genFormEx( [ [ 'textarea', 'Text:', undef, 'text', 'rows="5" cols="50"' ],
index 4a361d7e0d140f02a8735d6af95c19c9dba3bedf..bd8c70b7330156eab15199b65706335a1a7cc428 100644 (file)
@@ -18,13 +18,14 @@ sub getHelp( $$ ) {
        chomp $head;
        genHtmlHead( $req, $head, undef );
        my $addr = PciIds::Address::new( $req->uri() );
+       print "<div class='top'>\n";
        print "<h1>$head".( defined $addr ? " (".$addr->pretty().")" : "" )."</h1>\n";
-       genMenu( $req, $addr, $args, $auth, undef );
+       genMenu( $req, $addr, $args, $auth, [ [ 'Help index', 'help', 'index' ] ] );
        genPath( $req, $addr, 1 );
+       print "<div class='clear'></div></div>\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 "<div class='navigation'><ul><li><a href='${url}index'>Help index</a></ul></div>\n" if( $helpname ne 'index' );
        while( defined( my $line = <HELP> ) ) {
                $line =~ s/\$(\w+_URL)\$/$repls{$1}/g;
                print $line;
index e8b9a29054a32e1227d0eb7bc5b1cb75fd70e256..f4a0b4de2bb0558bbe8e4ec5665109cdd3e72957 100644 (file)
@@ -24,9 +24,12 @@ sub list( $$$$ ) {
        return NOT_FOUND unless( $ok );
        my $id = $address->pretty();
        genHtmlHead( $req, $id, undef );
+       print "<div class='top'>\n";
        print '<h1>'.encode( $id ).'</h1>';
        genMenu( $req, $address, $args, $auth, [ [ 'Help', 'help', 'list' ], $address->helpName() ? [ 'ID syntax', 'help', $address->helpName() ] : () ] );
        genPath( $req, $address, 0 );
+       print "<div class='clear'></div>\n";
+       print "</div\n>";
        print htmlDiv( 'name', '<p>'.encode( $name ) ) if defined( $name );
        print htmlDiv( 'note', '<p>'.encode( $note ) ) if( defined( $note ) );
        my $diss = 0;
index d3b38f588ade1d5fe16143240688253350606213..1d2e105ef1bf25c19c374165a07a67bef8433481 100644 (file)
@@ -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 "<div class='top'>\n";
        print "<h1>".$addr->pretty()." - notifications</h1>\n";
        genLocMenu( $req, $args, [ logItem( $auth ), $addr->canAddItem() ? [ 'New item', 'newitem' ] : (), $addr->canDiscuss ? [ 'Discuss', 'newhistory' ] : (), [ 'Profile', 'profile' ], [ 'Help', 'help', 'notifications' ] ] );
+       print "<div class='clear'></div></div>\n";
        print "<div class='error'>$error</div>\n" if( defined $error );
        my $uri = $addr->get();
        my $notifs = $tables->notificationsUser( $auth->{'authid'} );
index cb57189e80ef4836665fae33519774095ede9031..06d1ea6504d3054b63d2d445d72d1dc3f39ac546 100644 (file)
@@ -19,8 +19,10 @@ our @EXPORT = qw(&checkLogin &notLoggedComplaint);
 sub genRegisterForm( $$$$ ) {
        my( $req, $args, $error, $values ) = @_;
        genHtmlHead( $req, 'Register a new user', undef );
+       print "<div class='top'>\n";
        print '<h1>Register a new user</h1>';
        genLocMenu( $req, $args, [ [ 'Log in', 'login' ], [ 'Help', 'help', 'account' ] ] );
+       print "<div class='clear'></div></div>\n";
        print '<div class="error">'.$error.'</div>' if( defined $error );
        print '<form name="register" id="register" method="POST" action="">
                <table>';
@@ -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 "<div class='top'>\n";
        print "<h1>Registration email sent</h1>\n";
        genLocMenu( $req, $args, [ [ 'Log in', 'login' ], [ 'Help', 'help', 'account' ] ] );
+       print "<div class='clear'></div></div>\n";
        print '<p>
                        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 "<div class='top'>\n";
        print '<h1>Confirm registration</h1>';
        genLocMenu( $req, $args, [ [ 'Register', 'register' ], [ 'Help', 'help', 'account' ] ] );
+       print "<div class='clear'></div></div>\n";
        print '<div class="error">'.$error.'</div>' if( defined $error );
        print '<p>Email address: '.encode( $values->{'email'} );
        print '<form name="register-confirm" id="register-confirm" method="POST" action="">';
@@ -93,8 +99,10 @@ sub genConfirmForm( $$$$ ) {
 sub usedAddress( $$ ) {
        my( $req, $args ) = @_;
        genHtmlHead( $req, 'Used address', undef );
+       print "<div class='top'>\n";
        print "<h1>Used address</h1>\n";
        genLocMenu( $req, $args, [ [ 'Log in', 'login' ], [ 'Reset password', 'respass' ], [ 'Register', 'register' ], [ 'Help', 'help', 'account' ] ] );
+       print "<div class='clear'></div></div>\n";
        print '<div class="error">
                <p>
                        An account for this address is already registered.
@@ -162,8 +170,10 @@ sub confirmSubmit( $$$ ) {
                return OK;
        }
        genHtmlHead( $req, 'Registered', undef );
+       print "<div class='top'>\n";
        print "<h1>Registered</h1>\n";
        genLocMenu( $req, $args, [ [ 'Log in', 'login' ], [ 'Help', 'help', 'account' ] ] );
+       print "<div class='clear'></div></div>\n";
        print '<p>
                        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 "<div class='top'>\n";
        print '<h1>Login</h1>';
        genLocMenu( $req, $args, [ [ 'Register', 'register' ], [ 'Reset password', 'respass' ], [ 'Help', 'help', 'account' ] ] );
+       print "<div class='clear'></div></div>\n";
        print '<div class="error"><p>'.$error.'</div>' if( defined $error );
        print '<form name="login" id="login" method="POST" action="'.setAddrPrefix( $req->uri(), 'mods' ).buildExcept( 'action', $args ).'?action=login"><table>';
        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 "<div class='top'>\n";
                print '<h1>Logged in</h1>';
                genPath( $req, PciIds::Address::new( $req->uri() ), 1 );
+               print "<div class='clear'></div></div>\n";
                print "<p>You are logged in" . ( defined $args->{'redirectaction'} ? ", continue with your <a href='$url'>action</a>.\n" : ".\n" );
                print '<div class="lastlog"><p>'.encode( $last ).'</div>' if( defined( $last ) );
                genHtmlTail();
@@ -252,8 +266,10 @@ sub notLoggedComplaint( $$$ ) {
 sub genResetPasswdForm( $$$$ ) {
        my( $req, $args, $error, $values ) = @_;
        genHtmlHead( $req, 'Reset password', undef );
+       print "<div class='top'>\n";
        print "<h1>Reset password</h1>\n";
        genLocMenu( $req, $args, [ [ 'Log in', 'login' ], [ 'Register', 'register' ], [ 'Help', 'help', 'account' ] ] );
+       print "<div class='clear'></div></div>\n";
        print "<p>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 '<div class="error">'.$error.'</div>' 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 "<div class='top'>\n";
                print "<h1>Reset password</h1>\n";
                genLocMenu( $req, $args, [ [ 'Log in', 'login' ], [ 'Help', 'help', 'account' ] ] );
+               print "<div class='clear'></div></div>\n";
                print "<p>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 "<div class='top'>\n";
        print "<h1>Reset password</h1>\n";
        genLocMenu( $req, $args, [ [ 'Log in', 'login' ], [ 'Help', 'help', 'account' ] ] );
+       print "<div class='clear'></div></div>\n";
        print '<div class="error">'.$error.'</div>' if( defined $error );
        print "<p>You can enter new password here:\n";
        print '<form name="respass-confirm" id="respass-confirm" method="POST" action="">
@@ -356,8 +376,10 @@ sub resetPasswdConfirmFormSubmit( $$$ ) {
                if( defined( $myHash ) && ( $myHash eq $hash ) ) {
                        changePasswd( $tables, $id, $data->{'password'}, $email );
                        genHtmlHead( $req, 'Reset password', undef );
+                       print "<div class='top'>\n";
                        print "<h1>Reset password</h1>\n";
                        genLocMenu( $req, $args, [ [ 'Log in', 'login' ], [ 'Help', 'help', 'account' ] ] );
+                       print "<div class='clear'></div></div>\n";
                        print "<p>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 "<div class='top'>\n";
        print "<h1>User profile</h1>\n";
        genLocMenu( $req, $args, [ logItem( $auth ), [ 'Notifications', 'notifications' ], [ 'Help', 'help', 'profile' ] ] );
+       print "<div class='clear'></div></div>\n";
        print '<div class="error"><p>'.$error.'</div>' if defined $error;
        print "<div class='info'><p>$info</div>\n" if defined $info;
        print '<form name="profile" id="profile" method="POST" action=""><table>';
index 63f98bf0cbf7419a5fdd46369869fb3b013e9529..81498344fa783485b7e5ed4b6937888c813365fd 100644 (file)
@@ -143,7 +143,7 @@ sub genPath( $$$ ) {
        } else {
                $path = [];
        }
-       print "<div class='navigation'><ul>\n";
+       print "<div class='navigation-menu'><ul>\n";
        foreach my $addr ( @{$path} ) {
                print "  <li><a href='http://".$req->hostname()."/read/".$addr->get()."/'>".encode( $addr->pretty() )."</a>\n";
        }
index 03acde64ae54c04bbc700b0c586dbdd3bb38baba..69dea438e90319833a5360cb3910f77bc5a8a453 100644 (file)
--- a/help/list
+++ b/help/list
@@ -6,8 +6,8 @@ The IDs are organized into a tree.
 <p>
 Page is divided into parts:
 <ul>
-       <li><strong>Menu</strong> ‒ you can perform actions, both in connection with current item (like <a href='$HELP_URL$newitem'>adding a new sub-item</a>) and global (<a href='$CUR_URL$profile'>editing your profile</a>).
-       <li><strong>Hierarchy</strong> ‒ lists all parental items.
+       <li><strong>Menu</strong> ‒ you can perform actions, both in connection with current item (like <a href='$HELP_URL$newitem'>adding a new sub-item</a>) and global (<a href='$CUR_URL$profile'>editing your profile</a>). Placed in the top left corner.
+       <li><strong>Hierarchy</strong> ‒ lists all parental items. Placed in the top right corner.
        <li><strong>Discussion</strong> ‒ contains history of suggested names, notes and general talk about current item.
        <li><strong>List of sub-items</strong> ‒ all direct sub-items are listed here and you can browse into them.
 </ul>
@@ -22,15 +22,17 @@ Colors are used both in discussion and list of sub-items to mark status of discu
 
 <h2>Example</h2>
 <div class='help-example'>
+<div class='top'>
 <h1>ID 0000</h1>
 <div class='menu'><ul>
        <li><a href='$HELP_URL$account'>Log in</a>
        <li><a href='$HELP_URL$newitem'>Add item</a>
        <li><a href='$HELP_URL$newhistory'>Discuss</a>
 </ul></div>
-<div class='navigation'><ul>
+<div class='navigation-menu'><ul>
        <li><a href='$HELP_URL$index'>Parent</a>
 </div>
+<div class='clear'></div></div>
 <div class='name'><p>ID name</div>
 <div class='discussion'><h2>Discussion</h2>
 <div class='main-history'>
index 91ed5d026862284cafe0b4d53f01fa98f4defe4b..9640f8deeb03546e32b26e2fda26c25028b9189b 100644 (file)
@@ -1,4 +1,4 @@
-.menu, .navigation
+.menu, .navigation, .navigation-menu
 {
        overflow: hidden;
        display: none;
index 090d4daf88f7f180f26e06747d0afb7245e7ec6a..857fcec8215e6154558503901c938a0ac910b6ad 100644 (file)
@@ -44,12 +44,42 @@ body
        padding-left: 5px;
        padding-right: 5px;
 }
+div.menu
+{
+       position: relative;
+       float: left;
+       width: 20%;
+}
+div.navigation-menu
+{
+       position: relative;
+       float: right;
+       text-align: right;
+       width: 20%;
+       margin-right: 1em;
+}
+div.top h1
+{
+       text-align: center;
+       height: 0px; /* Hack. Place menu and navigation besides, not below. */
+       margin: 0px;
+}
+div.clear
+{
+       clear: both; /* Hack. Wait for all menus to end first. */
+}
 .menu ul,
 .navigation ul,
+.navigation-menu ul,
 ul.navigation
 {
        list-style-type: none;
 }
+.menu li,
+.navigation li
+{
+       margin-left: -1em; /* Hack. Move the place the bullets would take if they were there back left. */
+}
 table.subnodes
 {
        width: 100%;