Some small style tweaks

This commit is contained in:
swagg boi 2021-12-19 17:43:58 -05:00
parent 627fe02bda
commit a65dc26506
4 changed files with 16 additions and 14 deletions

View file

@ -18,14 +18,14 @@ helper pg => sub {
my $env = app->mode() eq 'development' ? 'dev_env' : 'prod_env';
state $pg = Mojo::Pg->new(
'postgres://' .
app->config->{$env}->{'pg_user'} .
':' .
app->config->{$env}->{'pg_pw'} .
'@' .
app->config->{$env}->{'pg_host'} .
'/' .
app->config->{$env}->{'pg_db'}
'postgres://' .
app->config->{$env}{'pg_user'} .
':' .
app->config->{$env}{'pg_pw'} .
'@' .
app->config->{$env}{'pg_host'} .
'/' .
app->config->{$env}{'pg_db'}
);
};

View file

@ -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 $first_post = $last_post - $self->{'max_posts'} + 1;

View file

@ -1,5 +1,5 @@
% layout 'default';
% title 'Home';
% title 'View';
<h2>Messages from the World Wide Web</h2>
<table>
<% for my $row (@$view_posts) { %>

View file

@ -1,5 +1,5 @@
% layout 'default';
% title 'New Post';
% title 'Sign';
<h2>Sign the Guestbook</h2>
<form method="post">
<table>
@ -15,21 +15,21 @@
<th>SwaggCAPTCHA™:</th>
<td>
<%= radio_button answer => 0 %>
<%= label_for answer => "I don\'t want to post" %>
<%= label_for answer => 'I don\'t want to sign' %>
</td>
</tr>
<tr>
<th>&nbsp;</th>
<td>
<%= 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>
</tr>
<tr>
<th>&nbsp;</th>
<td>
<%= 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>
</tr>
<tr>