def sidebar_widget(request): if SpecialQuestGame.disabled(): return '' user = request.user.get_profile().get_extension(SpecialQuestUser) count = len(user.active_tasks) if not count: return '' return render_to_string('specialquest/sidebar.html', {'not_done': count})
def sidebar_widget(context): user = context.get('user', None) if SpecialQuestGame.disabled() or not user or not user.is_authenticated(): return '' user = user.get_profile().get_extension(SpecialQuestUser) count = len(user.active_tasks) if not count: return '' return render_to_string('specialquest/sidebar.html', {'not_done': count, 'id': 'specialquest'})
def sidebar_widget(context): user = context.get('user', None) if SpecialQuestGame.disabled() or not user or not user.is_authenticated(): return '' user = user.get_profile().get_extension(SpecialQuestUser) count = len(user.active_tasks) if not count: return '' return render_to_string('specialquest/sidebar.html', {'not_done': count})
def header_link(request): profile = request.user.get_profile() if SpecialQuestGame.disabled(): return None if profile: user = profile.get_extension(SpecialQuestUser) count = len(user.active_tasks) else: count = 0 url = reverse('wouso.games.specialquest.views.index') return dict(link=url, count=count, text=_('Special'))
def sidebar_widget(request): if SpecialQuestGame.disabled(): return '' user = request.user.get_profile().get_extension(SpecialQuestUser) tasks = SpecialQuestTask.objects.all() today = date.today() tasks = [t for t in tasks if t not in user.done_tasks.all() and t.start_date <= today <= t.end_date] if not tasks: return '' return render_to_string('specialquest/sidebar.html', {'not_done': len(tasks)})
def sidebar_widget(request): if SpecialQuestGame.disabled(): return "" user = request.user.get_profile().get_extension(SpecialQuestUser) tasks = SpecialQuestTask.objects.all() today = date.today() tasks = [t for t in tasks if t not in user.done_tasks.all() and t.start_date <= today <= t.end_date] if not tasks: return "" return render_to_string("specialquest/sidebar.html", {"not_done": len(tasks)})
def header_link(context): user = context.get('user', None) if not user or not user.is_authenticated() or SpecialQuestGame.disabled(): return {} profile = user.get_profile() if profile: user = profile.get_extension(SpecialQuestUser) count = len(user.active_tasks) else: count = 0 url = reverse('wouso.games.specialquest.views.index') return dict(link=url, count=count, text=_('Special'))
def header_link(request): profile = request.user.get_profile() if SpecialQuestGame.disabled(): return None if profile: user = profile.get_extension(SpecialQuestUser) tasks = SpecialQuestTask.objects.all() today = date.today() tasks = [t for t in tasks if t not in user.done_tasks.all() and t.start_date <= today <= t.end_date] count = len(tasks) else: count = 0 url = reverse('wouso.games.specialquest.views.index') return dict(link=url, count=count, text=_('Special'))
def header_link(request): profile = request.user.get_profile() if SpecialQuestGame.disabled(): return None if profile: user = profile.get_extension(SpecialQuestUser) tasks = SpecialQuestTask.objects.all() today = date.today() tasks = [t for t in tasks if t not in user.done_tasks.all() and t.start_date <= today <= t.end_date] count = len(tasks) else: count = 0 url = reverse("wouso.games.specialquest.views.index") return dict(link=url, count=count, text=_("Special"))