From 3532310738ed323224f20c815c966c86891f51a8 Mon Sep 17 00:00:00 2001 From: swag Date: Sun, 3 Apr 2022 21:04:09 -0400 Subject: [PATCH] Display the visitor counter --- guestbook-ng.pl | 7 +++++-- templates/layouts/default.html.ep | 3 ++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/guestbook-ng.pl b/guestbook-ng.pl index 7921774..1d0be1e 100755 --- a/guestbook-ng.pl +++ b/guestbook-ng.pl @@ -44,7 +44,10 @@ under sub ($c) { $c->stash(status => 403) if $c->flash('error'); - $c->stash(post_count => format_number $c->message->get_post_count); + $c->stash( + post_count => format_number($c->message->get_post_count), + visitor_count => format_number($c->counter->get_visitor_count) + ); 1; }; @@ -129,7 +132,7 @@ app->secrets(app->config->{'secrets'}) || die $@; app->message->max_posts(app->config->{'max_posts'}) if app->config->{'max_posts'}; -app->pg->migrations->from_dir('migrations')->migrate(7); +app->pg->migrations->from_dir('migrations')->migrate(8); app->asset->process('swagg.css', 'css/swagg.css'); diff --git a/templates/layouts/default.html.ep b/templates/layouts/default.html.ep index 4faffde..dff0081 100644 --- a/templates/layouts/default.html.ep +++ b/templates/layouts/default.html.ep @@ -38,7 +38,8 @@