X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;f=PciIds%2FHtml%2FList.pm;h=b2f3df058e57f9050306c5c4643baf68133236c5;hb=d2935a5e76ef0e5a2f3a15e80b2649a2913581e5;hp=02c62c9d23bb6b8fc1e97c4da3316e1683c0257f;hpb=603808d6fe06a611c79e65ba50d46ce2a6b03088;p=pciids.git diff --git a/PciIds/Html/List.pm b/PciIds/Html/List.pm index 02c62c9..b2f3df0 100644 --- a/PciIds/Html/List.pm +++ b/PciIds/Html/List.pm @@ -1,3 +1,21 @@ +# 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::List; use strict; use warnings; @@ -22,13 +40,15 @@ sub list( $$$$ ) { my( $req, $args, $tables, $auth ) = @_; my( $ok, $parent, $name, $note, $address, $mid ) = loadItem( $tables, $req->uri() ); return NOT_FOUND unless( $ok ); - my $id = $address->pretty(); - genHtmlHead( $req, $id, undef ); - print '
The home of the pci.ids
file
'.encode( $name ) ) if( defined( $name ) ); - print htmlDiv( 'note', '
'.encode( $note ) ) if( defined( $note ) ); + print htmlDiv( 'name', '
Name: '.encode( $name ) ) if defined $name && $name ne ''; + print htmlDiv( 'note', '
Note: '.encode( $note ) ) if defined $note && $note ne ''; my $diss = 0; my $history; foreach $history ( @{$tables->history( $address->get() )} ) { @@ -36,24 +56,29 @@ sub list( $$$$ ) { print "
Name: ".encode( $name )."\n" if( defined( $name ) && ( $name ne '' ) ); + print "
Deletion request\n" if( defined $name && $name eq '' ); print "
Note: ".encode( $note )."\n" if( defined( $note ) && ( $note ne '' ) );
if( defined( $text ) && ( $text ne '' ) ) {
$text = encode( $text );
$text =~ s/\n/
/g;
print "
$text\n"; } + ( $user ) = ( $email =~ /^(.*)@/ ) if defined $email && !defined $user; print "
".encode( $time )."\n"; print "
Discuss\n"; + print "\n" if( $diss ); + } unless( $address->leaf() ) { - print "
"; @@ -69,8 +94,9 @@ sub list( $$$$ ) { $args->{'restrict'} = $address->defaultRestrict() unless( defined( $args->{'restrict'} ) ); $tables->nodes( $address->get(), $args ); genTableTail(); + print "
Add item\n"; } - genHtmlTail(); + genHtmlFooter( 1, $req, $args ); return OK; }