Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions templates/about
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[% WRAPPER common_htmlpage title="Debian Pastezone" %]
[%- WRAPPER common_htmlpage title="Debian Pastezone" -%]
<h1>About this Site</h1><br />

<p>
Expand All @@ -11,6 +11,6 @@ http://git.snow-crash.org/?p=paste.pl.git</a> or <a href="https://github.com/for
https://github.com/formorer/paste.pl</a>
and can be cloned via <i>git clone git://git.snow-crash.org/paste.pl</i>.

[% END %]
[%- END -%]
[%# vim: syntax=html sw=4 ts=4 noet shiftround
%]
24 changes: 12 additions & 12 deletions templates/after_paste
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
[% WRAPPER common_htmlpage title="Debian Pastezone" %]
[% USE format %]
[%- WRAPPER common_htmlpage title="Debian Pastezone" -%]
[%- USE format -%]

[% IF status %]
[%- IF status -%]
<div class=status>
[% status %]
[%- status -%]
</div>
[% STOP %]
[% END %]
[%- STOP -%]
[%- END -%]
<h1>Your entry has been added to the database</h1><br />
<ul>
<li>To link to your entry use: <a href="[% id %]">[% base_url %]/[% id %]</a></li>
<li>To download your entry use: <a href="download/[% id %]">[% base_url %]/download/[% id %]</a></li>
<li>To see your entry as plain text use: <a href="plain/[% id %]">[% base_url %]/plain/[% id %]</a></li>
<li>To delete your entry use: <a href="delete/[% digest %]">[% base_url %]/delete/[% digest %]</a></li>
<li>To link to your entry use: <a href="[%- id -%]">[%- base_url -%]/[%- id -%]</a></li>
<li>To download your entry use: <a href="download/[%- id -%]">[%- base_url -%]/download/[%- id -%]</a></li>
<li>To see your entry as plain text use: <a href="plain/[%- id -%]">[%- base_url -%]/plain/[%- id -%]</a></li>
<li>To delete your entry use: <a href="delete/[%- digest -%]">[%- base_url -%]/delete/[%- digest -%]</a></li>
</ul>
[% INCLUDE include_show %]
[% END %]
[%- INCLUDE include_show -%]
[%- END -%]

[%# vim: syntax=html sw=4 ts=4 noet shiftround
%]
Expand Down
4 changes: 2 additions & 2 deletions templates/clients
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[% WRAPPER common_htmlpage title="Debian Pastezone" %]
[%- WRAPPER common_htmlpage title="Debian Pastezone" -%]
<h1>XML-RPC Clients for paste.debian.net</h1><br />

<p>
Expand All @@ -14,7 +14,7 @@ There are some clients available for the XML-RPC interface of

If you have any additions please drop me a mail.

[% END %]
[%- END -%]
[%# vim: syntax=html sw=4 ts=4 noet shiftround
%]

6 changes: 3 additions & 3 deletions templates/common_error
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[% WRAPPER common_htmlpage title="Debian paste error" %]
[%- WRAPPER common_htmlpage title="Debian paste error" -%]
<center>
<h2>Some Error</h2>
Some strange error has been occurred: <br /> [% error.info %]<br />
Some strange error has been occurred: <br /> [%- error.info -%]<br />
<b>Please contact the <a href=mailto:formorer@debian.org>admin</a> about the problem</b>
</center>
[% END %]
[%- END -%]
8 changes: 4 additions & 4 deletions templates/common_htmlpage
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
[% INCLUDE common_htmltop %]
[%- INCLUDE common_htmltop -%]
<div id="content">
[% content %]
[% INCLUDE navbar %]
[%- content -%]
[%- INCLUDE navbar -%]

[% INCLUDE common_htmlbottom %]
[%- INCLUDE common_htmlbottom -%]

[%# vim: syntax=html sw=4 ts=4 noet shiftround
%]
Expand Down
6 changes: 3 additions & 3 deletions templates/common_htmltop
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
[% USE CGI %]
[%- USE CGI -%]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>[% title %]</title>
<title>[%- title -%]</title>
<link rel="stylesheet" type="text/css" href="/pastebin.css" />
</head>

<body>

<center><a href="/"><img src="/images/debian.png" alt="" border="0" hspace="0" vspace="0" height="61" /></a></center><br />
<div id="titlebar">[% title %]</div>
<div id="titlebar">[%- title -%]</div>

[%# vim: syntax=html sw=4 ts=4 noet shiftround
%]
Expand Down
2 changes: 1 addition & 1 deletion templates/dberror
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<center>
<h2>Database Error</h2>
A database error has occurred: <br /> [% error.info %]<br />
A database error has occurred: <br /> [%- error.info -%]<br />
<b>Please contact the <a href=mailto:formorer@debian.org>admin</a> about the problem</b>
</center>
10 changes: 5 additions & 5 deletions templates/error
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[% WRAPPER common_htmlpage title="Debian Pastezone error" %]
[%- WRAPPER common_htmlpage title="Debian Pastezone error" -%]
<center>
<h2>[% heading %]</h2>
A error has occurred: <br /> [% text %]<br />
<h2>[%- heading -%]</h2>
A error has occurred: <br /> [%- text -%]<br />
</center>
[% END %]
[% WRAPPER common_htmlbottom %]
[%- END -%]
[%- WRAPPER common_htmlbottom -%]
6 changes: 3 additions & 3 deletions templates/hidden
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[% WRAPPER common_htmlpage title="Debian Pastezone" %]
[% INCLUDE include_hidden %]
[% END %]
[%- WRAPPER common_htmlpage title="Debian Pastezone" -%]
[%- INCLUDE include_hidden -%]
[%- END -%]
[%# vim: syntax=html sw=4 ts=4 noet shiftround
%]

148 changes: 74 additions & 74 deletions templates/include_hidden
Original file line number Diff line number Diff line change
@@ -1,88 +1,88 @@
[% USE format %]
[% USE HighlightPygments %]
[% USE CGI %]
[% TRY %]
[% USE mydb = DBI(dbname, dbuser, dbpass) %]
[% CATCH %]
[% INCLUDE dberror %]
[% STOP %]
[% END %]
[%- USE format -%]
[%- USE HighlightPygments -%]
[%- USE CGI -%]
[%- TRY -%]
[%- USE mydb = DBI(dbname, dbuser, dbpass) -%]
[%- CATCH -%]
[%- INCLUDE dberror -%]
[%- STOP -%]
[%- END -%]

[% TRY -%]
[% entry = mydb.query ("SELECT substring(sha1 FROM 1 FOR 8) AS id, id as paste_id, poster,lang_id,code,date_trunc('second', posted + interval '1 second' * expires) as expiredate,date_trunc('second', posted) as postedate, expires from paste where substring(sha1 FROM 1 FOR 8) = '$show'") %]
[% IF entry.size != 1 %]
[%THROW notfound "Entry was not found in database" %]
[% END %]
[% FOREACH entry = mydb.query ("SELECT substring(sha1 FROM 1 FOR 8) AS id, id as paste_id, lang_id,poster,code,date_trunc('second', posted) as postedate,code,date_trunc('second', posted + interval '1 second' * expires) as expiredate, expires from paste where substring(sha1 FROM 1 FOR 8) = '$show'") %]
[% END %]
[% FOREACH language = mydb.query ("SELECT * from lang where lang_id = $entry.lang_id") %]
[% END %]
[% CATCH %]
[% INCLUDE common_error %]
[% STOP %]
[%- TRY -%]
[%- entry = mydb.query ("SELECT substring(sha1 FROM 1 FOR 8) AS id, id as paste_id, poster,lang_id,code,date_trunc('second', posted + interval '1 second' * expires) as expiredate,date_trunc('second', posted) as postedate, expires from paste where substring(sha1 FROM 1 FOR 8) = '$show'") -%]
[%- IF entry.size != 1 -%]
[%THROW notfound "Entry was not found in database" -%]
[%- END -%]
[%- FOREACH entry = mydb.query ("SELECT substring(sha1 FROM 1 FOR 8) AS id, id as paste_id, lang_id,poster,code,date_trunc('second', posted) as postedate,code,date_trunc('second', posted + interval '1 second' * expires) as expiredate, expires from paste where substring(sha1 FROM 1 FOR 8) = '$show'") -%]
[%- END -%]
[%- FOREACH language = mydb.query ("SELECT * from lang where lang_id = $entry.lang_id") -%]
[%- END -%]
[%- CATCH -%]
[%- INCLUDE common_error -%]
[%- STOP -%]

[% END %]
[%- END -%]

[%IF status -%]
<div id="status">
[% status %]
[%- status -%]
</div>
[% END %]
[%- END -%]

<h1><b>hidden</b> Posting [% entry.id %] from [% entry.poster %] posted at [% entry.postedate %] expires:
[% IF entry.expires == -1 %]
<h1><b>hidden</b> Posting [%- entry.id -%] from [%- entry.poster -%] posted at [%- entry.postedate -%] expires:
[%- IF entry.expires == -1 -%]
never
[% ELSE %]
[% entry.expiredate %]
[% END %]
[%- ELSE -%]
[%- entry.expiredate -%]
[%- END -%]
</h1>

[% TRY -%]
[% IF entry.code -%]
[% IF entry.lang_id == -1 %]
[% language.desc = "text" %]
[% END %]
[% IF lines == 0 %]
[% FILTER highlight "$language.desc" linenumbers = 0 cache=0 cache_dir="cache/" -%]
[% entry.code -%]
[% END -%]
[% ELSE %]
[% FILTER highlight "$language.desc" linenumbers = 1 cache=0 cache_dir="cache/" -%]
[% entry.code -%]
[% END -%]
[% END %]
[%- TRY -%]
[%- IF entry.code -%]
[%- IF entry.lang_id == -1 -%]
[%- language.desc = "text" -%]
[%- END -%]
[%- IF lines == 0 -%]
[%- FILTER highlight "$language.desc" linenumbers = 0 cache=0 cache_dir="cache/" -%]
[%- entry.code -%]
[%- END -%]
[%- ELSE -%]
[%- FILTER highlight "$language.desc" linenumbers = 1 cache=0 cache_dir="cache/" -%]
[%- entry.code -%]
[%- END -%]
[%- END -%]
<br/>
<a href='[% base_url %]/plainh/[% entry.id %]'>Show as text</a> |
<a href='[% base_url %]/downloadh/[% entry.id %]'>Download</a> |
[% IF lines == 0 %]
<a href='[% base_url %]/?hidden=[% entry.id %];lines=1'>With linenumbers</a> |
[% ELSE %]
<a href='[% base_url %]/?hidden=[% entry.id %];lines=0'>Without linenumbers</a> |
[% END %]
<a href='[% base_url %]/?as_hidden=1'>Paste new</a> |
<a href='[%- base_url -%]/plainh/[%- entry.id -%]'>Show as text</a> |
<a href='[%- base_url -%]/downloadh/[%- entry.id -%]'>Download</a> |
[%- IF lines == 0 -%]
<a href='[%- base_url -%]/?hidden=[%- entry.id -%];lines=1'>With linenumbers</a> |
[%- ELSE -%]
<a href='[%- base_url -%]/?hidden=[%- entry.id -%];lines=0'>Without linenumbers</a> |
[%- END -%]
<a href='[%- base_url -%]/?as_hidden=1'>Paste new</a> |
<br/>
[% END %]
[% CATCH -%]
[%- END -%]
[%- CATCH -%]
<pre>
[% entry.code | html -%]
[%- entry.code | html -%]
</pre>
[% END %]
[% comments = mydb.query ("SELECT text,name,date_trunc('second', date) as postedate from comments where paste_id = '$entry.paste_id'") %]
[% IF comments.size >= 1 %]
[%- END -%]
[%- comments = mydb.query ("SELECT text,name,date_trunc('second', date) as postedate from comments where paste_id = '$entry.paste_id'") -%]
[%- IF comments.size >= 1 -%]
<p>
[% FOREACH comment = mydb.query ("SELECT text,name,date_trunc('second', date) as postedate from comments where paste_id = '$entry.paste_id'") %]
[%- FOREACH comment = mydb.query ("SELECT text,name,date_trunc('second', date) as postedate from comments where paste_id = '$entry.paste_id'") -%]
<div id="comment_header">
Posted on [% comment.postedate %] by [% comment.name | html %]:</div>
Posted on [%- comment.postedate -%] by [%- comment.name | html -%]:</div>
<div id="comment">
[% comment.text | html %]<br />
[%- comment.text | html -%]<br />
</div>
[% END %]
[% END %]
[%- END -%]
[%- END -%]
<div id="comment_add">
<b>Add Comment:</b>
<form name="add_comment" id="add_comment" method="post" action="./">
<label for="poster" form="add_comment"><b>Name</b></label><br/><input type="hidden" name="paste_id" value="[% entry.paste_id %]"/>
<input type="text" maxlength="24" size="24" name="poster" id="poster" value="[% CGI.cookie('paste_name') | html %]" />
<label for="poster" form="add_comment"><b>Name</b></label><br/><input type="hidden" name="paste_id" value="[%- entry.paste_id -%]"/>
<input type="text" maxlength="24" size="24" name="poster" id="poster" value="[%- CGI.cookie('paste_name') | html -%]" />
<br />
<label for="comment"><b>Comment</b></label>
<br />
Expand All @@ -91,21 +91,21 @@ Posted on [% comment.postedate %] by [% comment.name | html %]:</div>
<input type="hidden" name="hide" value="1">
</form>
</div>
[% IF CGI.cookie('session_id') -%]
[% session_id = CGI.cookie('session_id') %]
[% FOREACH post = mydb.query("SELECT sha1, id from paste WHERE sessionid = '$session_id' AND substring(sha1 FROM 1 FOR 8) = '$show'") %]
[%- IF CGI.cookie('session_id') -%]
[%- session_id = CGI.cookie('session_id') -%]
[%- FOREACH post = mydb.query("SELECT sha1, id from paste WHERE sessionid = '$session_id' AND substring(sha1 FROM 1 FOR 8) = '$show'") -%]

<h1>Information about your entry</h1>
<br />
<b>This entry is hidden. So don't lose your hidden id ([% show %])</b>
<b>This entry is hidden. So don't lose your hidden id ([%- show -%])</b>
<ul>
<li>To link to your entry use: <a href="[% base_url %]/hidden/[% show %]">[% base_url.substr(2) %]/hidden/[% show %]</a></li>
<li>To download your entry use: <a href="[% base_url %]/downloadh/[% show %]">[% base_url.substr(2) %]/download_h/[% show %]</a></li>
<li>To see your entry as plain text use: <a href="[% base_url %]/plainh/[% show %]">[% base_url.substr(2) %]/plain_h/[% show %]</a></li>
<li>To delete your entry use: <a href="[% base_url %]/delete/[% post.sha1 %]">[% base_url.substr(2) %]/delete/[% post.sha1 %]</a></li>
<li>To link to your entry use: <a href="[%- base_url -%]/hidden/[%- show -%]">[%- base_url.substr(2) -%]/hidden/[%- show -%]</a></li>
<li>To download your entry use: <a href="[%- base_url -%]/downloadh/[%- show -%]">[%- base_url.substr(2) -%]/download_h/[%- show -%]</a></li>
<li>To see your entry as plain text use: <a href="[%- base_url -%]/plainh/[%- show -%]">[%- base_url.substr(2) -%]/plain_h/[%- show -%]</a></li>
<li>To delete your entry use: <a href="[%- base_url -%]/delete/[%- post.sha1 -%]">[%- base_url.substr(2) -%]/delete/[%- post.sha1 -%]</a></li>
</ul>
[% END -%]
[% END -%]
[%- END -%]
[%- END -%]


[%# vim: syntax=html sw=4 ts=4 noet shiftround
Expand Down
Loading