From 5b3a059b672be039d360a7fcb84054eb9c489f38 Mon Sep 17 00:00:00 2001 From: Evgeny Fadeev Date: Tue, 21 Jun 2011 02:45:59 -0400 Subject: started working on comment upvote --- askbot/skins/default/media/images/go-up-grey.png | Bin 0 -> 563 bytes askbot/skins/default/media/images/go-up-orange.png | Bin 0 -> 586 bytes askbot/skins/default/media/js/post.js | 11 +++++++++ askbot/skins/default/media/style/style.css | 27 ++++++++++++++++++++- askbot/skins/default/templates/macros.html | 14 +++++++++++ 5 files changed, 51 insertions(+), 1 deletion(-) create mode 100644 askbot/skins/default/media/images/go-up-grey.png create mode 100644 askbot/skins/default/media/images/go-up-orange.png diff --git a/askbot/skins/default/media/images/go-up-grey.png b/askbot/skins/default/media/images/go-up-grey.png new file mode 100644 index 00000000..763bb799 Binary files /dev/null and b/askbot/skins/default/media/images/go-up-grey.png differ diff --git a/askbot/skins/default/media/images/go-up-orange.png b/askbot/skins/default/media/images/go-up-orange.png new file mode 100644 index 00000000..eca3579d Binary files /dev/null and b/askbot/skins/default/media/images/go-up-orange.png differ diff --git a/askbot/skins/default/media/js/post.js b/askbot/skins/default/media/js/post.js index a228e9ce..ee6703d1 100644 --- a/askbot/skins/default/media/js/post.js +++ b/askbot/skins/default/media/js/post.js @@ -1059,6 +1059,17 @@ Comment.prototype.decorate = function(element){ this._edit_link.decorate(edit_link); } + var comment_vote = this._element.find('.upvote'); + var height = this._element.height(); + this._element.find('.comment-votes').height(height); + this._element.mouseenter(function(){ + comment_vote.addClass('hover'); + comment_vo + }); + this._element.mouseleave(function(){ + comment_vote.removeClass('hover'); + }); + this._blank = false; }; diff --git a/askbot/skins/default/media/style/style.css b/askbot/skins/default/media/style/style.css index ffa15009..c1474432 100755 --- a/askbot/skins/default/media/style/style.css +++ b/askbot/skins/default/media/style/style.css @@ -958,6 +958,32 @@ a:hover.medal { clear: both; } +.comments .content { + width: 650px; + float: right; +} + +.comments div.comment { + min-height: 25px; +} + +div.comment .comment-votes { + position:absolute; + width: 20px; + height: 25px; + margin-left: -20px; +} + +div.comment .comment-votes .upvote.hover { + background: url(../images/go-up-grey.png) no-repeat; + padding-left: 16px; +} + +div.comment .comment-votes .upvote:hover { + background: url(../images/go-up-orange.png) no-repeat; + padding-left: 16px; +} + .comments div.controls { clear: both; background: url(../images/gray-up-arrow-h18px.png) no-repeat; @@ -1782,7 +1808,6 @@ button::-moz-focus-inner { margin: 0; color: #444; padding: 2px 3px 5px 3px; - width: 670px; overflow: auto; } diff --git a/askbot/skins/default/templates/macros.html b/askbot/skins/default/templates/macros.html index 969052ba..45605d9c 100644 --- a/askbot/skins/default/templates/macros.html +++ b/askbot/skins/default/templates/macros.html @@ -450,9 +450,23 @@ poor design of the data or methods on data objects #} {%- endmacro -%} +{%- macro comment_votes(comment = None, user = None) -%} +
+ {% if comment.score > 0 %} + + {{comment.score}} + + {% else %} + + + {% endif %} +
+{%- endmacro -%} + {%- macro comment_list(comments = None, user = None) -%} {% for comment in comments %}
+ {{ comment_votes(comment = comment, user = user) }} {{comment.html}} -