From 93469e283bfd294e878cb906d9cd082bbe7c2a77 Mon Sep 17 00:00:00 2001 From: Michael Hall Date: Fri, 26 Jan 2018 21:42:13 -0500 Subject: [PATCH] Refactor get_together templates --- .../{ => events}/create_event.html | 0 .../get_together/{ => events}/edit_event.html | 0 .../{events.html => events/list_events.html} | 0 .../get_together/{ => events}/show_event.html | 0 .../{ => places}/create_place.html | 0 .../{places.html => places/list_places.html} | 0 .../get_together/{ => teams}/create_team.html | 0 .../get_together/{ => teams}/edit_team.html | 0 .../{teams.html => teams/list_teams.html} | 0 .../get_together/{ => teams}/show_team.html | 0 get_together/views.py | 30 +++++++++---------- 11 files changed, 15 insertions(+), 15 deletions(-) rename get_together/templates/get_together/{ => events}/create_event.html (100%) rename get_together/templates/get_together/{ => events}/edit_event.html (100%) rename get_together/templates/get_together/{events.html => events/list_events.html} (100%) rename get_together/templates/get_together/{ => events}/show_event.html (100%) rename get_together/templates/get_together/{ => places}/create_place.html (100%) rename get_together/templates/get_together/{places.html => places/list_places.html} (100%) rename get_together/templates/get_together/{ => teams}/create_team.html (100%) rename get_together/templates/get_together/{ => teams}/edit_team.html (100%) rename get_together/templates/get_together/{teams.html => teams/list_teams.html} (100%) rename get_together/templates/get_together/{ => teams}/show_team.html (100%) diff --git a/get_together/templates/get_together/create_event.html b/get_together/templates/get_together/events/create_event.html similarity index 100% rename from get_together/templates/get_together/create_event.html rename to get_together/templates/get_together/events/create_event.html diff --git a/get_together/templates/get_together/edit_event.html b/get_together/templates/get_together/events/edit_event.html similarity index 100% rename from get_together/templates/get_together/edit_event.html rename to get_together/templates/get_together/events/edit_event.html diff --git a/get_together/templates/get_together/events.html b/get_together/templates/get_together/events/list_events.html similarity index 100% rename from get_together/templates/get_together/events.html rename to get_together/templates/get_together/events/list_events.html diff --git a/get_together/templates/get_together/show_event.html b/get_together/templates/get_together/events/show_event.html similarity index 100% rename from get_together/templates/get_together/show_event.html rename to get_together/templates/get_together/events/show_event.html diff --git a/get_together/templates/get_together/create_place.html b/get_together/templates/get_together/places/create_place.html similarity index 100% rename from get_together/templates/get_together/create_place.html rename to get_together/templates/get_together/places/create_place.html diff --git a/get_together/templates/get_together/places.html b/get_together/templates/get_together/places/list_places.html similarity index 100% rename from get_together/templates/get_together/places.html rename to get_together/templates/get_together/places/list_places.html diff --git a/get_together/templates/get_together/create_team.html b/get_together/templates/get_together/teams/create_team.html similarity index 100% rename from get_together/templates/get_together/create_team.html rename to get_together/templates/get_together/teams/create_team.html diff --git a/get_together/templates/get_together/edit_team.html b/get_together/templates/get_together/teams/edit_team.html similarity index 100% rename from get_together/templates/get_together/edit_team.html rename to get_together/templates/get_together/teams/edit_team.html diff --git a/get_together/templates/get_together/teams.html b/get_together/templates/get_together/teams/list_teams.html similarity index 100% rename from get_together/templates/get_together/teams.html rename to get_together/templates/get_together/teams/list_teams.html diff --git a/get_together/templates/get_together/show_team.html b/get_together/templates/get_together/teams/show_team.html similarity index 100% rename from get_together/templates/get_together/show_team.html rename to get_together/templates/get_together/teams/show_team.html diff --git a/get_together/views.py b/get_together/views.py index ffa6ecc..2659923 100644 --- a/get_together/views.py +++ b/get_together/views.py @@ -35,7 +35,7 @@ def events_list(request, *args, **kwargs): context = { 'events_list': events, } - return render(request, 'get_together/events.html', context) + return render(request, 'get_together/events/list_events.html', context) def create_team(request, *args, **kwargs): if request.method == 'GET': @@ -44,7 +44,7 @@ def create_team(request, *args, **kwargs): context = { 'team_form': form, } - return render(request, 'get_together/create_team.html', context) + return render(request, 'get_together/teams/create_team.html', context) elif request.method == 'POST': form = NewTeamForm(request.POST) if form.is_valid: @@ -57,7 +57,7 @@ def create_team(request, *args, **kwargs): context = { 'team_form': form, } - return render(request, 'get_together/create_team.html', context) + return render(request, 'get_together/teams/create_team.html', context) else: return redirect('home') @@ -74,7 +74,7 @@ def edit_team(request, team_id): 'team': team, 'team_form': form, } - return render(request, 'get_together/edit_team.html', context) + return render(request, 'get_together/teams/edit_team.html', context) elif request.method == 'POST': form = TeamForm(request.POST, instance=team) if form.is_valid: @@ -87,7 +87,7 @@ def edit_team(request, team_id): 'team': team, 'team_form': form, } - return render(request, 'get_together/edit_team.html', context) + return render(request, 'get_together/teams/edit_team.html', context) else: return redirect('home') @@ -98,7 +98,7 @@ def teams_list(request, *args, **kwargs): } if request.user.is_authenticated: context['my_teams'] = request.user.profile.memberships.all() - return render(request, 'get_together/teams.html', context) + return render(request, 'get_together/teams/list_teams.html', context) def show_team(request, team_id, *args, **kwargs): @@ -112,7 +112,7 @@ def show_team(request, team_id, *args, **kwargs): 'can_create_event': request.user.profile.can_create_event(team), 'can_edit_team': request.user.profile.can_edit_team(team), } - return render(request, 'get_together/show_team.html', context) + return render(request, 'get_together/teams/show_team.html', context) def edit_event(request, event_id): event = Event.objects.get(id=event_id) @@ -129,7 +129,7 @@ def edit_event(request, event_id): 'event': event, 'event_form': form, } - return render(request, 'get_together/edit_event.html', context) + return render(request, 'get_together/events/edit_event.html', context) elif request.method == 'POST': form = TeamEventForm(request.POST,instance=event) if form.is_valid: @@ -141,7 +141,7 @@ def edit_event(request, event_id): 'event': event, 'event_form': form, } - return render(request, 'get_together/edit_event.html', context) + return render(request, 'get_together/events/edit_event.html', context) else: return redirect('home') @@ -158,7 +158,7 @@ def create_event(request, team_id): 'team': team, 'event_form': form, } - return render(request, 'get_together/create_event.html', context) + return render(request, 'get_together/events/create_event.html', context) elif request.method == 'POST': form = NewTeamEventForm(request.POST) if form.is_valid: @@ -171,7 +171,7 @@ def create_event(request, team_id): 'team': team, 'event_form': form, } - return render(request, 'get_together/create_event.html', context) + return render(request, 'get_together/events/create_event.html', context) else: return redirect('home') @@ -180,7 +180,7 @@ def places_list(request, *args, **kwargs): context = { 'places_list': places, } - return render(request, 'get_together/places.html', context) + return render(request, 'get_together/places/list_places.html', context) def create_place(request): if request.method == 'GET': @@ -189,7 +189,7 @@ def create_place(request): context = { 'place_form': form, } - return render(request, 'get_together/create_place.html', context) + return render(request, 'get_together/places/create_place.html', context) elif request.method == 'POST': form = NewPlaceForm(request.POST) if form.is_valid: @@ -199,7 +199,7 @@ def create_place(request): context = { 'place_form': form, } - return render(request, 'get_together/create_place.html', context) + return render(request, 'get_together/places/create_place.html', context) else: return redirect('home') @@ -212,4 +212,4 @@ def show_event(request, event_id, event_slug): 'attendee_list': Attendee.objects.filter(event=event), 'can_edit_event': request.user.profile.can_edit_event(event), } - return render(request, 'get_together/show_event.html', context) + return render(request, 'get_together/events/show_event.html', context)