Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
nkoexe committed Sep 2, 2024
2 parents 731c95c + 92c9f2d commit 76a10b0
Show file tree
Hide file tree
Showing 7 changed files with 54 additions and 128 deletions.
1 change: 1 addition & 0 deletions sostituzioni/view/legal/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ def privacy():
)


@app.route("/license")
@app.route("/licenze")
def licenze():
return render_template("licenze.html")
47 changes: 14 additions & 33 deletions sostituzioni/view/static/scripts/updater.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,13 @@ let has_rebooted = false


function ui_loading(title, description) {
let button = document.querySelector('#button')
button.classList.remove('active')
button.onclick = () => { }
button.onkeydown = () => { }
document.querySelector('#button-text').innerHTML = ''
document.querySelector('#title').innerHTML = title
document.querySelector('#description').innerHTML = description
document.querySelector('#button').classList.remove('active')
document.querySelector('#button').onclick = () => { }
document.querySelector('#button-text-container').style.opacity = '0'
setTimeout(() => {
document.querySelector('#loading-container').style.opacity = '1'
Expand All @@ -21,13 +24,19 @@ function ui_prompt(title, description, button_text, button_callback, href) {
document.querySelector('#loading-container').style.opacity = '0'
document.querySelector('#button-text').innerHTML = button_text
setTimeout(() => {
document.querySelector('#button').classList.add('active')
let button = document.querySelector('#button')
button.classList.add('active')
document.querySelector('#button-text-container').style.opacity = '1'
if (button_callback) {
document.querySelector('#button').onclick = button_callback
button.onclick = button_callback
button.onkeydown = (e) => {
if (e.key === 'Enter') {
button_callback()
}
}
}
if (href) {
document.querySelector('#success-link').href = href
button.href = href
}
}, 500)
}
Expand Down Expand Up @@ -93,31 +102,3 @@ if (should_reboot) {
ui_loading("Controllo aggiornamenti...", "")
socket.emit("check update")
}


// function checkserver() {
// fetch('/version')
// .then((response) => {
// if (response.ok) {
// return response.text()
// }
// })
// .then((new_version) => {
// if (version != new_version) {
// document.querySelector('#success-link').href = '/'
// document.querySelector('#title').innerHTML = '{{operazione}} completato.'
// document.querySelector('#loading-container').style.opacity = '0'
// setTimeout(() => {
// document.querySelector('#button').classList.add('active')
// document.querySelector('#button-text-container').style.opacity = '1'
// }, 500)

// } else {
// setTimeout(checkserver, 1000)
// }
// })
// .catch(() => {
// setTimeout(checkserver, 1000)
// })
// }
// checkserver()
14 changes: 11 additions & 3 deletions sostituzioni/view/static/style/updater.css
Original file line number Diff line number Diff line change
Expand Up @@ -98,13 +98,13 @@ a {
max-width: 100%;
border-radius: 70px;
background-color: #c00f19;
transition: all 0.3s, box-shadow 0.8s;
transition: all 0.3s, box-shadow .5s ease-out;
user-select: none;
}

#button.active {
width: 500px;
box-shadow: 0 5px 15px #00000080, 0 15px 30px #00000055;
width: min(500px, 100%);
box-shadow: 0 5px 10px #00000080, 0 15px 30px #00000055;
cursor: pointer;
}

Expand Down Expand Up @@ -145,6 +145,14 @@ a {
}
}

@media (max-width: 350px) {
#button-text-container-inner {
width: 100%;
flex-direction: column;
text-align: center;
}
}

#button-text {}

#button-icon {
Expand Down
59 changes: 0 additions & 59 deletions sostituzioni/view/templates/crediti.html

This file was deleted.

33 changes: 15 additions & 18 deletions sostituzioni/view/templates/licenze.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,33 +16,34 @@
<div id="main-container">
<h1>Licenze Software</h1>
<hr>
<p>Licenza sul progetto: &copy; <a href="https://linkedin.com/in/chiara-gandolfi-30266a13/">Chiara Gandolfi</a> e <a href="https://njco.dev">Niccolò Ragazzi</a></p>
<p>Licenza sul codice sorgente: &copy; <a href="https://njco.dev">Niccolò Ragazzi</a></p>
<p>Licenza sui dati contenuti: &copy; <a href="https://www.iiss-gandhi-merano.it/">I.I.S.S. "Gandhi" - Merano</a></p>
<p>Licenza sul progetto: &copy; <a href="https://linkedin.com/in/chiara-gandolfi-30266a13/" target="_blank">Chiara Gandolfi</a> e <a href="https://njco.dev" target="_blank">Niccolò Ragazzi</a></p>
<p>Licenza sul codice sorgente: &copy; <a href="https://njco.dev" target="_blank">Niccolò Ragazzi</a></p>
<p>Licenza sui dati contenuti: &copy; <a href="https://www.iiss-gandhi-merano.it/" target="_blank">I.I.S.S. "Gandhi" - Merano</a></p>
<br>
<br>
<br>
<h2>Crediti del sistema</h2>
<hr>
<p>Sistema progettato da <a href="https://linkedin.com/in/chiara-gandolfi-30266a13/">Chiara Gandolfi</a> e <a href="https://njco.dev">Niccolò Ragazzi</a>, su richiesta dell'<a href="https://www.iiss-gandhi-merano.it/">I.I.S.S "Gandhi" - Merano</a> (referente: il docente vicario prof. Tadeusz Sierotowicz).</p>
<p>Implementazione a cura di <a href="https://njco.dev">Niccolò Ragazzi</a>.</p>
<p>Il codice sorgente del sistema è reperibile alla <a href="https://github.com/nkoexe/sostituzioni">pagina Github dedicata</a>. Questa pagina rimarrà temporaneamente privata nei momenti finali della fase di sviluppo per l'ottimale messa in sicurezza.</p>
<p>Sistema progettato da <a href="https://linkedin.com/in/chiara-gandolfi-30266a13/" target="_blank">Chiara Gandolfi</a> e <a href="https://njco.dev" target="_blank">Niccolò Ragazzi</a>, su richiesta dell'<a href="https://www.iiss-gandhi-merano.it/" target="_blank">I.I.S.S "Gandhi" - Merano</a> (referente: il docente vicario prof. Tadeusz Sierotowicz).</p>
<p>Implementazione a cura di <a href="https://njco.dev" target="_blank">Niccolò Ragazzi</a>.</p>
<p>Il codice sorgente del sistema è reperibile alla <a href="https://github.com/nkoexe/sostituzioni" target="_blank">pagina Github dedicata</a>.</p>
<br>
<br>
<br>
<h2>Tecnologie utilizzate:</h2>
<ul>
<li><span class="material-symbols-rounded icon">folder_data</span><a href="http://python.org">Python</a></li>
<li><span class="material-symbols-rounded icon">dns</span><a href="https://github.com/pallets/flask">Flask</a><a href="https://www.sqlite.org/index.html">SQLite</a><a href="https://gunicorn.org/">Gunicorn</a><a href="https://nginx.org/">Nginx</a></li>
<li><span class="material-symbols-rounded icon">folder_data</span><a href="http://python.org" target="_blank">Python</a></li>
<li><span class="material-symbols-rounded icon">dns</span><a href="https://flask.palletsprojects.com/" target="_blank">Flask</a>, <a href="https://www.sqlite.org/index.html" target="_blank">SQLite</a>, <a href="https://gunicorn.org/" target="_blank">Gunicorn</a>, <a href="https://nginx.org/" target="_blank">Nginx</a></li>
<li><span class="material-symbols-rounded icon">code</span><span>HTML, CSS, JS</span></li>
</ul>
<h2>Software open source utilizzati:</h2>
<ul>
<li><span class="material-symbols-rounded icon">hub</span><a href="https://socket.io/">Socket.IO</a></li>
<li><span class="material-symbols-rounded icon">notifications_active</span><a href="https://github.com/caroso1222/notyf">Notyf</a></li>
<li><span class="material-symbols-rounded icon">data_array</span><a href="https://github.com/Glench/fuzzyset.js">FuzzySet</a></li>
<li><span class="material-symbols-rounded icon">emoticon</span><a href="https://fonts.google.com/icons">Material Icons</a></li>
<li><span class="material-symbols-rounded icon">close_fullscreen</span><a href="https://github.com/kangax/html-minifier">html-minifier</a><a href="https://github.com/css/csso">csso</a><a href="https://github.com/mishoo/UglifyJS">uglify-js</a></li>
<li><span class="material-symbols-rounded icon">hub</span><a href="https://socket.io/" target="_blank">Socket.IO</a></li>
<li><span class="material-symbols-rounded icon">notifications_active</span><a href="https://carlosroso.com/notyf/" target="_blank">Notyf</a></li>
<li><span class="material-symbols-rounded icon">data_array</span><a href="https://glench.github.io/fuzzyset.js/" target="_blank">Fuzzyset.js</a></li>
<li><span class="material-symbols-rounded icon">emoticon</span><a href="https://fonts.google.com/icons" target="_blank">Material Design Icons</a></li>
<li><span class="material-symbols-rounded icon">menu_book</span><a href="https://docsify.js.org/" target="_blank">Docsify</a></li>
<!-- <li><span class="material-symbols-rounded icon">close_fullscreen</span><a href="https://github.com/kangax/html-minifier">html-minifier</a><a href="https://github.com/css/csso">csso</a><a href="https://github.com/mishoo/UglifyJS">uglify-js</a></li> -->
</ul>
</div>
<style>
Expand Down Expand Up @@ -87,11 +88,7 @@ <h2>Software open source utilizzati:</h2>
li {
display: flex;
align-items: center;
}

li a:not(:last-of-type)::after {
content: ", ";
padding-right: 0.4em;
white-space: pre;
}

.icon {
Expand Down
2 changes: 1 addition & 1 deletion sostituzioni/view/templates/privacy.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ <h1>Informativa Privacy e Cookie</h1>
<tbody>
<tr>
<td>session</td>
<td>Contiene l'identificativo della sessione generato casualmente per permettere l'accesso al sistema, bloccando richieste non autorizzate.{% if logintimeout > 0 %} Viene elimnato dopo {{ logintimeout }} minuti.{% endif %}</td>
<td>Contiene l'identificativo della sessione generato casualmente per permettere l'accesso al sistema, bloccando richieste non autorizzate.{% if logintimeout > 0 %} Viene eliminato dopo {{ logintimeout }} minuti.{% endif %}</td>
</tr>
</tbody>
</table>
Expand Down
26 changes: 12 additions & 14 deletions sostituzioni/view/templates/updater.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,27 +23,25 @@ <h1 id="title"></h1>
<p id="description"></p>
</div>
<div id="button-container">
<a id="success-link">
<div id="button">
<div id="button-text-container">
<div id="button-text-container-inner">
<span id="button-text"></span><span id="button-icon" class="material-symbols-rounded icon">arrow_forward</span>
</div>
</div>
<div id="loading-container">
<div id="loading"></div>
<a id="button" tabindex="0">
<div id="button-text-container">
<div id="button-text-container-inner">
<span id="button-text"></span><span id="button-icon" class="material-symbols-rounded icon">arrow_forward</span>
</div>
</div>
<div id="loading-container">
<div id="loading"></div>
</div>
</a>
</div>
</div>
<script>
const version = "{{version}}"
const should_reboot = {{ reboot | tojson }}
document.title = "{{'Reboot' if reboot else 'Update'}}"
const version = "{{version}}";
const should_reboot = {{ reboot | tojson }};
document.title = "{{'Reboot' if reboot else 'Update'}}";
</script>
<script src="{{ url_for('static', filename='scripts/lib/socket.io.min.js') }}"></script>
<script src="{{ url_for('static', filename='scripts/updater.js') }}"></script>
<script src="{{ url_for('static', filename='scripts/lib/socket.io.min.js') }}" defer></script>
<script src="{{ url_for('static', filename='scripts/updater.js') }}" defer></script>
</body>

</html>

0 comments on commit 76a10b0

Please sign in to comment.