diff --git a/dojo.conf b/dojo.conf index 74cc878..04168e2 100755 --- a/dojo.conf +++ b/dojo.conf @@ -12,10 +12,10 @@ chat_channel => 'Grullas@radio.chat.chaos.foundation', #Radio ===================================================== - radio_server_name=>"http://chaos.foundation:8000/q", + radio_server_name=>"http://radio.chaos.foundation:8000/q", radio_server =>"https://radio.chaos.foundation", radio_channel => "/q", - radio_listen_url =>"https://chaos.foundation/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 bcbd89b..5d8f7a2 100755 --- a/lib/Dojo/Controller/Home.pm +++ b/lib/Dojo/Controller/Home.pm @@ -1,116 +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->stash( merge_hash( - # (load_module("home/tst"))[0], - # (load_module("home/contact"))[0] - #)); - # $c->stash(apend => ["home/contact"]); - #$c->stash( (load_module("home/tst"))[0] ); - #$c->stash(layout=> "defaultContact"); - #my $x = [get_names("public/home/cal/img/")]; - #log("@$x"); - #$c->stash( ilist => $x); - #$c->dbv->tst; $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((load_module("home/home"))[0]); - $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 ($v,$w)=load_module("home/pang"); - $c->stash($v); - $c->stash( $c->dbv->md_to_hash(@{$w->{'md'}}) ); - } +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; - $c->stash((load_module("home/cal"))[0]); - my $data=$c->dbv->calendar_events; - my $block=$c->dbv->calendar_monthblock; - my %hdata; - map{ push @{ $hdata{$_->{bid}} },$_; }(@$data); - $c->stash( r=>\%hdata, b=>$block); - } +} - sub event{ - my $c = shift; - $c->stash((load_module("home/event"))[0]); - $c->stash(layout=> "defaultContact"); - $c->stash($c->dbv->event($c->param("id"))); - } +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 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((load_module("home/contact"))[0]); - } - } +sub event{ + my $c = shift; + $c->stash($c->dbv->event($c->param("id"))); + $c->stash(layout=> "defaultContact"); +} - sub contact2{ - my $c = shift; - $c->redirect_to("home") unless $c->flash('mname'); - $c->stash( mname=>$c->flash('mname')); - $c->stash((load_module("home/contact2"))[0]); +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 store{ - my $c = shift; - $c->stash((load_module("home/store"))[0]); - $c->stash( r=>$c->dbv->store); - $c->stash(layout=> "defaultContact"); - } +sub contact2{ + my $c = shift; + $c->redirect_to("home") unless $c->flash('mname'); + $c->stash( mname=>$c->flash('mname')); + $c->stash(layout=>'default'); +} - sub tv{ - my $c = shift; - $c->stash( merge_hash( - (load_module("home/tv"))[0], - (load_module("home/tv/trans"))[0] - )); - $c->stash( videos=>$c->dbv->tv_videos, table=>$c->dbv->tv_series); - $c->stash(layout=> "defaultContact"); - } +sub store{ + my $c = shift; + $c->stash( r=>$c->dbv->store); + $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 tv{ + my $c = shift; + $c->stash( videos=>$c->dbv->tv_videos, table=>$c->dbv->tv_series); + $c->stash(layout=> "defaultContact"); +} - sub bcast{ - my $c = shift; - $c->stash((load_module("home/bcast"))[0]); - - } +sub podcast{ + my $c = shift; + $c->stash(layout=> "defaultContact"); + $c->stash( t=>$c->dbv->podcast_txt, pod=>$c->dbv->podcast_infoHash); +} + +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")); @@ -137,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); @@ -151,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"); @@ -162,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"); @@ -194,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, @@ -210,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/cal/q1Block.q b/lib/Dojo/Model/Data/cal/q1Block.q similarity index 100% rename from public/home/cal/q1Block.q rename to lib/Dojo/Model/Data/cal/q1Block.q diff --git a/public/home/cal/q3Event.q b/lib/Dojo/Model/Data/cal/q3Event.q similarity index 100% rename from public/home/cal/q3Event.q rename to lib/Dojo/Model/Data/cal/q3Event.q diff --git a/public/home/event/qEvent.q b/lib/Dojo/Model/Data/event/qEvent.q similarity index 100% rename from public/home/event/qEvent.q rename to lib/Dojo/Model/Data/event/qEvent.q diff --git a/public/home/pang/benjamin.md b/lib/Dojo/Model/Data/pang/benjamin.md similarity index 100% rename from public/home/pang/benjamin.md rename to lib/Dojo/Model/Data/pang/benjamin.md diff --git a/public/home/pang/helen.md b/lib/Dojo/Model/Data/pang/helen.md similarity index 100% rename from public/home/pang/helen.md rename to lib/Dojo/Model/Data/pang/helen.md diff --git a/public/home/pang/pang.md b/lib/Dojo/Model/Data/pang/pang.md similarity index 100% rename from public/home/pang/pang.md rename to lib/Dojo/Model/Data/pang/pang.md 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/public/home/store/qStore.q b/lib/Dojo/Model/Data/store/qStore.q similarity index 100% rename from public/home/store/qStore.q rename to lib/Dojo/Model/Data/store/qStore.q diff --git a/public/home/tv/qSeries.q b/lib/Dojo/Model/Data/tv/qSeries.q similarity index 100% rename from public/home/tv/qSeries.q rename to lib/Dojo/Model/Data/tv/qSeries.q diff --git a/public/home/tv/qTable.q b/lib/Dojo/Model/Data/tv/qTable.q similarity index 100% rename from public/home/tv/qTable.q rename to lib/Dojo/Model/Data/tv/qTable.q diff --git a/lib/Dojo/Model/Vuelo.pm b/lib/Dojo/Model/Vuelo.pm index 50f62df..1926b5b 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'; @@ -12,47 +11,51 @@ use DBI; use Dojo::Conf; sub new { bless {}, shift }; +my $data_path = path('lib/Dojo/Model/Data')->make_path; #just for fun # Read vdg user =============================================================== - sub mod{ - my $q="select nombre,contenido from casa;"; - my %h=map{ $_->{nombre} => $_->{contenido}}@{_read($q)}; - return %h; - } +# mensaje del día:mod,rmod,yt,fb,sc +sub mod{ + my $q="select nombre,contenido from casa;"; + my %h=map{ $_->{nombre} => $_->{contenido}}@{_read($q)}; + return %h; +} - sub md_to_hash{ - my ($self,@filelist)=@_; - return {map { basename($_,".md") => load_md("public/$_")}@filelist}; - } +sub pang_md{ + my $c=shift; + my %h = map { + $_=> markdown(decode_utf8($data_path->child('pang/'.$_.'.md')->slurp)) + } ("pang","helen","benjamin"); + return \%h; +} - sub calendar_monthblock { - return _read (path("public/home/cal/q1Block.q")->slurp); - } - sub calendar_events { - return _read (path("public/home/cal/q3Event.q")->slurp); - } +sub calendar_monthblock { + return _read ($data_path->child("cal/q1Block.q")->slurp); +} +sub calendar_events { + return _read ($data_path->child("cal/q3Event.q")->slurp); +} - sub event{ - my ($self,$id)=@_; - return shift @{ _read (path("public/home/event/qEvent.q")->slurp,$id)}; - } - sub store{ - return _read (path("public/home/store/qStore.q")->slurp); - } - sub tv_videos{ - return _read (path("public/home/tv/qSeries.q")->slurp); #group,name - } - sub tv_series{ - return _read (path("public/home/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 event{ + my ($c,$id)=@_; + return shift @{ _read ($data_path->child("event/qEvent.q")->slurp,$id)}; +} +sub store{ + return _read ($data_path->child("/store/qStore.q")->slurp); +} +sub tv_videos{ + return _read ($data_path->child("/tv/qSeries.q")->slurp); #group,name +} +sub tv_series{ + return _read ($data_path->child("/tv/qTable.q")->slurp); #name,order,group +} +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; +} #============================================================================== @@ -60,7 +63,7 @@ sub new { bless {}, shift }; 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"; @@ -72,7 +75,7 @@ sub new { bless {}, shift }; 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; @@ -81,59 +84,65 @@ sub new { bless {}, shift }; 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 eimgList{ return [get_names("public/home/cal/img/")] } + 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/")] } + sub eimgList{ + my $dp = path('public/home/cal/img')->make_path; + return [ map{ $_->basename} grep{/(jpg|png)$/i}@{$dp->list} ]; + + + } #============================================================================== # Write vdg user ============================================================== - sub contact{ - my $c=shift; - my $q="insert into entrada (nombre,correo,pagina,texto,fecha) values(?,?,?,?,now() )" ; - my @a=@_; - #simple method to ignore spam - return _writemsg($q,@a) unless $a[3]=~m/http|website|\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 99% rename from public/home/admin/event/cssEvent.css rename to public/home/admin/event/event.css index 447efcf..31c45ca 100755 --- a/public/home/admin/event/cssEvent.css +++ b/public/home/admin/event/event.css @@ -62,7 +62,7 @@ article.edit input[name=cost]{ width:100px; } article.edit input[type=number]{ - width:60px; + width:70px; } article.edit textarea{ flex:3; 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/cal/cssCal.css b/public/home/cal/cal.css similarity index 100% rename from public/home/cal/cssCal.css rename to public/home/cal/cal.css diff --git a/public/home/contact/cssContact1.css b/public/home/contact/contact1.css similarity index 100% rename from public/home/contact/cssContact1.css rename to public/home/contact/contact1.css diff --git a/public/home/contact/msg/b.pl b/public/home/contact/msg/b.pl deleted file mode 100755 index affe18b..0000000 --- a/public/home/contact/msg/b.pl +++ /dev/null @@ -1,48 +0,0 @@ -#!/usr/bin/perl -s -use warnings; -use strict; -#--- -use Cwd 'abs_path'; -use lib abs_path("../../")."/sibelius2/conf"; -use Paths; -use Init; -use ServerVars; -use Net::Telnet; -use MIME::Lite; -use JSON; -#------------- -### MimeLite necesita sendmail, para arch, sendmail esta sin atender, -### puedes usar msmtp msmtp-mta para simular sendmail. este ultimo -### necesita configurarse con un correo. - -my ($mod_name,$sid) = @ARGV; -my %var = (Init::modInit($sid),%ServerVars::sk); -my $server_name = $var{'chat_srv'}; - -my @arr; -push (@arr,{name=>"one",tag=>"notag"}); - - -my $to = 'benjamuga@gmail.com'; -my $from = 'mensajes@vuelodegrulla.com'; -my $subject = "Mensaje de $var{'mname'}"; -my $message = "Enviado por: -

$var{'mname'}

-

correo:
$var{'mail'}

-

$var{'msg'}

- "; - -my $msg = MIME::Lite->new( - From => $from, - To => $to, - Subject => $subject, - Data => $message - ); - -$msg->attr("content-type" => "text/html"); -$msg->send; - -print encode_json( \@arr ) ."\n"; - -1 -__END__ diff --git a/public/home/contact/msg/qUpdate.q b/public/home/contact/msg/qUpdate.q deleted file mode 100755 index e1e3a4c..0000000 --- a/public/home/contact/msg/qUpdate.q +++ /dev/null @@ -1,14 +0,0 @@ - - /* c#host localhost*/ - /* c#database #dbmsg */ - /* c#user #dbmsg_w */ - /* c#password #dbmsg_wp */ - /* c#write write*/ - - - - insert into entrada - (nombre,correo,pagina,texto,fecha) - values - ( q#mname , q#mail , q#wp , q#msg ,now() ); - diff --git a/public/home/contact2/cssContact2.css b/public/home/contact2/contact2.css similarity index 100% rename from public/home/contact2/cssContact2.css rename to public/home/contact2/contact2.css diff --git a/public/home/event/cssEvent.css b/public/home/event/event.css similarity index 100% rename from public/home/event/cssEvent.css rename to public/home/event/event.css diff --git a/public/home/home/cssAnimation.css b/public/home/home/animation.css similarity index 100% rename from public/home/home/cssAnimation.css rename to public/home/home/animation.css diff --git a/public/home/home/d3Tras.js b/public/home/home/d3_tras.js similarity index 100% rename from public/home/home/d3Tras.js rename to public/home/home/d3_tras.js diff --git a/public/home/home/jsFb.js b/public/home/home/fb.js similarity index 100% rename from public/home/home/jsFb.js rename to public/home/home/fb.js diff --git a/public/home/home/cssGrid.css b/public/home/home/grid.css similarity index 100% rename from public/home/home/cssGrid.css rename to public/home/home/grid.css diff --git a/public/home/home/cssHead.css b/public/home/home/head.css similarity index 100% rename from public/home/home/cssHead.css rename to public/home/home/head.css diff --git a/public/home/home/cssOsc.css b/public/home/home/osc.css similarity index 100% rename from public/home/home/cssOsc.css rename to public/home/home/osc.css diff --git a/public/home/home/qUser.q b/public/home/home/qUser.q deleted file mode 100755 index 88f2293..0000000 --- a/public/home/home/qUser.q +++ /dev/null @@ -1,13 +0,0 @@ - - - /* c#host localhost*/ - /* c#database #dbdata */ - /* c#user #dbdata_user */ - /* c#password #dbdata_pass */ - - - -select - nombre as "tag", - contenido as "uContent" - from casa; diff --git a/public/home/home/cssTrans.css b/public/home/home/trans.css similarity index 100% rename from public/home/home/cssTrans.css rename to public/home/home/trans.css diff --git a/public/home/pang/img/ben.png b/public/home/pang/ben.png similarity index 100% rename from public/home/pang/img/ben.png rename to public/home/pang/ben.png diff --git a/public/home/pang/grulla_21.jpg b/public/home/pang/bkg_grulla_21.jpg similarity index 100% rename from public/home/pang/grulla_21.jpg rename to public/home/pang/bkg_grulla_21.jpg diff --git a/public/home/pang/img/helen.png b/public/home/pang/helen.png similarity index 100% rename from public/home/pang/img/helen.png rename to public/home/pang/helen.png diff --git a/public/home/pang/htmlPang.html b/public/home/pang/htmlPang.html deleted file mode 100755 index 1a2d455..0000000 --- a/public/home/pang/htmlPang.html +++ /dev/null @@ -1,31 +0,0 @@ -
- -
-

Nuestro querido maestro Pang He Ming

-
-
-
-
- -
-
- -
-

Los maestros Zhang Qing (Helen) y  Qiu Fu Chun (Karl).

-
-
-
-
- -
-
- -
-

Instructor Benjamín Munñóz

-
-
-
-
- -
-
diff --git a/public/home/pang/img/maestro.png b/public/home/pang/maestro.png similarity index 100% rename from public/home/pang/img/maestro.png rename to public/home/pang/maestro.png diff --git a/public/home/pang/cssPang.css b/public/home/pang/pang.css similarity index 85% rename from public/home/pang/cssPang.css rename to public/home/pang/pang.css index 2ac0bb6..3bd438f 100755 --- a/public/home/pang/cssPang.css +++ b/public/home/pang/pang.css @@ -2,7 +2,7 @@ body{ background-repeat: no-repeat; background-attachment: fixed; background-size:cover; - background-image:url("grulla_21.jpg"); + background-image:url("bkg_grulla_21.jpg"); background-position: right top; } @@ -40,9 +40,9 @@ article.imageHead{ margin:20px; min-height:300px } -article#apang{ background-image:url("img/maestro.png");} -article#ahel{ background-image:url("img/helen.png");} -article#aben{ background-image:url("img/ben.png");} +article#apang{ background-image:url("maestro.png");} +article#ahel{ background-image:url("helen.png");} +article#aben{ background-image:url("ben.png");} /* text column -------------------*/ article.text{ 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/public/home/store/img/libro.jpg b/public/home/store/img/libro.jpg old mode 100755 new mode 100644 index bdfb4d7..5266c74 Binary files a/public/home/store/img/libro.jpg and b/public/home/store/img/libro.jpg differ diff --git a/public/home/store/img/libro_old.jpg b/public/home/store/img/libro_old.jpg new file mode 100755 index 0000000..bdfb4d7 Binary files /dev/null and b/public/home/store/img/libro_old.jpg differ diff --git a/public/home/store/cssShop.css b/public/home/store/shop.css similarity index 100% rename from public/home/store/cssShop.css rename to public/home/store/shop.css diff --git a/public/home/tv/trans/d3Tras.js b/public/home/tv/d3_tras.js similarity index 100% rename from public/home/tv/trans/d3Tras.js rename to public/home/tv/d3_tras.js diff --git a/public/home/tv/d3Tune.js b/public/home/tv/d3_tune.js similarity index 100% rename from public/home/tv/d3Tune.js rename to public/home/tv/d3_tune.js diff --git a/public/home/tv/cssHead.css b/public/home/tv/head.css similarity index 100% rename from public/home/tv/cssHead.css rename to public/home/tv/head.css diff --git a/public/home/tv/trans/cssTrans.css b/public/home/tv/trans.css similarity index 100% rename from public/home/tv/trans/cssTrans.css rename to public/home/tv/trans.css diff --git a/public/home/tv/cssTv.css b/public/home/tv/tv.css similarity index 100% rename from public/home/tv/cssTv.css rename to public/home/tv/tv.css diff --git a/public/home/tv/trans/vdg.svg b/public/home/tv/vdg.svg similarity index 100% rename from public/home/tv/trans/vdg.svg rename to public/home/tv/vdg.svg diff --git a/templates/home/admin/event.html.ep b/templates/home/admin/event.html.ep index 0c59e3e..b5c2d0b 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

@@ -38,7 +40,7 @@ <% } %><% (@{stash('months')}) %><% if defined(stash('months')); %> - +
@@ -48,7 +50,7 @@ <% } %><% (@{stash('months')}) %><% if defined(stash('months')); %> - +
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"];