Merge lp:~svwilliams/loco-team-portal/707123-add-child-task-from-update into lp:loco-team-portal

Proposed by Stephen V. Williams
Status: Merged
Merged at revision: 640
Proposed branch: lp:~svwilliams/loco-team-portal/707123-add-child-task-from-update
Merge into: lp:loco-team-portal
Diff against target: 75 lines (+12/-2)
3 files modified
loco_directory/meetings/urls.py (+1/-0)
loco_directory/meetings/views.py (+10/-2)
loco_directory/templates/meetings/agenda_item_update.html (+1/-0)
To merge this branch: bzr merge lp:~svwilliams/loco-team-portal/707123-add-child-task-from-update
Reviewer Review Type Date Requested Status
Michael Hall (community) Needs Fixing
Review via email: mp+82802@code.launchpad.net

Commit message

/templates/meeting/agenda_item_update.html - Added a link-button to update the take the user to add-item-add-child passing team meeting and agenda item
meeting/url.py - Added a url redirect linking the add-item-add-child to add-item-new
meeting/view.py - Added agenda-item-id to add-item new setting it to None automatically and set the parent id of the new agenda item if it is set

Description of the change

/templates/meeting/agenda_item_update.html - Added a link-button to update the take the user to add-item-add-child passing team meeting and agenda item
meeting/url.py - Added a url redirect linking the add-item-add-child to add-item-new
meeting/view.py - Added agenda-item-id to add-item new setting it to None automatically and set the parent id of the new agenda item if it is set

Does not save the update agenda item before going to the new agenda item. This may need to be done before this is pushed in or could be set as another bitsize bug ... up to the reviewer

To post a comment you must log in.
Revision history for this message
Michael Hall (mhall119) wrote :

On line 21 of the diff, attribute=none doesn't seem to belong. What is this for?

review: Needs Fixing
Revision history for this message
Adnane Belmadiaf (daker) wrote :

Hey Stephen, any update on this ?

Revision history for this message
Stephen V. Williams (svwilliams) wrote :

Hi Adnane,

I'll have to double check. I got behind on all of the stuff I was doing for
the portal with changing jobs and moving to Colorado. I'll check tonight
and get back with you ASAP. My recollection is I fixed the line, but I may
have forgotten to push to launchpad.

Thank you,
Stephen

*Stephen V. Williams*
Software Engineer

<http://plus.google.com/110344925712015359478/about>

On Mon, Nov 5, 2012 at 2:22 PM, Adnane Belmadiaf <email address hidden>wrote:

> Hey Stephen, any update on this ?
> --
>
> https://code.launchpad.net/~svwilliams/loco-team-portal/707123-add-child-task-from-update/+merge/82802
> You are the owner of
> lp:~svwilliams/loco-team-portal/707123-add-child-task-from-update.
>

Revision history for this message
Adnane Belmadiaf (daker) wrote :

Thanks Stephen i have merged this.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'loco_directory/meetings/urls.py'
2--- loco_directory/meetings/urls.py 2011-03-16 18:35:53 +0000
3+++ loco_directory/meetings/urls.py 2011-11-19 23:27:24 +0000
4@@ -17,6 +17,7 @@
5 url(r'^add/$', 'meetings.views.team_meeting_select', name='team-meeting-select'),
6
7 url(r'^team/(?P<team_meeting_id>\d+)/agenda/(?P<agenda_item_id>\d+)/delete/$', 'meetings.views.agenda_item_delete', name='agenda-item-delete'),
8+ url(r'^team/(?P<team_meeting_id>\d+)/agenda/(?P<agenda_item_id>\d+)/add-child/$', 'meetings.views.agenda_item_new', name='agenda-item-add-child'),
9 url(r'^team/(?P<team_meeting_id>\d+)/agenda/(?P<agenda_item_id>\d+)/update/$', 'meetings.views.agenda_item_update', name='agenda-item-update'),
10 url(r'^team/(?P<team_meeting_id>\d+)/agenda/add/$', 'meetings.views.agenda_item_new', name='agenda-item-new'),
11
12
13=== modified file 'loco_directory/meetings/views.py'
14--- loco_directory/meetings/views.py 2011-03-18 13:37:13 +0000
15+++ loco_directory/meetings/views.py 2011-11-19 23:27:24 +0000
16@@ -259,7 +259,7 @@
17 return redirect( team_meeting_object )
18 else:
19 form = TeamMeetingForm(instance=team_meeting_object)
20-
21+ attribute=none
22 context = {
23 'form': form,
24 }
25@@ -270,10 +270,11 @@
26 return redirect( team_meeting_object )
27
28 @login_required
29-def agenda_item_new(request, team_meeting_id):
30+def agenda_item_new(request, team_meeting_id, agenda_item_id=None):
31 """
32 new agenda item
33 """
34+
35 team_meeting_object = get_object_or_404(TeamMeeting, pk=team_meeting_id)
36 try:
37 user = UserProfile.objects.get(user=request.user)
38@@ -283,6 +284,11 @@
39 except UserProfile.DoesNotExist:
40 agenda_item_object = AgendaItem(meeting=team_meeting_object,
41 created_date=datetime.datetime.now())
42+
43+ #coming from another agenda item we pass the agenda id to set it as the parent
44+ if agenda_item_id != None:
45+ agenda_item_object.parent = get_object_or_404(AgendaItem, pk=agenda_item_id)
46+
47 is_member = False
48 for team in team_meeting_object.teams.all():
49 if launchpad.is_team_member(request.user, team):
50@@ -311,11 +317,13 @@
51 request.user.message_set.create(message='%s %s' % (_('You can not add a new agenda item for this team meeting.'), _('You are not a member of the team or on the LoCo Council.')))
52 return redirect( team_meeting_object )
53
54+
55 @login_required
56 def agenda_item_update(request, team_meeting_id, agenda_item_id):
57 """
58 update agenda item
59 """
60+
61 team_meeting_object = get_object_or_404(TeamMeeting, pk=team_meeting_id)
62 agenda_item_object = get_object_or_404(AgendaItem, pk=agenda_item_id)
63 #check if user is admin or owner of a team
64
65=== modified file 'loco_directory/templates/meetings/agenda_item_update.html'
66--- loco_directory/templates/meetings/agenda_item_update.html 2011-10-05 00:50:53 +0000
67+++ loco_directory/templates/meetings/agenda_item_update.html 2011-11-19 23:27:24 +0000
68@@ -6,6 +6,7 @@
69 {% block sub_nav_links %}
70 <a class="sub-nav-item" href="{% url team-meeting-detail team_meeting_object.first_team.lp_name team_meeting_object.id %}">{% trans "Back to Meeting Details" %}</a>
71 <a class="sub-nav-item" href="{% url agenda-item-delete team_meeting_object.id agenda_item_object.id %}">{% trans "Delete Agenda Item" %}</a>
72+<a class="sub-nav-item" href="{% url agenda-item-add-child team_meeting_object.id agenda_item_object.id %}">{% trans "Add Child Item" %}</a>
73 {% endblock %}
74
75 {% block extrahead %}{{ block.super }}

Subscribers

People subscribed via source and target branches