viikonpäivä valinta
This commit is contained in:
+16
-2
@@ -46,6 +46,18 @@
|
||||
<div class="col-md-6"><input type="text" id="haku-sana" class="form-control form-control-sm" placeholder="Haku" required></div>
|
||||
<input type="hidden" id="haku-regex" value=".*">
|
||||
<div class="col-md-5"><input type="text" id="haku-kansio" class="form-control form-control-sm" placeholder="Kansio" required></div>
|
||||
<div class="col-md-12">
|
||||
<label class="small text-muted">Aktiiviset päivät:</label><br>
|
||||
<div class="btn-group btn-group-sm" role="group">
|
||||
<input type="checkbox" class="btn-check" id="pv-0" checked><label class="btn btn-outline-secondary" for="pv-0">Ma</label>
|
||||
<input type="checkbox" class="btn-check" id="pv-1" checked><label class="btn btn-outline-secondary" for="pv-1">Ti</label>
|
||||
<input type="checkbox" class="btn-check" id="pv-2" checked><label class="btn btn-outline-secondary" for="pv-2">Ke</label>
|
||||
<input type="checkbox" class="btn-check" id="pv-3" checked><label class="btn btn-outline-secondary" for="pv-3">To</label>
|
||||
<input type="checkbox" class="btn-check" id="pv-4" checked><label class="btn btn-outline-secondary" for="pv-4">Pe</label>
|
||||
<input type="checkbox" class="btn-check" id="pv-5" checked><label class="btn btn-outline-secondary" for="pv-5">La</label>
|
||||
<input type="checkbox" class="btn-check" id="pv-6" checked><label class="btn btn-outline-secondary" for="pv-6">Su</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-1"><button type="submit" class="btn btn-success btn-sm w-100">Lisää</button></div>
|
||||
</form>
|
||||
</div>
|
||||
@@ -156,14 +168,16 @@
|
||||
function poistaKohde(i) { fetch(`/poista_kohde/${i}`, {method:'DELETE'}).then(() => paivitaNakyma()); }
|
||||
|
||||
document.getElementById('lisaa-form').addEventListener('submit', (e) => {
|
||||
e.preventDefault();
|
||||
e.preventDefault();
|
||||
const paivat = [0,1,2,3,4,5,6].filter(i => document.getElementById('pv-'+i).checked);
|
||||
fetch('/lisaa_kohde', {
|
||||
method:'POST',
|
||||
headers:{'Content-Type':'application/json'},
|
||||
body:JSON.stringify({
|
||||
jackett_haku: document.getElementById('haku-sana').value,
|
||||
regex_suodatin: document.getElementById('haku-regex').value,
|
||||
kohdekansio: document.getElementById('haku-kansio').value
|
||||
kohdekansio: document.getElementById('haku-kansio').value,
|
||||
paivat: paivat
|
||||
})
|
||||
}).then(() => { e.target.reset(); paivitaNakyma(); });
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user