Skip to content

Commit

Permalink
Merge pull request xsawyerx#6 from deluxaran/master
Browse files Browse the repository at this point in the history
fix BLOGSPERL-98 Place a cookie for welcome image
  • Loading branch information
drforr committed Dec 15, 2015
2 parents d7dfb36 + d85ca8b commit e648545
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 23 deletions.
13 changes: 11 additions & 2 deletions lib/PearlBee.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
};
};

Expand Down
43 changes: 22 additions & 21 deletions views/index.tt
Original file line number Diff line number Diff line change
@@ -1,26 +1,27 @@
<div class="blog">
[% IF first_visit == 0 %]
<div class="blog-start show">
<div class="container">
<div class="row">
<div class="col-sm-10 col-sm-offset-1 col-md-8 col-md-offset-2 text-center blog-start-wrapper">
<h1>There is more than one way to blog it.</h1>
<h4>blog.perl.org is a common blogging platform for the Perl community.</h4>
<div class="buttons-wrapper">
<a href="[% config.app_url %]/sign-up"><button type="button" class="btn btn-signin">Sign in</button></a>
<a href="[% config.app_url %]/register"><button type="button" class="btn btn-register">Register</button></a>
</div>

<div class="blog-start show">
<div class="container">
<div class="row">
<div class="col-sm-10 col-sm-offset-1 col-md-8 col-md-offset-2 text-center blog-start-wrapper">
<h1>There is more than one way to blog it.</h1>
<h4>blog.perl.org is a common blogging platform for the Perl community.</h4>
<div class="buttons-wrapper">
<a href="[% config.app_url %]/sign-up"><button type="button" class="btn btn-signin">Sign in</button></a>
<a href="[% config.app_url %]/register"><button type="button" class="btn btn-register">Register</button></a>
</div>

<div class="close-overlay" id="close_overlay">
<span class="icon-close"></span>
<span class="close-overlay-text">close and go to listings</span>
</div>
</div>
</div>
</div>
<div class="container-bottom">
</div>
</div>
<div class="close-overlay" id="close_overlay">
<span class="icon-close"></span>
<span class="close-overlay-text">close and go to listings</span>
</div>
</div>
</div>
</div>
<div class="container-bottom">
</div>
</div>
[% END %]

<div class="container">
<div class="row">
Expand Down

0 comments on commit e648545

Please sign in to comment.