Commits

Adam M Dutko  committed a409ba5

Rearrange a bit.

  • Participants
  • Parent commits 5c30386

Comments (0)

Files changed (8)

-.project/*
+.project

File site/www/clevelandpm.pl

 use strict;
 use warnings;
 
-use lib 'lib';
+use File::Basename 'dirname';
+use File::Spec;
+
+use Mojo::Base;
 use Mojo::Server::Hypnotoad;
 
-my $server = Mojo::Server::Hypnotoad->new;
-$server->run('lib/clevelandpm.pm');
+use lib join '/', File::Spec->splitdir(dirname(__FILE__)), 'lib';
+use lib join '/', File::Spec->splitdir(dirname(__FILE__)), '..', 'lib';
+
+# Check if Mojolicious is installed;
+die <<EOF unless eval 'use Mojolicious::Commands; 1';
+It looks like you don't have the Mojolicious framework installed.
+Please visit http://mojolicio.us for detailed installation instructions.
+
+EOF
+
+# Application
+$ENV{MOJO_APP} ||= 'ClevelandPM';
+
+# Start commands
+Mojolicious::Commands->start_app('ClevelandPM');

File site/www/lib/clevelandpm.pm

-package clevelandpm;
+package ClevelandPM;
 use Mojo::Base 'Mojolicious';
 
 sub startup {
-	## We need ourself to make it
+    ## We need ourself to make it
     my $self = shift;
 
     ## Go go hypnotoad
-    $self->app->config(hypnotoad => {listen => ['http://*:8080']});
+    $self->app->config(hypnotoad => {listen => ['http://*:8080/']});
 
     ## Hoorary for Cleveland Perl Mongers
     ## --> Secret Key for session information
     my $r = $self->routes;
 
     ## Route all requests to / to index
-    $r->get('/')->render('index');
+    $r->get('/')->to(template => 'index');
 
     ## Route all requests to /meetings/[date] to the proper meeting
     $r->get('/meetings/(:dateofmeeting)' => [dateofmeeting => qr/\d+/] => sub {

File site/www/templates/042213.html.ep

 % layout 'meetings';
 % title 'Cleveland.pm.org Meeting - 042213';
+%=include 'templates/header'
+
 Cleveland Perl Mongers had our first meeting on 042213 at Lakewood Public Library.
 <br />
 Download a copy of the slides <a href="/cleveland-pm-042213.pdf">here</a>.

File site/www/templates/index.html.ep

 % layout 'default';
 % title 'Cleveland.pm.org - Cleveland Perl Mongers';
 
-%= include 'header';
+%= include 'templates/header'
 
 Welcome to the Cleveland Perl Mongers (PM)!
 <br />

File site/www/templates/not_found.html.ep

+% layout 'default';
+% title 'Cleveland.pm.org - Cleveland Perl Mongers';
+
+%= include 'templates/header'
+
+Cleveland Perl Mongers (PM) is missing?
+<br />

File site/www/templates/templates/default.html.ep

 <html>
   <head><title><%= title %></title></head>
   <body>
-      %= include 'header';
+      %= include 'templates/header'
       <%= content %>
   </body>
 </html>

File site/www/templates/templates/meetings.html.ep

 <html>
   <head><title><%= title %></title></head>
   <body>
-      %= include 'header';
+      %= include 'templates/header'
       <%= content %>
   </body>
 </html>