7 |
use lib 'lib'; |
use lib 'lib'; |
8 |
use App::RoomReservation::Room; |
use App::RoomReservation::Room; |
9 |
|
|
10 |
|
sub room { |
11 |
|
App::RoomReservation::Room->new; |
12 |
|
} |
13 |
|
|
14 |
|
sub form_header { |
15 |
|
my $self = shift; |
16 |
|
$self->room->description; |
17 |
|
} |
18 |
|
|
19 |
|
sub form_footer { |
20 |
|
qq| |
21 |
|
<div style="font-size:75%; color: #888; clear: left;"> |
22 |
|
Insert some standard disclamer for every page here |
23 |
|
</div> |
24 |
|
|; |
25 |
|
} |
26 |
|
|
27 |
sub dsn { 'DBI:Pg:dbname=room-reservation' } |
sub dsn { 'DBI:Pg:dbname=room-reservation' } |
28 |
|
|
29 |
|
=head1 DEPLOY |
30 |
|
|
31 |
|
createdb --encoding=utf-8 room-reservation |
32 |
|
|
33 |
|
perl -Ilib -MFrey::Class::Schematize \ |
34 |
|
-e 'print Frey::Class::Schematize->new( class => "App::RoomReservation::Reservation" )->create_table,$/;' \ |
35 |
|
| psql room-reservation |
36 |
|
|
37 |
|
=cut |
38 |
|
|
39 |
our $dbh; |
our $dbh; |
40 |
sub dbh { |
sub dbh { |
41 |
my ($self) = @_; |
my ($self) = @_; |
55 |
my $url = $self->url_for( 'Reservation/create_as_markup' ); |
my $url = $self->url_for( 'Reservation/create_as_markup' ); |
56 |
|
|
57 |
return |
return |
58 |
App::RoomReservation::Room->new->room_markup |
$self->room->room_as_markup |
59 |
. qq|<a target="App::RoomReservation::Reservation" href="$url">seat reservation</a>| |
. qq|<a target="App::RoomReservation::Reservation" href="$url">seat reservation</a>| |
60 |
; |
; |
61 |
} |
} |
73 |
Class::MOP::load_class( $class ); |
Class::MOP::load_class( $class ); |
74 |
die "$class doesn't implement $method" unless $class->meta->has_method($method); |
die "$class doesn't implement $method" unless $class->meta->has_method($method); |
75 |
|
|
76 |
return "http://192.168.1.13:3000/$app"; |
return |
77 |
|
$self->request_url->scheme . '://' . $self->request_url->authority . '/' . $app; |
78 |
} |
} |
79 |
|
|
80 |
__PACKAGE__->meta->make_immutable; |
__PACKAGE__->meta->make_immutable; |