refine dashboard (remove chart.js in favor of bs progressbar), modify lineup to fit
This commit is contained in:
@@ -4,40 +4,27 @@
|
||||
{#{% block page_subheading %}{% endblock %}#}
|
||||
|
||||
{% block content %}
|
||||
{# <div class="container overflow-scroll mx-0 px-0">#}
|
||||
{# <div class="row flex-row flex-nowrap">#}
|
||||
{# {% for event_data in contexts %}#}
|
||||
{# <div class="col border-start border-end">#}
|
||||
{# <div class = "border-bottom">#}
|
||||
{# <h4>{{ event_data.event.data.formatted_title }}</h4>#}
|
||||
{# <h6 class="text-muted" >{{ event_data.data.start_date }}</h6>#}
|
||||
{# </div>#}
|
||||
{# {% include 'teamsnap/lineup/widgets/lineup.html' with formset_lineup=event_data.formset_lineup formset_bench=event_data.formset_bench event_id=event_data.event.data.id %}#}
|
||||
{# </div>#}
|
||||
{# {% endfor %}#}
|
||||
{# </div>#}
|
||||
{# </div>#}
|
||||
<div class="container overflow-scroll">
|
||||
<div id="popup-messages-content">
|
||||
</div>
|
||||
<div class="row flex-row flex-nowrap">
|
||||
<table>
|
||||
<tbody>
|
||||
<tr class="align-top mx-1">
|
||||
{% for event_data in contexts %}
|
||||
<td class="px-1">
|
||||
{% include "lineup/widgets/lineup.html" with event=event_data.event event_id=event_data.event.data.id formset=event_data.formset formset_startinglineup=event_data.formset_startinglineup formset_bench=event_data.formset_bench formset_out=event_data.formset_out formset_startingpositionalonly=event_data.formset_startingpositionalonly %}
|
||||
</td>
|
||||
{% endfor %}
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="container overflow-scroll">
|
||||
<div id="popup-messages-content">
|
||||
</div>
|
||||
<div class="row flex-row flex-nowrap">
|
||||
<table>
|
||||
<tbody>
|
||||
<tr class="align-top mx-1">
|
||||
{% for event_data in contexts %}
|
||||
<td class="px-1">
|
||||
{% include "lineup/widgets/lineup.html" with event=event_data.event event_id=event_data.event.data.id formset=event_data.formset formset_startinglineup=event_data.formset_startinglineup formset_bench=event_data.formset_bench formset_out=event_data.formset_out formset_startingpositionalonly=event_data.formset_startingpositionalonly availability_summary=event_data.availability_summary %}
|
||||
</td>
|
||||
{% endfor %}
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block inline_javascript %}
|
||||
{{ block.super }}
|
||||
{{ block.super }}
|
||||
<script src="{% static 'js/Sortable.js' %}"></script>
|
||||
<script src="{% static 'lineup/js/lineup.js' %}"></script>
|
||||
<script>
|
||||
|
||||
@@ -1,11 +1,21 @@
|
||||
{% load static %}
|
||||
{% load availability_percentage %}
|
||||
<div class="card mx-auto benchcoach-lineup" style="max-width: 455px" id="benchcoach-lineup-{{ event_id }}">
|
||||
<form method="post" id="form-lineup-{{ event.data.id }}">
|
||||
{{ formset.management_form }}
|
||||
{% csrf_token %}
|
||||
<div class="border-bottom p-2">
|
||||
<h4 class="card-title text-nowrap">{{ event.data.formatted_title }}</h4>
|
||||
<h6 class="text-muted card-subtitle text-nowrap">{{ event.data.start_date|date:"D, F j, Y g:i A" }}</h6>
|
||||
<span class="h4"><a class="text-decoration-none text-black" href="{% url 'teamsnap_view_event' team_id=event.data.team_id event_id=event.data.id %}">{{ event.data.formatted_title }}</a></span>
|
||||
<h6 class="text-muted mb-2">
|
||||
{{ event.data.start_date|date:"D, F j, g:i A" }}<br>
|
||||
{{ event.data.location_name }}
|
||||
</h6>
|
||||
<div class="progress">
|
||||
<div class="progress-bar bg-success" role="progressbar" style="width: {% availability_percentage availability_summary 'player_going' %}%">{{ availability_summary.data.player_going_count }}</div>
|
||||
<div class="progress-bar bg-info" role="progressbar" style="width: {% availability_percentage availability_summary 'player_maybe' %}%">{{ availability_summary.data.player_maybe_count }}</div>
|
||||
<div class="progress-bar bg-danger" role="progressbar" style="width: {% availability_percentage availability_summary 'player_not_going' %}%" >{{ availability_summary.data.player_not_going_count }}</div>
|
||||
<div class="progress-bar text-secondary" role="progressbar" style="width: {% availability_percentage availability_summary 'player_unknown' %}%;background-color:#e9ecef;">{{ availability_summary.data.player_unknown_count }}</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col text-end d-inline">
|
||||
|
||||
@@ -42,7 +42,11 @@ def edit_lineup(request, event_ids, team_id):
|
||||
][0]
|
||||
ts_availabilities = Availability.search(client, event_id=ts_event.data["id"])
|
||||
ts_lineup_entries = EventLineupEntry.search(client, event_id=event_id)
|
||||
|
||||
ts_availability_summary = [
|
||||
i
|
||||
for i in ts_bulkload
|
||||
if isinstance(i, AvailabilitySummary) and i.data["event_id"] == event_id
|
||||
][0]
|
||||
ts_members = [i for i in ts_bulkload if isinstance(i, Member)]
|
||||
ts_member_lookup = {m.data["id"]: m for m in ts_members}
|
||||
gc_player_lookup = {
|
||||
@@ -179,6 +183,7 @@ def edit_lineup(request, event_ids, team_id):
|
||||
contexts.append(
|
||||
{
|
||||
"event": ts_event,
|
||||
"availability_summary": ts_availability_summary,
|
||||
"formset": formset,
|
||||
"formset_bench": formset_bench,
|
||||
"formset_startinglineup": formset_startinglineup,
|
||||
|
||||
Reference in New Issue
Block a user