broke out lineup into its own app
This commit is contained in:
@@ -28,8 +28,6 @@
|
|||||||
<!-- Your stuff: Third-party javascript libraries go here -->
|
<!-- Your stuff: Third-party javascript libraries go here -->
|
||||||
|
|
||||||
<!-- place project specific Javascript in this file -->
|
<!-- place project specific Javascript in this file -->
|
||||||
<script defer src="{% static 'js/project.js' %}"></script>
|
|
||||||
<script defer src="{% static 'js/Sortable.js' %}"></script>
|
|
||||||
<script src="{% static 'js/chart.js' %}"></script>
|
<script src="{% static 'js/chart.js' %}"></script>
|
||||||
|
|
||||||
{% endblock javascript %}
|
{% endblock javascript %}
|
||||||
|
|||||||
@@ -272,5 +272,5 @@ SOCIALACCOUNT_FORMS = {"signup": "benchcoach.users.forms.UserSocialSignupForm"}
|
|||||||
|
|
||||||
# Your stuff...
|
# Your stuff...
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
INSTALLED_APPS += ["teamsnap", "instagen"]
|
INSTALLED_APPS += ["teamsnap", "instagen", "teamsnap.lineup"]
|
||||||
SOCIALACCOUNT_PROVIDERS = {"teamsnap": {"SCOPE": ["read", "write"]}}
|
SOCIALACCOUNT_PROVIDERS = {"teamsnap": {"SCOPE": ["read", "write"]}}
|
||||||
|
|||||||
0
teamsnap/lineup/__init__.py
Normal file
0
teamsnap/lineup/__init__.py
Normal file
6
teamsnap/lineup/apps.py
Normal file
6
teamsnap/lineup/apps.py
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
from django.apps import AppConfig
|
||||||
|
|
||||||
|
|
||||||
|
class LineupConfig(AppConfig):
|
||||||
|
default_auto_field = "django.db.models.BigAutoField"
|
||||||
|
name = "teamsnap.lineup"
|
||||||
48
teamsnap/lineup/forms.py
Normal file
48
teamsnap/lineup/forms.py
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
from django import forms
|
||||||
|
from django.forms import formset_factory
|
||||||
|
|
||||||
|
|
||||||
|
class LineupEntryForm(forms.Form):
|
||||||
|
member = None
|
||||||
|
availability = None
|
||||||
|
lineup_entry = None
|
||||||
|
|
||||||
|
event_lineup_entry_id = forms.Field(required=False)
|
||||||
|
event_lineup_id = forms.Field(required=False)
|
||||||
|
event_id = forms.Field()
|
||||||
|
member_id = forms.Field()
|
||||||
|
position_only = forms.BooleanField(initial=False, required=False)
|
||||||
|
sequence = forms.IntegerField(required=False)
|
||||||
|
label = forms.ChoiceField(
|
||||||
|
required=False,
|
||||||
|
choices=[
|
||||||
|
("", "--"),
|
||||||
|
("P", "P"),
|
||||||
|
("C", "C"),
|
||||||
|
("1B", "1B"),
|
||||||
|
("2B", "2B"),
|
||||||
|
("3B", "3B"),
|
||||||
|
("SS", "SS"),
|
||||||
|
("LF", "LF"),
|
||||||
|
("CF", "CF"),
|
||||||
|
("RF", "RF"),
|
||||||
|
("DH", "DH"),
|
||||||
|
("DR", "DR"),
|
||||||
|
("EH", "EH"),
|
||||||
|
],
|
||||||
|
widget=forms.Select(attrs={"onchange": "positionSelectChanged(this);"}),
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
LineupEntryFormset = formset_factory(
|
||||||
|
LineupEntryForm, can_delete=True, can_order=True, extra=0
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
class EventChooseForm(forms.Form):
|
||||||
|
event_id = forms.ChoiceField()
|
||||||
|
|
||||||
|
|
||||||
|
LineupEntryFormset = formset_factory(
|
||||||
|
LineupEntryForm, can_delete=True, can_order=True, extra=0
|
||||||
|
)
|
||||||
0
teamsnap/lineup/migrations/__init__.py
Normal file
0
teamsnap/lineup/migrations/__init__.py
Normal file
@@ -8,8 +8,6 @@ function positionSelectChanged(elem) {
|
|||||||
function colorPositions() {
|
function colorPositions() {
|
||||||
for (bcLineup of document.getElementsByClassName("benchcoach-lineup")) {
|
for (bcLineup of document.getElementsByClassName("benchcoach-lineup")) {
|
||||||
var player_rows = bcLineup.querySelectorAll('tr');
|
var player_rows = bcLineup.querySelectorAll('tr');
|
||||||
// player_rows.push.apply(player_rows, document.getElementsByClassName('benchcoach-lineup').querySelectorAll('tr'));
|
|
||||||
// player_rows.push.apply(player_rows, document.getElementsByClassName('benchcoach-bench').querySelectorAll('tr'));
|
|
||||||
var label_value_array = []
|
var label_value_array = []
|
||||||
player_rows.forEach(function (player_row, index) {
|
player_rows.forEach(function (player_row, index) {
|
||||||
if (player_row.querySelector('[name$="label"]')) {
|
if (player_row.querySelector('[name$="label"]')) {
|
||||||
@@ -30,9 +28,7 @@ function colorPositions() {
|
|||||||
}
|
}
|
||||||
position_status.classList.add('text-danger')
|
position_status.classList.add('text-danger')
|
||||||
}
|
}
|
||||||
// console.dir(position_status)
|
|
||||||
})
|
})
|
||||||
// console.dir(label_value_array)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
1
teamsnap/lineup/static/lineup/teamsnap.svg
Normal file
1
teamsnap/lineup/static/lineup/teamsnap.svg
Normal file
File diff suppressed because one or more lines are too long
|
After Width: | Height: | Size: 5.8 KiB |
@@ -35,13 +35,12 @@
|
|||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block inline_javascript %}
|
{% block inline_javascript %}
|
||||||
{{ block.super }}
|
{{ block.super }}
|
||||||
<script src="{% static 'js/Sortable.js' %}"></script>
|
<script src="{% static 'js/Sortable.js' %}"></script>
|
||||||
<script src="{% static 'js/lineup-table.js' %}"></script>
|
<script src="{% static 'lineup/js/lineup.js' %}"></script>
|
||||||
<script>
|
<script>
|
||||||
window.addEventListener('DOMContentLoaded', () => {
|
window.addEventListener('DOMContentLoaded', () => {
|
||||||
/* Run whatever you want */
|
/* Run whatever you want */
|
||||||
3
teamsnap/lineup/tests.py
Normal file
3
teamsnap/lineup/tests.py
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
# from django.test import TestCase
|
||||||
|
|
||||||
|
# Create your tests here.
|
||||||
26
teamsnap/lineup/urls.py
Normal file
26
teamsnap/lineup/urls.py
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
from django.urls import path
|
||||||
|
|
||||||
|
from .views import edit_lineup, multi_lineup_choose, submit_lineup
|
||||||
|
|
||||||
|
urlpatterns = [
|
||||||
|
path(
|
||||||
|
"<int:team_id>/schedule/edit_lineup/<int:event_ids>",
|
||||||
|
edit_lineup,
|
||||||
|
name="teamsnap_edit_lineup",
|
||||||
|
),
|
||||||
|
path(
|
||||||
|
"<int:team_id>/event/<int:event_id>/submit_lineup/",
|
||||||
|
submit_lineup,
|
||||||
|
name="teamsnap_submit_lineup",
|
||||||
|
),
|
||||||
|
path(
|
||||||
|
"<int:team_id>/event/<str:event_ids>/edit_lineup/",
|
||||||
|
edit_lineup,
|
||||||
|
name="teamsnap_edit_multiple_lineups",
|
||||||
|
),
|
||||||
|
path(
|
||||||
|
"<int:team_id>/multievent/choose",
|
||||||
|
multi_lineup_choose,
|
||||||
|
name="teamsnap_choose_multiple_lineups",
|
||||||
|
),
|
||||||
|
]
|
||||||
288
teamsnap/lineup/views.py
Normal file
288
teamsnap/lineup/views.py
Normal file
@@ -0,0 +1,288 @@
|
|||||||
|
from django.http import (
|
||||||
|
HttpResponse,
|
||||||
|
HttpResponseNotAllowed,
|
||||||
|
HttpResponseServerError,
|
||||||
|
JsonResponse,
|
||||||
|
)
|
||||||
|
from django.shortcuts import redirect, render
|
||||||
|
|
||||||
|
from teamsnap.views import get_teamsnap_client
|
||||||
|
|
||||||
|
|
||||||
|
def edit_lineup(request, event_ids, team_id):
|
||||||
|
import re
|
||||||
|
|
||||||
|
from pyteamsnap.api import (
|
||||||
|
Availability,
|
||||||
|
AvailabilitySummary,
|
||||||
|
Event,
|
||||||
|
EventLineup,
|
||||||
|
EventLineupEntry,
|
||||||
|
Member,
|
||||||
|
)
|
||||||
|
|
||||||
|
from teamsnap.forms import LineupEntryFormset
|
||||||
|
|
||||||
|
client = get_teamsnap_client(request)
|
||||||
|
|
||||||
|
event_ids = str(event_ids).split(",")
|
||||||
|
|
||||||
|
ts_bulkload = client.bulk_load(
|
||||||
|
team_id=team_id,
|
||||||
|
types=[Event, EventLineup, EventLineupEntry, AvailabilitySummary, Member],
|
||||||
|
event__id=",".join(event_ids),
|
||||||
|
)
|
||||||
|
event_ids = [int(i) for i in event_ids]
|
||||||
|
|
||||||
|
contexts = []
|
||||||
|
for event_id in event_ids:
|
||||||
|
ts_event = [
|
||||||
|
i for i in ts_bulkload if isinstance(i, Event) and i.data["id"] == event_id
|
||||||
|
][0]
|
||||||
|
ts_availabilities = Availability.search(client, event_id=ts_event.data["id"])
|
||||||
|
ts_lineup_entries = EventLineupEntry.search(client, event_id=event_id)
|
||||||
|
|
||||||
|
ts_members = [i for i in ts_bulkload if isinstance(i, Member)]
|
||||||
|
ts_member_lookup = {m.data["id"]: m for m in ts_members}
|
||||||
|
ts_availability_lookup = {m.data["member_id"]: m for m in ts_availabilities}
|
||||||
|
ts_lineup_entries_lookup = {m.data["member_id"]: m for m in ts_lineup_entries}
|
||||||
|
|
||||||
|
members = []
|
||||||
|
|
||||||
|
for lineup_entry in ts_lineup_entries:
|
||||||
|
members.append(
|
||||||
|
{
|
||||||
|
"member": getattr(
|
||||||
|
ts_member_lookup[lineup_entry.data["member_id"]], "data"
|
||||||
|
),
|
||||||
|
"availability": getattr(
|
||||||
|
ts_availability_lookup.get(lineup_entry.data["member_id"], {}),
|
||||||
|
"data",
|
||||||
|
{},
|
||||||
|
),
|
||||||
|
"lineup_entry": getattr(lineup_entry, "data", {}),
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
in_lineup_already = [m["member"] for m in members]
|
||||||
|
|
||||||
|
for member in ts_members:
|
||||||
|
if member.data not in in_lineup_already:
|
||||||
|
members.append(
|
||||||
|
{
|
||||||
|
"member": getattr(member, "data"),
|
||||||
|
"availability": getattr(
|
||||||
|
ts_availability_lookup.get(member.data["id"], {}),
|
||||||
|
"data",
|
||||||
|
{},
|
||||||
|
),
|
||||||
|
"lineup_entry": getattr(
|
||||||
|
ts_lineup_entries_lookup.get(member.data["id"], {}),
|
||||||
|
"data",
|
||||||
|
{},
|
||||||
|
),
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
members = sorted(
|
||||||
|
members,
|
||||||
|
key=lambda d: (
|
||||||
|
{None: 3, 0: 2, 2: 1, 1: 0}.get( # No Response # No # Maybe # Yes
|
||||||
|
d["availability"].get("status_code")
|
||||||
|
),
|
||||||
|
d["member"].get("last_name"),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
|
||||||
|
initial = []
|
||||||
|
for member in members:
|
||||||
|
if not member["member"]["is_non_player"]:
|
||||||
|
if re.search(
|
||||||
|
r"([A-Z0-9]+)(?:\s+\[(.*)\])?",
|
||||||
|
member["lineup_entry"].get("label", ""),
|
||||||
|
):
|
||||||
|
position, position_note = re.search(
|
||||||
|
r"([A-Z0-9]+)(?:\s+\[(.*)\])?",
|
||||||
|
member["lineup_entry"].get("label", ""),
|
||||||
|
).groups()
|
||||||
|
else:
|
||||||
|
position, position_note = ("", "")
|
||||||
|
position_only = position_note == "PO"
|
||||||
|
initial.append(
|
||||||
|
{
|
||||||
|
"event_lineup_entry_id": member["lineup_entry"].get("id"),
|
||||||
|
"event_lineup_id": member["lineup_entry"].get(
|
||||||
|
"event_lineup_id"
|
||||||
|
),
|
||||||
|
"event_id": event_id,
|
||||||
|
"position_only": position_only,
|
||||||
|
"member_id": member["member"]["id"],
|
||||||
|
"sequence": member["lineup_entry"].get("sequence"),
|
||||||
|
"label": position,
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
formset = LineupEntryFormset(initial=initial)
|
||||||
|
|
||||||
|
for form in formset:
|
||||||
|
form.member = ts_member_lookup.get(form["member_id"].initial)
|
||||||
|
form.availability = ts_availability_lookup.get(form["member_id"].initial)
|
||||||
|
|
||||||
|
formset_startinglineup = [
|
||||||
|
form
|
||||||
|
for form in formset
|
||||||
|
if form.initial.get("event_lineup_entry_id")
|
||||||
|
and not form.initial.get("position_only")
|
||||||
|
]
|
||||||
|
formset_startinglineup = sorted(
|
||||||
|
formset_startinglineup, key=lambda d: d.initial.get("sequence", 100)
|
||||||
|
)
|
||||||
|
formset_startingpositiononly = [
|
||||||
|
form
|
||||||
|
for form in formset
|
||||||
|
if form.initial.get("event_lineup_entry_id")
|
||||||
|
and form not in formset_startinglineup
|
||||||
|
]
|
||||||
|
formset_startingpositiononly = sorted(
|
||||||
|
formset_startingpositiononly, key=lambda d: d.initial.get("sequence", 100)
|
||||||
|
)
|
||||||
|
formset_bench = [
|
||||||
|
form
|
||||||
|
for form in formset
|
||||||
|
if form not in formset_startinglineup
|
||||||
|
and form not in formset_startingpositiononly
|
||||||
|
and form.availability.data["status_code"] in [2, 1]
|
||||||
|
]
|
||||||
|
formset_out = [
|
||||||
|
form
|
||||||
|
for form in formset
|
||||||
|
if form not in formset_startinglineup
|
||||||
|
and form not in formset_bench
|
||||||
|
and form not in formset_startingpositiononly
|
||||||
|
and not form.member.data["is_non_player"]
|
||||||
|
]
|
||||||
|
|
||||||
|
contexts.append(
|
||||||
|
{
|
||||||
|
"event": ts_event,
|
||||||
|
"formset": formset,
|
||||||
|
"formset_bench": formset_bench,
|
||||||
|
"formset_startinglineup": formset_startinglineup,
|
||||||
|
"formset_startingpositionalonly": formset_startingpositiononly,
|
||||||
|
"formset_out": formset_out,
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
return render(request, "lineup/multiple_edit.html", context={"contexts": contexts})
|
||||||
|
|
||||||
|
|
||||||
|
def submit_lineup(request, team_id, event_id):
|
||||||
|
from pyteamsnap.api import Event, EventLineup, EventLineupEntry
|
||||||
|
|
||||||
|
from teamsnap.forms import LineupEntryFormset
|
||||||
|
|
||||||
|
client = get_teamsnap_client(request)
|
||||||
|
ts_event = Event.get(client, event_id)
|
||||||
|
ts_lineup = EventLineup.search(client, event_id=event_id)
|
||||||
|
event_lineup_id = ts_lineup[0].data["id"]
|
||||||
|
if request.GET:
|
||||||
|
return HttpResponseNotAllowed()
|
||||||
|
if request.POST:
|
||||||
|
formset = LineupEntryFormset(request.POST)
|
||||||
|
if formset.is_valid():
|
||||||
|
r = []
|
||||||
|
for form in formset:
|
||||||
|
data = form.cleaned_data
|
||||||
|
if data.get("event_lineup_entry_id"):
|
||||||
|
event_lineup_entry = EventLineupEntry.get(
|
||||||
|
client, id=data.get("event_lineup_entry_id")
|
||||||
|
)
|
||||||
|
if data.get("position_only"):
|
||||||
|
data["label"] = data["label"] + " [PO]"
|
||||||
|
event_lineup_entry.data.update(data)
|
||||||
|
if not data.get("sequence") and not data.get("label"):
|
||||||
|
try:
|
||||||
|
r.append(event_lineup_entry.delete())
|
||||||
|
except Exception as e:
|
||||||
|
raise e
|
||||||
|
else:
|
||||||
|
try:
|
||||||
|
r.append(event_lineup_entry.put())
|
||||||
|
except Exception as e:
|
||||||
|
e
|
||||||
|
pass
|
||||||
|
pass
|
||||||
|
elif data.get("sequence") is not None and data.get("label"):
|
||||||
|
event_lineup_entry = EventLineupEntry.new(client)
|
||||||
|
if data.get("position_only"):
|
||||||
|
data["label"] = data["label"] + " [PO]"
|
||||||
|
event_lineup_entry.data.update(data)
|
||||||
|
event_lineup_entry.data.update({"event_lineup_id": event_lineup_id})
|
||||||
|
try:
|
||||||
|
r.append(event_lineup_entry.post())
|
||||||
|
except Exception as e:
|
||||||
|
raise e
|
||||||
|
else:
|
||||||
|
pass
|
||||||
|
else:
|
||||||
|
# breakpoint()
|
||||||
|
pass
|
||||||
|
# breakpoint()
|
||||||
|
pass
|
||||||
|
return JsonResponse(ts_event.data)
|
||||||
|
pass
|
||||||
|
return HttpResponseServerError
|
||||||
|
|
||||||
|
|
||||||
|
def multi_lineup_choose(request, team_id):
|
||||||
|
from django.forms import formset_factory
|
||||||
|
from pyteamsnap.api import Event
|
||||||
|
|
||||||
|
from .forms import EventChooseForm
|
||||||
|
|
||||||
|
client = get_teamsnap_client(request)
|
||||||
|
|
||||||
|
if request.method == "POST":
|
||||||
|
ts_events = Event.search(client, team_id=team_id)
|
||||||
|
EventChooseFormset = formset_factory(EventChooseForm)
|
||||||
|
formset = EventChooseFormset(request.POST)
|
||||||
|
choices = [(e.data["id"], e.data["formatted_title"]) for e in ts_events]
|
||||||
|
|
||||||
|
for form in formset:
|
||||||
|
form.fields["event_id"].choices = choices
|
||||||
|
|
||||||
|
if formset.is_valid():
|
||||||
|
event_ids = [f.cleaned_data["event_id"] for f in formset]
|
||||||
|
else:
|
||||||
|
event_ids = request.GET.get("event_ids").split(",")
|
||||||
|
EventChooseFormset = formset_factory(EventChooseForm)
|
||||||
|
formset = EventChooseFormset(request.POST)
|
||||||
|
|
||||||
|
return redirect(
|
||||||
|
"teamsnap_edit_multiple_lineups",
|
||||||
|
team_id=team_id,
|
||||||
|
event_ids=",".join(event_ids),
|
||||||
|
)
|
||||||
|
elif not request.GET.get("num"):
|
||||||
|
return HttpResponse(500)
|
||||||
|
else:
|
||||||
|
num = int(request.GET.get("num"))
|
||||||
|
TEAM_ID = team_id
|
||||||
|
|
||||||
|
ts_events = Event.search(client, team_id=TEAM_ID)
|
||||||
|
ts_events = {e.data["id"]: e for e in ts_events}
|
||||||
|
|
||||||
|
EventChooseFormset = formset_factory(EventChooseForm, extra=num)
|
||||||
|
formset = EventChooseFormset()
|
||||||
|
|
||||||
|
choices = [(id, e.data["formatted_title"]) for id, e in ts_events.items()]
|
||||||
|
|
||||||
|
for form in formset:
|
||||||
|
form.fields["event_id"].choices = choices
|
||||||
|
|
||||||
|
pass
|
||||||
|
return render(
|
||||||
|
request,
|
||||||
|
"lineup/multiple_choose.html",
|
||||||
|
context={"formset": formset, "team_id": team_id},
|
||||||
|
)
|
||||||
@@ -1,76 +0,0 @@
|
|||||||
<html lang="en">
|
|
||||||
{% extends "base.html" %}{% load static %}
|
|
||||||
{% block title %} {{ event.data.formatted_title }} - Instagenerator{% endblock %}
|
|
||||||
{% block page_heading %}
|
|
||||||
<div class="row d-inline-flex">
|
|
||||||
<div class="col">
|
|
||||||
<img src="{% static 'teamsnap/ig/graphics/hounds-insta.jpg' %}" class="mx-auto d-block img-fluid shadow-sm" style="height:30px;border-radius: 8px;">
|
|
||||||
</div>
|
|
||||||
<div class="col text-nowrap px-0">Hounds Instagenerator</div>
|
|
||||||
</div>
|
|
||||||
{% endblock %}
|
|
||||||
{% block page_subheading %}{{ event.data.formatted_title }}, {{ event.data.start_date }}, {{ event.data.location_name }}{% endblock %}
|
|
||||||
{% block content %}
|
|
||||||
|
|
||||||
<form method="get" action="generate">
|
|
||||||
|
|
||||||
<div class="mb-3">
|
|
||||||
<select hidden class="form-select" name="game_id" id="game_id">
|
|
||||||
<optgroup label="Events">
|
|
||||||
<option value="" disabled="disabled">Select an event...</option>
|
|
||||||
<option selected value="{{event.data.id}}">{{event.data.formatted_title}}</option>
|
|
||||||
</optgroup>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="mb-3">
|
|
||||||
<legend class="">Background</legend>
|
|
||||||
<div class="form-check">
|
|
||||||
<input class="form-check-input" type="radio" name="background" id="backgroundLocation" checked value="location">
|
|
||||||
<label class="form-check-label" for="backgroundLocation">
|
|
||||||
Location
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="form-check">
|
|
||||||
<input class="form-check-input" type="radio" name="background" id="backgroundTransparent" value="transparent">
|
|
||||||
<label class="form-check-label" for="backgroundTransparent">
|
|
||||||
Transparent
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
<div class="form-check">
|
|
||||||
<input class="form-check-input" type="radio" name="background" id="badge_only" value="badge">
|
|
||||||
<label class="form-check-label" for="badge_only">
|
|
||||||
Badge only
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="mb-3">
|
|
||||||
<legend class="">Layout</legend>
|
|
||||||
<div class="form-check">
|
|
||||||
<input class="form-check-input" type="radio" name="dimensions" id="square" checked value="1080x1080">
|
|
||||||
<label class="form-check-label" for="square">
|
|
||||||
Square
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
<div class="form-check">
|
|
||||||
<input class="form-check-input" type="radio" name="dimensions" id="portrait" value="1080x1920">
|
|
||||||
<label class="form-check-label" for="portrait">
|
|
||||||
Portrait
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
<div class="form-check">
|
|
||||||
<input class="form-check-input" type="radio" name="dimensions" id="portrait" value="1920x1080">
|
|
||||||
<label class="form-check-label" for="portrait">
|
|
||||||
Landscape
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="d-lg-flex justify-content-lg-end align-items-lg-center mb-3">
|
|
||||||
<button type="submit" class="btn btn-primary btn-block">Get Image</button>
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
|
|
||||||
{% endblock %}
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
{% 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 %}
|
|
||||||
{% include 'teamsnap/lineup/widgets/lineup.html' with formset_lineup=formset_lineup formset_bench=formset_bench%}
|
|
||||||
<script src="{% static 'js/Sortable.js' %}"></script>
|
|
||||||
<script src="{% static 'teamsnap/js/lineup-table.js' %}"></script>
|
|
||||||
{% endblock %}
|
|
||||||
@@ -1,45 +0,0 @@
|
|||||||
{% extends "base.html" %}{% load static %}
|
|
||||||
{% block title %} {{ title }}{% endblock %}
|
|
||||||
|
|
||||||
{% csrf_token %}
|
|
||||||
|
|
||||||
{% block page_heading %}
|
|
||||||
<div class="row d-inline-flex">
|
|
||||||
<div class="col">
|
|
||||||
Schedule
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{% endblock %}
|
|
||||||
{% block content %}
|
|
||||||
<form method="get" action="{% url 'teamsnap_edit_multiple_lineups' team_id=team_id%}">
|
|
||||||
{{ formset.management_form }}
|
|
||||||
<input class="btn btn-sm btn-outline-primary text-nowrap" type="submit" value="Submit">
|
|
||||||
{% load tz %}
|
|
||||||
<div class="table-responsive">
|
|
||||||
<table class="table table-striped table-sm">
|
|
||||||
{# <thead>#}
|
|
||||||
{# </thead>#}
|
|
||||||
<tbody>
|
|
||||||
{% for form in formset %}
|
|
||||||
{{ form.event_id.as_hidden }}
|
|
||||||
<tr>
|
|
||||||
<td>
|
|
||||||
{{ form.checked }}
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<a href="{% url 'teamsnap_view_event' event_id=form.event.data.id team_id=request.user.teamsnapsettings.managed_team.id%}">{{ form.event.data.formatted_title }}</a>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
{{ form.event.data.start_date | localtime}}
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
{{ form.event.data.location_name }}
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
{% endfor %}
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
{% endblock %}
|
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
from allauth.socialaccount.providers.oauth2.urls import default_urlpatterns
|
from allauth.socialaccount.providers.oauth2.urls import default_urlpatterns
|
||||||
from django.urls import path
|
from django.urls import include, path
|
||||||
|
|
||||||
from .provider import TeamsnapProvider
|
from .provider import TeamsnapProvider
|
||||||
from .views import (
|
from .views import (
|
||||||
@@ -45,4 +45,5 @@ urlpatterns += [
|
|||||||
multi_lineup_choose,
|
multi_lineup_choose,
|
||||||
name="teamsnap_choose_multiple_lineups",
|
name="teamsnap_choose_multiple_lineups",
|
||||||
),
|
),
|
||||||
|
path("", include("teamsnap.lineup.urls")),
|
||||||
]
|
]
|
||||||
|
|||||||
Reference in New Issue
Block a user