summaryrefslogtreecommitdiffstats
path: root/askbot/templates
diff options
context:
space:
mode:
authorEvgeny Fadeev <evgeny.fadeev@gmail.com>2013-05-26 12:59:15 -0400
committerEvgeny Fadeev <evgeny.fadeev@gmail.com>2013-05-26 12:59:20 -0400
commit31614f4da0ef5d2d28d427cea4d5a1200f7573e6 (patch)
treea9416483737e9b00d9afca52eea9d73bae3a9410 /askbot/templates
parent94d5a526148b3899aeaa1d6f289c7b0e588395b5 (diff)
downloadaskbot-31614f4da0ef5d2d28d427cea4d5a1200f7573e6.tar.gz
askbot-31614f4da0ef5d2d28d427cea4d5a1200f7573e6.tar.bz2
askbot-31614f4da0ef5d2d28d427cea4d5a1200f7573e6.zip
added a hovercard to the user karma display shown in the page header
Diffstat (limited to 'askbot/templates')
-rw-r--r--askbot/templates/meta/bottom_scripts.html5
-rw-r--r--askbot/templates/widgets/user_long_score_and_badge_summary.html6
-rw-r--r--askbot/templates/widgets/user_perms.html28
3 files changed, 37 insertions, 2 deletions
diff --git a/askbot/templates/meta/bottom_scripts.html b/askbot/templates/meta/bottom_scripts.html
index e707b29f..5c398358 100644
--- a/askbot/templates/meta/bottom_scripts.html
+++ b/askbot/templates/meta/bottom_scripts.html
@@ -98,6 +98,11 @@
var group_dropdown = new GroupDropdown({{ group_list }});
$('.dropdown').append(group_dropdown.getElement());
}
+ var userRep = $('#userToolsNav .reputation');
+ if (userRep.length) {
+ var showPermsTrigger = new ShowPermsTrigger();
+ showPermsTrigger.decorate(userRep);
+ }
});
if (askbot['data']['haveFlashNotifications']) {
$('#validate_email_alert').click(function(){notify.close(true)})
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 %}