|
@@ -5,12 +5,12 @@
|
|
Scegli gli eventi che vuoi mettere nel volantino e premi genera.
|
|
Scegli gli eventi che vuoi mettere nel volantino e premi genera.
|
|
Per stampare fai "File >> Stampa" Scegli come destinazione "Salva come PDF" e seleziona il giusto formato di carta (A3).
|
|
Per stampare fai "File >> Stampa" Scegli come destinazione "Salva come PDF" e seleziona il giusto formato di carta (A3).
|
|
<br>
|
|
<br>
|
|
-L'attuale layout può contenere fino a 24 eventi.
|
|
|
|
|
|
+L'attuale layout può contenere fino a <span id="maxEvents"></span> eventi.
|
|
</div>
|
|
</div>
|
|
<br>
|
|
<br>
|
|
<form action="/flyer" target="_blank">
|
|
<form action="/flyer" target="_blank">
|
|
<label for="template">Scegli un template</label>
|
|
<label for="template">Scegli un template</label>
|
|
- <select onchange="templateSelected(this)" id="template" name="template">
|
|
|
|
|
|
+ <select onchange="templateSelected(this.value)" id="template" name="template">
|
|
{% for template in templates %}
|
|
{% for template in templates %}
|
|
<option value="{{template.name}}">{{template.name}}</option>
|
|
<option value="{{template.name}}">{{template.name}}</option>
|
|
{% endfor %}
|
|
{% endfor %}
|
|
@@ -24,14 +24,17 @@ L'attuale layout può contenere fino a 24 eventi.
|
|
</form>
|
|
</form>
|
|
<script>
|
|
<script>
|
|
const templates={{templates|tojson}}
|
|
const templates={{templates|tojson}}
|
|
- function templateSelected(el) {
|
|
|
|
- const template = templates.find((t) => t.name == el.value)
|
|
|
|
|
|
+ function templateSelected(templateName) {
|
|
|
|
+ const template = templates.find((t) => t.name == templateName)
|
|
const events = document.querySelectorAll("[name=events]")
|
|
const events = document.querySelectorAll("[name=events]")
|
|
|
|
+ document.querySelector("#maxEvents").innerHTML = template.maxEvents
|
|
var maxEvents = template.maxEvents
|
|
var maxEvents = template.maxEvents
|
|
events.forEach((e) => {
|
|
events.forEach((e) => {
|
|
e.checked = maxEvents > 0
|
|
e.checked = maxEvents > 0
|
|
maxEvents--
|
|
maxEvents--
|
|
})
|
|
})
|
|
}
|
|
}
|
|
|
|
+ document.querySelector("#template").value = "{{default_template}}"
|
|
|
|
+ templateSelected("{{default_template}}")
|
|
</script>
|
|
</script>
|
|
|
|
|