add teamsnap links to views
This commit is contained in:
@@ -35,7 +35,10 @@
|
||||
<a class="card-link m-auto"
|
||||
href="{% url 'instagen' team_id=event.data.team_id event_id=event.data.id %}">
|
||||
<i class="bi bi-instagram"></i>
|
||||
</button>
|
||||
</a>
|
||||
<a class="card-link m-auto"
|
||||
href="{% url 'teamsnap_event_redirect' team_id=event.data.team_id event_id=event.data.id %}">
|
||||
<i class="bi bi-asterisk"></i>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -18,6 +18,11 @@
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col text-start d-inline">
|
||||
<a class="btn btn-teamsnap btn-sm py-0 m-1" href="{% url 'teamsnap_event_redirect' team_id=event.data.team_id event_id=event.data.id %}">
|
||||
<i class="bi bi-asterisk"></i>
|
||||
</a>
|
||||
</div>
|
||||
<div class="col text-end d-inline">
|
||||
<div class="btn-group">
|
||||
<div class="dropdown">
|
||||
|
||||
@@ -1,6 +1,11 @@
|
||||
from django.urls import path
|
||||
|
||||
from .views import edit_lineup, multi_lineup_choose, submit_lineup
|
||||
from .views import (
|
||||
edit_lineup,
|
||||
multi_lineup_choose,
|
||||
submit_lineup,
|
||||
teamsnap_event_redirect,
|
||||
)
|
||||
|
||||
urlpatterns = [
|
||||
path(
|
||||
@@ -23,4 +28,9 @@ urlpatterns = [
|
||||
multi_lineup_choose,
|
||||
name="teamsnap_choose_multiple_lineups",
|
||||
),
|
||||
path(
|
||||
"<int:team_id>/event/<str:event_id>/teamsnap/",
|
||||
teamsnap_event_redirect,
|
||||
name="teamsnap_event_redirect",
|
||||
),
|
||||
]
|
||||
|
||||
@@ -10,6 +10,10 @@ from gamechanger.models import Player as GamechangerPlayer
|
||||
from teamsnap.views import get_teamsnap_client
|
||||
|
||||
|
||||
def teamsnap_event_redirect(request, event_id, team_id):
|
||||
return redirect(f"https://go.teamsnap.com/{team_id}/schedule/view_game/{event_id}")
|
||||
|
||||
|
||||
def edit_lineup(request, event_ids, team_id):
|
||||
import re
|
||||
|
||||
|
||||
Reference in New Issue
Block a user