Commit c6de06dc by Arjun Singh

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

parent 1996b2f5
...@@ -65,5 +65,16 @@ class Thread(models.Model): ...@@ -65,5 +65,16 @@ class Thread(models.Model):
# that subclasses don't need to override for this. # that subclasses don't need to override for this.
def _retrieve(self, *args, **kwargs): def _retrieve(self, *args, **kwargs):
url = self.url(action='get', params=self.attributes) 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) self.update_attributes(**response)
...@@ -2,7 +2,6 @@ from utils import * ...@@ -2,7 +2,6 @@ from utils import *
import models import models
import settings import settings
import json
class User(models.Model): class User(models.Model):
......
...@@ -28,7 +28,7 @@ if Backbone? ...@@ -28,7 +28,7 @@ if Backbone?
showThread: (forum_name, thread_id) -> showThread: (forum_name, thread_id) ->
@thread = @discussion.get(thread_id) @thread = @discussion.get(thread_id)
@thread.set("unread_comments_count", 0) @thread.set("unread_comments_count", 0)
@thread.set("viewed", true) @thread.set("read", true)
@setActiveThread() @setActiveThread()
if(@main) if(@main)
@main.cleanup() @main.cleanup()
......
...@@ -130,8 +130,8 @@ if Backbone? ...@@ -130,8 +130,8 @@ if Backbone?
content.addClass("followed") content.addClass("followed")
if thread.get('endorsed') if thread.get('endorsed')
content.addClass("resolved") content.addClass("resolved")
if thread.get('viewed') if thread.get('read')
content.addClass("viewed") content.addClass("read")
@highlight(content) @highlight(content)
......
...@@ -1135,10 +1135,6 @@ body.discussion { ...@@ -1135,10 +1135,6 @@ body.discussion {
background: url(../images/following-flag.png) no-repeat; background: url(../images/following-flag.png) no-repeat;
} }
&.viewed {
@include linear-gradient(top, white, #ddd);
}
&.active { &.active {
@include linear-gradient(top, #96e0fd, #61c7fc); @include linear-gradient(top, #96e0fd, #61c7fc);
border-color: #4697c1; border-color: #4697c1;
...@@ -1209,12 +1205,13 @@ body.discussion { ...@@ -1209,12 +1205,13 @@ body.discussion {
background-position: 0 -5px; background-position: 0 -5px;
} }
&.new { &.unread {
@include linear-gradient(top, #84d7fe, #99e0fe); @include linear-gradient(top, #84d7fe, #60a8d6);
color: #333; color: #333;
&:after { &:after {
color: #99e0fe; color: #99e0fe;
background-position: 0 0px;
} }
} }
} }
......
...@@ -128,5 +128,13 @@ ...@@ -128,5 +128,13 @@
</script> </script>
<script type="text/template" id="thread-list-item-template"> <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> </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