diff options
-rw-r--r-- | askbot/conf/skin_counter_settings.py | 71 | ||||
-rwxr-xr-x | askbot/skins/default/media/style/style.css | 13 | ||||
-rw-r--r-- | askbot/skins/default/templates/question_list.html | 49 | ||||
-rw-r--r-- | askbot/skins/default/templates/questions.html | 54 | ||||
-rw-r--r-- | askbot/skins/default/templates/tag_selector.html | 2 | ||||
-rw-r--r-- | askbot/skins/default/templates/users_questions.html | 50 | ||||
-rw-r--r-- | askbot/views/readers.py | 6 |
7 files changed, 177 insertions, 68 deletions
diff --git a/askbot/conf/skin_counter_settings.py b/askbot/conf/skin_counter_settings.py index d7037693..dab36803 100644 --- a/askbot/conf/skin_counter_settings.py +++ b/askbot/conf/skin_counter_settings.py @@ -16,7 +16,8 @@ settings.register( SKIN_COUNTER_SETTINGS, 'VOTE_COUNTER_EXPECTED_MAXIMUM', default=3, - description=_('Vote counter value to give "full color"') + description=_('Vote counter value to give "full color"'), + hidden=True, ) ) @@ -26,7 +27,8 @@ settings.register( 'COLORS_VOTE_COUNTER_EMPTY_BG', default='white', description=_('Background color for votes = 0'), - help_text=_('HTML color name of hex value') + help_text=_('HTML color name of hex value'), + hidden=True, ) ) @@ -36,7 +38,8 @@ settings.register( 'COLORS_VOTE_COUNTER_EMPTY_FG', default='gray', description=_('Foreground color for votes = 0'), - help_text=_('HTML color name of hex value') + help_text=_('HTML color name of hex value'), + hidden=True, ) ) @@ -44,8 +47,8 @@ settings.register( StringValue( SKIN_COUNTER_SETTINGS, 'COLORS_VOTE_COUNTER_MIN_BG', - default='white', - description=_('Background color for votes = 1'), + default='#a3d0ff', + description=_('Background color for votes'), help_text=_('HTML color name of hex value') ) ) @@ -54,8 +57,8 @@ settings.register( StringValue( SKIN_COUNTER_SETTINGS, 'COLORS_VOTE_COUNTER_MIN_FG', - default='black', - description=_('Foreground color for votes = 1'), + default='#4a4a4a', + description=_('Foreground color for votes'), help_text=_('HTML color name of hex value') ) ) @@ -66,7 +69,8 @@ settings.register( 'COLORS_VOTE_COUNTER_MAX_BG', default='#a9d0f5', description=_('Background color for votes = MAX'), - help_text=_('HTML color name of hex value') + help_text=_('HTML color name of hex value'), + hidden=True, ) ) @@ -78,7 +82,8 @@ settings.register( settings.COLORS_VOTE_COUNTER_MAX_BG ).DarkerColor(0.7).html, description=_('Foreground color for votes = MAX'), - help_text=_('HTML color name of hex value') + help_text=_('HTML color name of hex value'), + hidden=True, ) ) @@ -87,7 +92,8 @@ settings.register( SKIN_COUNTER_SETTINGS, 'VIEW_COUNTER_EXPECTED_MAXIMUM', default=100, - description=_('View counter value to give "full color"') + description=_('View counter value to give "full color"'), + hidden=True, ) ) @@ -97,7 +103,8 @@ settings.register( 'COLORS_VIEW_COUNTER_EMPTY_BG', default='gray', description=_('Background color for views = 0'), - help_text=_('HTML color name of hex value') + help_text=_('HTML color name of hex value'), + hidden=True, ) ) @@ -107,7 +114,8 @@ settings.register( 'COLORS_VIEW_COUNTER_EMPTY_FG', default='white', description=_('Foreground color for views = 0'), - help_text=_('HTML color name of hex value') + help_text=_('HTML color name of hex value'), + hidden=True, ) ) @@ -115,8 +123,8 @@ settings.register( StringValue( SKIN_COUNTER_SETTINGS, 'COLORS_VIEW_COUNTER_MIN_BG', - default='#D0F5A9', - description=_('Background color for views = 1'), + default='#ff8c8c', + description=_('Background color for views'), help_text=_('HTML color name of hex value') ) ) @@ -125,10 +133,8 @@ settings.register( StringValue( SKIN_COUNTER_SETTINGS, 'COLORS_VIEW_COUNTER_MIN_FG', - default=Color.NewFromHtml( - settings.COLORS_VIEW_COUNTER_MIN_BG - ).DarkerColor(0.6).html, - description=_('Foreground color for views = 1'), + default='#4a4a4a', + description=_('Foreground color for views'), help_text=_('HTML color name of hex value') ) ) @@ -139,7 +145,8 @@ settings.register( 'COLORS_VIEW_COUNTER_MAX_BG', default='#FF8000', description=_('Background color for views = MAX'), - help_text=_('HTML color name of hex value') + help_text=_('HTML color name of hex value'), + hidden=True, ) ) @@ -151,7 +158,8 @@ settings.register( settings.COLORS_VIEW_COUNTER_MAX_BG ).DarkerColor(0.7).html, description=_('Foreground color for views = MAX'), - help_text=_('HTML color name of hex value') + help_text=_('HTML color name of hex value'), + hidden=True, ) ) @@ -160,7 +168,8 @@ settings.register( SKIN_COUNTER_SETTINGS, 'ANSWER_COUNTER_EXPECTED_MAXIMUM', default=4, - description=_('Answer counter value to give "full color"') + description=_('Answer counter value to give "full color"'), + hidden=True, ) ) @@ -172,7 +181,8 @@ settings.register( Color.NewFromHtml('white'),0.8 ).html, description=_('Background color for answers = 0'), - help_text=_('HTML color name of hex value') + help_text=_('HTML color name of hex value'), + hidden=True, ) ) @@ -182,7 +192,8 @@ settings.register( 'COLORS_ANSWER_COUNTER_EMPTY_FG', default='yellow', description=_('Foreground color for answers = 0'), - help_text=_('HTML color name of hex value') + help_text=_('HTML color name of hex value'), + hidden=True, ) ) @@ -190,8 +201,8 @@ settings.register( StringValue( SKIN_COUNTER_SETTINGS, 'COLORS_ANSWER_COUNTER_MIN_BG', - default='#AEB404', - description=_('Background color for answers = 1'), + default='#ffed9c', + description=_('Background color for answers'), help_text=_('HTML color name of hex value') ) ) @@ -200,8 +211,8 @@ settings.register( StringValue( SKIN_COUNTER_SETTINGS, 'COLORS_ANSWER_COUNTER_MIN_FG', - default='white', - description=_('Foreground color for answers = 1'), + default='#a4a4a4', + description=_('Foreground color for answers'), help_text=_('HTML color name of hex value') ) ) @@ -214,7 +225,8 @@ settings.register( Color.NewFromHtml('white'),0.75 ).html, description=_('Background color for answers = MAX'), - help_text=_('HTML color name of hex value') + help_text=_('HTML color name of hex value'), + hidden=True, ) ) @@ -224,7 +236,8 @@ settings.register( 'COLORS_ANSWER_COUNTER_MAX_FG', default='#ffff00', description=_('Foreground color for answers = MAX'), - help_text=_('HTML color name of hex value') + help_text=_('HTML color name of hex value'), + hidden=True, ) ) diff --git a/askbot/skins/default/media/style/style.css b/askbot/skins/default/media/style/style.css index 8471bdca..709e30f5 100755 --- a/askbot/skins/default/media/style/style.css +++ b/askbot/skins/default/media/style/style.css @@ -335,9 +335,9 @@ blockquote { border-right: 1px solid #820000; border-top: 1px solid #d40000; border-left: 1px solid #d40000; /*background:#A31E39; */ - background: #a40000; + background: #b03a48; color: #FFF; - font-weight: 600; + font-weight: 800; text-decoration: none } @@ -587,11 +587,18 @@ blockquote { } .short-summary .counts .item-count { - padding-top:4px; + border:1px solid #cccccc; + -moz-border-radius:5px; + -webkit-border-radius:5px; + padding:0px 5px 0px 5px; font-size: 17px; font-weight: 800; } +.short-summary .counts .votes div { + padding-top:1px; +} + .short-summary .votes, .short-summary .status, .short-summary .views { diff --git a/askbot/skins/default/templates/question_list.html b/askbot/skins/default/templates/question_list.html index 3410c6ae..3f5d701b 100644 --- a/askbot/skins/default/templates/question_list.html +++ b/askbot/skins/default/templates/question_list.html @@ -3,10 +3,55 @@ {% load humanize %} {% load extra_filters %} {% load extra_tags %} - {% for question in questions.object_list %} <div class="short-summary"> - {% question_counter_widget question %} + <div class="counts"> + <div class="votes"> + <span + class="item-count" + style="background:{{settings.COLORS_VOTE_COUNTER_MIN_BG}};color:{{settings.COLORS_VOTE_COUNTER_MIN_FG}}" + >{{question.score|humanize_counter}}</span> + <div> + {% blocktrans count question.score as cnt %} + vote + {% plural %} + votes + {% endblocktrans %} + </div> + </div > + {% comment %} + <div {% if question.answer_accepted %}title="{% trans "this answer has been accepted to be correct" %}"{% endif %} class="status {% if question.answer_accepted %}answered-accepted{% endif %} {% ifequal question.answer_count 0 %}unanswered{% endifequal %}{% ifnotequal question.answer_count 0 %}answered{% endifnotequal %}"> + {% endcomment %} + <div class="votes"> + <span + class="item-count" + {% if question.answer_accepted %} + style="background:{{settings.COLORS_ANSWER_COUNTER_ACCEPTED_BG}};color:{{settings.COLORS_ANSWER_COUNTER_ACCEPTED_FG}}" + {% else %} + style="background:{{settings.COLORS_ANSWER_COUNTER_MIN_BG}};color:{{settings.COLORS_ANSWER_COUNTER_MIN_FG}}" + {% endif %} + >{{question.answer_count|humanize_counter}}</span> + <div> + {% blocktrans count question.answer_count as cnt %} + answer + {% plural %} + answers + {% endblocktrans %} + </div> + </div> + <div class="votes"> + <span class="item-count" + style="background:{{settings.COLORS_VIEW_COUNTER_MIN_BG}};color:{{settings.COLORS_VIEW_COUNTER_MIN_FG}}" + >{{question.view_count|humanize_counter}}</span> + <div> + {% blocktrans count question.view_count as cnt %} + view + {% plural %} + views + {% endblocktrans %} + </div> + </div> + </div> <h2><a title="{{question.summary}}" href="{% url question id=question.id %}{{question.title|slugify}}">{{question.title}}</a></h2> <div class="userinfo"> <span class="relativetime" title="{{question.last_activity_at}}">{% diff_date question.last_activity_at %}</span> diff --git a/askbot/skins/default/templates/questions.html b/askbot/skins/default/templates/questions.html index a0a5265b..e2fdd3cf 100644 --- a/askbot/skins/default/templates/questions.html +++ b/askbot/skins/default/templates/questions.html @@ -120,10 +120,13 @@ {% if questions_count > 0 %} <div style="clear:both"> <p style="float:right;margin:3px 3px 0 0;"> - (<a style=text-decoration:none;" + (<a style="text-decoration:none;" href="{{settings.APP_URL}}/feeds/rss/" title="{% trans "subscribe to the questions feed" %}" - ><img style="vertical-align:middle;" src="{% media "/media/images/feed-icon-small.png" %}"/> {% trans "rss feed" %}</a>) + ><img + style="vertical-align:middle;" + alt="{% trans "subscribe to the questions feed" %}" + src="{% media "/media/images/feed-icon-small.png" %}"/> {% trans "rss feed" %}</a>) </p> <p class="search-result-summary"> {% if author_name or search_tags or query %} @@ -174,20 +177,15 @@ {% endif %} <div id="listA"> {% get_current_language as LANGUAGE_CODE %} -{% cache 0 questions search_tags scope sort query context.page context.page_size LANGUAGE_CODE %} - {% comment %} - {% include "question_list.html" %} - {% endcomment %} +{% cache 60 questions search_tags scope sort query context.page context.page_size LANGUAGE_CODE %} {% for question in questions.object_list %} <div class="short-summary"> <div class="counts"> - <div class="votes" - style="background:{{settings.COLORS_VOTE_COUNTER_MIN_BG}};color:{{settings.COLORS_VOTE_COUNTER_MIN_FG}}" - title="{% trans "Please decide if you like this question or not by voting" %}"> - {% spaceless %} - <div class="item-count"> - {{question.score|humanize_counter}} - </div> + <div class="votes"> + <span + class="item-count" + style="background:{{settings.COLORS_VOTE_COUNTER_MIN_BG}};color:{{settings.COLORS_VOTE_COUNTER_MIN_FG}}" + >{{question.score|humanize_counter}}</span> <div> {% blocktrans count question.score as cnt %} vote @@ -195,18 +193,19 @@ votes {% endblocktrans %} </div> - {% endspaceless %} </div > {% comment %} <div {% if question.answer_accepted %}title="{% trans "this answer has been accepted to be correct" %}"{% endif %} class="status {% if question.answer_accepted %}answered-accepted{% endif %} {% ifequal question.answer_count 0 %}unanswered{% endifequal %}{% ifnotequal question.answer_count 0 %}answered{% endifnotequal %}"> {% endcomment %} - {% if question.answer_accepted %} - <div class="votes" style="background:{{settings.COLORS_ANSWER_COUNTER_ACCEPTED_BG}};color:{{settings.COLORS_ANSWER_COUNTER_ACCEPTED_FG}}"> - {% else %} - <div class="votes" style="background:{{settings.COLORS_ANSWER_COUNTER_MIN_BG}};color:{{settings.COLORS_ANSWER_COUNTER_MIN_FG}}"> - {% endif %} - <div class="item-count">{{question.answer_count|humanize_counter}}</div> - {% spaceless %} + <div class="votes"> + <span + class="item-count" + {% if question.answer_accepted %} + style="background:{{settings.COLORS_ANSWER_COUNTER_ACCEPTED_BG}};color:{{settings.COLORS_ANSWER_COUNTER_ACCEPTED_FG}}" + {% else %} + style="background:{{settings.COLORS_ANSWER_COUNTER_MIN_BG}};color:{{settings.COLORS_ANSWER_COUNTER_MIN_FG}}" + {% endif %} + >{{question.answer_count|humanize_counter}}</span> <div> {% blocktrans count question.answer_count as cnt %} answer @@ -214,19 +213,18 @@ answers {% endblocktrans %} </div> - {% endspaceless %} </div> - <div class="views" style="background:{{settings.COLORS_VIEW_COUNTER_MIN_BG}};color:{{settings.COLORS_VIEW_COUNTER_MIN_FG}}"> - {% spaceless %} - <div class="item-count">{{question.view_count|humanize_counter}}</div> - <div> + <div class="votes"> + <span class="item-count" + style="background:{{settings.COLORS_VIEW_COUNTER_MIN_BG}};color:{{settings.COLORS_VIEW_COUNTER_MIN_FG}}" + >{{question.view_count|humanize_counter}}</span> + <div> {% blocktrans count question.view_count as cnt %} view {% plural %} views {% endblocktrans %} </div> - {% endspaceless %} </div> </div> <h2><a title="{{question.summary}}" href="{% url question id=question.id %}{{question.title|slugify}}">{{question.title}}</a></h2> @@ -311,7 +309,7 @@ {% endif %} {% if request.user.is_authenticated %} - {% include "tag_selector.html" %} + {% include "tag_selector.html" %} {% endif %} {% if tags %} diff --git a/askbot/skins/default/templates/tag_selector.html b/askbot/skins/default/templates/tag_selector.html index fe90b03a..7e5713fc 100644 --- a/askbot/skins/default/templates/tag_selector.html +++ b/askbot/skins/default/templates/tag_selector.html @@ -2,7 +2,7 @@ {% load extra_tags %} {% comment %}todo - maybe disable navigation from ignored tags here when "hide" is on - with js?{%endcomment%} <div id="tagSelector" class="boxC"> - <h3 class="subtitle">{% trans "Interesting tags" %}</h3> + <h3 class="subtitle">{% trans "Interesting tags" %}</h3> <div class="tags interesting marked-tags"> {% for tag_name in interesting_tag_names %} {% spaceless %} diff --git a/askbot/skins/default/templates/users_questions.html b/askbot/skins/default/templates/users_questions.html index 99a7f90c..b18a4e5b 100644 --- a/askbot/skins/default/templates/users_questions.html +++ b/askbot/skins/default/templates/users_questions.html @@ -17,7 +17,7 @@ <div class="favorites-count-off"> <img title="{% trans "this question was selected as favorite" %}{{question.favourite_count}} {% trans "number of times" %}" alt="{% trans "thumb-up off" %}" - src="{% media "/media/images/vote-favorite-off.png" %}"/> + src="{% media "/media/images/vote-favorite-off.png" %}"/> <div><b>{{question.favourite_count|intcomma}}</b></div> </div> {% endif %} @@ -25,7 +25,53 @@ <div class="favorites-empty"> </div> {% endif %} <div id="question-summary-{{question.id}}" class="short-summary narrow"> - {% question_counter_widget question %} + <div class="counts"> + <div class="votes"> + <span + class="item-count" + style="background:{{settings.COLORS_VOTE_COUNTER_MIN_BG}};color:{{settings.COLORS_VOTE_COUNTER_MIN_FG}}" + >{{question.score|humanize_counter}}</span> + <div> + {% blocktrans count question.score as cnt %} + vote + {% plural %} + votes + {% endblocktrans %} + </div> + </div > + {% comment %} + <div {% if question.answer_accepted %}title="{% trans "this answer has been accepted to be correct" %}"{% endif %} class="status {% if question.answer_accepted %}answered-accepted{% endif %} {% ifequal question.answer_count 0 %}unanswered{% endifequal %}{% ifnotequal question.answer_count 0 %}answered{% endifnotequal %}"> + {% endcomment %} + <div class="votes"> + <span + class="item-count" + {% if question.answer_accepted %} + style="background:{{settings.COLORS_ANSWER_COUNTER_ACCEPTED_BG}};color:{{settings.COLORS_ANSWER_COUNTER_ACCEPTED_FG}}" + {% else %} + style="background:{{settings.COLORS_ANSWER_COUNTER_MIN_BG}};color:{{settings.COLORS_ANSWER_COUNTER_MIN_FG}}" + {% endif %} + >{{question.answer_count|humanize_counter}}</span> + <div> + {% blocktrans count question.answer_count as cnt %} + answer + {% plural %} + answers + {% endblocktrans %} + </div> + </div> + <div class="votes"> + <span class="item-count" + style="background:{{settings.COLORS_VIEW_COUNTER_MIN_BG}};color:{{settings.COLORS_VIEW_COUNTER_MIN_FG}}" + >{{question.view_count|humanize_counter}}</span> + <div> + {% blocktrans count question.view_count as cnt %} + view + {% plural %} + views + {% endblocktrans %} + </div> + </div> + </div> <h2><a title="{{question.summary}}" href="{% url question id=question.id %}{{question.title|slugify}}">{{question.title}}</a></h2> <div class="tags"> {% convert2tagname_list question %} diff --git a/askbot/views/readers.py b/askbot/views/readers.py index a0ac867c..2177179a 100644 --- a/askbot/views/readers.py +++ b/askbot/views/readers.py @@ -140,7 +140,7 @@ def questions(request): contributors = Question.objects.get_question_and_answer_contributors(questions.object_list) #todo: organize variables by type - before = datetime.datetime.now() + #before = datetime.datetime.now() output = render_to_response('questions.html', { 'view_name': 'questions', 'active_tab': 'questions', @@ -169,8 +169,8 @@ def questions(request): 'base_url' : request.path + '?sort=%s&' % search_state.sort,#todo in T sort=>sort_method 'page_size' : search_state.page_size,#todo in T pagesize -> page_size }}, context_instance=RequestContext(request)) - after = datetime.datetime.now() - print 'time to render %s' % (after - before) + #after = datetime.datetime.now() + #print 'time to render %s' % (after - before) return output def search(request): #generates listing of questions matching a search query - including tags and just words |