3 %# Pastebin editing webservice for Odin
5 %# (c) 2015 Mark Wooding
7 %#----- Licensing notice ----------------------------------------------------
9 %# This file is part of the `odin.gg' service, `odin-cgi'.
11 %# `odin-cgi' is free software; you can redistribute it and/or modify
12 %# it under the terms of the GNU Affero General Public License as
13 %# published by the Free Software Foundation; either version 3 of the
14 %# License, or (at your option) any later version.
16 %# `odin-cgi' is distributed in the hope that it will be useful,
17 %# but WITHOUT ANY WARRANTY; without even the implied warranty of
18 %# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 %# GNU Affero General Public License for more details.
21 %# You should have received a copy of the GNU Affero General Public
22 %# License along with `odin-cgi'; if not, see
23 %# <http://www.gnu.org/licenses/>.
25 <&| SELF:wrapper, title => "odin.gg Paste Bin" &>
26 <h1><tt>odin.gg</tt> Paste Bin</h1>
28 % my $sep = "<div class=menu>\n";
32 <span class="item"><a href="<% "$Odin::PASTEBIN/$tag" %>">View</a></span>
33 <span class="item"><a href="<% "$Odin::PASTEBIN/$tag?edit=$edit;op=del" %>">Delete</a></span>
34 <span class="item"><a href="<% "$Odin::PASTEBIN/" %>">New</a></span>
35 % $sep = ""; $end = "</div>\n";
39 <form method="POST" action="<% "$Odin::PASTEBIN/$tag" %>"
40 accept-charset="UTF-8" enctype="multipart/form-data">
41 <div class="pastebin">
42 % if (defined $edit) {
43 <input type="hidden" name="edit" value="<% $edit |h %>">
46 <label class="invis" for="content" accesskey="c"><u>C</u>ontent</label>
47 <textarea id="content" name="content" rows=48 cols=80><%
48 $content |h %></textarea>
50 <div class="paste-widgets">
52 <label class="invis" for="lang" accesskey="l"><u>L</u>abel</label>
53 <select id="lang" name="lang" default="txt">
54 % my $lh = $db->selectall_hashref
55 % ("SELECT lang, descr FROM odin_pastebin_lang", "descr");
56 % for my $d (sort { Odin::nice_name $a cmp Odin::nice_name $b }
58 % my $l = $lh->{$d}{lang};
59 <option value="<% $l %>"<%
60 $l eq $lang ? " selected" : "" %>><%
65 <label class="invis" for="title" accesskey="t"><u>T</u>itle</label>
66 <input id="title" name="title" value="<% $title |h %>">
68 <button type="submit">Go</button>
80 $title => "(untitled)"
84 my $db = Odin::open_db;