Commit 6132b9b2 by Arjun Singh

Alter some css; don't send the user if there is no user when retrieivng a thread

parent 6824ab63
......@@ -65,5 +65,16 @@ class Thread(models.Model):
# that subclasses don't need to override for this.
def _retrieve(self, *args, **kwargs):
url = self.url(action='get', params=self.attributes)
response = perform_request('get', url, {'recursive': kwargs.get('recursive'), 'user_id': kwargs.get('user_id'), 'mark_as_read': kwargs.get('mark_as_read', True)})
request_params = {
'recursive': kwargs.get('recursive'),
'user_id': kwargs.get('user_id'),
'mark_as_read': kwargs.get('mark_as_read', True),
}
# user_id may be none, in which case it shouldn't be part of the
# request.
request_params = strip_none(request_params)
response = perform_request('get', url, request_params)
self.update_attributes(**response)
......@@ -2,7 +2,6 @@ from utils import *
import models
import settings
import json
class User(models.Model):
......
......@@ -28,7 +28,7 @@ if Backbone?
showThread: (forum_name, thread_id) ->
@thread = @discussion.get(thread_id)
@thread.set("unread_comments_count", 0)
@thread.set("viewed", true)
@thread.set("read", true)
@setActiveThread()
if(@main)
@main.cleanup()
......
......@@ -130,8 +130,8 @@ if Backbone?
content.addClass("followed")
if thread.get('endorsed')
content.addClass("resolved")
if thread.get('viewed')
content.addClass("viewed")
if thread.get('read')
content.addClass("read")
@highlight(content)
......
......@@ -1135,10 +1135,6 @@ body.discussion {
background: url(../images/following-flag.png) no-repeat;
}
&.viewed {
@include linear-gradient(top, white, #ddd);
}
&.active {
@include linear-gradient(top, #96e0fd, #61c7fc);
border-color: #4697c1;
......@@ -1209,12 +1205,13 @@ body.discussion {
background-position: 0 -5px;
}
&.new {
@include linear-gradient(top, #84d7fe, #99e0fe);
&.unread {
@include linear-gradient(top, #84d7fe, #60a8d6);
color: #333;
&:after {
color: #99e0fe;
background-position: 0 0px;
}
}
}
......
......@@ -128,5 +128,13 @@
</script>
<script type="text/template" id="thread-list-item-template">
<a href="${'<%- id %>'}" data-id="${'<%- id %>'}"><span class="title">${"<%- title %>"}</span> <span class="comments-count">${"<%- unread_comments_count %>"}</span><span class="votes-count">+${"<%- votes['up_count'] %>"}</span></a>
<a href="${'<%- id %>'}" data-id="${'<%- id %>'}">
<span class="title">${"<%- title %>"}</span>
${"<% if (unread_comments_count > 0) { %>"}
<span class="comments-count unread">${"<%- unread_comments_count %>"}</span>
${"<% } else { %>"}
<span class="comments-count">${"<%- comments_count %>"}</span>
${"<% } %>"}
<span class="votes-count">+${"<%- votes['up_count'] %>"}</span>
</a>
</script>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment