From dc5a1749fa9e5005e1acfde47ac1ea61c35fe8b5 Mon Sep 17 00:00:00 2001 From: Shlomi Fish Date: Wed, 8 Nov 2017 17:31:13 +0200 Subject: [PATCH] Remove whitespace in the outputs. Untested - it was excessive though. --- templates/about | 4 +- templates/after_paste | 24 +++---- templates/clients | 4 +- templates/common_error | 6 +- templates/common_htmlpage | 8 +-- templates/common_htmltop | 6 +- templates/dberror | 2 +- templates/error | 10 +-- templates/hidden | 6 +- templates/include_hidden | 148 +++++++++++++++++++------------------- templates/include_show | 130 ++++++++++++++++----------------- templates/links | 4 +- templates/mysql | 4 +- templates/navbar | 108 ++++++++++++++-------------- templates/paste | 92 ++++++++++++------------ templates/shorturl_add | 4 +- templates/shorturl_info | 68 +++++++++--------- templates/show | 6 +- templates/show_message | 8 +-- templates/test | 10 +-- 20 files changed, 326 insertions(+), 326 deletions(-) diff --git a/templates/about b/templates/about index 2bbb1c9..afc8eff 100644 --- a/templates/about +++ b/templates/about @@ -1,4 +1,4 @@ -[% WRAPPER common_htmlpage title="Debian Pastezone" %] +[%- WRAPPER common_htmlpage title="Debian Pastezone" -%]

About this Site


@@ -11,6 +11,6 @@ http://git.snow-crash.org/?p=paste.pl.git or -[% status %] +[%- status -%] -[% STOP %] -[% END %] +[%- STOP -%] +[%- END -%]

Your entry has been added to the database


-[% INCLUDE include_show %] -[% END %] +[%- INCLUDE include_show -%] +[%- END -%] [%# vim: syntax=html sw=4 ts=4 noet shiftround %] diff --git a/templates/clients b/templates/clients index 424bde4..3552a1f 100644 --- a/templates/clients +++ b/templates/clients @@ -1,4 +1,4 @@ -[% WRAPPER common_htmlpage title="Debian Pastezone" %] +[%- WRAPPER common_htmlpage title="Debian Pastezone" -%]

XML-RPC Clients for paste.debian.net


@@ -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 %] diff --git a/templates/common_error b/templates/common_error index 8d4f022..b47fee3 100644 --- a/templates/common_error +++ b/templates/common_error @@ -1,7 +1,7 @@ -[% WRAPPER common_htmlpage title="Debian paste error" %] +[%- WRAPPER common_htmlpage title="Debian paste error" -%]

Some Error

-Some strange error has been occurred:
[% error.info %]
+Some strange error has been occurred:
[%- error.info -%]
Please contact the admin about the problem
-[% END %] +[%- END -%] diff --git a/templates/common_htmlpage b/templates/common_htmlpage index d934512..c048f83 100644 --- a/templates/common_htmlpage +++ b/templates/common_htmlpage @@ -1,9 +1,9 @@ -[% INCLUDE common_htmltop %] +[%- INCLUDE common_htmltop -%]
-[% content %] -[% INCLUDE navbar %] +[%- content -%] +[%- INCLUDE navbar -%] -[% INCLUDE common_htmlbottom %] +[%- INCLUDE common_htmlbottom -%] [%# vim: syntax=html sw=4 ts=4 noet shiftround %] diff --git a/templates/common_htmltop b/templates/common_htmltop index ae5b794..457ec8f 100644 --- a/templates/common_htmltop +++ b/templates/common_htmltop @@ -1,16 +1,16 @@ -[% USE CGI %] +[%- USE CGI -%] - [% title %] + [%- title -%]

-
[% title %]
+
[%- title -%]
[%# vim: syntax=html sw=4 ts=4 noet shiftround %] diff --git a/templates/dberror b/templates/dberror index d14489e..0c4b201 100644 --- a/templates/dberror +++ b/templates/dberror @@ -1,5 +1,5 @@

Database Error

-A database error has occurred:
[% error.info %]
+A database error has occurred:
[%- error.info -%]
Please contact the admin about the problem
diff --git a/templates/error b/templates/error index dbdb6fc..6b911e4 100644 --- a/templates/error +++ b/templates/error @@ -1,7 +1,7 @@ -[% WRAPPER common_htmlpage title="Debian Pastezone error" %] +[%- WRAPPER common_htmlpage title="Debian Pastezone error" -%]
-

[% heading %]

-A error has occurred:
[% text %]
+

[%- heading -%]

+A error has occurred:
[%- text -%]
-[% END %] -[% WRAPPER common_htmlbottom %] +[%- END -%] +[%- WRAPPER common_htmlbottom -%] diff --git a/templates/hidden b/templates/hidden index e1925dd..9b1d204 100644 --- a/templates/hidden +++ b/templates/hidden @@ -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 %] diff --git a/templates/include_hidden b/templates/include_hidden index 625ee1b..eddcfdc 100644 --- a/templates/include_hidden +++ b/templates/include_hidden @@ -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 -%]
-[% status %] +[%- status -%]
-[% END %] +[%- END -%] -

hidden Posting [% entry.id %] from [% entry.poster %] posted at [% entry.postedate %] expires: -[% IF entry.expires == -1 %] +

hidden Posting [%- entry.id -%] from [%- entry.poster -%] posted at [%- entry.postedate -%] expires: +[%- IF entry.expires == -1 -%] never -[% ELSE %] -[% entry.expiredate %] -[% END %] +[%- ELSE -%] +[%- entry.expiredate -%] +[%- 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 %] +[%- 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 -%]
- Show as text | - Download | - [% IF lines == 0 %] - With linenumbers | - [% ELSE %] - Without linenumbers | - [% END %] - Paste new | + Show as text | + Download | + [%- IF lines == 0 -%] + With linenumbers | + [%- ELSE -%] + Without linenumbers | + [%- END -%] + Paste new |
- [% END %] -[% CATCH -%] + [%- END -%] +[%- CATCH -%]
-[% entry.code | html -%]
+[%- entry.code | html -%]
 
-[% 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 -%]

-[% 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'") -%]

-Posted on [% comment.postedate %] by [% comment.name | html %]:
+Posted on [%- comment.postedate -%] by [%- comment.name | html -%]:
-[% comment.text | html %]
+[%- comment.text | html -%]
-[% END %] -[% END %] +[%- END -%] +[%- END -%]
Add Comment:
-
- +
+

@@ -91,21 +91,21 @@ Posted on [% comment.postedate %] by [% comment.name | html %]:
-[% 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'") -%]

Information about your entry


-This entry is hidden. So don't lose your hidden id ([% show %]) +This entry is hidden. So don't lose your hidden id ([%- show -%]) -[% END -%] -[% END -%] +[%- END -%] +[%- END -%] [%# vim: syntax=html sw=4 ts=4 noet shiftround diff --git a/templates/include_show b/templates/include_show index fe4b07d..99f2806 100644 --- a/templates/include_show +++ b/templates/include_show @@ -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 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 id = '$show' and hidden is FALSE") %] - [% IF entry.size != 1 %] - [%THROW notfound "Entry was not found in database" %] - [% END %] - [% FOREACH entry = mydb.query ("SELECT 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 id = '$show' and hidden is FALSE") %] - [% 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 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 id = '$show' and hidden is FALSE") -%] + [%- IF entry.size != 1 -%] + [%THROW notfound "Entry was not found in database" -%] + [%- END -%] + [%- FOREACH entry = mydb.query ("SELECT 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 id = '$show' and hidden is FALSE") -%] + [%- END -%] + [%- FOREACH language = mydb.query ("SELECT * from lang where lang_id = $entry.lang_id") -%] + [%- END -%] +[%- CATCH -%] + [%- INCLUDE common_error -%] +[%- STOP -%] -[% END %] +[%- END -%] [%IF status -%]
-[% status %] +[%- status -%]
-[% END %] +[%- END -%] -

Posting [% entry.id %] from [% entry.poster %] posted at [% entry.postedate %] expires: -[% IF entry.expires == -1 %] +

Posting [%- entry.id -%] from [%- entry.poster -%] posted at [%- entry.postedate -%] expires: +[%- IF entry.expires == -1 -%] never -[% ELSE %] -[% entry.expiredate %] -[% END %] +[%- ELSE -%] +[%- entry.expiredate -%] +[%- 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 %] +[%- 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 -%]
- Show as text | - Download | - [% IF lines == 0 %] - With linenumbers | - [% ELSE %] - Without linenumbers | - [% END %] - Paste new | - Paste as new + Show as text | + Download | + [%- IF lines == 0 -%] + With linenumbers | + [%- ELSE -%] + Without linenumbers | + [%- END -%] + Paste new | + Paste as new
- [% END %] -[% CATCH -%] + [%- END -%] +[%- CATCH -%]
-[% entry.code | html %]
+[%- entry.code | html -%]
 
-[% END %] -[% 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 id = '$show'") %] +[%- END -%] +[%- 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 id = '$show'") -%]

Information about your entry

-[% END -%] -[% END -%] +[%- END -%] +[%- END -%] [%# vim: syntax=html sw=4 ts=4 noet shiftround diff --git a/templates/links b/templates/links index f3946c8..4cbb2bc 100644 --- a/templates/links +++ b/templates/links @@ -3,8 +3,8 @@
  • Add short URL
  • Debian
  • About
  • -
  • XML-RPC Interface
  • -
  • Clients
  • +
  • XML-RPC Interface
  • +
  • Clients
  • Admin

    Alexander Wirt diff --git a/templates/mysql b/templates/mysql index 008b3eb..42781c0 100644 --- a/templates/mysql +++ b/templates/mysql @@ -1,2 +1,2 @@ -[% USE mydb = DBI('dbi:mysql:pastebin', 'root', 'test') %] -[% foo = mydb.query('SELECT * FROM lang') %] +[%- USE mydb = DBI('dbi:mysql:pastebin', 'root', 'test') -%] +[%- foo = mydb.query('SELECT * FROM lang') -%] diff --git a/templates/navbar b/templates/navbar index 51208e7..ac154f4 100644 --- a/templates/navbar +++ b/templates/navbar @@ -1,76 +1,76 @@ -[% TRY %] - [% USE mydb = DBI(dbname, dbuser, dbpass) %] - [% CATCH %] - [% INCLUDE dberror %] - [% STOP %] -[% END %] -[% USE format %] -[% USE HighlightPygments %] +[%- TRY -%] + [%- USE mydb = DBI(dbname, dbuser, dbpass) -%] + [%- CATCH -%] + [%- INCLUDE dberror -%] + [%- STOP -%] +[%- END -%] +[%- USE format -%] +[%- USE HighlightPygments -%] -[% USE CGI %] -[% f = mydb.query("DELETE from paste where posted + interval '1 second' * expires < now() and expires <> '-1'") -%] +[%- USE CGI -%] +[%- f = mydb.query("DELETE from paste where posted + interval '1 second' * expires < now() and expires <> '-1'") -%]