mirror of https://github.com/tLDP/LDP
more database interface changes for the Wiki, plus help
This commit is contained in:
parent
17232da14f
commit
09c3998dc8
|
@ -1,3 +1,4 @@
|
|||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
|
|
|
@ -0,0 +1,66 @@
|
|||
#! /usr/bin/perl
|
||||
|
||||
use CGI qw(:standard);
|
||||
use Pg;
|
||||
|
||||
$query = new CGI;
|
||||
|
||||
$dbmain = "ldp";
|
||||
@row;
|
||||
|
||||
# Read parameters
|
||||
$doc_id = param('doc_id');
|
||||
|
||||
print header(-expires=>'now');
|
||||
|
||||
$conn=Pg::connectdb("dbname=$dbmain");
|
||||
die $conn->errorMessage unless PGRES_CONNECTION_OK eq $conn->status;
|
||||
|
||||
$result = $conn->exec("SELECT title, filename FROM document WHERE doc_id = $doc_id");
|
||||
die $conn->errorMessage unless PGRES_TUPLES_OK eq $result->resultStatus;
|
||||
@row = $result->fetchrow;
|
||||
$title = $row[0];
|
||||
$title =~ s/\s+$//;
|
||||
$filename = $row[1];
|
||||
|
||||
print "<html><head><title>$title Wiki</title>";
|
||||
print "<link rel=stylesheet href='../ldp.css' type='text/css'>";
|
||||
print "</head>";
|
||||
print "<body>";
|
||||
|
||||
print "<h1>$title Wiki</h1>\n";
|
||||
|
||||
print "<p><a href='/index.html'>Index</a> ";
|
||||
print "<a href='/cgi-bin/document_list.pl'>Documents</a> ";
|
||||
print "<a href='/cgi-bin/topic_list.pl'>Topics</a> ";
|
||||
print "<a href='/cgi-bin/maintainer_list.pl'>Maintainers</a> ";
|
||||
print "<a href='/cgi-bin/editor_list.pl'>Editors</a> ";
|
||||
print "<a href='/cgi-bin/ldp_stats.pl'>Statistics</a> ";
|
||||
print "<a href='/help/'>Help</a> ";
|
||||
|
||||
print "<p>";
|
||||
print "<a href='document_edit.pl?doc_id=$doc_id'>Meta-Data</a>\n";
|
||||
print " | ";
|
||||
print "<a href='document_wiki.pl?doc_id=$doc_id'>Edit</a>\n";
|
||||
|
||||
print "<p><table>\n";
|
||||
print "<tr><th align=right>Revision</th><th>Saved</th><th>Comment</th><th>User</th></tr>\n";
|
||||
$result = $conn->exec("SELECT revision, date_entered, wiki, notes, username FROM document_wiki WHERE doc_id = $doc_id ORDER BY revision DESC LIMIT 10, 0");
|
||||
die $conn->errorMessage unless PGRES_TUPLES_OK eq $result->resultStatus;
|
||||
while (@row = $result->fetchrow) {
|
||||
$revision = $row[0];
|
||||
$date_entered = $row[1];
|
||||
$wiki = $row[2];
|
||||
$wiki =~ s/\s+$//;
|
||||
$notes = $row[3];
|
||||
$username = $row[4];
|
||||
|
||||
print "<tr><td align=right>$revision</td>\n";
|
||||
print "<td>$date_entered</td>\n";
|
||||
print "<td>$notes</td>\n";
|
||||
print "<td>$username</td></tr>\n";
|
||||
}
|
||||
print "</table>\n";
|
||||
|
||||
print end_html;
|
||||
|
|
@ -21,6 +21,7 @@
|
|||
<p><ul>
|
||||
<li><a href="../newaccount.html">Getting an account</a></li>
|
||||
<li><a href="license.html">Licensing</a></li>
|
||||
<li><a href="wiki.html">Wiki</a></li>
|
||||
</ul>
|
||||
|
||||
</body>
|
||||
|
|
|
@ -0,0 +1,87 @@
|
|||
<html>
|
||||
<head>
|
||||
<title>LDP Document Database</title>
|
||||
<link rel=stylesheet href="/ldp.css" type="text/css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<h2>Wiki Help</h2>
|
||||
|
||||
<a href="/index.html">Index</a>
|
||||
<a href="/cgi-bin/document_list.pl">Documents</a>
|
||||
<a href='/cgi-bin/topic_list.pl'>Topics</a>
|
||||
<a href='/cgi-bin/maintainer_list.pl'>Maintainers</a>
|
||||
<a href='/cgi-bin/editor_list.pl'>Editors</a>
|
||||
<a href='/cgi-bin/ldp_stats.pl'>Statistics</a>
|
||||
<a href='/help/'>Help</a>
|
||||
|
||||
<p>The LDP is currently experimenting with Wiki-style editing for selected documents.
|
||||
The Wiki functionality allows permitted users to edit documents online, using
|
||||
a web interface.
|
||||
|
||||
<p>To edit your document, click the "Edit" link in the upper right of the Meta-data
|
||||
area on your document's edit page. Only the administrators and the author of a given
|
||||
document can edit it.
|
||||
|
||||
<p>You can use a simplified text based format to write your documentation, so you
|
||||
do not need to use DocBook. It uses a utility called txt2db. The following excerpt
|
||||
from the README for txt2db explains how to use it:
|
||||
|
||||
<pre>
|
||||
TEXT FORMAT DOCBOOK OUTPUT
|
||||
|
||||
=Title= <sect1><title>Title</title>
|
||||
<sect1>
|
||||
|
||||
=Title|id= <sect1 id='id'><title>Title</title>
|
||||
<sect1>
|
||||
|
||||
(works for other sect levels as well)
|
||||
|
||||
==Title== <sect2><title>Title</title>
|
||||
</sect2>
|
||||
|
||||
===Title=== <sect3><title>Title</title>
|
||||
</sect3>
|
||||
|
||||
Foo <para>Foo</para>
|
||||
|
||||
#Foo <orderedlist>
|
||||
#Bar <listitem><para>Foo</para></listitem>
|
||||
#Baz <listitem><para>Bar</para></listitem>
|
||||
<listitem><para>Baz</para></listitem>
|
||||
</orderedlist>
|
||||
|
||||
*Foo <simplelist>
|
||||
#Bar <listitem><para>Foo</para></listitem>
|
||||
#Baz <listitem><para>Bar</para></listitem>
|
||||
<listitem><para>Baz</para></listitem>
|
||||
</simplelist>
|
||||
|
||||
[[http://foo.org]] <ulink url='http://foo.org'>
|
||||
<citetitle>http://foo.org</citetitle>
|
||||
</ulink>
|
||||
|
||||
[[http://foo.org Foo]] <ulink url='http://foo.org'>
|
||||
<citetitle>Foo</citetitle>
|
||||
</ulink>
|
||||
|
||||
[Foo] <filename>Foo</filename>
|
||||
|
||||
'''Foo''' <emphasis>Foo</emphasis>
|
||||
|
||||
<foo></foo> <foo></foo>
|
||||
|
||||
Or, you can insert arbitrary DocBook. It cannot be embedded within anything
|
||||
else, though. In other words, you cannot have DocBook and one of the constructs
|
||||
above in the same line.
|
||||
|
||||
Any text that starts with "<" is considered docbook, until the
|
||||
close tag is found. Tags can be nested arbitrarily deep. It won't be wrapped
|
||||
with <para> tags or anything, so you'll need to do that manually if you
|
||||
insert DocBook.
|
||||
</pre>
|
||||
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,33 @@
|
|||
<html>
|
||||
<head>
|
||||
<title>Insufficient Permissions</title>
|
||||
<link rel=stylesheet href="ldp.css" type="text/css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
|
||||
<h1>Insufficient Permissions</h1>
|
||||
|
||||
<p><a href='/index.html'>Index</a>
|
||||
<a href='/cgi-bin/document_list.pl'>Documents</a>
|
||||
<a href='/cgi-bin/topic_list.pl'>Topics</a>
|
||||
<a href='/cgi-bin/maintainer_list.pl'>Maintainers</a>
|
||||
<a href='/cgi-bin/editor_list.pl'>Editors</a>
|
||||
<a href='/cgi-bin/ldp_stats.pl'>Statistics</a>
|
||||
<a href='/help/'>Help</a>
|
||||
|
||||
<p>You have not been granted permission to make the requested change to
|
||||
the database. If you wish to obtain proper permissions, please write
|
||||
<a href="mailto:david@lupercalia.net">David Merrill</a> and he will set up
|
||||
your permissions.
|
||||
|
||||
<p>Please note that this is intentionally a manual process, so be patient.
|
||||
You will receive confirmation by email once the permissions are established.
|
||||
|
||||
<p><b>Your email must include your username.
|
||||
|
||||
<p><a href="index.html">Return to the LDP Database</a>
|
||||
|
||||
</body>
|
||||
</html>
|
Loading…
Reference in New Issue