This commit is contained in:
mynah
2019-03-12 19:20:30 -06:00
parent 956dbdb909
commit fa0fbe9eb4
49 changed files with 77 additions and 205 deletions

View File

@@ -4,21 +4,9 @@ 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};
sub tst{ sub tst{
my $c=shift; 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'}); $c->render(text=> $c->config->{radio}{'channel'});
} }
# User ======================================================================== # User ========================================================================
sub home_ { sub home_ {
my $c = shift; my $c = shift;
@@ -27,32 +15,32 @@ sub tst{
sub home { sub home {
my $c = shift; my $c = shift;
$c->stash((load_module("home/home"))[0]);
$c->stash( $c->dbv->mod) ; $c->stash( $c->dbv->mod) ;
$c->stash(layout=>'default');
} }
sub pang { sub pang {
my $c = shift; my $c = shift;
my ($v,$w)=load_module("home/pang"); my $h=$c->dbv->pang_md;
$c->stash($v); map { $c->stash( $_ => $h->{$_}) } keys %$h;
$c->stash( $c->dbv->md_to_hash(@{$w->{'md'}}) ); $c->stash(layout=>'default');
} }
sub cal { sub cal {
my $c = shift; my $c = shift;
$c->stash((load_module("home/cal"))[0]);
my $data=$c->dbv->calendar_events; my $data=$c->dbv->calendar_events;
my $block=$c->dbv->calendar_monthblock; my $block=$c->dbv->calendar_monthblock;
my %hdata; my %h;
map{ push @{ $hdata{$_->{bid}} },$_; }(@$data); map{ push @{ $h{$_->{bid}} },$_; }(@$data);
$c->stash( r=>\%hdata, b=>$block); $c->stash( r=>\%h, b=>$block);
$c->stash(layout=>'default');
} }
sub event{ sub event{
my $c = shift; my $c = shift;
$c->stash((load_module("home/event"))[0]);
$c->stash(layout=> "defaultContact");
$c->stash($c->dbv->event($c->param("id"))); $c->stash($c->dbv->event($c->param("id")));
$c->stash(layout=> "defaultContact");
} }
sub contact{ sub contact{
@@ -67,7 +55,7 @@ sub tst{
); );
$c->redirect_to('contact2'); $c->redirect_to('contact2');
}else{ }else{
$c->stash((load_module("home/contact"))[0]); $c->stash(layout=>'default');
} }
} }
@@ -75,22 +63,17 @@ sub tst{
my $c = shift; my $c = shift;
$c->redirect_to("home") unless $c->flash('mname'); $c->redirect_to("home") unless $c->flash('mname');
$c->stash( mname=>$c->flash('mname')); $c->stash( mname=>$c->flash('mname'));
$c->stash((load_module("home/contact2"))[0]); $c->stash(layout=>'default');
} }
sub store{ sub store{
my $c = shift; my $c = shift;
$c->stash((load_module("home/store"))[0]);
$c->stash( r=>$c->dbv->store); $c->stash( r=>$c->dbv->store);
$c->stash(layout=> "defaultContact"); $c->stash(layout=> "defaultContact");
} }
sub tv{ sub tv{
my $c = shift; 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( videos=>$c->dbv->tv_videos, table=>$c->dbv->tv_series);
$c->stash(layout=> "defaultContact"); $c->stash(layout=> "defaultContact");
} }

View File

@@ -12,39 +12,43 @@ use DBI;
use Dojo::Conf; use Dojo::Conf;
sub new { bless {}, shift }; sub new { bless {}, shift };
my $data_path = path('lib/Dojo/Model/Data')->make_path;
#just for fun #just for fun
# Read vdg user =============================================================== # Read vdg user ===============================================================
# mensaje del día:mod,rmod,yt,fb,sc
sub mod{ sub mod{
my $q="select nombre,contenido from casa;"; my $q="select nombre,contenido from casa;";
my %h=map{ $_->{nombre} => $_->{contenido}}@{_read($q)}; my %h=map{ $_->{nombre} => $_->{contenido}}@{_read($q)};
return %h; return %h;
} }
sub md_to_hash{ sub pang_md{
my ($self,@filelist)=@_; my $c=shift;
return {map { basename($_,".md") => load_md("public/$_")}@filelist}; my %h = map {$_=> markdown(decode_utf8($data_path->child('pang/'.$_.'.md')->slurp))}
("pang","helen","benjamin");
return \%h;
} }
sub calendar_monthblock { sub calendar_monthblock {
return _read (path("public/home/cal/q1Block.q")->slurp); return _read ($data_path->child("cal/q1Block.q")->slurp);
} }
sub calendar_events { sub calendar_events {
return _read (path("public/home/cal/q3Event.q")->slurp); return _read ($data_path->child("cal/q3Event.q")->slurp);
} }
sub event{ sub event{
my ($self,$id)=@_; my ($c,$id)=@_;
return shift @{ _read (path("public/home/event/qEvent.q")->slurp,$id)}; return shift @{ _read ($data_path->child("event/qEvent.q")->slurp,$id)};
} }
sub store{ sub store{
return _read (path("public/home/store/qStore.q")->slurp); return _read ($data_path->child("/store/qStore.q")->slurp);
} }
sub tv_videos{ sub tv_videos{
return _read (path("public/home/tv/qSeries.q")->slurp); #group,name return _read ($data_path->child("/tv/qSeries.q")->slurp); #group,name
} }
sub tv_series{ sub tv_series{
return _read (path("public/home/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 "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.";

View File

@@ -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:
<h1>$var{'mname'}</h1>
<h2>correo:</br>$var{'mail'}<h2>
<p>$var{'msg'}</p>
";
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__

View File

@@ -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() );

View File

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

View File

Before

Width:  |  Height:  |  Size: 278 KiB

After

Width:  |  Height:  |  Size: 278 KiB

View File

Before

Width:  |  Height:  |  Size: 589 KiB

After

Width:  |  Height:  |  Size: 589 KiB

View File

Before

Width:  |  Height:  |  Size: 364 KiB

After

Width:  |  Height:  |  Size: 364 KiB

View File

@@ -1,31 +0,0 @@
<section class="spacer"></section>
<section id="trs" class="trans header">
<h2 class="textHead"> Nuestro querido maestro Pang He Ming </h3>
</section>
<section class=" trans content flex">
<article id="apang" class="imageHead"></article>
<article class="text">
<!-- ##pang.txt -->
</article>
</section>
<section id="trs" class="trans header">
<h2 class="textHead"> Los maestros Zhang Qing (Helen) y  Qiu Fu Chun (Karl). </h3>
</section>
<section class=" trans content flex">
<article id="ahel" class="imageHead"></article>
<article class="text">
<!-- ##helen.txt -->
</article>
</section>
<section id="trs" class="trans header">
<h2 class="textHead"> Instructor Benjamín Munñóz </h3>
</section>
<section class=" trans content flex">
<article id="aben" class="imageHead"></article>
<article class="text">
<!-- ##benjamin.txt -->
</article>
</section>

View File

Before

Width:  |  Height:  |  Size: 343 KiB

After

Width:  |  Height:  |  Size: 343 KiB

View File

@@ -2,7 +2,7 @@ body{
background-repeat: no-repeat; background-repeat: no-repeat;
background-attachment: fixed; background-attachment: fixed;
background-size:cover; background-size:cover;
background-image:url("grulla_21.jpg"); background-image:url("bkg_grulla_21.jpg");
background-position: right top; background-position: right top;
} }
@@ -40,9 +40,9 @@ article.imageHead{
margin:20px; margin:20px;
min-height:300px min-height:300px
} }
article#apang{ background-image:url("img/maestro.png");} article#apang{ background-image:url("maestro.png");}
article#ahel{ background-image:url("img/helen.png");} article#ahel{ background-image:url("helen.png");}
article#aben{ background-image:url("img/ben.png");} article#aben{ background-image:url("ben.png");}
/* text column -------------------*/ /* text column -------------------*/
article.text{ article.text{

BIN
public/home/store/img/libro.jpg Executable file → Normal file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

After

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

View File

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

View File

@@ -1,11 +1,9 @@
% stash css=>["home/cal/cal.css/"];
<section class="title"> <p>Próximos eventos</p></section> <section class="title"> <p>Próximos eventos</p></section>
<section class="cal"> <section class="cal">
% foreach (@$b) { % foreach (@$b) {
<section class="month flex"> <section class="month flex"> <div class="spacer"></div>
<p class="month">
<div class="spacer"></div> <p class="month">
<%= $_->{text} %> <%= $_->{text} %>
</p> </p>
<div class="spacer"></div> <div class="spacer"></div>
@@ -24,11 +22,9 @@
<img class="small" src= "home/cal/img/<%= $d->{imagen_chica} %>"> <img class="small" src= "home/cal/img/<%= $d->{imagen_chica} %>">
<article class="more"> ... </article> <article class="more"> ... </article>
</article> </article>
</article>
</section> </section>
</a> </a>
%} %} }
%}
</section> </section>

View File

@@ -1,3 +1,4 @@
% stash css=>["/home/contact/contact1.css"];
<section id="msg" class="contact"> <section id="msg" class="contact">
<section class="cbanner"> <section class="cbanner">

View File

@@ -1,3 +1,4 @@
% stash css=>["/home/contact2/contact2.css"];
<section class="contact"> <section class="contact">
<section class="cbanner"> <section class="cbanner">

View File

@@ -1,3 +1,4 @@
% stash css=> ["/home/event/event.css"];
<section class="event"> <section class="event">
<section class="eimage"> <section class="eimage">
</section> </section>

View File

@@ -1,3 +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 js=>["/home/home/d3_tras.js","/home/home/fb.js"];
<section id="ihead"> <section id="ihead">
<div id="courtain"> <div id="courtain">
<div class="logo"></div> <div class="logo"></div>
@@ -36,14 +38,11 @@
<iframe id="evideo" <iframe id="evideo"
src="https://www.youtube.com/embed/<%= $yt %> " allowfullscreen> src="https://www.youtube.com/embed/<%= $yt %> " allowfullscreen>
</iframe> </iframe>
</article> </article>
<div class="group flex"> <div class="group flex">
<article class="box-2 fb"> <article class="box-2 fb">
<div class="fb-post" id="fbdiv" data-href="<%= $fb %>" <div class="fb-post" id="fbdiv" data-href="<%= $fb %>"
data-width="450" data-show-text="true"></div> data-width="450" data-show-text="true"></div>
</article> </article>
<article class="box-1 sc"> <article class="box-1 sc">
<%== $sc %> <%== $sc %>

View File

@@ -1,3 +1,5 @@
% stash css => ["home/pang/pang.css"];
% stash js => ["home/pang/d3Tras.js"];
<section class="spacer"></section> <section class="spacer"></section>
<section id="trs" class="trans header"> <section id="trs" class="trans header">

View File

@@ -1,3 +1,4 @@
% stash css=>["/home/store/shop.css"];
<section class="shop"> <section class="shop">
<article class="heading"> <p class="heading">TIENDA VIRTUAL</p> </article> <article class="heading"> <p class="heading">TIENDA VIRTUAL</p> </article>
% for (@$r){ % for (@$r){

View File

@@ -1,11 +1,9 @@
% stash css=>["/home/tv/head.css","/home/tv/trans.css","/home/tv/tv.css"];
% stash js=>["/home/tv/d3_tras.js","/home/tv/d3_tune.js"];
<section id="ihead"> <section id="ihead">
<div id="courtain"></div> <div id="courtain"></div>
<!--
<article class="mod"> <p class="mod"> #uContent </p></article>
-->
</section> </section>
<!-- trans -->
<section id="trs" class="trans flex"> <section id="trs" class="trans flex">
<article class="vdg"></article> <article class="vdg"></article>
<article id=tcurt" class="trans"> <article id=tcurt" class="trans">
@@ -14,8 +12,6 @@
<p class="superlight">+++</p> <p class="superlight">+++</p>
</article> </article>
</section> </section>
<!-- trans -->
<!-- tv -->
<section class="grid"> <section class="grid">
<section class="yt"> <section class="yt">
<iframe id="evideo" frameBorder="0" <iframe id="evideo" frameBorder="0"
@@ -26,25 +22,20 @@
<section class="col flex"> <section class="col flex">
<article class="series"><ul> <article class="series"><ul>
<!-- ##series -->
% for (@$videos){ % for (@$videos){
<li class="series" value="<%= $_->{group} %>"> <li class="series" value="<%= $_->{group} %>">
<%= $_->{name} %> <%= $_->{name} %>
</li> </li>
% } % }
<!-- c#series -->
</ul> </ul>
</article> </article>
<article class="chap"> <ul> <article class="chap"> <ul>
<!-- ##table -->
% for (@$table){ % for (@$table){
<li class="chap <%= $_->{group} %> " value="<%= $_->{link} %> "> <li class="chap <%= $_->{group} %> " value="<%= $_->{link} %> ">
<%= $_->{order} %> <%= $_->{name} %> <%= $_->{order} %> <%= $_->{name} %>
</li> </li>
% } % }
<!-- c#table -->
</ul> </article> </ul> </article>
<article class="facefeed"> <article class="facefeed">
@@ -53,4 +44,3 @@
</section> </section>
</section> </section>
<!-- tv -->

View File

@@ -10,7 +10,7 @@
<%= stylesheet "/global/nav/cssSide.css" %> <%= stylesheet "/global/nav/cssSide.css" %>
<%= stylesheet "/global/nav/cssNav.css" %> <%= stylesheet "/global/nav/cssNav.css" %>
<%= stylesheet "/global/chaos/c.css" %> <%= stylesheet "/global/chaos/c.css" %>
<%= stylesheet "/home/contact/cssContact1.css" %> <%= stylesheet "/home/contact/contact1.css" %>
<% map{%><%= stylesheet "$_"%><%}(@{stash('css')}) if defined(stash('css'));%> <% map{%><%= stylesheet "$_"%><%}(@{stash('css')}) if defined(stash('css'));%>
</head> </head>
<body> <body>