Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Get it working under Dancer2.

  • Loading branch information...
commit b896f155c4d31bcc68e0df7821d87bac69843463 1 parent 79aeb02
@davorg authored
View
1  PoliticalWeb/MANIFEST
@@ -7,7 +7,6 @@ views/index.tt
views/layouts/main.tt
MANIFEST.SKIP
lib/PoliticalWeb.pm
-public/css/style.css
public/css/error.css
public/images/perldancer-bg.jpg
public/images/perldancer.jpg
View
2  PoliticalWeb/bin/app.pl
@@ -1,4 +1,4 @@
#!/usr/bin/env perl
-use Dancer;
+use Dancer2;
use PoliticalWeb;
dance;
View
1  PoliticalWeb/config.yml
@@ -21,6 +21,7 @@ charset: "UTF-8"
#template: "simple"
template: "template_toolkit"
+layout: main.tt
engines:
template_toolkit:
WRAPPER: layouts/main.tt
View
9 PoliticalWeb/lib/PoliticalWeb.pm
@@ -1,14 +1,15 @@
package PoliticalWeb;
-use Dancer ':syntax';
-use Dancer::Plugin::DBIC;
-use Dancer::Plugin::Cache::CHI;
+
+use Dancer2;
+use Dancer2::Plugin::DBIC;
+use Dancer2::Plugin::Cache::CHI;
use Data::Dumper;
use PoliticalWeb::Constituency;
our $VERSION = '0.1';
-check_page_cache;
+# check_page_cache;
get '/' => sub {
return template 'index' unless keys %{ +params };
View
6 PoliticalWeb/lib/PoliticalWeb/Constituency.pm
@@ -6,9 +6,9 @@ use 5.010;
use Moose;
use WebService::TWFY::API;
-use Dancer ':syntax';
-use Dancer::Plugin::DBIC;
-use Dancer::Plugin::Cache::CHI;
+use Dancer2;
+use Dancer2::Plugin::DBIC;
+use Dancer2::Plugin::Cache::CHI;
use Encode qw[encode decode];
use PoliticalWeb::Schema::Result::Constituency;
View
6 PoliticalWeb/lib/PoliticalWeb/Mp.pm
@@ -6,9 +6,9 @@ use 5.010;
use Moose;
use WebService::TWFY::API;
-use Dancer ':syntax';
-use Dancer::Plugin::DBIC;
-use Dancer::Plugin::Cache::CHI;
+use Dancer2;
+use Dancer2::Plugin::DBIC;
+use Dancer2::Plugin::Cache::CHI;
use Encode qw[encode decode];
my $twfy_query = WebService::TWFY::API->new({
View
2  PoliticalWeb/t/002_index_route.t
@@ -4,7 +4,7 @@ use warnings;
# the order is important
use PoliticalWeb;
-use Dancer::Test;
+use Dancer2::Test apps => [ 'PoliticalWeb' ];
route_exists [GET => '/'], 'a route handler is defined for /';
response_status_is ['GET' => '/'], 200, 'response status is 200 for /';
View
2  PoliticalWeb/views/layouts/main.tt
@@ -28,10 +28,8 @@
</ul>
<ul class="nav navbar-nav navbar-right">
-<!--
<li><a href="/register">Register</a></li>
<li><a href="/login">Log in</a></li>
--->
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
Share
Please sign in to comment.
Something went wrong with that request. Please try again.