summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEvgeny Fadeev <evgeny.fadeev@gmail.com>2011-01-27 15:14:34 -0500
committerEvgeny Fadeev <evgeny.fadeev@gmail.com>2011-01-27 15:14:34 -0500
commit872f28db2e94b988ccf2dcac9786362deefccbc3 (patch)
tree48cf40bedae42b0cc93b606c82ab0ab1f5c9ba5d
parent6ef8d47b8e1a4c738dcd0265c3fb1ff06bc327d7 (diff)
downloadaskbot-872f28db2e94b988ccf2dcac9786362deefccbc3.tar.gz
askbot-872f28db2e94b988ccf2dcac9786362deefccbc3.tar.bz2
askbot-872f28db2e94b988ccf2dcac9786362deefccbc3.zip
refactored css classes on question stat counters
-rw-r--r--askbot/skins/default/media/js/live_search.js9
-rwxr-xr-xaskbot/skins/default/media/style/style.css18
-rw-r--r--askbot/skins/default/templates/macros.html23
-rw-r--r--askbot/views/users.py2
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 = '<div class="votes">' +
- '<span class="item-count ' + counter_class + '">' +
+ var render_counter = function(count, word, counter_class, counter_subclass){
+ var output = '<div class="' + counter_class + ' ' + counter_subclass + '">' +
+ '<span class="item-count">' +
count;
if (counter_class === 'accepted'){
output += '&#10003;';
@@ -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) -%}
<div class="short-summary{% if extra_class %} {{extra_class}}{% endif %}">
<div class="counts">
- <div class="votes">
- <span
- class="item-count
+ <div class="votes
{% if question.score == 0 -%}
no-votes
{% else -%}
some-votes
- {%- endif -%}"
- >{{question.score|humanize_counter}}</span>
+ {%- endif -%}">
+ <span class="item-count">{{question.score|humanize_counter}}</span>
<div>
{% trans cnt=question.score %}vote{% pluralize %}votes{% endtrans %}
</div>
</div>
- <div class="votes">
- <span
- class="item-count
+ <div class="answers
{% if question.answer_count == 0 -%}
no-answers
{% else -%}
@@ -221,20 +217,21 @@ poor design of the data or methods on data objects #}
{%- else -%}
some-answers
{%- endif -%}
- {%- endif -%}"
+ {%- endif -%}">
+ <span
+ class="item-count"
>{{question.answer_count|humanize_counter}}{% if question.answer_accepted%}&#10003;{% endif %}</span>
<div>
{% trans cnt=question.answer_count %}answer{% pluralize %}answers{% endtrans %}
</div>
</div>
- <div class="views">
- <span class="item-count
+ <div class="views
{% if question.view_count == 0 -%}
no-views
{% else -%}
some-views
- {%- endif -%}"
- >{{question.view_count|humanize_counter}}</span>
+ {%- endif -%}">
+ <span class="item-count">{{question.view_count|humanize_counter}}</span>
<div>
{% trans cnt=question.view_count %}view{% pluralize %}views{% endtrans %}
</div>
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',
}