Skip to content

Commit

Permalink
[#150] Greyed update button for all project pages
Browse files Browse the repository at this point in the history
  • Loading branch information
KasperBrandt committed Apr 24, 2014
1 parent 0e2db5c commit eb33ef0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions akvo/rsr/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -671,13 +671,15 @@ def projectcomments(request, project_id):
comments = Project.objects.get(id=project_id).comments.all().order_by('-time')
form = CommentForm()
updates = project.project_updates.all().order_by('-created_at')[:3]
can_add_update = project.connected_to_user(request.user)
return {
'project': project,
'comments': comments,
'form': form,
'project_section': 'comments',
'hide_comments': True,
'updates': updates,
'can_add_update': can_add_update
}


Expand Down Expand Up @@ -947,6 +949,7 @@ def projectdetails(request, project_id):
def projectpartners(request, project, draft=False, can_add_update=False):
updates = project.project_updates.all().order_by('-created_at')[:3]
comments = project.comments.all().order_by('-time')[:3]
can_add_update = project.connected_to_user(request.user)
return {
'can_add_update': can_add_update,
'draft': draft,
Expand All @@ -964,6 +967,7 @@ def projectfunding(request, project, draft=False, can_add_update=False):
public_donations = project.public_donations()
updates = project.project_updates.all().order_by('-created_at')[:3]
comments = project.comments.all().order_by('-time')[:3]
can_add_update = project.connected_to_user(request.user)
return {
'can_add_update': can_add_update,
'draft': draft,
Expand Down

0 comments on commit eb33ef0

Please sign in to comment.