Browse Source

* fix pages for zerobin

master
Alex "AdUser" Z 10 years ago
parent
commit
afa1f146c1
  1. 22
      templates/zerobin/create.html.ep
  2. 20
      templates/zerobin/view.html.ep

22
templates/zerobin/create.html.ep

@ -3,11 +3,14 @@
% my %times = (day => 1, week => 7, month => 30, quarter => 90, year => 395); % my %times = (day => 1, week => 7, month => 30, quarter => 90, year => 395);
% my @times = map { [l($_) => $times{$_}] } sort { $times{$a} <=> $times{$b} } keys(%times); % my @times = map { [l($_) => $times{$_}] } sort { $times{$a} <=> $times{$b} } keys(%times);
% stash 'styles' => 'zerobin'; % stash 'styles' => 'zerobin';
% stash 'expire' => 30; % param 'expire' => 30;
% my $syntax = (stash 'syntax') || [];
% param 'syntax' => '';
% my %opts = (id => 'paste', name => 'paste', required => 1);
<h1>Создать запись</h1> <h1>Создать запись</h1>
<div> <div>
<%= form_for "/zerobin2" => (method => 'POST') => begin %>
<div> <div>
<%= form_for "/zerobin2/create" => (method => 'POST') => begin %>
<span class="zerobin cblock"> <span class="zerobin cblock">
<%= submit_button l('Save') %> <%= submit_button l('Save') %>
</span> </span>
@ -16,13 +19,18 @@
<%= select_field 'expire' => \@times %> <%= select_field 'expire' => \@times %>
</span> </span>
<span class="zerobin cblock"> <span class="zerobin cblock">
<%= check_box 'syntax' => 0 %> <%= tag 'label' => (for => 'syntax') => l('Syntax') %>:
<%= tag 'label' => (for => 'syntax') => l('Syntax highlight') %> <%= select_field 'syntax' => $syntax; %>
</span> </span>
<% end %>
</div> </div>
<hr style="width: 50%"/>
<div> <div>
<%= tag 'textarea' => (id => "paste", placeholder => l('Paste your text here')) => '' %> <%= tag 'textarea' => (placeholder => l('Paste your text here'), %opts) => '' %>
</div> </div>
<% end %>
</div>
% my $result = (flash 'result') || '';
% if ($result) {
<div>
<p style="color: red; font-size: 14pt;"><%= l(ucfirst($result)) %></p>
</div> </div>
% }

20
templates/zerobin/view.html.ep

@ -6,24 +6,14 @@
<div> <div>
<div> <div>
<span class="zerobin cblock"> <span class="zerobin cblock">
<%= link_to l('Create new') => "/zerobin2/create" %> <%= link_to l('Create new') => "/zerobin2" %>
</span> </span>
</div> </div>
<br/> <br/>
% my $paste = (stash 'paste') || {};
% my $syntax = $paste->{syntax};
% my @opts = ($syntax and $syntax ne 'auto') ? (class => $syntax) : ();
<div> <div>
<pre><code class="perl"> <pre><%= tag 'code' => (@opts) => $paste->{data}; %></pre>
package LDV::Zerobin;
use strict;
use warnings;
use utf8;
use Mojo::Base 'Mojolicious::Controller';
sub view { my ($self) = @_; $self->render(); }
sub create { my ($self) = @_; $self->render(); }
1;
</code></pre>
</div> </div>
</div> </div>

Loading…
Cancel
Save