Commit 190f25c0 by Arjun Singh

Merge branch 'feature/arjun/new-discussions' of github.com:MITx/mitx into…

Merge branch 'feature/arjun/new-discussions' of github.com:MITx/mitx into feature/arjun/new-discussions
parents 3756d317 2f5ad06e
......@@ -17,10 +17,9 @@ if Backbone?
render: ->
@template = DiscussionUtil.getTemplate("_profile_thread")
if not @model.has('abbreviatedBody')
@abbreviateBody()
params = $.extend(@model.toJSON(),{expanded: @expanded})
params = $.extend(@model.toJSON(),{expanded: @expanded, permalink: @model.urlFor('retrieve')})
if not @model.get('anonymous')
params = $.extend(params, user:{username: @model.username, user_url: @model.user_url})
@$el.html(Mustache.render(@template, params))
......
......@@ -36,14 +36,20 @@ if Backbone?
hideEditorChrome: ->
@$('.wmd-button-row').hide()
@$('.wmd-preview').hide()
@$('.wmd-input').css(height: '50px')
@$('.wmd-input').css({
height: '35px',
padding: '0'
})
@$('.comment-post-control').hide()
showEditorChrome: ->
@$('.wmd-button-row').show()
@$('.wmd-preview').show()
@$('.comment-post-control').show()
@$('.wmd-input').css(height: '125px')
@$('.wmd-input').css({
height: '125px',
padding: '10px'
})
renderComments: ->
comments = new Comments()
......
......@@ -1508,16 +1508,20 @@ body.discussion {
}
p {
.response-body {
font-size: 13px;
padding: 10px 20px;
.posted-details {
font-size: 11px;
white-space: nowrap;
p + p {
margin-top: 12px;
}
}
.posted-details {
margin: 0 20px 10px;
font-size: 11px;
}
.staff-label {
margin-left: 2px;
padding: 0 4px;
......@@ -1529,14 +1533,22 @@ body.discussion {
color: white;
text-transform: uppercase;
}
.posted-details {
margin-left: 8px;
}
}
.comment-form {
padding: 8px 20px;
.wmd-input {
@include transition(all .2s);
}
.wmd-button {
background: transparent;
span {
background-image: url(../images/wmd-buttons-transparent.png);
}
}
}
.comment-form-input {
......
......@@ -22,7 +22,7 @@
<div class="response-body">${reply['body']}</div>
<ol class="comments">
% for comment in reply.get("children", []):
<li><p>${comment['body']}</p></li>
<li><div class="comment-body">${comment['body']}</div></li>
% endfor
</ol>
</li>
......
......@@ -117,13 +117,15 @@
</script>
<script type="text/template" id="response-comment-show-template">
<p id="comment_${'<%- id %>'}">
<div id="comment_${'<%- id %>'}">
${'<% if (deep) {%>'}
<a href="#comment_${'<%- parent_id %>'}">@${'<%- parent_username %>'}</a>:
${'<% }%>'}
<span class="response-body">${'<%- body %>'}</span>
<span class="posted-details">&ndash;posted <span class="timeago" title="${'<%- created_at %>'}">${'<%- created_at %>'}</span> by <a href="${'<%- user_url %>'}" class="profile-link">${'<%- username %>'}</a></span>
</p>
<div class="response-body">
${'<%- body %>'}
</div>
<p class="posted-details">&ndash;posted <span class="timeago" title="${'<%- created_at %>'}">${'<%- created_at %>'}</span> by <a href="${'<%- user_url %>'}" class="profile-link">${'<%- username %>'}</a></p>
</div>
</script>
<script type="text/template" id="thread-list-item-template">
......
......@@ -5,7 +5,7 @@
<div class="user-profile">
<%
role_names = sorted(map(attrgetter('name'), django_user.roles.all()))
role_names = sorted(set(map(attrgetter('name'), django_user.roles.all())))
%>
<div class="sidebar-username">${django_user.username | h}</div>
<div class="sidebar-user-roles">
......
......@@ -25,8 +25,8 @@
</ol>
<div class="local post-tools">
<a href="javascript:void(0)" class="expand-post">View discussion</a>
<a href="javascript:void(0)" class="collapse-post">Hide discussion</a>
<a href="{{permalink}}">View discussion</a>
<!-- <a href="javascript:void(0)" class="collapse-post">Hide discussion</a> -->
</div>
</article>
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