Beispiel #1
0
    def project_notes(self):
        """Get notes and note form for the project."""

        notes = self.object.notes.all().order_by('-creation_date')
        form = NoteForm()

        return {'notes': notes, 'form': form}
Beispiel #2
0
    def task_notes(self):
        """Get notes and note form for tasks."""

        self.object = self.get_object()
        notes = self.object.notes.all().order_by('-creation_date')
        form = NoteForm()
        return {'notes': notes, 'form': form}
Beispiel #3
0
    def notes(self):
        """Get all user notes associated with user and note form."""

        notes = self.object.note_set.filter(
            note_type="USER").order_by('-creation_date')
        form = NoteForm()

        return {'notes': notes, 'form': form}
Beispiel #4
0
def include_private_message_form(request):
    return {}
    if request.user.is_authenticated():
        privatemessageform = PrivateMessageForm(request=request)
        usernoteform = NoteForm()
        return {'privatemessageform': privatemessageform, 'usernoteform': usernoteform}
    else:
        return {}
Beispiel #5
0
 def get_context_data(self, pk):
     task = get_object_or_404(Task, pk=pk)
     form = NoteForm()
     notes = task.notes.all().order_by('-creation_date')
     return {
         'task': task,
         'form': form,
         'notes': notes,
     }
Beispiel #6
0
 def get_context_data(self, pk):
     event = get_object_or_404(Event, pk=pk)
     form = NoteForm()
     notes = event.notes.all().order_by('-creation_date')
     return {
         'event': event,
         'form': form,
         'notes': notes,
     }
Beispiel #7
0
 def get_context_data(self, pk):
     story = get_object_or_404(Story, pk=pk)
     form = NoteForm()
     notes = story.notes.all().order_by('-creation_date')
     return {
         'story': story,
         'form': form,
         'notes': notes,
     }
Beispiel #8
0
 def get_context_data(self, pk):
     project = get_object_or_404(Project, pk=pk)
     form = NoteForm()
     notes = project.notes.all().order_by('-creation_date')
     return {
         'project': project,
         'form': form,
         'notes': notes,
     }
Beispiel #9
0
 def get_context_data(self, pk):
     user = get_object_or_404(User, pk=pk)
     form = NoteForm()
     notes = user.notes.all().order_by('-creation_date')
     return {
         'user': user,
         'form': form,
         'notes': notes,
     }
Beispiel #10
0
 def get_context_data(self, pk):
     network = get_object_or_404(Network, pk=pk)
     form = NoteForm()
     notes = network.notes.all().order_by('-creation_date')
     return {
         'network': network,
         'form': form,
         'notes': notes,
     }
Beispiel #11
0
 def get_context_data(self, pk):
     organization = get_object_or_404(Organization, pk=pk)
     form = NoteForm()
     notes = organization.notes.all().order_by('-creation_date')
     all_notes = organization.notes.all()
     return {
         'organization': organization,
         'form': form,
         'notes': notes,
     }
Beispiel #12
0
    def get_context_data(self, **kwargs):
        """Add related info."""

        context = super(OrganizationDetailView,
                        self).get_context_data(**kwargs)

        form = NoteForm()
        notes = self.object.notes.order_by('-creation_date')[:4]
        # users = Organization.get_org_users(self.object)
        organizationcomments = Comment.objects.filter(
            discussion=self.object.discussion).order_by('date')
        organizationcommentform = CommentForm()

        context.update({
            'form': form,
            'notes': notes,
            'organizationcomments': organizationcomments,
            'organizationcommentform': organizationcommentform,
        })
        return context
Beispiel #13
0
    def get_context_data(self, **kwargs):
        """Get network related info."""

        context = super(NetworkDetailView, self).get_context_data(**kwargs)

        form = NoteForm()
        notes = self.object.notes.order_by('-creation_date')[:4]
        comments = self.object.discussion.comment_set.all().order_by('date')
        commentform = CommentForm()
        networkinvitationform = InviteToNetworkForm()

        context.update({
            'notes': notes,
            'form': form,
            'comments': comments,
            'commentform': commentform,
            'networkinvitationform': networkinvitationform,
        })

        return context