Exemple #1
0
def teams(request):
    teams: Sequence[Team] = get_all_teams()
    title: str = "Teams"
    return render(
        request,
        "team_index.html",
        {
            "title": title,
            "items": teams,
            "og": opengraph_website(title=title, request=request, image=None),
        },
    )
Exemple #2
0
def performers(request):
    all_performers: Sequence[Performer] = get_all_performers()
    title = "Performers"
    return render(
        request,
        "performer_index.html",
        {
            "title": title,
            "performers": all_performers,
            "og": opengraph_website(title=title, request=request, image=None),
        },
    )
Exemple #3
0
def events(request):
    now: datetime.datetime = datetime.datetime.now(
        tz=timezone("Europe/London"))
    events: Sequence[Event] = get_events_after_datetime(now)
    title: str = "World Improv Guide"
    return render(
        request,
        "events_index.html",
        {
            "title": "World Improv Guide",
            "events": events,
            "og": opengraph_website(title=title, request=request, image=None),
        },
    )
Exemple #4
0
def home(request, event_days: int = 7):
    now: datetime.datetime = datetime.datetime.now()
    later: datetime = now + datetime.timedelta(hours=24 * event_days)
    events: Sequence[Event] = get_events_between_dates(now, later)
    title: str = "World Improv Guide"
    return render(
        request,
        "home.html",
        {
            "title": "World Improv Guide",
            "event_days": event_days,
            "events": events,
            "teams": get_featured_teams(),
            "teachers": get_featured_performers(teachers=True),
            "og": opengraph_website(title=title, request=request, image=None),
        },
    )
Exemple #5
0
def team(request, id: int):
    team: Team = get_team_by_id(id)
    title = f"Team: {team.name}"

    events = team.event_set.all()
    players = team.players.all()

    return render(
        request,
        "team.html",
        {
            "title": title,
            "team": team,
            "events": events,
            "players": players,
            "og": opengraph_website(title=title, request=request, image=None),
        },
    )
Exemple #6
0
def venue(request, id: int):
    this_venue: Venue = get_venue_by_id(id)
    title = this_venue.name

    events: Sequence[Event] = this_venue.event_set.order_by("-start_time")

    return render(
        request,
        "venue.html",
        {
            "title":
            title,
            "venue":
            this_venue,
            "events":
            events,
            "og":
            opengraph_website(
                title=title, request=request, image=this_venue.image),
        },
    )
Exemple #7
0
def event(request, id: int):
    this_event: Event = get_event_by_id(id)
    title = f"{this_event.name}"
    venue: Venue = this_event.venue

    return render(
        request,
        "event.html",
        {
            "title":
            title,
            "event":
            this_event,
            "venue":
            venue,
            "teams":
            this_event.teams.all(),
            "og":
            opengraph_website(
                title=title, request=request, image=this_event.image),
        },
    )
def school(request, id: int):
    this_school: School = get_school_by_id(id)
    title = this_school.name

    teachers: Sequence[Performer] = this_school.teachers.order_by(
        "family_name", "first_name"
    )
    venues: Sequence[Venue] = this_school.venue_set.order_by("name")

    return render(
        request,
        "school.html",
        {
            "title": title,
            "school": this_school,
            "teachers": teachers,
            "venues": venues,
            "og": opengraph_website(
                title=title, request=request, image=this_school.image
            ),
        },
    )