-[submodule "ND"]
- path = ND
+[submodule "lib/ND"]
+ path = lib/ND
url = whale@ruin.nu:git/ND.git
+++ /dev/null
-Subproject commit 193d9ed10fea0563da8da5f54ec42f3068547dd4
--- /dev/null
+Subproject commit 193d9ed10fea0563da8da5f54ec42f3068547dd4
sub index : Local Path Args(0) {
my ( $self, $c ) = @_;
- # Hello World
- #$c->response->body( $c->welcome_message );
+ $c->stash(abc => $c->req->base);
}
sub default : Path {
my ( $self, $c ) = @_;
- $c->response->body( 'Page not found' );
+ $c->res->body( 'Page not found' );
$c->response->status(404);
}
+sub auto : Private {
+ my ($self, $c) = @_;
+
+ my $dbh = $c ->model;
+ $c->stash(dbh => $dbh);
+
+ $c->stash->{game}->{tick} = $dbh->selectrow_array('SELECT tick()',undef);
+
+}
+
=head2 end
Attempt to render a view, if needed.
--- /dev/null
+package NDWeb::Model::Model;
+use strict;
+use warnings;
+use base 'Catalyst::Model::Factory::PerRequest';
+
+__PACKAGE__->config(
+ class => 'ND::DB',
+ constructor => 'DB',
+);
+
+1;
copyright => '2008 harv',
};
+ USE DBI ( dbh = dbh);
+
# load up any other configuration items
PROCESS config/url.tt2;
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
- <title>[% template.title or site.title %]</title>
+ <title>[% site.title %]: [% template.title %]</title>
<meta http-equiv="Content-Type" content="application/xhtml+xml;charset=UTF-8"/>
<link rel="stylesheet" type="text/css" href="/static/default.css"/>
<link rel="stylesheet" type="text/css" href="/static/css/[% user.css or "black" %].css"/>
<ul class="linkbar">
- <li><a href="/main">Main page</a></li>
+ <li><a href="/index">Main page</a></li>
<li><a href="/settings">Settings</a></li>
<li><a href="/forum">Forum</a></li>
[% IF user %]
-[% META title = 'Catalyst/TT View!' %]
+[% META title = 'Main' %]
<p>
- Yay! You're looking at a page generated by the Catalyst::View::TT
- plugin module.
-</p>
-<p>
- This is the welcome page. Why not try the equally-exciting
+Hello [% user.name %]
</p>
+
--- /dev/null
+use strict;
+use warnings;
+use Test::More tests => 1;
+
+BEGIN { use_ok 'NDWeb::Model::Model' }
+