concat inferno

This commit is contained in:
mynah
2018-07-20 05:16:47 -05:00
parent e25fc46010
commit ef16d6f7b5
19 changed files with 518 additions and 423 deletions

View File

@@ -6,42 +6,55 @@ use Dojo::Model::Users;
use Dojo::Model::Data;
# This method will run once at server start
sub startup {
my $self = shift;
my $config = $self->plugin('Config'); #Config hash dojo.conf
$self->plugin('PODRenderer') if $config->{perldoc}; #doc
$self->secrets(['Mojojojo jojo']); #cookies
sub startup {
my $self = shift;
my $config = $self->plugin('Config'); #Config hash dojo.conf
$self->plugin('PODRenderer') if $config->{perldoc}; #doc
$self->secrets(['Mojojojo jojo']); #cookies
$self->helper(dbv => sub { state $dbv = Dojo::Model::Vuelo->new });
$self->helper(dbg => sub { state $dbg = Dojo::Model::Users->new });
$self->helper(ddtt => sub { state $ddtt = Dojo::Model::Data->new });
$self->defaults({%Dojo::Conf::def});
$self->helper(dbv => sub { state $dbv = Dojo::Model::Vuelo->new });
$self->helper(dbg => sub { state $dbg = Dojo::Model::Users->new });
$self->helper(ddtt => sub { state $ddtt = Dojo::Model::Data->new });
$self->defaults({%Dojo::Conf::def});
my $r = $self->routes; #router
# user ========================================================================
$r->any('/home')->to('home#home');
$r->any('/cal')->to('home#cal');
$r->any('/event/:id'=> [id => qr/\d+/])->to('home#event');
$r->any('/pod')->to('home#podcast');
$r->any('/store')->to('home#store');
$r->any('/tv')->to('home#tv');
$r->any('/contact')->to('home#contact');
$r->any('/contact2')->to('home#contact2');
$r->any('/pang')->to('home#pang');
$r->any('/tst')->to('home#tst');
# =============================================================================
# json ========================================================================
$r->any('/json/:dreq')->to('data#simple');
# =============================================================================
# candy =======================================================================
$r->any('/json/candy/:command')->to('data#candy');
# =============================================================================
my $r = $self->routes; #router
# admin =======================================================================
$r->any('/admin/home')->to('home#admin_home');
$r->any('/admin/radio')->to('home#admin_radio');
$r->any('/admin/eventos')->to('home#admin_eventos');
$r->any('/admin/eventos/:type'=> [type=>['e','p','c']])->to('home#admin_eventos');
$r->any('/admin/mensajes')->to('home#admin_mensajes');
$r->any('/admin/json/:dreq/:id')->to('home#admin_json');
# =============================================================================
$r->any('/home')->to('home#home');
$r->any('/cal')->to('home#cal');
$r->any('/event/:id'=> [id => qr/\d+/])->to('home#event');
#$r->any('/radio')->to('home#radio');
$r->any('/pod')->to('home#podcast');
$r->any('/store')->to('home#store');
$r->any('/tv')->to('home#tv');
$r->any('/contact')->to('home#contact');
$r->any('/contact2')->to('home#contact2');
$r->any('/pang')->to('home#pang');
$r->any('/tst')->to('home#tst');
$r->any('/json/:dreq')->to('data#simple');
$r->any('/json/candy/:command')->to('data#candy');
$r->any('/admin/:section'=> {section =>'home'})->to('home#admin');
$r->any('/admin/json/:dreq/:id/')->to('data#admin');
# login =======================================================================
$r->any('/login')->to('users#login');
$r->any('/logout')->to('users#logout');
$r->any('/login')->to('users#login');
$r->any('/logout')->to('users#logout');
my $logged_in = $r->under('/')->to('users#is_logged');
$logged_in->get('/radio')->to('home#radio');
my $logged_in = $r->under('/')->to('users#is_logged');
$logged_in->get('/radio')->to('home#radio');
# =============================================================================
}