Merge lp:~mhall119/loco-team-portal/fixes-537563 into lp:loco-team-portal

Proposed by Michael Hall
Status: Superseded
Proposed branch: lp:~mhall119/loco-team-portal/fixes-537563
Merge into: lp:loco-team-portal
Diff against target: 69 lines (+14/-5)
3 files modified
loco_directory/events/views.py (+10/-4)
loco_directory/templates/events/global_event_detail_attending_teamevents.inc.html (+3/-0)
loco_directory/templates/events/team_event_new_select.html (+1/-1)
To merge this branch: bzr merge lp:~mhall119/loco-team-portal/fixes-537563
Reviewer Review Type Date Requested Status
LoCo Team Portal Developers Pending
Review via email: mp+21248@code.launchpad.net

This proposal has been superseded by a proposal from 2010-03-16.

Description of the change

Adds a link to the Global Event details page (only if the current user is a team admin) to create a new Team Event for the given Global Event. This takes the user to the screen to add a team event (or team select screen if they are admin on more than one team), and populates the Global Event field for them.

To post a comment you must log in.
70. By Michael Hall

Added next= parameter to login url so that users are always redirected back to the page they were on

71. By Michael Hall

Create Django groups for LP Teams

72. By Michael Hall

Create Django groups for LP Teams

73. By Michael Hall

Allow team members to create and edit team events

Revision history for this message
Daniel Holbach (dholbach) wrote :

Should this probably be updated to allow every team member to add stuff?

74. By Dave Walker

Removed rule.png reference in base.html as it has never existed, and doesn't seem to be required. (LP: #494594)

75. By Daniel Holbach

release 0.2.1

Revision history for this message
Michael Hall (mhall119) wrote :

Yes, I will update it and resubmit

76. By Michael Hall

Update from trunk

77. By Michael Hall

Updated check to see if user is a member of a team, not just the admin of a team

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'loco_directory/events/views.py'
2--- loco_directory/events/views.py 2010-03-15 18:09:25 +0000
3+++ loco_directory/events/views.py 2010-03-16 16:00:49 +0000
4@@ -1,5 +1,5 @@
5 from django.template import RequestContext
6-from django.http import HttpResponse
7+from django.http import HttpResponse, HttpResponseRedirect
8 from django.shortcuts import render_to_response
9 from django.shortcuts import get_object_or_404
10 from django.contrib.auth.decorators import login_required
11@@ -135,9 +135,14 @@
12 request.user.message_set.create(message=_('You can not add a new team event'))
13 return redirect( 'event-list' )
14 elif len(teams) == 1:
15- return redirect('team-event-new', teams[0].lp_name)
16+ from django.core import urlresolvers
17+ url = urlresolvers.reverse('team-event-new', args=[teams[0].lp_name])
18+ if request.GET.has_key('global_event_id'):
19+ return HttpResponseRedirect('%s?global_event_id=%s' % (url, request.GET.get('global_event_id', None)))
20+ else:
21+ return HttpResponseRedirect(url)
22 else:
23- context = {'teams': teams}
24+ context = {'teams': teams, 'global_event_id': request.GET.get('global_event_id', None)}
25 return render_to_response('events/team_event_new_select.html', context, RequestContext(request))
26
27 def team_events_rss(request, team_slug):
28@@ -181,7 +186,7 @@
29 request.user.message_set.create(message=_('New event created'))
30 return redirect( team_object )
31 else:
32- form = TeamEventForm()
33+ form = TeamEventForm(initial={'global_event':request.GET.get('global_event_id', None)})
34
35 context = {
36 'team_object': team_object,
37@@ -294,6 +299,7 @@
38 global_event_object = get_object_or_404(GlobalEvent, pk=global_event_id)
39 context = {
40 'global_event_object': global_event_object,
41+ 'add_team_event': Team.objects.filter(admins__lpid=request.user.username),
42 }
43 return render_to_response('events/global_event_detail.html',
44 context, RequestContext(request))
45
46=== modified file 'loco_directory/templates/events/global_event_detail_attending_teamevents.inc.html'
47--- loco_directory/templates/events/global_event_detail_attending_teamevents.inc.html 2010-01-10 20:39:23 +0000
48+++ loco_directory/templates/events/global_event_detail_attending_teamevents.inc.html 2010-03-16 16:00:49 +0000
49@@ -6,4 +6,7 @@
50 {% endfor %}
51 </ul>
52 {% endif %}
53+{% if add_team_event %}
54+<a href="{% url team-event-select %}?global_event_id={{global_event_object.id}}">{% trans "Add your Team's Event" %}</a>
55+{% endif %}
56
57
58=== modified file 'loco_directory/templates/events/team_event_new_select.html'
59--- loco_directory/templates/events/team_event_new_select.html 2010-01-20 15:44:13 +0000
60+++ loco_directory/templates/events/team_event_new_select.html 2010-03-16 16:00:49 +0000
61@@ -6,7 +6,7 @@
62 {% block content %}
63 <h1>{% trans "Select a Team to add an Event for" %}</h1>
64 {% for team in teams %}
65-<h2><a href="{%url team-event-new team.lp_name%}">{{team.name}}</a></h2>
66+<h2><a href="{%url team-event-new team.lp_name%}{% if global_event_id %}?global_event_id={{global_event_id}}{% endif %}">{{team.name}}</a></h2>
67 {% endfor %}
68
69 {% endblock %}

Subscribers

People subscribed via source and target branches