Iniziata realizzazione degli eventi ripetitivi in una pagine apparte

This commit is contained in:
gine 2017-04-08 12:52:41 +02:00
parent eb24381f2f
commit 41827adacd
4 changed files with 148 additions and 4 deletions

View file

@ -400,9 +400,11 @@
box-shadow:10px 10px 15px #888;
}
/*
.ui-navbar li:last-child .ui-btn {
color: black !important;
}
*/
.ui-footer li:last-child .ui-btn {
color: white !important;

View file

@ -49,7 +49,7 @@
<script type="text/javascript" src="js/crud.events.js"></script>
<script type="text/javascript" src="js/push.js"></script>
<script type="text/javascript" src="js/share.js"></script>
<script type="text/javascript" src="js/progetti.js"></script>
<script type="text/javascript" src="cordova.js"></script>
</head>
@ -61,6 +61,7 @@
<li><a class="nav" href="#info">Home</a></li>
<li><a class="nav" href="#ilove">I love XM24</a></li>
<li><a class="nav" href="#events">Eventi</a></li>
<li><a class="nav" href="#laboratori">Laboratori</a></li>
<li><a class="nav" href="#about">About</a></li>
<li>
<input type="text" class="cerca" value="" placeholder="Cerca" data-clear-btn="true" />
@ -135,8 +136,8 @@
<div data-role="tabs">
<div data-role="navbar">
<ul>
<li><a href="#single" data-theme="a" data-ajax="false">Iniziative</a></li>
<li><a href="#repeat" data-theme="a" data-ajax="false">Fissi</a></li>
<li><a href="#single" data-theme="a">Iniziative</a></li>
<li><a href="#repeat" data-theme="a">Fissi</a></li>
</ul>
</div>
<div id="single" >
@ -154,6 +155,38 @@
</div>
</div><!--chiude content -->
<div data-role="page" id="laboratori" data-prev="index" data-next="" data-dom-cache="true" data-theme="a" class="ui-page">
<div role="main" class="ui-content">
<div class="ui-body">
<p class="introlettera">Laboratori</p>
<div data-role="tabs">
<div data-role="navbar">
<ul>
<li><a href="#today" data-theme="a" class="ui-btn-active">Oggi</a></li>
<li><a href="#mydate" data-theme="a">Data</a></li>
<li><a href="#project" data-theme="a">Progetti</a></li>
</ul>
</div>
<div id="today">
<p class="listatovirgole listevoci">
<i>Non sono stati attualmente caricati laboratori.</i>
</p>
</div>
<div id="mydate">
<p class="listatovirgole listevoci">
<i>Non sono stati attualmente caricati laboratori.</i>
</p>
</div>
<div id="project">
<p class="listatovirgole listevoci">
<i>Non sono stati attualmente caricati laboratori.</i>
</p>
</div>
</div>
</div>
</div>
</div><!--chiude content -->
<div data-role="page" id="about" data-prev="index" data-next="" data-dom-cache="true" data-theme="a" class="ui-page">
<div role="main" class="ui-content">
<div class="ui-body">

View file

@ -92,6 +92,11 @@ function alterContent(url) {
$("#navfooter").addClass("hide");
EVENTS.render();
break;
case '#laboratori':
$("#navheader").removeClass("hide");
$("#navfooter").addClass("hide");
PROJECT.render();
break;
case '#aggiorna':
$("#navheader").removeClass("hide");
$("#navfooter").removeClass("hide");
@ -161,7 +166,7 @@ $(document).on("mobileinit", function () {
$(document).on("pagecontainerchange", function () {
var current = $(".ui-page-active").prop("id");     // Remove active class from nav buttons
if(current == 'about' || current == 'info' || current == 'ilove' || current == 'events' || current == 'cerca'){
if(current == 'about' || current == 'info' || current == 'ilove' || current == 'events' || current == 'cerca' || current == 'laboratori'){
$("#navfooter").addClass("hide");
} else {
$("#navfooter").removeClass("hide");

104
www/js/progetti.js Normal file
View file

@ -0,0 +1,104 @@
var PROJECT = PROJECT || {};
PROJECT.labs = [
{
title: "Ciclofficina",
dshort: "Officina per le biciclette. Nessuno ti ripara le bici, impari a farlo insieme a chi ha già questa competenza.",
dlong: "",
when : [
{day: "Mer", hour: ["18:00", "22:00"]},
{day: "Dom", hour: ["18:00", "22:00"]}
],
old_event: "",
site: "http://ampioraggio.noblogs.org/",
sn: "",
},
{
title: "Scuola Italiano con Migranti",
dshort: '“Nessuno educa nessuno, nessuno educa se stesso, gli uomini si educano insieme, con la mediazione del mondo.” Paulo Freire,',
dlong: "La Scuola dItaliano CON migranti del XM24 è una scuola autogestita che unisce al percorso linguistico un percorso politico, sia perchè si oppone alle leggi razziste dello stato, sia perchè concepisce l apprendimento dellitaliano da parte dei migranti come uno strumento di emancipazione, autodefinizione e socializzazione.",
when : [
{day: "Lun", hour: ["19:00", "21:00"]},
{day: "Mar", hour: ["19:00", "21:00"]},
{day: "Mer", hour: ["19:00", "21:00"]}
],
old_event: "",
site: "http://simxm24.noblogs.org/",
sn: [],
},
];
PROJECT.getHtmlA = function(label, url, _class) {
if(!url)
return "";
_class = _class || "";
return "<span class='"+_class+"'>" + label + "</span>"+
"<a class='"+_class+"' href='" + url + "' rel='external'>" +
url +
"</a>";
};
PROJECT.getHtmlDate = function(evt) {
return "<ol>"+
"<span class='e_day'>" + evt.day + "</span>" +
"<span class='e_from'>" + evt.hour[0] + "</span>" + " - " +
"<span class='e_to'>" + evt.hour[1] + "</span>" +
"</ol>";
};
PROJECT.labOrder = function(lab){
var events = "<ul>";
for(var e = 0; e < lab.when.length; e++) {
events += PROJECT.getHtmlDate(lab.when[e]);
}
events += "</ul>";
var li = "<li>"+
"<span class='title'>" + lab.title + "</span>"+
"<span class='dshort'>" + lab.dshort + "</span>"+
PROJECT.getHtmlA("Sito:", lab.site)+
PROJECT.getHtmlA("Social Network", lab.sn)+
events+
//"<small>" + cleanTime + "</small>"+
"<hr class='post-divider'>"+
"</li>";
return li;
};
PROJECT.dateOrder = function(lab){
};
PROJECT.todayOrder = function(lab){
};
var init = true;
PROJECT.render = function() {
var a = moment().format("MMM");
//if(ini)
var lab = "", date = "", today = "";
for(var l = 0, labLen = PROJECT.labs.length; l < labLen; l++) {
//today += PROJECT.todayOrder(PROJECT.labs[l]);
lab += PROJECT.labOrder(PROJECT.labs[l]);
//date += PROJECT.dateOrder(PROJECT.labs[l]);
}
// $('#today p').empty();
// $('#today p').html("<ul>" + lab + "</ul>");
//
// $('#mydate p').empty();
// $('#mydate p').html("<ul>" + lab + "</ul>");
$('#project p').empty();
$('#project p').html("<ul>" + lab + "</ul>");
init = false;
};