show link to report dashboard if user has reported something

This commit is contained in:
Laura Klünder 2019-12-24 19:03:22 +01:00
parent 2a4f841070
commit 698aef7100
4 changed files with 55 additions and 3 deletions

View file

@ -29,7 +29,15 @@
{% trans 'You can review reports' %}
</p>
<p>
<a class="button" href="{% url 'site.report_list' %}">{% trans 'Show reports' %}</a>
<a class="button" href="{% url 'site.report_list' filter='open' %}">{% trans 'Show reports' %}</a>
</p>
{% elif user_has_reports %}
<hr>
<p>
{% trans 'You have submitted reports.' %}
</p>
<p>
<a class="button" href="{% url 'site.report_list' filter='all' %}">{% trans 'Show your reports' %}</a>
</p>
{% endif %}

View file

@ -303,7 +303,9 @@ def change_password_view(request):
@never_cache
@login_required(login_url='site.login')
def account_view(request):
return render(request, 'site/account.html', {})
return render(request, 'site/account.html', {
'user_has_reports': Report.user_has_reports(request.user),
})
@never_cache