summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEvgeny Fadeev <evgeny.fadeev@gmail.com>2011-06-21 02:45:59 -0400
committerEvgeny Fadeev <evgeny.fadeev@gmail.com>2011-06-21 02:45:59 -0400
commit5b3a059b672be039d360a7fcb84054eb9c489f38 (patch)
tree27518e8784c6f4ebd87de806dd35084f286a6969
parent2549dc475991599e0ccd0e94debdde6004a47dae (diff)
downloadaskbot-5b3a059b672be039d360a7fcb84054eb9c489f38.tar.gz
askbot-5b3a059b672be039d360a7fcb84054eb9c489f38.tar.bz2
askbot-5b3a059b672be039d360a7fcb84054eb9c489f38.zip
started working on comment upvote
-rw-r--r--askbot/skins/default/media/images/go-up-grey.pngbin0 -> 563 bytes
-rw-r--r--askbot/skins/default/media/images/go-up-orange.pngbin0 -> 586 bytes
-rw-r--r--askbot/skins/default/media/js/post.js11
-rwxr-xr-xaskbot/skins/default/media/style/style.css27
-rw-r--r--askbot/skins/default/templates/macros.html14
5 files changed, 51 insertions, 1 deletions
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
--- /dev/null
+++ b/askbot/skins/default/media/images/go-up-grey.png
Binary files 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
--- /dev/null
+++ b/askbot/skins/default/media/images/go-up-orange.png
Binary files 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 #}
</div>
{%- endmacro -%}
+{%- macro comment_votes(comment = None, user = None) -%}
+ <div class="comment-votes">
+ {% if comment.score > 0 %}
+ <span class="upvote{% if comment.voted_by(user) %} upvoted{% endif %}">
+ {{comment.score}}
+ </span>
+ {% else %}
+ <span class="upvote">
+ </span>
+ {% endif %}
+ </div>
+{%- endmacro -%}
+
{%- macro comment_list(comments = None, user = None) -%}
{% for comment in comments %}
<div class="comment" id="comment-{{comment.id}}">
+ {{ comment_votes(comment = comment, user = user) }}
{{comment.html}} -
<a
class="author"