From 26523cdca23f9b5882cb12db3e0fa34a336aeb84 Mon Sep 17 00:00:00 2001 From: mynah Date: Thu, 14 Mar 2019 03:19:54 -0600 Subject: [PATCH] revolucion --- dojo.conf | 6 +- lib/Dojo.pm | 2 +- lib/Dojo/Controller/Data.pm | 5 + lib/Dojo/Controller/Home.pm | 162 ++++++++---------- .../Dojo/Model/Data}/admin/event/add/qCup.q | 0 .../Dojo/Model/Data}/admin/event/add/qEup.q | 0 .../Dojo/Model/Data}/admin/event/add/qPup.q | 0 .../Model/Data}/admin/event/change/qCdel.q | 0 .../Model/Data}/admin/event/change/qCup.q | 0 .../Model/Data}/admin/event/change/qEdel.q | 0 .../Model/Data}/admin/event/change/qEup.q | 0 .../Model/Data}/admin/event/change/qPdel.q | 0 .../Model/Data}/admin/event/change/qPup.q | 0 .../Model/Data}/admin/event/json/qCourse.q | 0 .../Model/Data}/admin/event/json/qEvent.q | 0 .../Model/Data}/admin/event/json/qPlace.q | 0 .../Dojo/Model/Data}/admin/event/qCprev.q | 0 .../Dojo/Model/Data}/admin/event/qEcourse.q | 0 .../Dojo/Model/Data}/admin/event/qEmend.q | 0 .../Dojo/Model/Data}/admin/event/qEmini.q | 0 .../Dojo/Model/Data}/admin/event/qEplace.q | 0 .../Dojo/Model/Data}/admin/event/qEprev.q | 0 .../Dojo/Model/Data}/admin/event/qPprev.q | 0 .../Model/Data}/admin/home/update/qUpdate.q | 0 .../Data}/admin/mensajes/json/qGetInfo.q | 0 .../Model/Data}/admin/mensajes/qEntries.q | 0 .../Dojo/Model/Data}/admin/radio/qAdmin.q | 0 .../Model/Data}/admin/radio/update/qUpdate.q | 0 .../Dojo/Model/Data/podcast/podcast.json | 0 .../Dojo/Model/Data}/podcast/text.txt | 0 lib/Dojo/Model/Vuelo.pm | 99 ++++++----- public/home/admin/{cssAdmin.css => admin.css} | 0 .../candySwitch/{jsCSwitch.js => cSwitch.js} | 0 .../candySwitch/{cssMain.css => main.css} | 0 .../candySwitch/{cssSwitch.css => switch.css} | 0 .../admin/event/{cssEvent.css => event.css} | 0 .../home/admin/event/{jsEvent.js => event.js} | 0 public/home/admin/event/listImages.pl | 25 --- .../admin/home/{cssAdmin.css => admin.css} | 0 .../admin/home/{jsButtons.js => buttons.js} | 0 public/home/admin/home/{jsFb.js => fb.js} | 0 .../admin/mensajes/{cssMsg.css => msg.css} | 0 .../home/admin/mensajes/{jsMsg.js => msg.js} | 0 .../admin/radio/{cssAdmin.css => admin.css} | 0 .../radio/{jsLoadInfo.js => loadInfo.css} | 0 public/home/bcast/{cssCast.css => cast.css} | 0 .../podcast/{cssPodcast.css => podcast.css} | 0 .../home/podcast/{jsPodcast.js => podcast.js} | 2 +- public/home/radio/{jsLink.js => link.js} | 0 public/home/radio/{cssRadio.css => radio.css} | 0 public/home/radio/{jsRadio.js => radio.js} | 0 templates/home/admin/event.html.ep | 2 + templates/home/admin/home.html.ep | 2 + templates/home/admin/mensajes.html.ep | 2 + templates/home/admin/radio.html.ep | 10 ++ templates/home/bcast.html.ep | 2 + templates/home/home.html.ep | 2 +- templates/home/podcast.html.ep | 2 + templates/home/radio.html.ep | 2 + 59 files changed, 156 insertions(+), 169 deletions(-) rename {public/home => lib/Dojo/Model/Data}/admin/event/add/qCup.q (100%) rename {public/home => lib/Dojo/Model/Data}/admin/event/add/qEup.q (100%) rename {public/home => lib/Dojo/Model/Data}/admin/event/add/qPup.q (100%) rename {public/home => lib/Dojo/Model/Data}/admin/event/change/qCdel.q (100%) rename {public/home => lib/Dojo/Model/Data}/admin/event/change/qCup.q (100%) rename {public/home => lib/Dojo/Model/Data}/admin/event/change/qEdel.q (100%) rename {public/home => lib/Dojo/Model/Data}/admin/event/change/qEup.q (100%) rename {public/home => lib/Dojo/Model/Data}/admin/event/change/qPdel.q (100%) rename {public/home => lib/Dojo/Model/Data}/admin/event/change/qPup.q (100%) rename {public/home => lib/Dojo/Model/Data}/admin/event/json/qCourse.q (100%) rename {public/home => lib/Dojo/Model/Data}/admin/event/json/qEvent.q (100%) rename {public/home => lib/Dojo/Model/Data}/admin/event/json/qPlace.q (100%) rename {public/home => lib/Dojo/Model/Data}/admin/event/qCprev.q (100%) rename {public/home => lib/Dojo/Model/Data}/admin/event/qEcourse.q (100%) rename {public/home => lib/Dojo/Model/Data}/admin/event/qEmend.q (100%) rename {public/home => lib/Dojo/Model/Data}/admin/event/qEmini.q (100%) rename {public/home => lib/Dojo/Model/Data}/admin/event/qEplace.q (100%) rename {public/home => lib/Dojo/Model/Data}/admin/event/qEprev.q (100%) rename {public/home => lib/Dojo/Model/Data}/admin/event/qPprev.q (100%) rename {public/home => lib/Dojo/Model/Data}/admin/home/update/qUpdate.q (100%) rename {public/home => lib/Dojo/Model/Data}/admin/mensajes/json/qGetInfo.q (100%) rename {public/home => lib/Dojo/Model/Data}/admin/mensajes/qEntries.q (100%) rename {public/home => lib/Dojo/Model/Data}/admin/radio/qAdmin.q (100%) rename {public/home => lib/Dojo/Model/Data}/admin/radio/update/qUpdate.q (100%) rename public/home/podcast/jsonPod.json => lib/Dojo/Model/Data/podcast/podcast.json (100%) rename {public/home => lib/Dojo/Model/Data}/podcast/text.txt (100%) rename public/home/admin/{cssAdmin.css => admin.css} (100%) rename public/home/admin/candySwitch/{jsCSwitch.js => cSwitch.js} (100%) rename public/home/admin/candySwitch/{cssMain.css => main.css} (100%) rename public/home/admin/candySwitch/{cssSwitch.css => switch.css} (100%) rename public/home/admin/event/{cssEvent.css => event.css} (100%) rename public/home/admin/event/{jsEvent.js => event.js} (100%) delete mode 100755 public/home/admin/event/listImages.pl rename public/home/admin/home/{cssAdmin.css => admin.css} (100%) rename public/home/admin/home/{jsButtons.js => buttons.js} (100%) rename public/home/admin/home/{jsFb.js => fb.js} (100%) rename public/home/admin/mensajes/{cssMsg.css => msg.css} (100%) rename public/home/admin/mensajes/{jsMsg.js => msg.js} (100%) rename public/home/admin/radio/{cssAdmin.css => admin.css} (100%) rename public/home/admin/radio/{jsLoadInfo.js => loadInfo.css} (100%) rename public/home/bcast/{cssCast.css => cast.css} (100%) rename public/home/podcast/{cssPodcast.css => podcast.css} (100%) rename public/home/podcast/{jsPodcast.js => podcast.js} (90%) rename public/home/radio/{jsLink.js => link.js} (100%) rename public/home/radio/{cssRadio.css => radio.css} (100%) rename public/home/radio/{jsRadio.js => radio.js} (100%) diff --git a/dojo.conf b/dojo.conf index f871e9c..c7402e4 100755 --- a/dojo.conf +++ b/dojo.conf @@ -12,10 +12,10 @@ chat_channel => 'Grullas@radio.chat.vuelodegrulla.com', #Radio ===================================================== - radio_server_name=>"http://chaos.foundation:8000/p", + radio_server_name=>"http://radio.chaos.foundation:8000/q", radio_server =>"https://radio.chaos.foundation", - radio_channel => "/p", - radio_listen_url =>"https://chaos.foundation/p", + radio_channel => "/q", + radio_listen_url =>"http://radio.chaos.foundation:8000/q", #RTPM ======================================================= rtmp_server =>"rtmp://chaos.foundation/steam", diff --git a/lib/Dojo.pm b/lib/Dojo.pm index 64a38d5..36c1178 100755 --- a/lib/Dojo.pm +++ b/lib/Dojo.pm @@ -31,7 +31,7 @@ use Dojo::Model::Users; # ============================================================================= # json ======================================================================== - $r->any('/json/:dreq')->to('data#simple'); + $r->any('/json/*dreq')->to('data#simple'); # ============================================================================= # candy ======================================================================= diff --git a/lib/Dojo/Controller/Data.pm b/lib/Dojo/Controller/Data.pm index 60bc416..73f2aa0 100755 --- a/lib/Dojo/Controller/Data.pm +++ b/lib/Dojo/Controller/Data.pm @@ -1,16 +1,21 @@ package Dojo::Controller::Data; +use Mojo::File 'path'; +use Mojo::JSON qw(decode_json encode_json); use Mojo::Base 'Mojolicious::Controller'; use Dojo::Support qw{ dmph merge_hash load_module }; use Net::Telnet; my $server_name = ""; our $t; #telnet server object + my $data_path = path('lib/Dojo/Model/Data')->make_path; sub simple{ my $c=shift; my $n=$c->param("dreq")//""; my $json = {status => "304"}; $json = { srv =>$c->config->{radio_server} } if $n =~m/^radio$/ ; $json = candy() if $n =~m/^candy$/ ; + $json = decode_json($data_path->child("$n")->slurp) + if $n=~m/^podcast\/podcast.json$/; $c->render(json=>$json); } diff --git a/lib/Dojo/Controller/Home.pm b/lib/Dojo/Controller/Home.pm index cbc7118..5d8f7a2 100755 --- a/lib/Dojo/Controller/Home.pm +++ b/lib/Dojo/Controller/Home.pm @@ -1,99 +1,97 @@ package Dojo::Controller::Home; use Mojo::Base 'Mojolicious::Controller'; use Mojo::Template; -use Dojo::Support qw{ log dmph merge_hash load_module get_names}; +#use Dojo::Support qw{ log dmph merge_hash load_module get_names}; +use Dojo::Support qw{ log get_names}; sub tst{ my $c=shift; $c->render(text=> $c->config->{radio}{'channel'}); } # User ======================================================================== - sub home_ { - my $c = shift; - $c->redirect_to("/home") ; - } +sub home_ { + my $c = shift; + $c->redirect_to("/home") ; +} - sub home { - my $c = shift; - $c->stash( $c->dbv->mod) ; +sub home { + my $c = shift; + $c->stash( $c->dbv->mod) ; + $c->stash(layout=>'default'); +} + +sub pang { + my $c = shift; + my $h=$c->dbv->pang_md; + map { $c->stash( $_ => $h->{$_}) } keys %$h; + $c->stash(layout=>'default'); + +} + +sub cal { + my $c = shift; + my $data=$c->dbv->calendar_events; + my $block=$c->dbv->calendar_monthblock; + my %h; + map{ push @{ $h{$_->{bid}} },$_; }(@$data); + $c->stash( r=>\%h, b=>$block); + $c->stash(layout=>'default'); +} + +sub event{ + my $c = shift; + $c->stash($c->dbv->event($c->param("id"))); + $c->stash(layout=> "defaultContact"); +} + +sub contact{ + my $c = shift; + if ($c->param("mup")){ + $c->flash(mname => $c->param("mname")); + $c->dbv->contact( + $c->param("mname"), + $c->param("mail"), + $c->match->stack->[-1]{action}, + $c->param("msg") + ); + $c->redirect_to('contact2'); + }else{ $c->stash(layout=>'default'); } +} - sub pang { - my $c = shift; - my $h=$c->dbv->pang_md; - map { $c->stash( $_ => $h->{$_}) } keys %$h; - $c->stash(layout=>'default'); - - } +sub contact2{ + my $c = shift; + $c->redirect_to("home") unless $c->flash('mname'); + $c->stash( mname=>$c->flash('mname')); + $c->stash(layout=>'default'); +} - sub cal { - my $c = shift; - my $data=$c->dbv->calendar_events; - my $block=$c->dbv->calendar_monthblock; - my %h; - map{ push @{ $h{$_->{bid}} },$_; }(@$data); - $c->stash( r=>\%h, b=>$block); - $c->stash(layout=>'default'); - } +sub store{ + my $c = shift; + $c->stash( r=>$c->dbv->store); + $c->stash(layout=> "defaultContact"); +} - sub event{ - my $c = shift; - $c->stash($c->dbv->event($c->param("id"))); - $c->stash(layout=> "defaultContact"); - } +sub tv{ + my $c = shift; + $c->stash( videos=>$c->dbv->tv_videos, table=>$c->dbv->tv_series); + $c->stash(layout=> "defaultContact"); +} - sub contact{ - my $c = shift; - if ($c->param("mup")){ - $c->flash(mname => $c->param("mname")); - $c->dbv->contact( - $c->param("mname"), - $c->param("mail"), - $c->match->stack->[-1]{action}, - $c->param("msg") - ); - $c->redirect_to('contact2'); - }else{ - $c->stash(layout=>'default'); - } - } +sub podcast{ + my $c = shift; + $c->stash(layout=> "defaultContact"); + $c->stash( t=>$c->dbv->podcast_txt, pod=>$c->dbv->podcast_infoHash); +} - sub contact2{ - my $c = shift; - $c->redirect_to("home") unless $c->flash('mname'); - $c->stash( mname=>$c->flash('mname')); - $c->stash(layout=>'default'); - } - - sub store{ - my $c = shift; - $c->stash( r=>$c->dbv->store); - $c->stash(layout=> "defaultContact"); - } - - sub tv{ - my $c = shift; - $c->stash( videos=>$c->dbv->tv_videos, table=>$c->dbv->tv_series); - $c->stash(layout=> "defaultContact"); - } - - sub podcast{ - my $c = shift; - $c->stash((load_module("home/podcast"))[0]); - $c->stash(layout=> "defaultContact"); - $c->stash( t=>$c->dbv->podcast_txt, pod=>$c->dbv->podcast_infoHash); - } - - sub bcast{ - my $c = shift; - $c->stash((load_module("home/bcast"))[0]); - - } +sub bcast{ + my $c = shift; + $c->stash(layout=> "defaultContact"); +} sub radio{ my $c=shift; - $c->stash((load_module("home/radio"))[0]); $c->stash(layout=> "defaultContact"); $c->stash($c->dbv->mod); $c->stash(nick=>$c->session("nick")); @@ -120,7 +118,6 @@ sub tst{ my $c=shift; $c->dbv->umod($c->param('link'),$c->param('update')) if (($c->param("hup") // " " )=~/Cambiar/); - $c->stash((load_module("home/admin/home"))[0]); $c->stash(template=>"home/admin/home"); $c->stash(layout=>"admin"); $c->stash( $c->dbv->mod); @@ -134,10 +131,6 @@ sub tst{ if (($c->param("pup") // " " )=~/Cambiar/); $c->stash($c->dbv->mod); $c->stash($c->dbg->grulla_pass); - $c->stash( merge_hash( - (load_module("home/admin/radio"))[0], - (load_module("home/admin/candySwitch"))[0], - )); $c->stash(apend => ["home/admin/candySwitch"]); $c->stash(template=>"home/admin/radio"); $c->stash(layout=>"admin"); @@ -145,7 +138,6 @@ sub tst{ sub admin_mensajes{ my $c=shift; - $c->stash((load_module("home/admin/mensajes"))[0]); $c->stash( h=>$c->dbv->msg_heads); $c->stash(template=>"home/admin/mensajes"); $c->stash(layout=>"admin"); @@ -177,14 +169,9 @@ sub tst{ $c->dbv->place_up(@list) if ($id ==0); $c->dbv->place_ch(@list) if ($id >0); } - - } - $c->redirect_to("/admin/eventos"); } - - $c->stash( courses=>$c->dbv->courses, @@ -193,7 +180,6 @@ sub tst{ events=>$c->dbv->events, img=>$c->dbv->eimgList, ); - $c->stash((load_module("home/admin/event"))[0]); $c->stash(template=>"home/admin/event"); $c->stash(layout=>"admin"); } diff --git a/public/home/admin/event/add/qCup.q b/lib/Dojo/Model/Data/admin/event/add/qCup.q similarity index 100% rename from public/home/admin/event/add/qCup.q rename to lib/Dojo/Model/Data/admin/event/add/qCup.q diff --git a/public/home/admin/event/add/qEup.q b/lib/Dojo/Model/Data/admin/event/add/qEup.q similarity index 100% rename from public/home/admin/event/add/qEup.q rename to lib/Dojo/Model/Data/admin/event/add/qEup.q diff --git a/public/home/admin/event/add/qPup.q b/lib/Dojo/Model/Data/admin/event/add/qPup.q similarity index 100% rename from public/home/admin/event/add/qPup.q rename to lib/Dojo/Model/Data/admin/event/add/qPup.q diff --git a/public/home/admin/event/change/qCdel.q b/lib/Dojo/Model/Data/admin/event/change/qCdel.q similarity index 100% rename from public/home/admin/event/change/qCdel.q rename to lib/Dojo/Model/Data/admin/event/change/qCdel.q diff --git a/public/home/admin/event/change/qCup.q b/lib/Dojo/Model/Data/admin/event/change/qCup.q similarity index 100% rename from public/home/admin/event/change/qCup.q rename to lib/Dojo/Model/Data/admin/event/change/qCup.q diff --git a/public/home/admin/event/change/qEdel.q b/lib/Dojo/Model/Data/admin/event/change/qEdel.q similarity index 100% rename from public/home/admin/event/change/qEdel.q rename to lib/Dojo/Model/Data/admin/event/change/qEdel.q diff --git a/public/home/admin/event/change/qEup.q b/lib/Dojo/Model/Data/admin/event/change/qEup.q similarity index 100% rename from public/home/admin/event/change/qEup.q rename to lib/Dojo/Model/Data/admin/event/change/qEup.q diff --git a/public/home/admin/event/change/qPdel.q b/lib/Dojo/Model/Data/admin/event/change/qPdel.q similarity index 100% rename from public/home/admin/event/change/qPdel.q rename to lib/Dojo/Model/Data/admin/event/change/qPdel.q diff --git a/public/home/admin/event/change/qPup.q b/lib/Dojo/Model/Data/admin/event/change/qPup.q similarity index 100% rename from public/home/admin/event/change/qPup.q rename to lib/Dojo/Model/Data/admin/event/change/qPup.q diff --git a/public/home/admin/event/json/qCourse.q b/lib/Dojo/Model/Data/admin/event/json/qCourse.q similarity index 100% rename from public/home/admin/event/json/qCourse.q rename to lib/Dojo/Model/Data/admin/event/json/qCourse.q diff --git a/public/home/admin/event/json/qEvent.q b/lib/Dojo/Model/Data/admin/event/json/qEvent.q similarity index 100% rename from public/home/admin/event/json/qEvent.q rename to lib/Dojo/Model/Data/admin/event/json/qEvent.q diff --git a/public/home/admin/event/json/qPlace.q b/lib/Dojo/Model/Data/admin/event/json/qPlace.q similarity index 100% rename from public/home/admin/event/json/qPlace.q rename to lib/Dojo/Model/Data/admin/event/json/qPlace.q diff --git a/public/home/admin/event/qCprev.q b/lib/Dojo/Model/Data/admin/event/qCprev.q similarity index 100% rename from public/home/admin/event/qCprev.q rename to lib/Dojo/Model/Data/admin/event/qCprev.q diff --git a/public/home/admin/event/qEcourse.q b/lib/Dojo/Model/Data/admin/event/qEcourse.q similarity index 100% rename from public/home/admin/event/qEcourse.q rename to lib/Dojo/Model/Data/admin/event/qEcourse.q diff --git a/public/home/admin/event/qEmend.q b/lib/Dojo/Model/Data/admin/event/qEmend.q similarity index 100% rename from public/home/admin/event/qEmend.q rename to lib/Dojo/Model/Data/admin/event/qEmend.q diff --git a/public/home/admin/event/qEmini.q b/lib/Dojo/Model/Data/admin/event/qEmini.q similarity index 100% rename from public/home/admin/event/qEmini.q rename to lib/Dojo/Model/Data/admin/event/qEmini.q diff --git a/public/home/admin/event/qEplace.q b/lib/Dojo/Model/Data/admin/event/qEplace.q similarity index 100% rename from public/home/admin/event/qEplace.q rename to lib/Dojo/Model/Data/admin/event/qEplace.q diff --git a/public/home/admin/event/qEprev.q b/lib/Dojo/Model/Data/admin/event/qEprev.q similarity index 100% rename from public/home/admin/event/qEprev.q rename to lib/Dojo/Model/Data/admin/event/qEprev.q diff --git a/public/home/admin/event/qPprev.q b/lib/Dojo/Model/Data/admin/event/qPprev.q similarity index 100% rename from public/home/admin/event/qPprev.q rename to lib/Dojo/Model/Data/admin/event/qPprev.q diff --git a/public/home/admin/home/update/qUpdate.q b/lib/Dojo/Model/Data/admin/home/update/qUpdate.q similarity index 100% rename from public/home/admin/home/update/qUpdate.q rename to lib/Dojo/Model/Data/admin/home/update/qUpdate.q diff --git a/public/home/admin/mensajes/json/qGetInfo.q b/lib/Dojo/Model/Data/admin/mensajes/json/qGetInfo.q similarity index 100% rename from public/home/admin/mensajes/json/qGetInfo.q rename to lib/Dojo/Model/Data/admin/mensajes/json/qGetInfo.q diff --git a/public/home/admin/mensajes/qEntries.q b/lib/Dojo/Model/Data/admin/mensajes/qEntries.q similarity index 100% rename from public/home/admin/mensajes/qEntries.q rename to lib/Dojo/Model/Data/admin/mensajes/qEntries.q diff --git a/public/home/admin/radio/qAdmin.q b/lib/Dojo/Model/Data/admin/radio/qAdmin.q similarity index 100% rename from public/home/admin/radio/qAdmin.q rename to lib/Dojo/Model/Data/admin/radio/qAdmin.q diff --git a/public/home/admin/radio/update/qUpdate.q b/lib/Dojo/Model/Data/admin/radio/update/qUpdate.q similarity index 100% rename from public/home/admin/radio/update/qUpdate.q rename to lib/Dojo/Model/Data/admin/radio/update/qUpdate.q diff --git a/public/home/podcast/jsonPod.json b/lib/Dojo/Model/Data/podcast/podcast.json similarity index 100% rename from public/home/podcast/jsonPod.json rename to lib/Dojo/Model/Data/podcast/podcast.json diff --git a/public/home/podcast/text.txt b/lib/Dojo/Model/Data/podcast/text.txt similarity index 100% rename from public/home/podcast/text.txt rename to lib/Dojo/Model/Data/podcast/text.txt diff --git a/lib/Dojo/Model/Vuelo.pm b/lib/Dojo/Model/Vuelo.pm index c4c303b..2b9e304 100755 --- a/lib/Dojo/Model/Vuelo.pm +++ b/lib/Dojo/Model/Vuelo.pm @@ -1,5 +1,4 @@ -package Dojo::Model::Vuelo; -use Mojo::File 'path'; +package Dojo::Model::Vuelo; use Mojo::File 'path'; use Mojo::JSON qw(decode_json encode_json); use Dojo::Support qw{ log dmph merge_hash load_module get_names}; use Mojo::Base 'Mojolicious::Controller'; @@ -25,8 +24,9 @@ sub mod{ sub pang_md{ my $c=shift; - my %h = map {$_=> markdown(decode_utf8($data_path->child('pang/'.$_.'.md')->slurp))} - ("pang","helen","benjamin"); + my %h = map { + $_=> markdown(decode_utf8($data_path->child('pang/'.$_.'.md')->slurp)) + } ("pang","helen","benjamin"); return \%h; } @@ -50,13 +50,12 @@ sub tv_videos{ sub tv_series{ return _read ($data_path->child("/tv/qTable.q")->slurp); #name,order,group } - sub podcast_txt{ - # return "Hemos desarrollado con mucho cariño ejercicios gratuitos y descargables que pueden ser practicados por cualquier persona aún antes de asistir a uno de los cursos de instrucción."; - return decode_utf8(path("public/home/podcast/text.txt")->slurp); - } - sub podcast_infoHash{ - return decode_json path("public/home/podcast/jsonPod.json")->slurp; - } +sub podcast_txt{ + return decode_utf8($data_path->child("/podcast/text.txt")->slurp); +} +sub podcast_infoHash{ + return decode_json $data_path->child("/podcast/podcast.json")->slurp; +} #============================================================================== @@ -64,7 +63,7 @@ sub tv_series{ sub msg_heads{ my ($self,@bind)=@_; my @empty; - my $q= path("public/home/admin/mensajes/qEntries.q")->slurp; + my $q= $data_path->child("/admin/mensajes/qEntries.q")->slurp; my $dbh = DBI->connect("DBI:mysql:".Dojo::Conf::MSGDB.":".Dojo::Conf::MSGDB_H,Dojo::Conf::MSGDB_UR,Dojo::Conf::MSGDB_URP,{mysql_enable_utf8 => 1}); return \@empty unless($dbh); my $h=$dbh->selectall_arrayref($q,{ Slice => {} },@bind)//"error"; @@ -76,7 +75,7 @@ sub tv_series{ sub msg{ my ($c,@bind)=@_; my @empty; - my $q= path("public/home/admin/mensajes/json/qGetInfo.q")->slurp; + my $q= $data_path->child("/admin/mensajes/json/qGetInfo.q")->slurp; my $dbh = DBI->connect("DBI:mysql:".Dojo::Conf::MSGDB.":".Dojo::Conf::MSGDB_H,Dojo::Conf::MSGDB_UR,Dojo::Conf::MSGDB_URP,{mysql_enable_utf8 => 1}); return \@empty unless($dbh); my $h=$dbh->selectall_arrayref($q,{ Slice => {} },@bind)//\@empty; @@ -85,12 +84,12 @@ sub tv_series{ return shift @$h; } sub courses{ return _read("select nombre as name, id from curso;")} - sub course { return shift @{_read(path("public/home/admin/event/json/qCourse.q")->slurp,pop)}} + sub course { return shift @{_read($data_path->child("/admin/event/json/qCourse.q")->slurp,pop)}} sub places { return _read("select nombre as name, id from lugar;")} - sub place { return shift @{_read(path("public/home/admin/event/json/qPlace.q")->slurp,pop)}} + sub place { return shift @{_read($data_path->child("/admin/event/json/qPlace.q")->slurp,pop)}} sub months { return _read("select nombre as name, id from mes;")}; - sub events { return _read(path("public/home/admin/event/qEprev.q")->slurp)} - sub eventa { return shift @{_read(path("public/home/admin/event/json/qEvent.q")->slurp,pop)}} + sub events { return _read($data_path->child("/admin/event/qEprev.q")->slurp)} + sub eventa { return shift @{_read($data_path->child("/admin/event/json/qEvent.q")->slurp,pop)}} sub eimgList{ return [get_names("public/home/cal/img/")] } #============================================================================== # Write vdg user ============================================================== @@ -104,40 +103,40 @@ sub contact{ } #============================================================================== # Write vdg admin ============================================================== - sub umod{ - my $c=shift; - my $q="update casa set contenido = ? where nombre = ? ;"; - return _write($q,@_); - } +sub umod{ + my $c=shift; + my $q="update casa set contenido = ? where nombre = ? ;"; + return _write($q,@_); +} - sub event_del { return _write("delete from evento where id = ?;",pop);} - sub course_del{ return _write("delete from curso where id = ?;",pop); } - sub place_del { return _write("delete from lugar where id = ?;",pop); } - - sub event_up{ - my ($self,@bind)=@_; - return _write(path("public/home/admin/event/add/qEup.q")->slurp,@bind); - } - sub course_up{ - my ($self,@bind)=@_; - return _write(path("public/home/admin/event/add/qCup.q")->slurp,@bind); - } - sub place_up{ - my ($self,@bind)=@_; - return _write(path("public/home/admin/event/add/qPup.q")->slurp,@bind); - } - sub event_ch{ - my ($self,@bind)=@_; - return _write(path("public/home/admin/event/change/qEup.q")->slurp,@bind); - } - sub course_ch{ - my ($self,@bind)=@_; - return _write(path("public/home/admin/event/change/qCup.q")->slurp,@bind); - } - sub place_ch{ - my ($self,@bind)=@_; - return _write(path("public/home/admin/event/change/qPup.q")->slurp,@bind); - } +sub event_del { return _write("delete from evento where id = ?;",pop);} +sub course_del{ return _write("delete from curso where id = ?;",pop); } +sub place_del { return _write("delete from lugar where id = ?;",pop); } + +sub event_up{ + my ($self,@bind)=@_; + return _write($data_path->child("/admin/event/add/qEup.q")->slurp,@bind); +} +sub course_up{ + my ($self,@bind)=@_; + return _write($data_path->child("/admin/event/add/qCup.q")->slurp,@bind); +} +sub place_up{ + my ($self,@bind)=@_; + return _write($data_path->child("/admin/event/add/qPup.q")->slurp,@bind); +} +sub event_ch{ + my ($self,@bind)=@_; + return _write($data_path->child("/admin/event/change/qEup.q")->slurp,@bind); +} +sub course_ch{ + my ($self,@bind)=@_; + return _write($data_path->child("/admin/event/change/qCup.q")->slurp,@bind); +} +sub place_ch{ + my ($self,@bind)=@_; + return _write($data_path->child("/admin/event/change/qPup.q")->slurp,@bind); +} #============================================================================== diff --git a/public/home/admin/cssAdmin.css b/public/home/admin/admin.css similarity index 100% rename from public/home/admin/cssAdmin.css rename to public/home/admin/admin.css diff --git a/public/home/admin/candySwitch/jsCSwitch.js b/public/home/admin/candySwitch/cSwitch.js similarity index 100% rename from public/home/admin/candySwitch/jsCSwitch.js rename to public/home/admin/candySwitch/cSwitch.js diff --git a/public/home/admin/candySwitch/cssMain.css b/public/home/admin/candySwitch/main.css similarity index 100% rename from public/home/admin/candySwitch/cssMain.css rename to public/home/admin/candySwitch/main.css diff --git a/public/home/admin/candySwitch/cssSwitch.css b/public/home/admin/candySwitch/switch.css similarity index 100% rename from public/home/admin/candySwitch/cssSwitch.css rename to public/home/admin/candySwitch/switch.css diff --git a/public/home/admin/event/cssEvent.css b/public/home/admin/event/event.css similarity index 100% rename from public/home/admin/event/cssEvent.css rename to public/home/admin/event/event.css diff --git a/public/home/admin/event/jsEvent.js b/public/home/admin/event/event.js similarity index 100% rename from public/home/admin/event/jsEvent.js rename to public/home/admin/event/event.js diff --git a/public/home/admin/event/listImages.pl b/public/home/admin/event/listImages.pl deleted file mode 100755 index 66f8854..0000000 --- a/public/home/admin/event/listImages.pl +++ /dev/null @@ -1,25 +0,0 @@ -#!/usr/bin/perl -use warnings; -use strict; -use JSON; -use Cwd 'abs_path'; -use lib abs_path("../../")."/sibelius2/conf"; -use Paths; -#------------------------- -print getNames( Paths::MOD ."/cal/img"); -sub getNames{ -my $dir = shift; -my @file_name; -opendir(DIR, $dir) or die "error opening dir: $dir \n$!"; -while (my $file = readdir(DIR)) { -next unless ( $file =~m/^[\w\d]/); -next unless (-f "$dir/$file"); -push(@file_name,{name=>$file,tag=>"ilist"}); -} - closedir(DIR); - return encode_json( \@file_name ); -} - -1; -__END__ - diff --git a/public/home/admin/home/cssAdmin.css b/public/home/admin/home/admin.css similarity index 100% rename from public/home/admin/home/cssAdmin.css rename to public/home/admin/home/admin.css diff --git a/public/home/admin/home/jsButtons.js b/public/home/admin/home/buttons.js similarity index 100% rename from public/home/admin/home/jsButtons.js rename to public/home/admin/home/buttons.js diff --git a/public/home/admin/home/jsFb.js b/public/home/admin/home/fb.js similarity index 100% rename from public/home/admin/home/jsFb.js rename to public/home/admin/home/fb.js diff --git a/public/home/admin/mensajes/cssMsg.css b/public/home/admin/mensajes/msg.css similarity index 100% rename from public/home/admin/mensajes/cssMsg.css rename to public/home/admin/mensajes/msg.css diff --git a/public/home/admin/mensajes/jsMsg.js b/public/home/admin/mensajes/msg.js similarity index 100% rename from public/home/admin/mensajes/jsMsg.js rename to public/home/admin/mensajes/msg.js diff --git a/public/home/admin/radio/cssAdmin.css b/public/home/admin/radio/admin.css similarity index 100% rename from public/home/admin/radio/cssAdmin.css rename to public/home/admin/radio/admin.css diff --git a/public/home/admin/radio/jsLoadInfo.js b/public/home/admin/radio/loadInfo.css similarity index 100% rename from public/home/admin/radio/jsLoadInfo.js rename to public/home/admin/radio/loadInfo.css diff --git a/public/home/bcast/cssCast.css b/public/home/bcast/cast.css similarity index 100% rename from public/home/bcast/cssCast.css rename to public/home/bcast/cast.css diff --git a/public/home/podcast/cssPodcast.css b/public/home/podcast/podcast.css similarity index 100% rename from public/home/podcast/cssPodcast.css rename to public/home/podcast/podcast.css diff --git a/public/home/podcast/jsPodcast.js b/public/home/podcast/podcast.js similarity index 90% rename from public/home/podcast/jsPodcast.js rename to public/home/podcast/podcast.js index 06f66c2..0a5fb79 100755 --- a/public/home/podcast/jsPodcast.js +++ b/public/home/podcast/podcast.js @@ -1,5 +1,5 @@ var sources; -d3.json( "home/podcast/jsonPod.json",function(d){ +d3.json( "/json/podcast/podcast.json",function(d){ d3.select("#audioframe").attr("src",d[0].source); sources=d; }); diff --git a/public/home/radio/jsLink.js b/public/home/radio/link.js similarity index 100% rename from public/home/radio/jsLink.js rename to public/home/radio/link.js diff --git a/public/home/radio/cssRadio.css b/public/home/radio/radio.css similarity index 100% rename from public/home/radio/cssRadio.css rename to public/home/radio/radio.css diff --git a/public/home/radio/jsRadio.js b/public/home/radio/radio.js similarity index 100% rename from public/home/radio/jsRadio.js rename to public/home/radio/radio.js diff --git a/templates/home/admin/event.html.ep b/templates/home/admin/event.html.ep index 0c59e3e..18c9beb 100755 --- a/templates/home/admin/event.html.ep +++ b/templates/home/admin/event.html.ep @@ -1,3 +1,5 @@ +% stash css=>["/home/admin/admin.css","/home/admin/event/event.css"]; +% stash js=>["/home/admin/event/event.js"];

Editar Eventos

diff --git a/templates/home/admin/home.html.ep b/templates/home/admin/home.html.ep index daa1650..b391c33 100755 --- a/templates/home/admin/home.html.ep +++ b/templates/home/admin/home.html.ep @@ -1,3 +1,5 @@ +% stash css=>["/home/admin/admin.css","/home/admin/home/admin.css"]; +% stash js=>["/home/admin/home/buttons.js","/home/admin/home/fb.js"];

Editar Casa

diff --git a/templates/home/admin/mensajes.html.ep b/templates/home/admin/mensajes.html.ep index efc3e5f..e1c6659 100755 --- a/templates/home/admin/mensajes.html.ep +++ b/templates/home/admin/mensajes.html.ep @@ -1,3 +1,5 @@ +% stash css=>["/home/admin/admin.css","/home/admin/mensajes/msg.css"]; +% stash js=>["/home/admin/mensajes/msg.js"];