From 872f28db2e94b988ccf2dcac9786362deefccbc3 Mon Sep 17 00:00:00 2001 From: Evgeny Fadeev Date: Thu, 27 Jan 2011 15:14:34 -0500 Subject: refactored css classes on question stat counters --- askbot/skins/default/media/js/live_search.js | 9 ++++++--- askbot/skins/default/media/style/style.css | 18 ++++++++++-------- askbot/skins/default/templates/macros.html | 23 ++++++++++------------- askbot/views/users.py | 2 +- 4 files changed, 27 insertions(+), 25 deletions(-) diff --git a/askbot/skins/default/media/js/live_search.js b/askbot/skins/default/media/js/live_search.js index 4b6da7c5..965002f9 100644 --- a/askbot/skins/default/media/js/live_search.js +++ b/askbot/skins/default/media/js/live_search.js @@ -75,9 +75,9 @@ $(document).ready(function(){ }); }; - var render_counter = function(count, word, counter_class){ - var output = '
' + - '' + + var render_counter = function(count, word, counter_class, counter_subclass){ + var output = '
' + + '' + count; if (counter_class === 'accepted'){ output += '✓'; @@ -201,16 +201,19 @@ $(document).ready(function(){ render_counter( question['votes'], question['votes_word'], + 'votes', question['votes_class'] ) + render_counter( question['answers'], question['answers_word'], + 'answers', question['answers_class'] ) + render_counter( question['views'], question['views_word'], + 'views', question['views_class'] ) + render_user_info(question) + diff --git a/askbot/skins/default/media/style/style.css b/askbot/skins/default/media/style/style.css index c2df5a23..79aa2dd3 100755 --- a/askbot/skins/default/media/style/style.css +++ b/askbot/skins/default/media/style/style.css @@ -380,7 +380,8 @@ blockquote { } .short-summary .counts .votes div, -.short-summary .counts .views div +.short-summary .counts .views div, +.short-summary .counts .answers div { font-size: 12px; line-height:14px; @@ -391,36 +392,37 @@ blockquote { margin-top: 0; } -.no-votes { +.no-votes .item-count { background: white; color: gray; } -.some-votes { +.some-votes .item-count { background: #a3d0ff; color: #4a4a4a; } -.no-answers { +.no-answers .item-count { background: #b63333; color: yellow; } -.some-answers { +.some-answers .item-count { background: #ffed9c; color: #a4a4a4; } -.accepted { +.accepted .item-count { background:#338333; color:#d0f5a9; } -.no-views { +.no-views .item-count { background: gray; color: white; } -.some-views { +.some-views .item-count { background: #ff8c8c; color: #4a4a4a; } .short-summary .votes, +.short-summary .answers, .short-summary .views { text-align: center; margin: 0 3px; diff --git a/askbot/skins/default/templates/macros.html b/askbot/skins/default/templates/macros.html index 856d6a13..c93077f5 100644 --- a/askbot/skins/default/templates/macros.html +++ b/askbot/skins/default/templates/macros.html @@ -197,22 +197,18 @@ poor design of the data or methods on data objects #} {%- macro question_summary(question, extra_class=None) -%}
-
- {{question.score|humanize_counter}} + {%- endif -%}"> + {{question.score|humanize_counter}}
{% trans cnt=question.score %}vote{% pluralize %}votes{% endtrans %}
-
- + {{question.answer_count|humanize_counter}}{% if question.answer_accepted%}✓{% endif %}
{% trans cnt=question.answer_count %}answer{% pluralize %}answers{% endtrans %}
-
- {{question.view_count|humanize_counter}} + {%- endif -%}"> + {{question.view_count|humanize_counter}}
{% trans cnt=question.view_count %}view{% pluralize %}views{% endtrans %}
diff --git a/askbot/views/users.py b/askbot/views/users.py index faf00000..e68d1446 100644 --- a/askbot/views/users.py +++ b/askbot/views/users.py @@ -271,7 +271,7 @@ def edit_user(request, id): form = forms.EditUserForm(user) data = { 'active_tab': 'users', - 'page_class': 'user-profile-page', + 'page_class': 'user-profile-edit-page', 'form' : form, 'gravatar_faq_url' : reverse('faq') + '#gravatar', } -- cgit v1.2.3-1-g7c22