From de814e2b0339a7761dc63bb61fa66d6cdb0f4280 Mon Sep 17 00:00:00 2001 From: Michael Hall Date: Thu, 20 Sep 2018 23:57:23 -0400 Subject: [PATCH] Allow moving an event from one team to another. Fixes #120 --- events/forms.py | 7 ++++ events/templates/events/change_team_form.html | 4 +++ get_together/static/css/get_together.css | 8 +++++ .../get_together/events/change_team.html | 24 ++++++++++++++ .../get_together/events/show_event.html | 16 +++------ .../get_together/teams/team_page_base.html | 14 -------- get_together/urls.py | 1 + get_together/views/events.py | 33 +++++++++++++++++++ 8 files changed, 81 insertions(+), 26 deletions(-) create mode 100644 events/templates/events/change_team_form.html create mode 100644 get_together/templates/get_together/events/change_team.html diff --git a/events/forms.py b/events/forms.py index 09ed31b..174b922 100644 --- a/events/forms.py +++ b/events/forms.py @@ -345,6 +345,13 @@ class CancelEventForm(forms.Form): confirm = forms.BooleanField(label="Yes, cancel this event", required=True) reason = forms.CharField(label=_("Reason for cancellation"), widget=forms.widgets.Textarea) +class ChangeEventHostForm(forms.ModelForm): + class Meta: + model = Event + fields = [ + 'team' + ] + class EventInviteMemberForm(forms.Form): member = forms.ChoiceField(label=_("")) diff --git a/events/templates/events/change_team_form.html b/events/templates/events/change_team_form.html new file mode 100644 index 0000000..84d102f --- /dev/null +++ b/events/templates/events/change_team_form.html @@ -0,0 +1,4 @@ + +{{ change_form }} +
+ \ No newline at end of file diff --git a/get_together/static/css/get_together.css b/get_together/static/css/get_together.css index 41d5fde..3462768 100644 --- a/get_together/static/css/get_together.css +++ b/get_together/static/css/get_together.css @@ -40,7 +40,15 @@ form { width: 16px; height: 16px; } +.gt-profile { + position: relative; +} +.gt-profile .gt-profile-badges { + position: absolute; + top: 24px; + left: 6px; +} .btn-googleplus { color: #FFFFFF; background-color: #DB4437; diff --git a/get_together/templates/get_together/events/change_team.html b/get_together/templates/get_together/events/change_team.html new file mode 100644 index 0000000..8b7a9f0 --- /dev/null +++ b/get_together/templates/get_together/events/change_team.html @@ -0,0 +1,24 @@ +{% extends "get_together/base.html" %} +{% load static %} +{% block content %} +

Change host for: {{event.name}}

+

Select which of your teams you would like to host this event.

+
+{% csrf_token %} +{% include "events/change_team_form.html" %} +
+ +Cancel +
+{% endblock %} + + +{% block javascript %} + +{% endblock %} diff --git a/get_together/templates/get_together/events/show_event.html b/get_together/templates/get_together/events/show_event.html index ae773b0..a1511fa 100644 --- a/get_together/templates/get_together/events/show_event.html +++ b/get_together/templates/get_together/events/show_event.html @@ -14,19 +14,10 @@ {% block styles %} {% endblock %} @@ -155,6 +146,7 @@ textarea {