Exemple #1
0
    def get_context_data(self, **kwargs):
        context = super(ProjectDashboard, self).get_context_data(**kwargs)
        filter = VersionFilter(constants.IMPORTANT_VERSION_FILTERS, queryset=self.get_queryset())
        context['filter'] = filter

        bookmarks = Bookmark.objects.filter(user=self.request.user)

        if bookmarks.exists:
            context['bookmark_list'] = bookmarks[:3]
        else:
            bookmarks = None

        return context
Exemple #2
0
def project_dashboard(request):
    """
    A dashboard!  If you aint know what that means you aint need to.
    Essentially we show you an overview of your content.
    """
    qs = Version.objects.active(user=request.user).filter(
        project__users__in=[request.user])
    filter = VersionFilter(constants.IMPORTANT_VERSION_FILTERS, queryset=qs)
    return object_list(request,
                       queryset=request.user.projects.live(),
                       page=int(request.GET.get('page', 1)),
                       template_object_name='project',
                       template_name='projects/project_dashboard.html',
                       extra_context={
                           'filter': filter,
                       })