Commit 712e59a6 by Ibrahim Awwal

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

Conflicts:
	lms/djangoapps/django_comment_client/forum/views.py
	lms/static/sass/_discussion.scss
parents 9a0798b6 ba56afae
common/static/images/spinner.gif

6.78 KB | W: | H:

common/static/images/spinner.gif

6.87 KB | W: | H:

common/static/images/spinner.gif
common/static/images/spinner.gif
common/static/images/spinner.gif
common/static/images/spinner.gif
  • 2-up
  • Swipe
  • Onion skin
...@@ -227,6 +227,7 @@ def forum_form_discussion(request, course_id): ...@@ -227,6 +227,7 @@ def forum_form_discussion(request, course_id):
'annotated_content_info': saxutils.escape(json.dumps(annotated_content_info),escapedict), 'annotated_content_info': saxutils.escape(json.dumps(annotated_content_info),escapedict),
'course_id': course.id, 'course_id': course.id,
'category_map': category_map, 'category_map': category_map,
'roles': saxutils.escape(json.dumps(utils.get_role_ids(course_id)), escapedict),
} }
# print "start rendering.." # print "start rendering.."
return render_to_response('discussion/index.html', context) return render_to_response('discussion/index.html', context)
...@@ -273,6 +274,8 @@ def single_thread(request, course_id, discussion_id, thread_id): ...@@ -273,6 +274,8 @@ def single_thread(request, course_id, discussion_id, thread_id):
thread['courseware_location'] = courseware_context['courseware_location'] thread['courseware_location'] = courseware_context['courseware_location']
thread['courseware_title'] = courseware_context['courseware_title'] thread['courseware_title'] = courseware_context['courseware_title']
threads = [utils.safe_content(thread) for thread in threads]
#recent_active_threads = cc.search_recent_active_threads( #recent_active_threads = cc.search_recent_active_threads(
# course_id, # course_id,
# recursive=False, # recursive=False,
...@@ -304,6 +307,7 @@ def single_thread(request, course_id, discussion_id, thread_id): ...@@ -304,6 +307,7 @@ def single_thread(request, course_id, discussion_id, thread_id):
'thread_id': thread_id, 'thread_id': thread_id,
'threads': saxutils.escape(json.dumps(threads), escapedict), 'threads': saxutils.escape(json.dumps(threads), escapedict),
'category_map': category_map, 'category_map': category_map,
'roles': saxutils.escape(json.dumps(utils.get_role_ids(course_id)), escapedict),
} }
return render_to_response('discussion/single_thread.html', context) return render_to_response('discussion/single_thread.html', context)
...@@ -314,10 +318,12 @@ def user_profile(request, course_id, user_id): ...@@ -314,10 +318,12 @@ def user_profile(request, course_id, user_id):
course = get_course_with_access(request.user, course_id, 'load') course = get_course_with_access(request.user, course_id, 'load')
try: try:
profiled_user = cc.User(id=user_id, course_id=course_id) profiled_user = cc.User(id=user_id, course_id=course_id)
query_params = { query_params = {
'page': request.GET.get('page', 1), 'page': request.GET.get('page', 1),
'per_page': INLINE_THREADS_PER_PAGE, 'per_page': THREADS_PER_PAGE, # more than threads_per_page to show more activities
} }
threads, page, num_pages = profiled_user.active_threads(query_params) threads, page, num_pages = profiled_user.active_threads(query_params)
query_params['page'] = page query_params['page'] = page
query_params['num_pages'] = num_pages query_params['num_pages'] = num_pages
......
...@@ -39,6 +39,14 @@ def strip_blank(dic): ...@@ -39,6 +39,14 @@ def strip_blank(dic):
def merge_dict(dic1, dic2): def merge_dict(dic1, dic2):
return dict(dic1.items() + dic2.items()) return dict(dic1.items() + dic2.items())
def get_role_ids(course_id):
roles = Role.objects.filter(course_id=course_id)
staff = list(User.objects.filter(is_staff=True).values_list('id', flat=True))
roles_with_ids = {'Staff': staff}
for role in roles:
roles_with_ids[role.name] = list(role.users.values_list('id', flat=True))
return roles_with_ids
def get_full_modules(): def get_full_modules():
global _FULLMODULES global _FULLMODULES
if not _FULLMODULES: if not _FULLMODULES:
...@@ -273,7 +281,7 @@ def safe_content(content): ...@@ -273,7 +281,7 @@ def safe_content(content):
'created_at', 'updated_at', 'depth', 'type', 'created_at', 'updated_at', 'depth', 'type',
'commentable_id', 'comments_count', 'at_position_list', 'commentable_id', 'comments_count', 'at_position_list',
'children', 'highlighted_title', 'highlighted_body', 'children', 'highlighted_title', 'highlighted_body',
'courseware_title', 'courseware_location' 'courseware_title', 'courseware_location', 'tags'
] ]
if content.get('anonymous') is False: if content.get('anonymous') is False:
......
...@@ -9,6 +9,7 @@ if Backbone? ...@@ -9,6 +9,7 @@ if Backbone?
paginationTemplate: -> DiscussionUtil.getTemplate("_pagination") paginationTemplate: -> DiscussionUtil.getTemplate("_pagination")
page_re: /\?discussion_page=(\d+)/ page_re: /\?discussion_page=(\d+)/
initialize: -> initialize: ->
@toggleDiscussionBtn = @$(".discussion-show")
# Set the page if it was set in the URL. This is used to allow deep linking to pages # Set the page if it was set in the URL. This is used to allow deep linking to pages
match = @page_re.exec(window.location.href) match = @page_re.exec(window.location.href)
if match if match
...@@ -18,31 +19,38 @@ if Backbone? ...@@ -18,31 +19,38 @@ if Backbone?
toggleNewPost: (event) -> toggleNewPost: (event) ->
event.preventDefault() event.preventDefault()
if @newPostForm.is(':hidden') if !@newPostForm
@toggleDiscussion()
@isWaitingOnNewPost = true;
return
if @showed
@newPostForm.slideDown(300) @newPostForm.slideDown(300)
else else
@newPostForm.slideUp(300) @newPostForm.show()
@toggleDiscussionBtn.addClass('shown')
@toggleDiscussionBtn.find('.button-text').html("Hide Discussion")
@$("section.discussion").slideDown()
@showed = true
hideNewPost: (event) -> hideNewPost: (event) ->
event.preventDefault() event.preventDefault()
@newPostForm.slideUp(300) @newPostForm.slideUp(300)
toggleDiscussion: (event) -> toggleDiscussion: (event) ->
thisButton = $(event.target).closest('a')
if @showed if @showed
@$("section.discussion").slideUp() @$("section.discussion").slideUp()
thisButton.removeClass('shown') @toggleDiscussionBtn.removeClass('shown')
thisButton.find('.button-text').html("Show Discussion") @toggleDiscussionBtn.find('.button-text').html("Show Discussion")
@showed = false @showed = false
else else
thisButton.addClass('shown') @toggleDiscussionBtn.addClass('shown')
thisButton.find('.button-text').html("Hide Discussion") @toggleDiscussionBtn.find('.button-text').html("Hide Discussion")
if @retrieved if @retrieved
@$("section.discussion").slideDown() @$("section.discussion").slideDown()
@showed = true @showed = true
else else
$elem = $(event.target) $elem = @toggleDiscussionBtn
@loadPage $elem @loadPage $elem
loadPage: ($elem)=> loadPage: ($elem)=>
...@@ -59,7 +67,7 @@ if Backbone? ...@@ -59,7 +67,7 @@ if Backbone?
renderDiscussion: ($elem, response, textStatus, discussionId) => renderDiscussion: ($elem, response, textStatus, discussionId) =>
window.user = new DiscussionUser(response.user_info) window.user = new DiscussionUser(response.user_info)
Content.loadContentInfos(response.annotated_content_info) Content.loadContentInfos(response.annotated_content_info)
$elem.html("Hide Discussion") # $elem.html("Hide Discussion")
@discussion = new Discussion() @discussion = new Discussion()
@discussion.reset(response.discussion_data, {silent: false}) @discussion.reset(response.discussion_data, {silent: false})
$discussion = $(Mustache.render $("script#_inline_discussion").html(), {'threads':response.discussion_data, 'discussionId': discussionId}) $discussion = $(Mustache.render $("script#_inline_discussion").html(), {'threads':response.discussion_data, 'discussionId': discussionId})
...@@ -77,6 +85,8 @@ if Backbone? ...@@ -77,6 +85,8 @@ if Backbone?
@retrieved = true @retrieved = true
@showed = true @showed = true
@renderPagination(2, response.num_pages) @renderPagination(2, response.num_pages)
if @isWaitingOnNewPost
@newPostForm.show()
addThread: (thread, collection, options) => addThread: (thread, collection, options) =>
# TODO: When doing pagination, this will need to repaginate. Perhaps just reload page 1? # TODO: When doing pagination, this will need to repaginate. Perhaps just reload page 1?
......
...@@ -26,12 +26,16 @@ if Backbone? ...@@ -26,12 +26,16 @@ if Backbone?
@thread = @discussion.get(thread_id) @thread = @discussion.get(thread_id)
@setActiveThread() @setActiveThread()
if(@main) if(@main)
@main.cleanup()
@main.undelegateEvents() @main.undelegateEvents()
@main = new DiscussionThreadView(el: $(".discussion-column"), model: @thread) @main = new DiscussionThreadView(el: $(".discussion-column"), model: @thread)
@main.render() @main.render()
@main.on "thread:responses:rendered", => @main.on "thread:responses:rendered", =>
@nav.updateSidebar() @nav.updateSidebar()
@main.on "tag:selected", (tag) =>
search = "[#{tag}]"
@nav.setAndSearchFor(search)
navigateToThread: (thread_id) => navigateToThread: (thread_id) =>
thread = @discussion.get(thread_id) thread = @discussion.get(thread_id)
......
...@@ -15,6 +15,11 @@ class @DiscussionUtil ...@@ -15,6 +15,11 @@ class @DiscussionUtil
@getTemplate: (id) -> @getTemplate: (id) ->
$("script##{id}").html() $("script##{id}").html()
@isStaff: (user_id) ->
ids = $("#discussion-container").data("roles")
staff = _.union(ids['Staff'], ids['Moderator'], ids['Administrator'])
_.include(staff, parseInt(user_id))
@bulkUpdateContentInfo: (infos) -> @bulkUpdateContentInfo: (infos) ->
for id, info of infos for id, info of infos
Content.getContent(id).updateInfo(info) Content.getContent(id).updateInfo(info)
...@@ -71,7 +76,7 @@ class @DiscussionUtil ...@@ -71,7 +76,7 @@ class @DiscussionUtil
params["loadingCallback"].apply(params["$loading"]) params["loadingCallback"].apply(params["$loading"])
else else
params["$loading"].loading() params["$loading"].loading()
$.ajax(params).always -> request = $.ajax(params).always ->
if $elem if $elem
$elem.removeAttr("disabled") $elem.removeAttr("disabled")
if params["$loading"] if params["$loading"]
...@@ -79,6 +84,7 @@ class @DiscussionUtil ...@@ -79,6 +84,7 @@ class @DiscussionUtil
params["loadedCallback"].apply(params["$loading"]) params["loadedCallback"].apply(params["$loading"])
else else
params["$loading"].loaded() params["$loading"].loaded()
return request
@get: ($elem, url, data, success) -> @get: ($elem, url, data, success) ->
@safeAjax @safeAjax
......
...@@ -142,7 +142,10 @@ if Backbone? ...@@ -142,7 +142,10 @@ if Backbone?
setTimeout (-> @$(".post-search-field").focus()), 200 setTimeout (-> @$(".post-search-field").focus()), 200
toggleTopicDrop: (event) => toggleTopicDrop: (event) =>
event.preventDefault()
event.stopPropagation() event.stopPropagation()
if @current_search != ""
@clearSearch()
@$(".search").removeClass('is-open') @$(".search").removeClass('is-open')
@$(".browse").addClass('is-open') @$(".browse").addClass('is-open')
@$(".browse").toggleClass('is-dropped') @$(".browse").toggleClass('is-dropped')
...@@ -235,6 +238,11 @@ if Backbone? ...@@ -235,6 +238,11 @@ if Backbone?
text = @$(".post-search-field").val() text = @$(".post-search-field").val()
@searchFor(text) @searchFor(text)
setAndSearchFor: (text) ->
@showSearch()
@$(".post-search-field").val(text)
@searchFor(text)
searchFor: (text, callback, value) -> searchFor: (text, callback, value) ->
@current_search = text @current_search = text
url = DiscussionUtil.urlFor("search") url = DiscussionUtil.urlFor("search")
......
...@@ -3,6 +3,7 @@ if Backbone? ...@@ -3,6 +3,7 @@ if Backbone?
events: events:
"click .discussion-submit-post": "submitComment" "click .discussion-submit-post": "submitComment"
"click .thread-tag": "tagSelected"
$: (selector) -> $: (selector) ->
@$el.find(selector) @$el.find(selector)
...@@ -14,19 +15,39 @@ if Backbone? ...@@ -14,19 +15,39 @@ if Backbone?
render: -> render: ->
@template = _.template($("#thread-template").html()) @template = _.template($("#thread-template").html())
@$el.html(@template(@model.toJSON())) @$el.html(@template(@model.toJSON()))
@$el.find(".loading").hide()
@delegateEvents() @delegateEvents()
@renderShowView() @renderShowView()
@renderAttrs() @renderAttrs()
@renderTags()
@$("span.timeago").timeago() @$("span.timeago").timeago()
@makeWmdEditor "reply-body" @makeWmdEditor "reply-body"
@renderResponses() @renderResponses()
@ @
cleanup: ->
if @responsesRequest?
@responsesRequest.abort()
renderTags: ->
tags = $('<div class="thread-tags">')
for tag in @model.get("tags")
tags.append("<a class='thread-tag'>#{tag}</a>")
@$(".post-body").after(tags)
tagSelected: (e) ->
@trigger "tag:selected", $(e.target).html()
renderResponses: -> renderResponses: ->
DiscussionUtil.safeAjax setTimeout(=>
@$el.find(".loading").show()
, 200)
@responsesRequest = DiscussionUtil.safeAjax
url: "/courses/#{$$course_id}/discussion/forum/#{@model.get('commentable_id')}/threads/#{@model.id}" url: "/courses/#{$$course_id}/discussion/forum/#{@model.get('commentable_id')}/threads/#{@model.id}"
success: (data, textStatus, xhr) => success: (data, textStatus, xhr) =>
@responsesRequest = null
@$el.find(".loading").remove() @$el.find(".loading").remove()
Content.loadContentInfos(data['annotated_content_info']) Content.loadContentInfos(data['annotated_content_info'])
comments = new Comments(data['content']['children']) comments = new Comments(data['content']['children'])
......
...@@ -18,6 +18,7 @@ if Backbone? ...@@ -18,6 +18,7 @@ if Backbone?
@initLocal() @initLocal()
@delegateEvents() @delegateEvents()
@renderAttrs() @renderAttrs()
@markAsStaff()
@$el.find(".timeago").timeago() @$el.find(".timeago").timeago()
@convertMath() @convertMath()
@ @
...@@ -29,3 +30,7 @@ if Backbone? ...@@ -29,3 +30,7 @@ if Backbone?
body.children("p").each (index, elem) -> body.children("p").each (index, elem) ->
$(elem).replaceWith($(elem).html()) $(elem).replaceWith($(elem).html())
MathJax.Hub.Queue ["Typeset", MathJax.Hub, body[0]] MathJax.Hub.Queue ["Typeset", MathJax.Hub, body[0]]
markAsStaff: ->
if DiscussionUtil.isStaff(@model.get("user_id"))
@$el.find("a").after('<span class="staff-label">staff</span>')
...@@ -18,6 +18,7 @@ if Backbone? ...@@ -18,6 +18,7 @@ if Backbone?
@renderAttrs() @renderAttrs()
@$el.find(".posted-details").timeago() @$el.find(".posted-details").timeago()
@convertMath() @convertMath()
@markAsStaff()
@renderComments() @renderComments()
@ @
...@@ -26,6 +27,11 @@ if Backbone? ...@@ -26,6 +27,11 @@ if Backbone?
element.html DiscussionUtil.postMathJaxProcessor DiscussionUtil.markdownWithHighlight element.html() element.html DiscussionUtil.postMathJaxProcessor DiscussionUtil.markdownWithHighlight element.html()
MathJax.Hub.Queue ["Typeset", MathJax.Hub, element[0]] MathJax.Hub.Queue ["Typeset", MathJax.Hub, element[0]]
markAsStaff: ->
if DiscussionUtil.isStaff(@model.get("user_id"))
@$el.addClass("staff")
@$el.prepend('<div class="staff-banner">staff</div>')
renderComments: -> renderComments: ->
comments = new Comments() comments = new Comments()
comments.comparator = (comment) -> comments.comparator = (comment) ->
......
...@@ -274,20 +274,23 @@ body.discussion { ...@@ -274,20 +274,23 @@ body.discussion {
width: 100%; width: 100%;
margin-bottom: 20px; margin-bottom: 20px;
@include clearfix; @include clearfix;
@include box-sizing(border-box);
.form-row {
margin-top: 20px;
}
.post-cancel { .post-cancel {
@include white-button; @include white-button;
border-color: #444;
float: left; float: left;
margin: 10px 0 0 15px; margin: 10px 0 0 15px;
} }
.post-update { .post-update {
@include blue-button; @include blue-button;
float: left; float: left;
height: 37px; height: 37px;
margin-top: 10px; margin-top: 10px;
border-color: #333;
padding-bottom: 2px; padding-bottom: 2px;
&:hover { &:hover {
...@@ -301,13 +304,28 @@ body.discussion { ...@@ -301,13 +304,28 @@ body.discussion {
padding: 0 10px; padding: 0 10px;
box-sizing: border-box; box-sizing: border-box;
border-radius: 3px; border-radius: 3px;
border: 1px solid #333; border: 1px solid #aaa;
font-size: 16px; font-size: 16px;
font-family: 'Open Sans', sans-serif; font-family: $sans-serif;
color: #333; color: #333;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3) inset; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15) inset;
} }
.tagsinput {
padding: 10px;
@include box-sizing(border-box);
border: 1px solid #aaa;
border-radius: 3px;
background: #fff;
font-family: 'Monaco', monospace;
font-size: 13px;
line-height: 1.6;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3) inset;
span.tag {
margin-bottom: 0;
}
}
} }
.new-post-form { .new-post-form {
...@@ -1006,8 +1024,14 @@ body.discussion { ...@@ -1006,8 +1024,14 @@ body.discussion {
.post-list { .post-list {
background-color: #ddd; background-color: #ddd;
.loading { .loading {
padding: 15px 0; padding: 15px 0;
background: #f6f6f6;
.loading-animation {
background-image: url(../images/spinner-on-grey.gif);
}
} }
a { a {
...@@ -1231,6 +1255,12 @@ body.discussion { ...@@ -1231,6 +1255,12 @@ body.discussion {
font-style: italic; font-style: italic;
color: #888; color: #888;
.username {
display: block;
font-size: 16px;
font-weight: 700;
}
span { span {
font-style: italic; font-style: italic;
} }
...@@ -1309,7 +1339,7 @@ body.discussion { ...@@ -1309,7 +1339,7 @@ body.discussion {
> li { > li {
position: relative; position: relative;
margin: 0 -10px 30px; margin: 0 -10px 30px;
padding: 26px 30px 30px; padding: 26px 30px 20px;
border-radius: 3px; border-radius: 3px;
border: 1px solid #b2b2b2; border: 1px solid #b2b2b2;
box-shadow: 0 1px 3px rgba(0, 0, 0, .15); box-shadow: 0 1px 3px rgba(0, 0, 0, .15);
...@@ -1573,6 +1603,7 @@ body.discussion { ...@@ -1573,6 +1603,7 @@ body.discussion {
.discussion-reply-new { .discussion-reply-new {
padding: 20px; padding: 20px;
@include clearfix; @include clearfix;
@include transition(opacity .2s);
h4 { h4 {
font-size: 16px; font-size: 16px;
...@@ -1619,8 +1650,9 @@ body.discussion { ...@@ -1619,8 +1650,9 @@ body.discussion {
.discussion-module { .discussion-module {
@extend .discussion-body; @extend .discussion-body;
position: relative;
margin: 20px 0; margin: 20px 0;
padding: 20px 20px 28px 20px; padding: 20px;
background: #f6f6f6 !important; background: #f6f6f6 !important;
border-radius: 3px; border-radius: 3px;
...@@ -1633,10 +1665,13 @@ body.discussion { ...@@ -1633,10 +1665,13 @@ body.discussion {
} }
} }
.loading-animation {
background-image: url(../images/spinner-on-grey.gif);
}
.discussion-show { .discussion-show {
display: block; position: relative;
width: 200px; top: 3px;
margin: auto;
font-size: 14px; font-size: 14px;
text-align: center; text-align: center;
...@@ -1660,10 +1695,11 @@ body.discussion { ...@@ -1660,10 +1695,11 @@ body.discussion {
.new-post-btn { .new-post-btn {
display: inline-block; display: inline-block;
float: right;
} }
section.discussion { section.discussion {
margin-top: 20px; margin-top: 30px;
.threads { .threads {
margin-top: 20px; margin-top: 20px;
...@@ -1715,6 +1751,16 @@ body.discussion { ...@@ -1715,6 +1751,16 @@ body.discussion {
padding-bottom: 0; padding-bottom: 0;
margin-bottom: 15px; margin-bottom: 15px;
.posted-details {
margin-top: 4px;
.username {
display: inline;
font-size: 14px;
font-weight: 700;
}
}
h3 { h3 {
font-size: 19px; font-size: 19px;
font-weight: 700; font-weight: 700;
...@@ -1758,13 +1804,16 @@ body.discussion { ...@@ -1758,13 +1804,16 @@ body.discussion {
margin-top: 10px; margin-top: 10px;
header { header {
padding-bottom: 0em; padding-bottom: 0;
margin-bottom: 5px; margin-bottom: 15px;
.posted-by { .posted-by {
font-size: 0.8em; float: left;
margin-right: 5px;
font-size: 16px;
} }
} }
.response-body { .response-body {
margin-bottom: 0.2em; margin-bottom: 0.2em;
font-size: 14px; font-size: 14px;
......
...@@ -2,4 +2,5 @@ ...@@ -2,4 +2,5 @@
<div class="discussion-module" data-discussion-id="${discussion_id | h}"> <div class="discussion-module" data-discussion-id="${discussion_id | h}">
<a class="discussion-show control-button" href="javascript:void(0)" data-discussion-id="${discussion_id | h}"><span class="show-hide-discussion-icon"></span><span class="button-text">Show Discussion</span></a> <a class="discussion-show control-button" href="javascript:void(0)" data-discussion-id="${discussion_id | h}"><span class="show-hide-discussion-icon"></span><span class="button-text">Show Discussion</span></a>
<a href="#" class="new-post-btn"><span class="new-post-icon"></span>New Post</a>
</div> </div>
...@@ -25,10 +25,11 @@ ...@@ -25,10 +25,11 @@
<a href="#" class="vote-btn discussion-vote discussion-vote-up" data-role="discussion-vote"><span class="plus-icon">+</span> <span class='votes-count-number'>${'<%- votes["up_count"] %>'}</span></a> <a href="#" class="vote-btn discussion-vote discussion-vote-up" data-role="discussion-vote"><span class="plus-icon">+</span> <span class='votes-count-number'>${'<%- votes["up_count"] %>'}</span></a>
<h1>${'<%- title %>'}</h1> <h1>${'<%- title %>'}</h1>
<p class="posted-details"> <p class="posted-details">
<span class="timeago" title="${'<%- created_at %>'}">${'<%- created_at %>'}</span> by
${"<% if (!obj.anonymous) { %>"} ${"<% if (!obj.anonymous) { %>"}
<a href="${'<%- user_url %>'}">${'<%- username %>'}</a> <a href="${'<%- user_url %>'}" class="username">${'<%- username %>'}</a>
${"<% } else {print('anonymous');} %>"} ${"<% } else {print('anonymous');} %>"}
<span class="timeago" title="${'<%- created_at %>'}">${'<%- created_at %>'}</span>
<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>
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
<script type="text/javascript" src="${static.url('js/discussions-temp.js')}"></script> <script type="text/javascript" src="${static.url('js/discussions-temp.js')}"></script>
<section class="discussion container" id="discussion-container" data-course-id="${course_id}" data-user-info="${user_info}" data-threads="${threads}"> <section class="discussion container" id="discussion-container" data-roles="${roles}" data-course-id="${course_id}" data-user-info="${user_info}" data-threads="${threads}">
<div class="discussion-body"> <div class="discussion-body">
<div class="sidebar"></div> <div class="sidebar"></div>
<div class="discussion-column"> <div class="discussion-column">
......
<section class="discussion" data-discussion-id="{{discussionId}}"> <section class="discussion" data-discussion-id="{{discussionId}}">
<a href="#" class="new-post-btn"><span class="new-post-icon"></span>New Post</a>
<article class="new-post-article"> <article class="new-post-article">
<span class="topic" data-discussion-id="{{discussionId}}" /> <span class="topic" data-discussion-id="{{discussionId}}" />
......
...@@ -5,13 +5,15 @@ ...@@ -5,13 +5,15 @@
<a href="#" class="vote-btn discussion-vote discussion-vote-up" data-role="discussion-vote"><span class="plus-icon">+</span> <span class='votes-count-number'>{{votes.up_count}}</span></a> <a href="#" class="vote-btn discussion-vote discussion-vote-up" data-role="discussion-vote"><span class="plus-icon">+</span> <span class='votes-count-number'>{{votes.up_count}}</span></a>
<h3>{{title}}</h3> <h3>{{title}}</h3>
<p class="posted-details"> <p class="posted-details">
<span class="timeago" title="{{created_at}}">{{created_at}}</span> by
{{#user}} {{#user}}
<a href="{{user_url}}">{{username}}</a> <a href="{{user_url}}" class="username">{{username}}</a>
{{/user}} {{/user}}
{{^user}} {{^user}}
anonymous anonymous
{{/user}} {{/user}}
<span class="timeago" title="{{created_at}}">{{created_at}}</span>
<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>
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
<%include file="_new_post.html" /> <%include file="_new_post.html" />
<section class="discussion container" id="discussion-container" data-course-id="${course_id}" data-user-info="${user_info}" data-threads="${threads}" data-content-info="${annotated_content_info}"> <section class="discussion container" id="discussion-container" data-roles="${roles}" data-course-id="${course_id}" data-user-info="${user_info}" data-threads="${threads}" data-content-info="${annotated_content_info}">
<div class="discussion-body"> <div class="discussion-body">
<div class="sidebar"></div> <div class="sidebar"></div>
<div class="discussion-column"></div> <div class="discussion-column"></div>
......
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