Skip to content
This repository has been archived by the owner on Aug 20, 2018. It is now read-only.

Commit

Permalink
Merge pull request #233 from tessie/feature_fixBug1032426
Browse files Browse the repository at this point in the history
Fixed Bug 1032426 - Unclear that front page displays only some tasks
  • Loading branch information
bobsilverberg committed Jan 13, 2015
2 parents 99c9578 + d3db9fe commit fcdcc2f
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
7 changes: 7 additions & 0 deletions oneanddone/base/views.py
Expand Up @@ -4,6 +4,8 @@
from django.shortcuts import redirect
from django_filters.views import FilterView

from tower import ugettext as _

from oneanddone.tasks.filters import TasksFilterSet
from oneanddone.tasks.models import Task
from oneanddone.tasks.mixins import TaskMustBeAvailableMixin
Expand All @@ -17,6 +19,11 @@ class HomeView(TaskMustBeAvailableMixin, FilterView):
paginate_by = 10
filterset_class = TasksFilterSet

def get_context_data(self, *args, **kwargs):
ctx = super(HomeView, self).get_context_data(*args, **kwargs)
ctx['task_list_heading'] = _('Suggested First Tasks')
return ctx

def dispatch(self, request, *args, **kwargs):
if (request.user.is_authenticated() and
not UserProfile.objects.filter(user=request.user).exists()):
Expand Down
2 changes: 1 addition & 1 deletion oneanddone/tasks/templates/tasks/task_listing.html
@@ -1,6 +1,6 @@
<div class="task-list-container">
<h3>
Tasks
{{ task_list_heading }}
{% if request.GET.get('keyword', '') %}
{% trans keyword=request.GET['keyword'] %}
for keyword: {{ keyword }}
Expand Down
10 changes: 10 additions & 0 deletions oneanddone/tasks/views.py
Expand Up @@ -66,6 +66,11 @@ class AvailableTasksView(TaskMustBeAvailableMixin, FilterView):
template_name = 'tasks/list.html'
paginate_by = 10
filterset_class = TasksFilterSet

def get_context_data(self, *args, **kwargs):
ctx = super(AvailableTasksView, self).get_context_data(*args, **kwargs)
ctx['task_list_heading'] = _('Tasks')
return ctx


class CreateFeedbackView(LoginRequiredMixin, PrivacyPolicyRequiredMixin,
Expand Down Expand Up @@ -257,6 +262,11 @@ class ListTasksView(LoginRequiredMixin, MyStaffUserRequiredMixin, FilterView):
paginate_by = 20
filterset_class = TasksFilterSet

def get_context_data(self, *args, **kwargs):
ctx = super(ListTasksView, self).get_context_data(*args, **kwargs)
ctx['task_list_heading'] = _('Tasks')
return ctx


class LeaderboardView(generic.ListView):
template_name = 'tasks/leaderboard.html'
Expand Down

0 comments on commit fcdcc2f

Please sign in to comment.