47 lines
2.0 KiB
HTML
47 lines
2.0 KiB
HTML
<div class="bird-sightings-widget">
|
|
<div class="bird-sightings-list">
|
|
{% for sighting in widget.sightings %}
|
|
<div class="bird-sighting-row row mb-2">
|
|
<div class="col-md-6">
|
|
<select name="{{widget.name}}_bird_id" class="form-control">
|
|
<option value="">Select bird...</option>
|
|
{% for bird in widget.birds %}
|
|
<option value="{{bird.id}}" {% if sighting.bird_id == bird.id %}selected{% endif %}>{{bird.common_name}}</option>
|
|
{% endfor %}
|
|
</select>
|
|
</div>
|
|
<div class="col-md-2">
|
|
<input type="number" name="{{widget.name}}_quantity" class="form-control" value="{{sighting.quantity|default:1}}" min="1" placeholder="Qty">
|
|
</div>
|
|
<div class="col-md-3">
|
|
<input type="text" name="{{widget.name}}_sighting_notes" class="form-control" value="{{sighting.sighting_notes|default:''}}" placeholder="Notes">
|
|
</div>
|
|
<div class="col-md-1">
|
|
<button type="button" class="btn btn-sm btn-outline-danger remove-sighting">×</button>
|
|
</div>
|
|
</div>
|
|
{% empty %}
|
|
<div class="bird-sighting-row row mb-2">
|
|
<div class="col-md-6">
|
|
<select name="{{widget.name}}_bird_id" class="form-control">
|
|
<option value="">Select bird...</option>
|
|
{% for bird in widget.birds %}
|
|
<option value="{{bird.id}}">{{bird.common_name}}</option>
|
|
{% endfor %}
|
|
</select>
|
|
</div>
|
|
<div class="col-md-2">
|
|
<input type="number" name="{{widget.name}}_quantity" class="form-control" value="1" min="1" placeholder="Qty">
|
|
</div>
|
|
<div class="col-md-3">
|
|
<input type="text" name="{{widget.name}}_sighting_notes" class="form-control" value="" placeholder="Notes">
|
|
</div>
|
|
<div class="col-md-1">
|
|
<button type="button" class="btn btn-sm btn-outline-danger remove-sighting">×</button>
|
|
</div>
|
|
</div>
|
|
{% endfor %}
|
|
</div>
|
|
<button type="button" class="btn btn-sm btn-outline-primary add-sighting-row mt-2">Add bird</button>
|
|
</div>
|