done cleaning
This commit is contained in:
138
lib/Dojo.pm
138
lib/Dojo.pm
@@ -6,86 +6,86 @@ use Dojo::Model::Users;
|
||||
use Dojo::Model::Vdgproc;
|
||||
|
||||
# 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(mproc => sub { state $mproc = Dojo::Model::Vdgproc->new });
|
||||
$self->helper(dbv => sub { state $dbv = Dojo::Model::Vuelo->new });
|
||||
$self->helper(dbg => sub { state $dbg = Dojo::Model::Users->new });
|
||||
$self->helper(mproc => sub { state $mproc = Dojo::Model::Vdgproc->new });
|
||||
$self->defaults({%Dojo::Conf::def});
|
||||
my $r = $self->routes; #router
|
||||
my $r = $self->routes; #router
|
||||
|
||||
# de la pagina ===============================================================
|
||||
$r->any('/')->to('home#home_');
|
||||
$r->any('/home')->to('home#home');
|
||||
$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');
|
||||
# json ==================
|
||||
$r->any('/json/*dreq')->to('data#simple');
|
||||
# =============================================================================
|
||||
# de la pagina ===============================================================
|
||||
$r->any('/')->to('home#home_');
|
||||
$r->any('/home')->to('home#home');
|
||||
$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');
|
||||
# json ==================
|
||||
$r->any('/json/*dreq')->to('data#simple');
|
||||
# =============================================================================
|
||||
|
||||
# de la tienda ================================================================
|
||||
$r->any('/cal')->to('proc#cal');
|
||||
$r->any('/event/:id'=> [id => qr/\d+/])->to('proc#event');
|
||||
$r->any('/spay/:class/:id' => [class => qr/\d+/, id => qr/\d+/])->to('proc#spay');
|
||||
$r->any('/spay/intentCreate')->to('proc#intentCreate');
|
||||
$r->any('/spay/intentConfirm')->to('proc#intentConfirm');
|
||||
$r->any('/spay/userCheck')->to('proc#userCheck');
|
||||
# =============================================================================
|
||||
# de la tienda ================================================================
|
||||
$r->any('/cal')->to('proc#cal');
|
||||
$r->any('/event/:id'=> [id => qr/\d+/])->to('proc#event');
|
||||
$r->any('/spay/:class/:id' => [class => qr/\d+/, id => qr/\d+/])->to('proc#spay');
|
||||
$r->any('/spay/intentCreate')->to('proc#intentCreate');
|
||||
$r->any('/spay/intentConfirm')->to('proc#intentConfirm');
|
||||
$r->any('/spay/userCheck')->to('proc#userCheck');
|
||||
# =============================================================================
|
||||
|
||||
# candy =======================================================================
|
||||
$r->any('/json/candy/:command')->to('data#candy');
|
||||
$r->any('/candy')->to('home#candy');
|
||||
# =============================================================================
|
||||
# candy =======================================================================
|
||||
$r->any('/json/candy/:command')->to('data#candy');
|
||||
$r->any('/candy')->to('home#candy');
|
||||
# =============================================================================
|
||||
|
||||
# usuarios y accesos ==========================================================
|
||||
$r->any('/reg')->to('users#reg');
|
||||
|
||||
# login guest ======
|
||||
$r->any('/login')->to('users#login');
|
||||
$r->any('/logout')->to('users#logout');
|
||||
# usuarios y accesos ==========================================================
|
||||
$r->any('/reg')->to('users#reg');
|
||||
|
||||
my $logged_in = $r->under('/')->to('users#is_logged');
|
||||
$logged_in->get('/radio')->to('home#radio');
|
||||
# ===================
|
||||
# login guest ======
|
||||
$r->any('/login')->to('users#login');
|
||||
$r->any('/logout')->to('users#logout');
|
||||
|
||||
# login user grulla =
|
||||
# common grulla user
|
||||
my $user = $r->under('/')->to('users#is_grulla');
|
||||
$user->any('/ccast')->to('home#bcast');
|
||||
# personal
|
||||
my $guest = $r->under('/')->to('users#is_grulla_tmp');
|
||||
$guest->any('/bcast')->to('home#bcast');
|
||||
# ===================
|
||||
|
||||
# admin =======================================================================
|
||||
my $admin = $r->under('/admin')->to('users#is_admin');
|
||||
$admin->any('')->to('admin#admin');
|
||||
$admin->any('home')->to('admin#admin');
|
||||
$admin->any('radio')->to('admin#radio');
|
||||
$admin->any('eventos')->to('admin#eventos');
|
||||
$admin->any('eventos/:type'=> [type=>['e','p','c']])->to('admin#eventos');
|
||||
$admin->any('mensajes')->to('admin#mensajes');
|
||||
$admin->any('tienda')->to('admin#tienda');
|
||||
$admin->any('json/:dreq/:id')->to('admin#json');
|
||||
my $logged_in = $r->under('/')->to('users#is_logged');
|
||||
$logged_in->get('/radio')->to('home#radio');
|
||||
# ===================
|
||||
|
||||
# =============================================================================
|
||||
# login user grulla =
|
||||
# common grulla user
|
||||
my $user = $r->under('/')->to('users#is_grulla');
|
||||
$user->any('/ccast')->to('home#bcast');
|
||||
# personal
|
||||
my $guest = $r->under('/')->to('users#is_grulla_tmp');
|
||||
$guest->any('/bcast')->to('home#bcast');
|
||||
# ===================
|
||||
|
||||
# admin =======================================================================
|
||||
my $admin = $r->under('/admin')->to('users#is_admin');
|
||||
$admin->any('')->to('admin#admin');
|
||||
$admin->any('home')->to('admin#admin');
|
||||
$admin->any('radio')->to('admin#radio');
|
||||
$admin->any('eventos')->to('admin#eventos');
|
||||
$admin->any('eventos/:type'=> [type=>['e','p','c']])->to('admin#eventos');
|
||||
$admin->any('mensajes')->to('admin#mensajes');
|
||||
$admin->any('tienda')->to('admin#tienda');
|
||||
$admin->any('json/:dreq/:id')->to('admin#json');
|
||||
|
||||
# =============================================================================
|
||||
|
||||
# a not foud ==================================================================
|
||||
|
||||
# a not foud ==================================================================
|
||||
|
||||
$r->any('/*whatever' => {whatever => ''} => sub {
|
||||
my $c = shift;
|
||||
my $whatever = $c->param('whatever');
|
||||
$c->stash(layout=>'clean');
|
||||
$c->render(template=>'home/not_found', status=>404);
|
||||
});
|
||||
my $c = shift;
|
||||
my $whatever = $c->param('whatever');
|
||||
$c->stash(layout=>'clean');
|
||||
$c->render(template=>'home/not_found', status=>404);
|
||||
});
|
||||
}
|
||||
|
||||
1;
|
||||
|
||||
Reference in New Issue
Block a user