fix index, update webpages

This commit is contained in:
david 2002-03-09 00:16:13 +00:00
parent 37310e83ed
commit 5cf07d4337
8 changed files with 44 additions and 33 deletions

View File

@ -9,7 +9,7 @@ CREATE TABLE document_rev
initials CHAR(3) NOT NULL,
notes TEXT,
PRIMARY KEY (rev_id)
PRIMARY KEY (doc_id, rev_id)
);
ALTER TABLE document_rev

View File

@ -377,6 +377,7 @@ while (@row = $authors_result->fetchrow) {
if ( $role eq "Co-Author" ) { print '<option selected>Co-Author</option>' } else { print '<option>Co-Author</option>' }
if ( $role eq "Maintainer" ) { print '<option selected>Maintainer</option>' } else { print '<option>Maintainer</option>' }
if ( $role eq "Converter" ) { print '<option selected>Converter</option>' } else { print '<option>Converter</option>' }
if ( $role eq "Translator" ) { print '<option selected>Translator</option>' } else { print '<option>Translator</option>' }
print "</select></td>\n";
print "<td valign=top><a href='maintainer_edit.pl?maintainer_id=$maintainer_id'>$maintainer_name</a></td>\n";
@ -404,6 +405,7 @@ print '<option>Author</option>';
print '<option>Co-Author</option>';
print '<option>Maintainer</option>';
print '<option>Converter</option>';
print '<option>Translator</option>';
print "</select></td>\n";
print "<td valign=top>";

View File

@ -42,9 +42,9 @@ print "<p>ID: $editor_id";
print "<form name=edit method=POST action='editor_save.pl'>";
print "<input type=hidden name=editor_id value=$editor_id></input>";
printf "<p><table>\n";
print '<tr><td>Name:</td><td><input type=text name="editor_name" size=30 value="' . $editor_name . '"></input></td></tr>';
print '<tr><td>Email:</td><td><input type=text name="email" size=30 value="' . $email . '"></input></td></tr>';
print "<tr><td valign=top>Notes:</td><td><textarea name=notes rows=10 cols=40>$notes</textarea></td></tr>\n";
print '<tr><th>Name:</th><td><input type=text name="editor_name" size=30 value="' . $editor_name . '"></input></td></tr>';
print '<tr><th>Email:</th><td><input type=text name="email" size=30 value="' . $email . '"></input></td></tr>';
print "<tr><th valign=top>Notes:</th><td><textarea name=notes rows=10 cols=40>$notes</textarea></td></tr>\n";
print "<tr><td></td><td><input type=submit value=Save></td></tr>";
print "</table>";
print "</form>";

View File

@ -32,14 +32,18 @@ print "<h1>LDP Editors</h1>\n";
system("./navbar.pl");
print "<p><table border=0>\n";
print "<tr><th>Name</th><th>Email</th></tr>\n";
while (@row = $result->fetchrow) {
$editor_id = $row[0];
$editor_name = $row[1];
$editor_email = $row[2];
if ( $editor_name eq "" ) { $editor_name = 'J. Doe' }
$email = $row[2];
print "<tr><td>";
print "<tr><td>\n";
print a({href=>"editor_edit.pl?editor_id=$editor_id"},"$editor_name");
print "</td>";
print "</td>\n";
print "<td>\n";
print a({href=>"mailto\:$editor_email"},"$editor_email");
print "</td>\n";
print "</tr>";
$count++;
}

View File

@ -43,14 +43,14 @@ print "<table>\n";
print "<tr><th>Status</th><th>Count</th><th>Percent</th></tr>";
while (@row = $result->fetchrow) {
print "<tr>\n";
print "<td>" . $row[0] . "</td>\n";
print "<th>" . $row[0] . "</th>\n";
print "<td align=right>" . $row[1] . "</td>\n";
$pct = sprintf( '%3.2f', $row[1] / $document_total * 100 );
print "<td align=right>" . $pct . "%</td>\n";
print "</tr>\n";
$total = $total + $row[1];
}
print "<tr><td>Total</td><td align=right>$total</td></tr>";
print "<tr><th>Total</th><td align=right>$total</td></tr>";
print "</table>\n";
print "<p>Only documents marked &quot;Active&quot; are represented in the following statistics.\n";
@ -74,7 +74,7 @@ while (@row = $result->fetchrow) {
$license =~ s/\s+$//;
$count = $row[1];
print "<tr>\n";
print "<td>$license</td>\n";
print "<th>$license</th>\n";
print "<td align=right>$count</td>\n";
$pct = sprintf( '%3.2f', $count / $document_count * 100 );
print "<td align=right>$pct%</td>\n";
@ -91,7 +91,7 @@ while (@row = $result->fetchrow) {
$nonfree_count += $count;
}
}
print "<tr><td>Total</td><td align=right>$total</td></tr>";
print "<tr><th>Total</th><td align=right>$total</td></tr>";
print "</table>\n";
$free_pct = sprintf( '%3.2f', $free_count / $total * 100 );
@ -100,10 +100,10 @@ $unknown_pct = sprintf( '%3.2f', $unknown_count / $total * 100 );
print "<p><table>\n";
print "<tr><th>Type</th><th align=right>Count</th><th align=right>Percent</th></tr>\n";
print "<tr><td>Free*</td><td align=right>$free_count</td><td align=right>$free_pct</td></tr>\n";
print "<tr><td>Non-Free</td><td align=right>$nonfree_count</td><td align=right>$nonfree_pct</td></tr>\n";
print "<tr><td>Unknown</td><td align=right>$unknown_count</td><td align=right>$unknown_pct</td></tr>\n";
print "<tr><td>Total</td><td align=right>$total</td></tr>";
print "<tr><th>Free*</th><td align=right>$free_count</td><td align=right>$free_pct</td></tr>\n";
print "<tr><th>Non-Free</th><td align=right>$nonfree_count</td><td align=right>$nonfree_pct</td></tr>\n";
print "<tr><th>Unknown</th><td align=right>$unknown_count</td><td align=right>$unknown_pct</td></tr>\n";
print "<tr><th>Total</th><td align=right>$total</td></tr>";
print "</table>\n";
print "<p>*Free licenses include GFDL, GPL, OPL, and PD.\n";
@ -120,14 +120,14 @@ print "<table>\n";
print "<tr><th>Class</th><th>Count</th><th>Percent</th></tr>";
while (@row = $result->fetchrow) {
print "<tr>\n";
print "<td>" . $row[0] . "</td>\n";
print "<th>" . $row[0] . "</th>\n";
print "<td align=right>" . $row[1] . "</td>\n";
$pct = sprintf( '%3.2f', $row[1] / $document_count * 100 );
print "<td align=right>" . $pct . "%</td>\n";
print "</tr>\n";
$total = $total + $row[1];
}
print "<tr><td>Total</td><td align=right>" . $total . "</td></tr>";
print "<tr><th>Total</th><td align=right>" . $total . "</td></tr>";
print "</table>\n";
@ -143,14 +143,14 @@ print "<table>\n";
print "<tr><th>Format</th><th>Count</th><th>Percent</th></tr>";
while (@row = $result->fetchrow) {
print "<tr>\n";
print "<td>" . $row[0] . "</td>\n";
print "<th>" . $row[0] . "</th>\n";
print "<td align=right>" . $row[1] . "</td>\n";
$pct = sprintf( '%3.2f', $row[1] / $document_count * 100 );
print "<td align=right>" . $pct . "%</td>\n";
print "</tr>\n";
$total = $total + $row[1];
}
print "<tr><td>Total</td><td align=right>" . $total . "</td></tr>";
print "<tr><th>Total</th><td align=right>" . $total . "</td></tr>";
print "</table>\n";
@ -166,14 +166,14 @@ print "<table>\n";
print "<tr><th>DTD</th><th>Count</th><th>Percent</th></tr>";
while (@row = $result->fetchrow) {
print "<tr>\n";
print "<td>" . $row[0] . "</td>\n";
print "<th>" . $row[0] . "</th>\n";
print "<td align=right>" . $row[1] . "</td>\n";
$pct = sprintf( '%3.2f', $row[1] / $document_count * 100 );
print "<td align=right>" . $pct . "%</td>\n";
print "</tr>\n";
$total = $total + $row[1];
}
print "<tr><td>Total</td><td align=right>" . $total . "</td></tr>";
print "<tr><th>Total</th><td align=right>" . $total . "</td></tr>";
print "</table>\n";
print "<p><hr>";
@ -192,14 +192,14 @@ while (@row = $result->fetchrow) {
$count = $row[2];
$pct = sprintf( '%3.2f', $count / $document_count * 100 );
print "<tr>\n";
print "<td>$format</td>\n";
print "<td>$dtd</td>\n";
print "<th>$format</th>\n";
print "<th>$dtd</th>\n";
print "<td align=right>$count</td>\n";
print "<td align=right>" . $pct . "%</td>\n";
print "</tr>\n";
$total = $total + $count;
}
print "<tr><td>Total</td><td></td><td align=right>" . $total . "</td></tr>";
print "<tr><th>Total</th><td></td><td align=right>" . $total . "</td></tr>";
print "</table>\n";
print "<p><hr>";
@ -215,16 +215,16 @@ print "<table>\n";
print "<tr><th>Class</th><th>DTD</th><th>Format</th><th>Count</th><th>Percent</th></tr>";
while (@row = $result->fetchrow) {
print "<tr>\n";
print "<td>" . $row[0] . "</td>\n";
print "<td>" . $row[1] . "</td>\n";
print "<td>" . $row[2] . "</td>\n";
print "<th>" . $row[0] . "</th>\n";
print "<th>" . $row[1] . "</th>\n";
print "<th>" . $row[2] . "</th>\n";
print "<td align=right>" . $row[3] . "</td>\n";
$pct = sprintf( '%3.2f', $row[3] / $document_count * 100 );
print "<td align=right>" . $pct . "%</td>\n";
print "</tr>\n";
$total = $total + $row[3];
}
print "<tr><td>Total</td><td></td><td></td><td align=right>" . $total . "</td></tr>";
print "<tr><th>Total</th><td></td><td></td><td align=right>" . $total . "</td></tr>";
print "</table>\n";
@ -263,7 +263,7 @@ while (@row = $result->fetchrow) {
print "<table>\n";
print "<tr><th>Statistic</th><th>Value</th></tr>";
print "<tr><td>Average Age Since Last Update</td><td>&nbsp;";
print "<tr><th>Average Age Since Last Update</th><td>&nbsp;";
printf "%i", $avg_age;
print " days</td></tr>";
print "</table>\n";

View File

@ -37,14 +37,16 @@ system("./navbar.pl");
print "<p>ID: $maintainer_id";
print "<form name=edit method=POST action='maintainer_save.pl'>";
printf "<p>\n";
print "<input type=hidden name=maintainer_id value=$maintainer_id></input>";
printf "<p>\n";
printf "<p><table><tr><th>Name</th><th>Email</th></tr>";
print "</tr>\n";
print "<tr><td>\n";
print 'Name: <input type=text name="maintainer_name" size=30 value="' . $maintainer_name . '"></input><br>';
printf "<p>\n";
printf "</td><td>\n";
print 'Email: <input type=text name="email" size=30 value="' . $email . '"></input><br>';
printf "<p>\n";
print "</td><td>\n";
print "<input type=submit value=Save>";
print "</td></tr></table>\n";
print "</form>";
$docs_result = $conn->exec("SELECT document.doc_id, document.title, class, pub_status.pub_status_name, document_maintainer.role, document_maintainer.active, document_maintainer.email, document.url FROM document_maintainer, document, pub_status WHERE document_maintainer.maintainer_id = $maintainer_id AND document.pub_status = pub_status.pub_status AND document_maintainer.doc_id = document.doc_id ORDER BY document.title");

View File

@ -32,6 +32,7 @@ print "<h1>LDP Maintainers</h1>\n";
system("./navbar.pl");
print "<p><table border=0>\n";
print "<tr><th>Name</th><th>Email</th></tr>\n";
while (@row = $result->fetchrow) {
$maintainer_id = $row[0];
$maintainer_name = $row[1];

View File

@ -27,6 +27,8 @@ $admin = 'f' unless ($admin eq 't');
$editor_id = param('editor_id');
$editor_id = 0 unless ($editor_id);
$password = param('password');
$password =~ s/^\s+//;
$password =~ s/\s+$//;
$conn=Pg::connectdb("dbname=$dbmain");