Commit ce16d224 by Ibrahim Awwal

Fix anonymous posts on the inline discussion view.

parent 8b7940f4
......@@ -38,8 +38,6 @@ if Backbone?
thisButton.addClass('shown')
thisButton.find('.button-text').html("Hide Discussion")
console.log($(event.target))
if @retrieved
@$("section.discussion").slideDown()
@showed = true
......
......@@ -24,7 +24,10 @@ if Backbone?
render: ->
if not @model.has('abbreviatedBody')
@abbreviateBody()
@$el.html(Mustache.render(@template(), $.extend(@model.toJSON(),{expanded: @expanded}) ))
params = $.extend(@model.toJSON(),{expanded: @expanded})
if not @model.get('anonymous')
params = $.extend(params, user:{username: @model.username, user_url: @model.user_url})
@$el.html(Mustache.render(@template(), params))
@initLocal()
@delegateEvents()
@renderDogear()
......
......@@ -6,14 +6,19 @@
<h3>{{title}}</h3>
<p class="posted-details">
<span class="timeago" title="{{created_at}}">{{created_at}}</span> by
{{#user}}
<a href="{{user_url}}">{{username}}</a>
{{/user}}
{{^user}}
anonymous
{{/user}}
<span class="post-status-closed top-post-status" style="display: none">
&bull; This thread is closed.
</span>
</p>
</header>
<div class="post-body">{{abbreviatedBody}}</div>
<ul class="moderator-actions post-extended-content">
<li style="display: none"><a class="action-edit" href="javascript:void(0)"><span class="edit-icon"></span> Edit</a></li>
<li style="display: none"><a class="action-delete" href="javascript:void(0)"><span class="delete-icon"></span> Delete</a></li>
......
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