summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNoahY <yuttadhammo@yahoo.com>2011-07-27 08:00:13 +0530
committerNoahY <yuttadhammo@yahoo.com>2011-07-27 08:00:13 +0530
commit33ee641f2765f3bf38ca76504ebf3da4d082c6ec (patch)
treeb41426afc4f0aedcb0f5a9d3052ac407f5a46425
parent10d4fa6380387aad06dfacb36940cbab71a2c698 (diff)
downloadaskbot-33ee641f2765f3bf38ca76504ebf3da4d082c6ec.tar.gz
askbot-33ee641f2765f3bf38ca76504ebf3da4d082c6ec.tar.bz2
askbot-33ee641f2765f3bf38ca76504ebf3da4d082c6ec.zip
abstracted question_type and answer_type from code
-rw-r--r--askbot/skins/default/templates/user_profile/user_stats.html4
-rw-r--r--askbot/views/users.py2
2 files changed, 4 insertions, 2 deletions
diff --git a/askbot/skins/default/templates/user_profile/user_stats.html b/askbot/skins/default/templates/user_profile/user_stats.html
index 1eefe2a3..7009acb5 100644
--- a/askbot/skins/default/templates/user_profile/user_stats.html
+++ b/askbot/skins/default/templates/user_profile/user_stats.html
@@ -107,7 +107,7 @@
<ul id="badge-context-{{ badge.id }}" class="badge-context-list" style="display:none">
{% for abt in awarded_badge_context %}
{% if abt.badge == badge.id %}
- {% if abt.content_type == 31 %}{# question #}
+ {% if abt.content_type == question_type %}
{% for question in questions %}{# could also create a new dict #}
{% if question.id == abt.object_id %}
<li>
@@ -117,7 +117,7 @@
{% endif %}
{% endfor %}
{% endif %}
- {% if abt.content_type == 36 %}{# answer #}
+ {% if abt.content_type == answer_type %}
{% for answered_question in answered_questions %}{# could also create a new dict #}
{% if answered_question.answer_id == abt.object_id %}
<li>
diff --git a/askbot/views/users.py b/askbot/views/users.py
index 2b9c4954..8bad5322 100644
--- a/askbot/views/users.py
+++ b/askbot/views/users.py
@@ -388,6 +388,8 @@ def user_stats(request, user, context):
'page_title' : _('user profile overview'),
'user_status_for_display': user.get_status_display(soft = True),
'questions' : questions,
+ 'question_type' : question_type,
+ 'answer_type' : answer_type,
'favorited_myself': favorited_myself,
'answered_questions' : answered_questions,
'up_votes' : up_votes,