first init of this template.
This commit is contained in:
116
teamsnap/templates/teamsnap/edit_lineup.html
Normal file
116
teamsnap/templates/teamsnap/edit_lineup.html
Normal file
@@ -0,0 +1,116 @@
|
||||
{% extends "base.html" %}{% load static %}
|
||||
{% block title %} {{ event.data.formatted_title }}{% endblock %}
|
||||
{% block page_heading %}{{ event.data.formatted_title }}{% endblock %}
|
||||
{% block page_subheading %}{{ event.data.start_date }}, {{ event.data.location_name }}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
<h6>Lineup</h6>
|
||||
<form method="post" action="{% url 'teamsnap_submit_lineup' team_id=team_id event_id=event_id %}">
|
||||
{{ formset.management_form }}
|
||||
{% csrf_token %}
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped table-sm" id="table-event-lineup">
|
||||
<tbody id="tablebody-event-lineup">
|
||||
{% for form in formset %}
|
||||
{% if form.event_lineup_entry_id.value %}
|
||||
<tr>
|
||||
{{ form.event_lineup_entry_id.as_hidden }}
|
||||
{{ form.event_lineup_id.as_hidden }}
|
||||
{{ form.event_id.as_hidden }}
|
||||
{{ form.member_id.as_hidden }}
|
||||
{{ form.sequence.as_hidden }}
|
||||
{{ form.label.as_hidden }}
|
||||
{{ form.member_name.as_hidden }}
|
||||
|
||||
<td class="col-1 px-1">
|
||||
{{ forloop.counter }}
|
||||
</td>
|
||||
<td class="col-auto">
|
||||
{{ form.member_name.value }}
|
||||
</td>
|
||||
<td class="col-3">
|
||||
<div class="form-select-sm">{{ form.label }}</div>
|
||||
</td>
|
||||
<td class="col-1">
|
||||
<div class="d-flex">
|
||||
<div class="px-1">
|
||||
<i class="bi bi-dash-circle text-danger"></i>
|
||||
{{ form.DELETE.as_hidden }}
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td class="col-1 drag-handle">
|
||||
<i class="bi bi-grip-vertical text-secondary"></i>
|
||||
</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<input class="btn btn-success" type="submit" value="Submit">
|
||||
</form>
|
||||
<h6>Bench</h6>
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped table-sm">
|
||||
{# <thead>#}
|
||||
{# <th scope="row">#}
|
||||
{# <td>Status</td>#}
|
||||
{# <td>Last</td>#}
|
||||
{# <td>First</td>#}
|
||||
{# </th>#}
|
||||
{# </thead>#}
|
||||
|
||||
{% for availability in availablities %}
|
||||
{% if availability.data.member_is_non_player is False %}
|
||||
<tr>
|
||||
<td class="col-1">
|
||||
{% if availability.data.status_code == 1 %}
|
||||
<i class="bi bi-check-circle-fill text-success"></i>
|
||||
{% endif %}
|
||||
{% if availability.data.status_code == 0 %}
|
||||
<i class="bi bi-x-circle-fill text-danger"></i>
|
||||
{% endif %}
|
||||
{% if availability.data.status_code == None %}
|
||||
<i class="bi bi-circle"></i>
|
||||
{% endif %}
|
||||
{% if availability.data.status_code == 2 %}
|
||||
<i class="bi bi-circle-half text-info"></i>
|
||||
{% endif %}
|
||||
</td>
|
||||
<td class="col-auto">
|
||||
{{ availability.data.member_first_name }} {{ availability.data.member_last_name }}
|
||||
</td>
|
||||
<td class="col-3">
|
||||
</td>
|
||||
<td class="col-1">
|
||||
<div class="d-flex">
|
||||
<div class="px-1">
|
||||
<i class="bi bi-plus-circle"></i>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<script src="{% static 'js/Sortable.js' %}"></script>
|
||||
<script id="sortable">
|
||||
var lineup = new Sortable.create(
|
||||
document.getElementById('tablebody-event-lineup'), {
|
||||
animation: 150,
|
||||
ghostClass:"ghost",
|
||||
handle: ".drag-handle",
|
||||
group:{
|
||||
put:true,
|
||||
pull:true
|
||||
},
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user