]> mj.ucw.cz Git - pciids.git/blobdiff - PciIds/Html/Changes.pm
Make the h1 titles little lower
[pciids.git] / PciIds / Html / Changes.pm
index 57473544d65015e33f36402dbb3d2d146a8173dd..f5fbea1012275f363d85d9f969e5146901dfe506 100644 (file)
@@ -13,18 +13,26 @@ sub genNewItemForm( $$$$$$ ) {
        my( $req, $args, $auth, $tables, $error, $values ) = @_;
        my( $ok, $parent, $name, $note, $address ) = loadItem( $tables, $req->uri() );
        return NOT_FOUND unless( $ok );
-       my $prettyAddr = encode( $address->pretty() );
-       genHtmlHead( $req, "$prettyAddr - add new item", undef );
-       genCustomHead( $req, $args, $address, "$prettyAddr - add new item", [ $address->canDiscuss() ? [ 'Discuss', 'newhistory' ] : (), [ 'Help', 'help', 'newitem' ], [ 'ID syntax', 'help', $address->helpName() ] ], [ logItem( $auth ), [ 'Notifications', 'notifications' ] ] );
+       genHtmlHead( $req, "Add new item", undef );
+       genCustomHead( $req, $args, $address, "Add new item", [ $address->canDiscuss() ? [ 'Discuss', 'newhistory' ] : (), [ 'Help', 'help', 'newitem' ], [ 'ID syntax', 'help', $address->helpName() ], [ '', 'jump' ] ], [ logItem( $auth ), [ 'Notifications', 'notifications' ] ] );
        print "<div class='error'>$error</div>\n" if( defined $error );
-       print "<form name='newitem' id='newitem' method='POST' action='".( $args->{'full_links'} ? 'http://'.$req->hostname().$req->uri().buildExcept( 'action', $args ).'?action=newitem' : '' )."'>\n<table>";
-       genFormEx( [ [ 'input', 'Id:', 'text', 'id', 'maxlength="50"' ],
+       print "<form name='newitem' id='newitem' method='POST' action=''>\n<table>";
+       genFormEx( [ [ 'input', 'ID:', 'text', 'id', 'maxlength="'.$address->subIdSize().'"' ],
                [ 'input', 'Name:', 'text', 'name', 'maxlength="200"' ],
-               [ 'input', 'Note*:', 'text', 'note', 'maxlength="1024"' ],
-               [ 'textarea', 'Discussion*:', undef, 'discussion', 'rows="5" cols="50"' ],
+               [ 'input', 'Note:', 'text', 'note', 'maxlength="1024"' ],
+               [ 'textarea', 'Discussion:', undef, 'discussion', 'rows="5" cols="50"' ],
                [ 'input', '', 'submit', 'submit', 'value="Submit"' ] ], $values );
        print '</table></form>';
-       print '<p>Items marked with * are optional.';
+       print '
+<p>
+       Please enter only accurate information. Descriptions like "Unknown modem device" are only of a little use to anybody.
+       Real chip names and numbers are preferred over marketing names. In case you know both, enclose the marketing name in square brackets like in
+       "3c595 100BaseTX [Vortex]". Do not include names of superitems in the name (like vendor name in device name).
+       Check information specific to this <a href="'.buildExcept( 'action', $args ).'?action=help?help='.$address->helpName().'">ID type</a>.
+<p>
+       If you there is something you want to clarify about the item, you can use note (like the ID does not belong to people using it).
+       Discussion is for things more relevant to history of the item than the real device (like information source).
+       Both note and discussion is optional.';
        genHtmlTail();
        return OK;
 }
@@ -64,14 +72,14 @@ sub newItemSubmit( $$$$ ) {
                if( $result eq 'exists' ) {
                        genHtmlHead( $req, 'ID collision', undef );
                        my $addr = PciIds::Address::new( $req->uri() );
-                       genCustomHead( $req, $args, $addr, 'ID collision', [ [ 'Add other item', 'newitem' ], $addr->canDiscuss() ? [ 'Discuss', 'newhistory' ] : () ], [ logItem( $auth ) ] );
+                       genCustomHead( $req, $args, $addr, 'ID collision', [ [ 'Add other item', 'newitem' ], $addr->canDiscuss() ? [ 'Discuss', 'newhistory' ] : (), [ '', 'jump' ] ], [ logItem( $auth ) ] );
                        print '<p>Sorry, this ID already exists.';
                        genHtmlTail();
                        return OK;
                } elsif( $result ) {
                        return genNewItemForm( $req, $args, $auth, $tables, $result, $data );
                }
-               notify( $tables, $data->{'address'}->get(), $comName, 2, 0 );
+               notify( $tables, $data->{'address'}->parent()->get(), $comName, 2, 0 );#Notify the parent (parent gets new items)
                tulog( $auth->{'authid'}, "Item created ".$data->{'address'}->get()." ".logEscape( $data->{'name'} )." ".logEscape( $data->{'note'} )." ".logEscape( $data->{'discussion'} )." $comName" );
                return HTTPRedirect( $req, '/read/'.$data->{'address'}->get().'?action=list' );
        } else {
@@ -83,11 +91,10 @@ sub genNewHistoryForm( $$$$$$ ) {
        my( $req, $args, $tables, $auth, $error, $values ) = @_;
        my( $ok, $parent, $name, $note, $address ) = loadItem( $tables, $req->uri() );
        return NOT_FOUND unless( $ok );
-       my $prettyAddr = encode( $address->pretty() );
-       genHtmlHead( $req, "$prettyAddr - discuss", undef );
-       genCustomHead( $req, $args, $address, "$prettyAddr - discuss", [ $address->canAddItem() ? [ 'Add item', 'newitem' ] : (), [ 'Help', 'help', 'newhistory' ] ], [ logItem( $auth ),  [ 'Notifications', 'notifications' ] ] );
+       genHtmlHead( $req, "Discuss", undef );
+       genCustomHead( $req, $args, $address, "Discuss", [ $address->canAddItem() ? [ 'Add item', 'newitem' ] : (), [ 'Help', 'help', 'newhistory' ], [ '', 'jump' ] ], [ logItem( $auth ),  [ 'Notifications', 'notifications' ] ] );
        print "<div class='error'>$error</div>\n" if( defined $error );
-       print "<form name='newhistory' id='newhistory' method='POST' action='".( $args->{'full_links'} ? 'http://'.$req->hostname().$req->uri().buildExcept( 'action', $args ).'?action=newhistory' : '' )."'>\n<table>";
+       print "<form name='newhistory' id='newhistory' method='POST' action=''>\n<table>";
        genFormEx( [ [ 'textarea', 'Text:', undef, 'text', 'rows="5" cols="50"' ],
                [ 'input', 'Request deletion', 'checkbox', 'delete', 'value="delete"' ],
                [ 'input', 'Name:', 'text', 'name', 'maxlength="200"' ],