housecleaning
This commit is contained in:
parent
ebdc8790e2
commit
dc6ef77754
|
@ -9,7 +9,6 @@ use List::Util qw{shuffle};
|
||||||
use Regexp::Common qw{URI};
|
use Regexp::Common qw{URI};
|
||||||
use Number::Format qw{format_number};
|
use Number::Format qw{format_number};
|
||||||
use WebService::Discord::Webhook;
|
use WebService::Discord::Webhook;
|
||||||
#use Data::Dumper; # Uncomment for debugging
|
|
||||||
|
|
||||||
# Load the model
|
# Load the model
|
||||||
use lib 'lib';
|
use lib 'lib';
|
||||||
|
@ -19,7 +18,7 @@ use GuestbookNg::Model::Counter;
|
||||||
# Plugins
|
# Plugins
|
||||||
plugin 'Config';
|
plugin 'Config';
|
||||||
plugin 'TagHelpers::Pagination';
|
plugin 'TagHelpers::Pagination';
|
||||||
plugin AssetPack => {pipes => [qw{Css JavaScript Combine}]};
|
plugin AssetPack => {pipes => [qw{Css Combine}]};
|
||||||
|
|
||||||
# Helpers
|
# Helpers
|
||||||
helper pg => sub {
|
helper pg => sub {
|
||||||
|
|
|
@ -4,10 +4,6 @@ use Mojo::Base -base, -signatures;
|
||||||
|
|
||||||
has 'pg';
|
has 'pg';
|
||||||
|
|
||||||
sub new($class, $pg, $pg_object) {
|
|
||||||
bless {$pg => $pg_object}, $class
|
|
||||||
}
|
|
||||||
|
|
||||||
sub get_visitor_count($self) {
|
sub get_visitor_count($self) {
|
||||||
$self->pg->db->query(<<~'END_SQL')->text()
|
$self->pg->db->query(<<~'END_SQL')->text()
|
||||||
SELECT counter_value
|
SELECT counter_value
|
||||||
|
|
|
@ -4,13 +4,6 @@ use Mojo::Base -base, -signatures;
|
||||||
|
|
||||||
has 'pg';
|
has 'pg';
|
||||||
|
|
||||||
sub new($class, $pg, $pg_object) {
|
|
||||||
bless {
|
|
||||||
$pg => $pg_object,
|
|
||||||
max_posts => 5
|
|
||||||
}, $class
|
|
||||||
}
|
|
||||||
|
|
||||||
sub get_posts($self, $this_page = undef) {
|
sub get_posts($self, $this_page = undef) {
|
||||||
if ($this_page) {
|
if ($this_page) {
|
||||||
my $row_count = $self->{'max_posts'};
|
my $row_count = $self->{'max_posts'};
|
||||||
|
|
Loading…
Reference in a new issue