Some small style tweaks
This commit is contained in:
parent
627fe02bda
commit
a65dc26506
|
@ -18,14 +18,14 @@ helper pg => sub {
|
||||||
my $env = app->mode() eq 'development' ? 'dev_env' : 'prod_env';
|
my $env = app->mode() eq 'development' ? 'dev_env' : 'prod_env';
|
||||||
|
|
||||||
state $pg = Mojo::Pg->new(
|
state $pg = Mojo::Pg->new(
|
||||||
'postgres://' .
|
'postgres://' .
|
||||||
app->config->{$env}->{'pg_user'} .
|
app->config->{$env}{'pg_user'} .
|
||||||
':' .
|
':' .
|
||||||
app->config->{$env}->{'pg_pw'} .
|
app->config->{$env}{'pg_pw'} .
|
||||||
'@' .
|
'@' .
|
||||||
app->config->{$env}->{'pg_host'} .
|
app->config->{$env}{'pg_host'} .
|
||||||
'/' .
|
'/' .
|
||||||
app->config->{$env}->{'pg_db'}
|
app->config->{$env}{'pg_db'}
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -28,7 +28,9 @@ sub send_post($self, $name, $msg) {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
sub view_posts($self, $this_page, $last_page, @posts) {
|
sub view_posts($self, $this_page, $last_page = undef, @posts) {
|
||||||
|
$last_page //= get_last_page(@posts);
|
||||||
|
|
||||||
my $last_post = $this_page * $self->{'max_posts'} - 1;
|
my $last_post = $this_page * $self->{'max_posts'} - 1;
|
||||||
my $first_post = $last_post - $self->{'max_posts'} + 1;
|
my $first_post = $last_post - $self->{'max_posts'} + 1;
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
% layout 'default';
|
% layout 'default';
|
||||||
% title 'Home';
|
% title 'View';
|
||||||
<h2>Messages from the World Wide Web</h2>
|
<h2>Messages from the World Wide Web</h2>
|
||||||
<table>
|
<table>
|
||||||
<% for my $row (@$view_posts) { %>
|
<% for my $row (@$view_posts) { %>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
% layout 'default';
|
% layout 'default';
|
||||||
% title 'New Post';
|
% title 'Sign';
|
||||||
<h2>Sign the Guestbook</h2>
|
<h2>Sign the Guestbook</h2>
|
||||||
<form method="post">
|
<form method="post">
|
||||||
<table>
|
<table>
|
||||||
|
@ -15,21 +15,21 @@
|
||||||
<th>SwaggCAPTCHA™:</th>
|
<th>SwaggCAPTCHA™:</th>
|
||||||
<td>
|
<td>
|
||||||
<%= radio_button answer => 0 %>
|
<%= radio_button answer => 0 %>
|
||||||
<%= label_for answer => "I don\'t want to post" %>
|
<%= label_for answer => 'I don\'t want to sign' %>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th> </th>
|
<th> </th>
|
||||||
<td>
|
<td>
|
||||||
<%= radio_button answer => "false" %>
|
<%= radio_button answer => "false" %>
|
||||||
<%= label_for answer => "I\'m ready to post (choose this one)" %>
|
<%= label_for answer => 'I\'m ready to sign (choose this one)' %>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th> </th>
|
<th> </th>
|
||||||
<td>
|
<td>
|
||||||
<%= radio_button answer => undef %>
|
<%= radio_button answer => undef %>
|
||||||
<%= label_for answer => 'This is spam, do not post' %>
|
<%= label_for answer => 'This is spam/I\'m a bot, do not sign' %>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user