fix: show selected species name in confirm button
This commit is contained in:
parent
b16df6caa4
commit
62fdbf7029
1 changed files with 3 additions and 1 deletions
|
|
@ -18,6 +18,7 @@
|
||||||
<div class="match-card d-flex align-items-center gap-3 p-3 border rounded"
|
<div class="match-card d-flex align-items-center gap-3 p-3 border rounded"
|
||||||
style="cursor:pointer; {% if forloop.first %}border-color:#52b788 !important; background:#f0faf4;{% endif %}"
|
style="cursor:pointer; {% if forloop.first %}border-color:#52b788 !important; background:#f0faf4;{% endif %}"
|
||||||
data-idx="{{ forloop.counter0 }}"
|
data-idx="{{ forloop.counter0 }}"
|
||||||
|
data-name="{{ m.scientific_name }}"
|
||||||
onclick="selectMatch(this)">
|
onclick="selectMatch(this)">
|
||||||
<div class="flex-grow-1">
|
<div class="flex-grow-1">
|
||||||
<div class="fw-bold">{{ m.scientific_name }}</div>
|
<div class="fw-bold">{{ m.scientific_name }}</div>
|
||||||
|
|
@ -36,7 +37,7 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<button type="submit" class="btn btn-success w-100" id="confirm-btn">
|
<button type="submit" class="btn btn-success w-100" id="confirm-btn">
|
||||||
Use selected species →
|
Use <span id="selected-name">{{ matches.0.scientific_name }}</span> →
|
||||||
</button>
|
</button>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
|
|
@ -49,6 +50,7 @@ function selectMatch(el) {
|
||||||
el.style.borderColor = '#52b788';
|
el.style.borderColor = '#52b788';
|
||||||
el.style.background = '#f0faf4';
|
el.style.background = '#f0faf4';
|
||||||
document.getElementById('match_idx_input').value = el.dataset.idx;
|
document.getElementById('match_idx_input').value = el.dataset.idx;
|
||||||
|
document.getElementById('selected-name').textContent = el.dataset.name;
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue