diff --git a/lib/PearlBee.pm b/lib/PearlBee.pm index 7a4bcfaf..4b9753c9 100644 --- a/lib/PearlBee.pm +++ b/lib/PearlBee.pm @@ -79,7 +79,15 @@ get '/' => sub { my $total_pages = get_total_pages($nr_of_posts, $nr_of_rows); my ($previous_link, $next_link) = get_previous_next_link(1, $total_pages); - + + #check if there is a first visit cookie set; if there is don't display the overlay with the new way to blog about it. + my $first_visit = 0; + + if ( cookie "first_visit") { + $first_visit = 1; + } else { + cookie first_visit => 1; + } template 'index', { posts => \@mapped_posts, @@ -90,7 +98,8 @@ get '/' => sub { page => 1, total_pages => $total_pages, previous_link => $previous_link, - next_link => $next_link + next_link => $next_link, + first_visit => $first_visit, }; }; diff --git a/views/index.tt b/views/index.tt index a0cc5176..4b9861b5 100644 --- a/views/index.tt +++ b/views/index.tt @@ -1,26 +1,27 @@