summaryrefslogtreecommitdiffstats
path: root/askbot/templates/widgets
diff options
context:
space:
mode:
Diffstat (limited to 'askbot/templates/widgets')
-rw-r--r--askbot/templates/widgets/user_long_score_and_badge_summary.html6
-rw-r--r--askbot/templates/widgets/user_perms.html28
2 files changed, 32 insertions, 2 deletions
diff --git a/askbot/templates/widgets/user_long_score_and_badge_summary.html b/askbot/templates/widgets/user_long_score_and_badge_summary.html
index 35e4cb67..771a8f3f 100644
--- a/askbot/templates/widgets/user_long_score_and_badge_summary.html
+++ b/askbot/templates/widgets/user_long_score_and_badge_summary.html
@@ -1,7 +1,9 @@
{% set have_badges = user.gold or user.silver or user.bronze %}
{%- if karma_mode != 'hidden' -%}
-<a class="user-micro-info"
- href="{{user.get_absolute_url()}}?sort=reputation"
+<a
+ class="user-micro-info reputation"
+ href="{{user.get_absolute_url()}}?sort=reputation"
+ data-url="{% url 'get_perms_data' %}"
>{% trans %}karma:{% endtrans %} {{user.reputation}}</a>{% if badges_mode == 'public' and have_badges %},{% endif %}
{%- endif -%}
{% if badges_mode == 'public' and have_badges %}
diff --git a/askbot/templates/widgets/user_perms.html b/askbot/templates/widgets/user_perms.html
new file mode 100644
index 00000000..a51a8882
--- /dev/null
+++ b/askbot/templates/widgets/user_perms.html
@@ -0,0 +1,28 @@
+<!--h2>{% trans karma=user.reputation %}Your karma is {{ karma }}{% endtrans %}</h2-->
+<div class="triangle"></div>
+<p>
+ {% trans %}Karma reflects how valuable is your contribution to this community.{% endtrans %}
+</p>
+<p>
+ {% if user.is_administrator_or_moderator() %}
+ {% if user.is_moderator() %}
+ {% set role=gettext('moderator') %}
+ {% else %}
+ {% set role=gettext('administrator') %}
+ {% endif %}
+ {% trans %}Since you are the site {{ role }}, you have access to all functions regardless of your karma.{% endtrans %}
+ {% else %}
+ {% trans %}The higher is your karma, the more rights you have on this site.{% endtrans %}
+ {% endif %}
+</p>
+{% if not user.is_administrator_or_moderator() %}
+<p> {% trans %}Currently, you can:{% endtrans %}</p>
+<ul>
+ <li>{% trans %}Post questions, answers and comments{% endtrans %}</li>
+ {% for perm in perms_data %}
+ {% if user.reputation >= perm[1] %}
+ <li>{{ perm[0] }}</li>
+ {% endif %}
+ {% endfor %}
+</ul>
+{% endif %}