Añadido Aulas (En desarrollo)
This commit is contained in:
99
assets/static/appico/Classroom.svg
Normal file
99
assets/static/appico/Classroom.svg
Normal file
@@ -0,0 +1,99 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->
|
||||
<svg fill="#000000" height="800px" width="800px" version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
viewBox="0 0 512.001 512.001" xml:space="preserve">
|
||||
<g>
|
||||
<g>
|
||||
<path d="M467.309,16.768H221.454c-6.128,0-11.095,4.967-11.095,11.095v86.451l12.305-7.64c3.131-1.945,6.475-3.257,9.884-3.978
|
||||
V38.958h223.665v160.016H232.549v-25.89l-22.19,13.778v23.208c0,6.128,4.967,11.095,11.095,11.095h245.855
|
||||
c6.127,0,11.095-4.967,11.095-11.095V27.863C478.404,21.735,473.436,16.768,467.309,16.768z"/>
|
||||
</g>
|
||||
</g>
|
||||
<g>
|
||||
<g>
|
||||
<path d="M306.001,78.356c-2.919-3.702-8.285-4.335-11.986-1.418l-38.217,30.133c3.649,2.385,6.85,5.58,9.301,9.527
|
||||
c0.695,1.117,1.298,2.266,1.834,3.431l37.651-29.687C308.286,87.424,308.92,82.057,306.001,78.356z"/>
|
||||
</g>
|
||||
</g>
|
||||
<g>
|
||||
<g>
|
||||
<circle cx="121.535" cy="31.935" r="31.935"/>
|
||||
</g>
|
||||
</g>
|
||||
<g>
|
||||
<g>
|
||||
<path d="M252.01,124.728c-4.489-7.229-13.987-9.451-21.218-4.963l-31.206,19.375c-0.13-25.879-0.061-12.145-0.144-28.811
|
||||
c-0.101-20.005-16.458-36.281-36.464-36.281h-15.159c-12.951,33.588-8.779,21.12-19.772,49.63l4.623-20.131
|
||||
c0.32-1.508,0.088-3.08-0.655-4.43l-6.264-11.393l5.559-10.109c0.829-1.508-0.264-3.356-1.985-3.356h-15.271
|
||||
c-1.72,0-2.815,1.848-1.985,3.356l5.57,10.13l-6.276,11.414c-0.728,1.325-0.966,2.865-0.672,4.347l4.005,20.172
|
||||
c-2.159-5.599-17.084-44.306-19.137-49.63H80.093c-20.005,0-36.363,16.275-36.464,36.281l-0.569,113.2
|
||||
c-0.042,8.51,6.821,15.443,15.331,15.486c0.027,0,0.052,0,0.079,0c8.473,0,15.364-6.848,15.406-15.331l0.569-113.2
|
||||
c0-0.018,0-0.036,0-0.053c0.024-1.68,1.399-3.026,3.079-3.013c1.68,0.012,3.034,1.378,3.034,3.058l0.007,160.381
|
||||
c14.106-0.6,27.176,4.488,36.981,13.423v-62.568h7.983v71.773c5.623,8.268,8.914,18.243,8.914,28.974
|
||||
c0,9.777-2.732,18.928-7.469,26.731c4.866,0.023,9.592,0.669,14.099,1.861c6.076-5.271,13.385-9.151,21.437-11.136
|
||||
c0-279.342-0.335-106.627-0.335-229.418c0-1.779,1.439-3.221,3.218-3.224c1.779-0.004,3.224,1.432,3.232,3.211
|
||||
c0.054,10.807,0.224,44.59,0.283,56.351c0.028,5.579,3.07,10.708,7.953,13.407c4.874,2.694,10.835,2.554,15.583-0.394
|
||||
l54.604-33.903C254.276,141.458,256.499,131.957,252.01,124.728z"/>
|
||||
</g>
|
||||
</g>
|
||||
<g>
|
||||
<g>
|
||||
<circle cx="429.221" cy="322.831" r="33.803"/>
|
||||
</g>
|
||||
</g>
|
||||
<g>
|
||||
<g>
|
||||
<path d="M511.459,405.811c-0.107-21.176-17.421-38.404-38.598-38.404c-9.137,0-76.583,0-84.781,0
|
||||
c3.637,7.068,5.704,15.069,5.704,23.55c0,9.005-2.405,18.413-7.5,26.782c18.904,0.764,35.468,10.91,45.149,25.897h40.579v-37.43
|
||||
c0-1.842,1.46-3.352,3.301-3.415s3.402,1.345,3.526,3.182c0,0,0,0.001,0,0.002l0.19,37.661h32.621L511.459,405.811z"/>
|
||||
</g>
|
||||
</g>
|
||||
<g>
|
||||
<g>
|
||||
<path d="M290.469,390.956c0-8.629,2.138-16.763,5.894-23.92c-22.009,0-47.852,0-75.267,0c3.472,6.939,5.437,14.756,5.437,23.029
|
||||
c0,9.721-2.73,18.926-7.469,26.731c15.558,0.074,29.912,6.538,40.283,17.267c10.054-9.822,23.759-15.914,38.836-15.995
|
||||
C292.948,409.616,290.469,400.126,290.469,390.956z"/>
|
||||
</g>
|
||||
</g>
|
||||
<g>
|
||||
<g>
|
||||
<path d="M264.819,288.655c-18.668,0-33.804,15.132-33.804,33.803c0,18.628,15.107,33.803,33.804,33.803
|
||||
c18.518,0,33.803-14.965,33.803-33.803C298.622,303.808,283.517,288.655,264.819,288.655z"/>
|
||||
</g>
|
||||
</g>
|
||||
<g>
|
||||
<g>
|
||||
<path d="M123.217,390.065c0-8.252,1.956-16.053,5.411-22.98c-1.457-0.072,4.672-0.049-89.485-0.049
|
||||
c-21.068,0-38.491,17.138-38.598,38.404l-0.192,38.196c14.907,0,17.906,0,32.621,0l0.191-38.031
|
||||
c0.01-1.884,1.541-3.402,3.423-3.397c1.882,0.006,3.404,1.532,3.404,3.414v38.014h45.727c9.855-15.754,26.8-25.646,45.243-26.406
|
||||
C125.956,409.168,123.217,399.865,123.217,390.065z"/>
|
||||
</g>
|
||||
</g>
|
||||
<g>
|
||||
<g>
|
||||
<path d="M82.786,288.655c-18.668,0-33.803,15.134-33.803,33.803c0,18.584,15.046,33.803,33.803,33.803
|
||||
c18.536,0,33.804-15.015,33.804-33.803C116.59,303.788,101.455,288.655,82.786,288.655z"/>
|
||||
</g>
|
||||
</g>
|
||||
<g>
|
||||
<g>
|
||||
<path d="M422.533,473.807c-0.105-21.178-17.42-38.406-38.597-38.406c-2.246,0-82.969,0-85.507,0
|
||||
c-21.176,0-39.601,17.227-39.708,38.404l-0.275-0.891c-0.105-21.092-17.341-38.404-38.597-38.404c-24.544,0-59.795,0-85.507,0
|
||||
c-21.176,0-39.601,17.227-39.708,38.404L94.442,512h32.621l0.191-38.922c0.008-1.622,1.327-2.93,2.948-2.926
|
||||
c1.621,0.004,2.932,1.32,2.932,2.941v38.908c19.121,0,68.483,0,86.392,0v-38.908c0-1.736,1.405-3.144,3.141-3.149
|
||||
c1.735-0.004,3.149,1.397,3.158,3.133l0.191,38.923c6.669,0,58.238,0,65.134,0l0.191-38.031c0,0,0-0.001,0-0.002
|
||||
c0.009-1.621,1.328-2.928,2.949-2.924c1.621,0.004,2.931,1.32,2.931,2.941v38.016c19.121,0,68.483,0,86.392,0v-38.016
|
||||
c0-1.736,1.405-3.144,3.141-3.149c1.735-0.004,3.149,1.397,3.158,3.133l0.191,38.031h32.621L422.533,473.807z"/>
|
||||
</g>
|
||||
</g>
|
||||
<g>
|
||||
<g>
|
||||
<circle cx="175.934" cy="389.933" r="34.198"/>
|
||||
</g>
|
||||
</g>
|
||||
<g>
|
||||
<g>
|
||||
<circle cx="342.07" cy="390.821" r="34.198"/>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 4.8 KiB |
@@ -1083,9 +1083,11 @@ var Booted = false;
|
||||
var TimeoutBoot = 4;
|
||||
var BootLoops = 0;
|
||||
getPeers();
|
||||
|
||||
setInterval(() => {
|
||||
getPeers();
|
||||
}, 750);
|
||||
|
||||
setInterval(() => {
|
||||
BootLoops =+ 1;
|
||||
if ((BootLoops >= TimeoutBoot || window.navigator.onLine == false) && !Booted) {
|
||||
Booted = true;
|
||||
|
||||
@@ -23,9 +23,9 @@ const RELAYS = [
|
||||
"https://gun-es05.tech.eus/gun",
|
||||
"https://gun-es06.tech.eus/gun",
|
||||
// "https://gun-es07.tech.eus/gun", // No he podido instalar el nodo.
|
||||
"https://gun-manhattan.herokuapp.com/gun",
|
||||
"https://peer.wallie.io/gun",
|
||||
"https://gun.defucc.me/gun",
|
||||
// "https://gun-manhattan.herokuapp.com/gun",
|
||||
// "https://peer.wallie.io/gun",
|
||||
// "https://gun.defucc.me/gun",
|
||||
];
|
||||
var SECRET = "";
|
||||
var SUB_LOGGED_IN = false;
|
||||
|
||||
@@ -118,6 +118,7 @@
|
||||
<script src="page/login.js"></script>
|
||||
<script src="page/index.js"></script>
|
||||
<script src="page/dataman.js"></script>
|
||||
<script src="page/aulas.js"></script>
|
||||
<script src="page/materiales.js"></script>
|
||||
<script src="page/resumen_diario.js"></script>
|
||||
<script src="page/personas.js"></script>
|
||||
|
||||
142
src/page/aulas.js
Normal file
142
src/page/aulas.js
Normal file
@@ -0,0 +1,142 @@
|
||||
PERMS["aulas"] = "Aulas";
|
||||
PERMS["aulas:edit"] = "> Editar";
|
||||
PAGES.aulas = {
|
||||
//navcss: "btn1",
|
||||
Title: "Aulas",
|
||||
// Make a clone of notas.js and modify it to be aulas.js
|
||||
icon: "static/appico/Classroom.svg",
|
||||
AccessControl: true,
|
||||
edit: function (mid) {
|
||||
if (!checkRole("aulas:edit")) {
|
||||
setUrlHash("aulas");
|
||||
return;
|
||||
}
|
||||
var nameh1 = safeuuid();
|
||||
var field_nombre = safeuuid();
|
||||
var btn_guardar = safeuuid();
|
||||
var btn_borrar = safeuuid();
|
||||
var data_Comedor = safeuuid();
|
||||
container.innerHTML = `
|
||||
<h1>Aula <code id="${nameh1}"></code></h1>
|
||||
<div>
|
||||
<fieldset style="float: left;">
|
||||
<legend>Datos</legend>
|
||||
<label for="${field_nombre}">Nombre:</label>
|
||||
<input type="text" id="${field_nombre}" />
|
||||
<br><br>
|
||||
<button class="btn5" id="${btn_guardar}">Guardar</button>
|
||||
<button class="rojo" id="${btn_borrar}">Borrar</button>
|
||||
</fieldset>
|
||||
<fieldset style="float: left;">
|
||||
<legend>Notas</legend>
|
||||
<a class="button btn5" style="font-size: 25px;" href="#notas,inicio_dia">Iniciar el dia</a>
|
||||
<a class="button" style="font-size: 25px;" href="#notas,horario">Horario</a>
|
||||
<a class="button" style="font-size: 25px;" href="#notas,realizacion_cafe">Realización del café</a>
|
||||
<a class="button" style="font-size: 25px;" href="#notas,fin_dia">Acabar el dia</a>
|
||||
<a class="button rojo" style="font-size: 25px;" href="#notas,alertas">Alertas para hoy</a>
|
||||
</fieldset>
|
||||
<fieldset style="float: left;">
|
||||
<legend>Datos de hoy</legend>
|
||||
|
||||
<span class="btn7" style="display: inline-block; margin: 5px; padding: 5px; border-radius: 5px; border: 2px solid black;"><b>Comedor</b>: <span id="${data_Comedor}">Cargando...</span></span>
|
||||
</fieldset>
|
||||
</div>
|
||||
`;
|
||||
gun
|
||||
.get(TABLE)
|
||||
.get("aulas")
|
||||
.get(mid)
|
||||
.once((data, key) => {
|
||||
function load_data(data, ENC = "") {
|
||||
document.getElementById(nameh1).innerText = key;
|
||||
document.getElementById(field_nombre).value = data["Nombre"] || "";
|
||||
}
|
||||
if (typeof data == "string") {
|
||||
SEA.decrypt(data, SECRET, (data) => {
|
||||
load_data(data, "%E");
|
||||
});
|
||||
} else {
|
||||
load_data(data);
|
||||
}
|
||||
});
|
||||
document.getElementById(btn_guardar).onclick = () => {
|
||||
var data = {
|
||||
Nombre: document.getElementById(field_nombre).value,
|
||||
};
|
||||
var enc = SEA.encrypt(data, SECRET, (encrypted) => {
|
||||
document.getElementById("actionStatus").style.display = "block";
|
||||
betterGunPut(gun.get(TABLE).get("aulas").get(mid), encrypted);
|
||||
toastr.success("Guardado!");
|
||||
setTimeout(() => {
|
||||
document.getElementById("actionStatus").style.display = "none";
|
||||
setUrlHash("aulas");
|
||||
}, 1500);
|
||||
});
|
||||
};
|
||||
document.getElementById(btn_borrar).onclick = () => {
|
||||
if (confirm("¿Quieres borrar este aula?") == true) {
|
||||
betterGunPut(gun.get(TABLE).get("aulas").get(mid), null);
|
||||
toastr.error("Borrado!");
|
||||
setTimeout(() => {
|
||||
setUrlHash("aulas");
|
||||
}, 1500);
|
||||
}
|
||||
};
|
||||
|
||||
//#region Cargar Comedor
|
||||
gun
|
||||
.get(TABLE)
|
||||
.get("comedor")
|
||||
.get(CurrentISODate())
|
||||
.once((data, key) => {
|
||||
function add_row(data) {
|
||||
// Fix newlines
|
||||
data.Platos = data.Platos || "No hay platos registrados para hoy.";
|
||||
// Display platos
|
||||
document.getElementById(data_Comedor).innerHTML =
|
||||
data.Platos.replace(/\n/g, "<br>");
|
||||
}
|
||||
if (typeof data == "string") {
|
||||
SEA.decrypt(data, SECRET, (data) => {
|
||||
add_row(data || {});
|
||||
});
|
||||
} else {
|
||||
add_row(data || {});
|
||||
}
|
||||
});
|
||||
//#endregion Cargar Comedor
|
||||
},
|
||||
index: function () {
|
||||
if (!checkRole("aulas")) {
|
||||
setUrlHash("index");
|
||||
return;
|
||||
}
|
||||
const tablebody = safeuuid();
|
||||
var btn_new = safeuuid();
|
||||
container.innerHTML = `
|
||||
<h1>Aulas - en desarrollo</h1>
|
||||
<button id="${btn_new}">Nuevo aula</button>
|
||||
<div id="cont"></div>
|
||||
`;
|
||||
TS_IndexElement(
|
||||
"aulas",
|
||||
[
|
||||
{
|
||||
key: "Nombre",
|
||||
type: "raw",
|
||||
default: "",
|
||||
label: "Nombre",
|
||||
},
|
||||
],
|
||||
gun.get(TABLE).get("aulas"),
|
||||
document.querySelector("#cont")
|
||||
);
|
||||
if (!checkRole("aulas:edit")) {
|
||||
document.getElementById(btn_new).style.display = "none";
|
||||
} else {
|
||||
document.getElementById(btn_new).onclick = () => {
|
||||
setUrlHash("aulas," + safeuuid(""));
|
||||
};
|
||||
}
|
||||
},
|
||||
};
|
||||
@@ -15,24 +15,26 @@ PAGES.notas = {
|
||||
var btn_borrar = safeuuid();
|
||||
var div_actions = safeuuid();
|
||||
container.innerHTML = `
|
||||
<h1>Nota <code id="${nameh1}"></code></h1>
|
||||
<fieldset style="float: left;">
|
||||
<legend>Valores</legend>
|
||||
<label>
|
||||
Asunto<br>
|
||||
<input type="text" id="${field_asunto}" value=""><br><br>
|
||||
</label>
|
||||
<input type="hidden" id="${field_autor}">
|
||||
<div id="${div_actions}"></div>
|
||||
<label>
|
||||
Contenido<br>
|
||||
<textarea id="${field_contenido}"></textarea><br><br>
|
||||
</label>
|
||||
<hr>
|
||||
<button class="btn5" id="${btn_guardar}">Guardar</button>
|
||||
<button class="rojo" id="${btn_borrar}">Borrar</button>
|
||||
</fieldset>
|
||||
`;
|
||||
<h1>Nota <code id="${nameh1}"></code></h1>
|
||||
<fieldset style="float: none; width: calc(100% - 40px);max-width: none;">
|
||||
<legend>Valores</legend>
|
||||
<div style="max-width: 400px;">
|
||||
<label>
|
||||
Asunto<br>
|
||||
<input type="text" id="${field_asunto}" value=""><br><br>
|
||||
</label>
|
||||
<input type="hidden" id="${field_autor}" value="${SUB_LOGGED_IN_ID || ""}">
|
||||
<div id="${div_actions}"></div>
|
||||
</div>
|
||||
<label>
|
||||
Contenido<br>
|
||||
<textarea id="${field_contenido}" style="width: 100%; height: 400px;"></textarea><br><br>
|
||||
</label>
|
||||
<hr>
|
||||
<button class="btn5" id="${btn_guardar}">Guardar</button>
|
||||
<button class="rojo" id="${btn_borrar}">Borrar</button>
|
||||
</fieldset>
|
||||
`;
|
||||
var divact = document.getElementById(div_actions);
|
||||
addCategory_Personas(
|
||||
divact,
|
||||
|
||||
Reference in New Issue
Block a user