revolucion

This commit is contained in:
mynah
2019-03-14 03:19:54 -06:00
parent fa0fbe9eb4
commit 26523cdca2
59 changed files with 156 additions and 169 deletions

View File

@@ -12,10 +12,10 @@
chat_channel => 'Grullas@radio.chat.vuelodegrulla.com', chat_channel => 'Grullas@radio.chat.vuelodegrulla.com',
#Radio ===================================================== #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_server =>"https://radio.chaos.foundation",
radio_channel => "/p", radio_channel => "/q",
radio_listen_url =>"https://chaos.foundation/p", radio_listen_url =>"http://radio.chaos.foundation:8000/q",
#RTPM ======================================================= #RTPM =======================================================
rtmp_server =>"rtmp://chaos.foundation/steam", rtmp_server =>"rtmp://chaos.foundation/steam",

View File

@@ -31,7 +31,7 @@ use Dojo::Model::Users;
# ============================================================================= # =============================================================================
# json ======================================================================== # json ========================================================================
$r->any('/json/:dreq')->to('data#simple'); $r->any('/json/*dreq')->to('data#simple');
# ============================================================================= # =============================================================================
# candy ======================================================================= # candy =======================================================================

View File

@@ -1,16 +1,21 @@
package Dojo::Controller::Data; package Dojo::Controller::Data;
use Mojo::File 'path';
use Mojo::JSON qw(decode_json encode_json);
use Mojo::Base 'Mojolicious::Controller'; use Mojo::Base 'Mojolicious::Controller';
use Dojo::Support qw{ dmph merge_hash load_module }; use Dojo::Support qw{ dmph merge_hash load_module };
use Net::Telnet; use Net::Telnet;
my $server_name = ""; my $server_name = "";
our $t; #telnet server object our $t; #telnet server object
my $data_path = path('lib/Dojo/Model/Data')->make_path;
sub simple{ sub simple{
my $c=shift; my $c=shift;
my $n=$c->param("dreq")//""; my $n=$c->param("dreq")//"";
my $json = {status => "304"}; my $json = {status => "304"};
$json = { srv =>$c->config->{radio_server} } if $n =~m/^radio$/ ; $json = { srv =>$c->config->{radio_server} } if $n =~m/^radio$/ ;
$json = candy() if $n =~m/^candy$/ ; $json = candy() if $n =~m/^candy$/ ;
$json = decode_json($data_path->child("$n")->slurp)
if $n=~m/^podcast\/podcast.json$/;
$c->render(json=>$json); $c->render(json=>$json);
} }

View File

@@ -1,99 +1,97 @@
package Dojo::Controller::Home; package Dojo::Controller::Home;
use Mojo::Base 'Mojolicious::Controller'; use Mojo::Base 'Mojolicious::Controller';
use Mojo::Template; 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{ sub tst{
my $c=shift; my $c=shift;
$c->render(text=> $c->config->{radio}{'channel'}); $c->render(text=> $c->config->{radio}{'channel'});
} }
# User ======================================================================== # User ========================================================================
sub home_ { sub home_ {
my $c = shift; my $c = shift;
$c->redirect_to("/home") ; $c->redirect_to("/home") ;
} }
sub home { sub home {
my $c = shift; my $c = shift;
$c->stash( $c->dbv->mod) ; $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'); $c->stash(layout=>'default');
} }
}
sub pang { sub contact2{
my $c = shift; my $c = shift;
my $h=$c->dbv->pang_md; $c->redirect_to("home") unless $c->flash('mname');
map { $c->stash( $_ => $h->{$_}) } keys %$h; $c->stash( mname=>$c->flash('mname'));
$c->stash(layout=>'default'); $c->stash(layout=>'default');
}
} sub store{
my $c = shift;
$c->stash( r=>$c->dbv->store);
$c->stash(layout=> "defaultContact");
}
sub cal { sub tv{
my $c = shift; my $c = shift;
my $data=$c->dbv->calendar_events; $c->stash( videos=>$c->dbv->tv_videos, table=>$c->dbv->tv_series);
my $block=$c->dbv->calendar_monthblock; $c->stash(layout=> "defaultContact");
my %h; }
map{ push @{ $h{$_->{bid}} },$_; }(@$data);
$c->stash( r=>\%h, b=>$block);
$c->stash(layout=>'default');
}
sub event{ sub podcast{
my $c = shift; my $c = shift;
$c->stash($c->dbv->event($c->param("id"))); $c->stash(layout=> "defaultContact");
$c->stash(layout=> "defaultContact"); $c->stash( t=>$c->dbv->podcast_txt, pod=>$c->dbv->podcast_infoHash);
} }
sub contact{ sub bcast{
my $c = shift; my $c = shift;
if ($c->param("mup")){ $c->stash(layout=> "defaultContact");
$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 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 radio{ sub radio{
my $c=shift; my $c=shift;
$c->stash((load_module("home/radio"))[0]);
$c->stash(layout=> "defaultContact"); $c->stash(layout=> "defaultContact");
$c->stash($c->dbv->mod); $c->stash($c->dbv->mod);
$c->stash(nick=>$c->session("nick")); $c->stash(nick=>$c->session("nick"));
@@ -120,7 +118,6 @@ sub tst{
my $c=shift; my $c=shift;
$c->dbv->umod($c->param('link'),$c->param('update')) $c->dbv->umod($c->param('link'),$c->param('update'))
if (($c->param("hup") // " " )=~/Cambiar/); if (($c->param("hup") // " " )=~/Cambiar/);
$c->stash((load_module("home/admin/home"))[0]);
$c->stash(template=>"home/admin/home"); $c->stash(template=>"home/admin/home");
$c->stash(layout=>"admin"); $c->stash(layout=>"admin");
$c->stash( $c->dbv->mod); $c->stash( $c->dbv->mod);
@@ -134,10 +131,6 @@ sub tst{
if (($c->param("pup") // " " )=~/Cambiar/); if (($c->param("pup") // " " )=~/Cambiar/);
$c->stash($c->dbv->mod); $c->stash($c->dbv->mod);
$c->stash($c->dbg->grulla_pass); $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(apend => ["home/admin/candySwitch"]);
$c->stash(template=>"home/admin/radio"); $c->stash(template=>"home/admin/radio");
$c->stash(layout=>"admin"); $c->stash(layout=>"admin");
@@ -145,7 +138,6 @@ sub tst{
sub admin_mensajes{ sub admin_mensajes{
my $c=shift; my $c=shift;
$c->stash((load_module("home/admin/mensajes"))[0]);
$c->stash( h=>$c->dbv->msg_heads); $c->stash( h=>$c->dbv->msg_heads);
$c->stash(template=>"home/admin/mensajes"); $c->stash(template=>"home/admin/mensajes");
$c->stash(layout=>"admin"); $c->stash(layout=>"admin");
@@ -177,15 +169,10 @@ sub tst{
$c->dbv->place_up(@list) if ($id ==0); $c->dbv->place_up(@list) if ($id ==0);
$c->dbv->place_ch(@list) if ($id >0); $c->dbv->place_ch(@list) if ($id >0);
} }
} }
$c->redirect_to("/admin/eventos"); $c->redirect_to("/admin/eventos");
} }
$c->stash( $c->stash(
courses=>$c->dbv->courses, courses=>$c->dbv->courses,
places=>$c->dbv->places, places=>$c->dbv->places,
@@ -193,7 +180,6 @@ sub tst{
events=>$c->dbv->events, events=>$c->dbv->events,
img=>$c->dbv->eimgList, img=>$c->dbv->eimgList,
); );
$c->stash((load_module("home/admin/event"))[0]);
$c->stash(template=>"home/admin/event"); $c->stash(template=>"home/admin/event");
$c->stash(layout=>"admin"); $c->stash(layout=>"admin");
} }

View File

@@ -1,5 +1,4 @@
package Dojo::Model::Vuelo; package Dojo::Model::Vuelo; use Mojo::File 'path';
use Mojo::File 'path';
use Mojo::JSON qw(decode_json encode_json); use Mojo::JSON qw(decode_json encode_json);
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 Mojo::Base 'Mojolicious::Controller'; use Mojo::Base 'Mojolicious::Controller';
@@ -25,8 +24,9 @@ sub mod{
sub pang_md{ sub pang_md{
my $c=shift; my $c=shift;
my %h = map {$_=> markdown(decode_utf8($data_path->child('pang/'.$_.'.md')->slurp))} my %h = map {
("pang","helen","benjamin"); $_=> markdown(decode_utf8($data_path->child('pang/'.$_.'.md')->slurp))
} ("pang","helen","benjamin");
return \%h; return \%h;
} }
@@ -50,13 +50,12 @@ sub tv_videos{
sub tv_series{ sub tv_series{
return _read ($data_path->child("/tv/qTable.q")->slurp); #name,order,group return _read ($data_path->child("/tv/qTable.q")->slurp); #name,order,group
} }
sub podcast_txt{ 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($data_path->child("/podcast/text.txt")->slurp);
return decode_utf8(path("public/home/podcast/text.txt")->slurp); }
} sub podcast_infoHash{
sub podcast_infoHash{ return decode_json $data_path->child("/podcast/podcast.json")->slurp;
return decode_json path("public/home/podcast/jsonPod.json")->slurp; }
}
#============================================================================== #==============================================================================
@@ -64,7 +63,7 @@ sub tv_series{
sub msg_heads{ sub msg_heads{
my ($self,@bind)=@_; my ($self,@bind)=@_;
my @empty; 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}); 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); return \@empty unless($dbh);
my $h=$dbh->selectall_arrayref($q,{ Slice => {} },@bind)//"error"; my $h=$dbh->selectall_arrayref($q,{ Slice => {} },@bind)//"error";
@@ -76,7 +75,7 @@ sub tv_series{
sub msg{ sub msg{
my ($c,@bind)=@_; my ($c,@bind)=@_;
my @empty; 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}); 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); return \@empty unless($dbh);
my $h=$dbh->selectall_arrayref($q,{ Slice => {} },@bind)//\@empty; my $h=$dbh->selectall_arrayref($q,{ Slice => {} },@bind)//\@empty;
@@ -85,12 +84,12 @@ sub tv_series{
return shift @$h; return shift @$h;
} }
sub courses{ return _read("select nombre as name, id from curso;")} 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 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 months { return _read("select nombre as name, id from mes;")};
sub events { return _read(path("public/home/admin/event/qEprev.q")->slurp)} sub events { return _read($data_path->child("/admin/event/qEprev.q")->slurp)}
sub eventa { return shift @{_read(path("public/home/admin/event/json/qEvent.q")->slurp,pop)}} 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{ return [get_names("public/home/cal/img/")] }
#============================================================================== #==============================================================================
# Write vdg user ============================================================== # Write vdg user ==============================================================
@@ -104,40 +103,40 @@ sub contact{
} }
#============================================================================== #==============================================================================
# Write vdg admin ============================================================== # Write vdg admin ==============================================================
sub umod{ sub umod{
my $c=shift; my $c=shift;
my $q="update casa set contenido = ? where nombre = ? ;"; my $q="update casa set contenido = ? where nombre = ? ;";
return _write($q,@_); return _write($q,@_);
} }
sub event_del { return _write("delete from evento where id = ?;",pop);} sub event_del { return _write("delete from evento where id = ?;",pop);}
sub course_del{ return _write("delete from curso 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 place_del { return _write("delete from lugar where id = ?;",pop); }
sub event_up{ sub event_up{
my ($self,@bind)=@_; my ($self,@bind)=@_;
return _write(path("public/home/admin/event/add/qEup.q")->slurp,@bind); return _write($data_path->child("/admin/event/add/qEup.q")->slurp,@bind);
} }
sub course_up{ sub course_up{
my ($self,@bind)=@_; my ($self,@bind)=@_;
return _write(path("public/home/admin/event/add/qCup.q")->slurp,@bind); return _write($data_path->child("/admin/event/add/qCup.q")->slurp,@bind);
} }
sub place_up{ sub place_up{
my ($self,@bind)=@_; my ($self,@bind)=@_;
return _write(path("public/home/admin/event/add/qPup.q")->slurp,@bind); return _write($data_path->child("/admin/event/add/qPup.q")->slurp,@bind);
} }
sub event_ch{ sub event_ch{
my ($self,@bind)=@_; my ($self,@bind)=@_;
return _write(path("public/home/admin/event/change/qEup.q")->slurp,@bind); return _write($data_path->child("/admin/event/change/qEup.q")->slurp,@bind);
} }
sub course_ch{ sub course_ch{
my ($self,@bind)=@_; my ($self,@bind)=@_;
return _write(path("public/home/admin/event/change/qCup.q")->slurp,@bind); return _write($data_path->child("/admin/event/change/qCup.q")->slurp,@bind);
} }
sub place_ch{ sub place_ch{
my ($self,@bind)=@_; my ($self,@bind)=@_;
return _write(path("public/home/admin/event/change/qPup.q")->slurp,@bind); return _write($data_path->child("/admin/event/change/qPup.q")->slurp,@bind);
} }
#============================================================================== #==============================================================================

View File

@@ -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__

View File

@@ -1,5 +1,5 @@
var sources; 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); d3.select("#audioframe").attr("src",d[0].source);
sources=d; sources=d;
}); });

View File

@@ -1,3 +1,5 @@
% stash css=>["/home/admin/admin.css","/home/admin/event/event.css"];
% stash js=>["/home/admin/event/event.js"];
<section class="name" flex> <article class="user"> <section class="name" flex> <article class="user">
<p class="title">Editar Eventos</p> <p class="title">Editar Eventos</p>
</article> </section> </article> </section>

View File

@@ -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"];
<section class="title flex"> <section class="title flex">
<article class="title"> <p>Editar Casa</p> </article> <article class="title"> <p>Editar Casa</p> </article>
</section> </section>

View File

@@ -1,3 +1,5 @@
% stash css=>["/home/admin/admin.css","/home/admin/mensajes/msg.css"];
% stash js=>["/home/admin/mensajes/msg.js"];
<section class="flex messages"> <section class="flex messages">
<article class="select"> <article class="select">
<select id="sentry" class="entry" size=10> <select id="sentry" class="entry" size=10>

View File

@@ -1,3 +1,13 @@
% stash css=>[
% "/home/admin/admin.css",
% "/home/admin/radio/admin.css",
% "/home/admin/candySwitch/main.css",
% "/home/admin/candySwitch/switch.css"
% ];
% stash js=>[
% "/home/admin/radio/loadInfo.js",
% "/home/admin/candySwitch/cSwitch.js"
% ];
<section class="title flex"> <section class="title flex">
<article class="title"> <p>Radio</p> </article> <article class="title"> <p>Radio</p> </article>
<article class="bcast"> <form action="/admin/radio" method="post"> <article class="bcast"> <form action="/admin/radio" method="post">

View File

@@ -1,3 +1,5 @@
% stash css=>["/home/bcast/cast.css"];
<link rel="stylesheet" href="//releases.flowplayer.org/7.2.1/skin/skin.css"> <link rel="stylesheet" href="//releases.flowplayer.org/7.2.1/skin/skin.css">
<script src="//releases.flowplayer.org/7.2.1/flowplayer.min.js"></script> <script src="//releases.flowplayer.org/7.2.1/flowplayer.min.js"></script>
<script src="//releases.flowplayer.org/dashjs/flowplayer.dashjs.min.js"></script> <script src="//releases.flowplayer.org/dashjs/flowplayer.dashjs.min.js"></script>

View File

@@ -1,5 +1,5 @@
%stash css=>[ "/home/home/animation.css", "/home/home/grid.css", "/home/home/head.css", "/home/home/osc.css", "/home/home/trans.css" ]; %stash css=>[ "/home/home/animation.css", "/home/home/grid.css", "/home/home/head.css", "/home/home/osc.css", "/home/home/trans.css" ];
%stash js=>["/home/home/d3_tras.js","/home/home/fb.js"]; %stash js=>["/home/home/d3_tras.js","/home/home/fb.js","/home/home/bcast.js"];
<section id="ihead"> <section id="ihead">
<div id="courtain"> <div id="courtain">
<div class="logo"></div> <div class="logo"></div>

View File

@@ -1,3 +1,5 @@
% stash css=>["/home/podcast/podcast.css"];
% stash js=>["/home/podcast/podcast.js"];
<section id="stitle" class="title"> <section id="stitle" class="title">
<p class="title"> Podcast de ZhiNeng QiGong </p> <p class="title"> Podcast de ZhiNeng QiGong </p>
</section> </section>

View File

@@ -1,3 +1,5 @@
% stash css=>["/home/radio/radio.css"];
% stash js=>["/home/radio/link,js","/home/radio/radio.js"];
<section class="flex title"> <section class="flex title">
<article class="title"> <p>Radio Vuelo de grulla</p> </article> <article class="title"> <p>Radio Vuelo de grulla</p> </article>
</section> </section>