# HG changeset patch # User Brian Neal # Date 1466994451 18000 # Node ID deed541ca79d17b7e6bd6b249b281e954d782d8b # Parent d9cd3180c12cdd1935588733b729be47ec6f8842 Get rid of GCalendar thanks pages. diff -r d9cd3180c12c -r deed541ca79d gcalendar/urls.py --- a/gcalendar/urls.py Tue Jun 14 21:16:09 2016 -0500 +++ b/gcalendar/urls.py Sun Jun 26 21:27:31 2016 -0500 @@ -12,6 +12,4 @@ url(r'^change/$', gcalendar.views.edit_events, name='gcalendar-edit_events'), url(r'^change/(\d+)/$', gcalendar.views.edit_event, name='gcalendar-edit_event'), url(r'^delete/$', gcalendar.views.delete_event, name='gcalendar-delete'), - url(r'^thanks/add/$', gcalendar.views.add_thanks, name='gcalendar-add_thanks'), - url(r'^thanks/change/$', gcalendar.views.edit_thanks, name='gcalendar-edit_thanks'), ] diff -r d9cd3180c12c -r deed541ca79d gcalendar/views.py --- a/gcalendar/views.py Tue Jun 14 21:16:09 2016 -0500 +++ b/gcalendar/views.py Sun Jun 26 21:27:31 2016 -0500 @@ -35,6 +35,7 @@ @login_required def add_event(request): + thanks_flag = False if request.method == 'POST': form = EventEntryForm(request.POST) if form.is_valid(): @@ -42,25 +43,21 @@ event.user = request.user event.repeat = 'none' event.save(html=form.html) - return HttpResponseRedirect(reverse('gcalendar-add_thanks')) + return HttpResponseRedirect(reverse('gcalendar-add') + '?thanks=1') else: form = EventEntryForm() + thanks_flag = bool(request.GET.get('thanks', False)) return render(request, 'gcalendar/event.html', { 'title': 'Add Calendar Event', 'form': form, 'is_new': True, + 'thanks_flag': thanks_flag, 'V3_DESIGN': True, }) @login_required -def add_thanks(request): - return render(request, 'gcalendar/thanks_add.html', { - }) - - -@login_required def edit_events(request): events = Event.objects.filter(user=request.user, status=Event.ON_CAL).\ order_by('-start_date') @@ -73,6 +70,7 @@ return render(request, 'gcalendar/edit.html', { 'page': page, + 'thanks_flag': bool(request.GET.get('thanks', False)), 'V3_DESIGN': True, }) @@ -91,7 +89,7 @@ event.repeat = 'none' event.status = Event.EDIT_REQ event.save() - return HttpResponseRedirect(reverse('gcalendar-edit_thanks')) + return HttpResponseRedirect(reverse('gcalendar-edit_events') + '?thanks=1') else: form = EventEntryForm(instance=event) @@ -103,12 +101,6 @@ }) -@login_required -def edit_thanks(request): - return render(request, 'gcalendar/thanks_edit.html', { - }) - - def delete_event(request): """This view marks an event for deletion. It is called via AJAX.""" if request.user.is_authenticated(): diff -r d9cd3180c12c -r deed541ca79d sg101/templates/gcalendar/edit.html --- a/sg101/templates/gcalendar/edit.html Tue Jun 14 21:16:09 2016 -0500 +++ b/sg101/templates/gcalendar/edit.html Sun Jun 26 21:27:31 2016 -0500 @@ -12,6 +12,20 @@ +{% if thanks_flag %} +
+
Event Calendar Changes Received
+

+ Thanks for updating your event. + Your changes will be reviewed by the staff, and should appear on the calendar + shortly. You may be contacted if we have any questions. +

+ +
+{% endif %} +

Edit Calendar Events

{% if page.object_list %}

diff -r d9cd3180c12c -r deed541ca79d sg101/templates/gcalendar/event.html --- a/sg101/templates/gcalendar/event.html Tue Jun 14 21:16:09 2016 -0500 +++ b/sg101/templates/gcalendar/event.html Sun Jun 26 21:27:31 2016 -0500 @@ -21,6 +21,19 @@ +{% if thanks_flag %} +

+
Thanks for submitting an event!
+

+ Thanks for submitting an event to our calendar. Your event will be reviewed by the staff, + and should appear on the calendar shortly. You may be contacted if we have any questions. +

+ +
+{% endif %} +

{{ title }}

Use this form to add or change an event on our calendar. Please note the following: