Commit a719cce1 by Ibrahim Awwal

Fix anonymous posts on the inline discussion view.

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