--- a/ForgeUserStats/forgeuserstats/templates/artifacts.html
+++ b/ForgeUserStats/forgeuserstats/templates/artifacts.html
@@ -9,7 +9,7 @@
{% block content %}
- {% if user %}
+ {% if user and (user.stats.visible or (c.user == user)) %}
<div class="grid-20">
<ul><li><a href="/userstats/{{user.username}}">Go back to general statistics</a></li></ul>
</div>
@@ -47,6 +47,19 @@
</table>
</div>
{% endif %}
+ {% else %}
+ {% if not user.stats.visible %}
+ <h2>Statistics not available</h2>
+ <div class="grid-20">
+ This user has set his or her preferences so that personal statistics are not visible
+ to other users of the forge.
+ </div>
+ {% else %}
+ <h2>Invalid user</h2>
+ <div class="grid-20">
+ You are looking for personal statistics of a user which doesn't exist on this forge. Check your url.
+ </div>
+ {% endif %}
{% endif %}
{% endblock %}