Commit 4b743549 by Arjun Singh

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

Merge branch 'feature/tomg/new-discussions' of github.com:MITx/mitx into feature/tomg/new-discussions
parents 36b35245 c3e3fee9
......@@ -111,7 +111,7 @@ def get_threads(request, course_id, discussion_id=None):
default_query_params = {
'page': 1,
'per_page': THREADS_PER_PAGE,
'sort_key': 'activity',
'sort_key': 'date',
'sort_order': 'desc',
'text': '',
'tags': '',
......@@ -129,8 +129,10 @@ def get_threads(request, course_id, discussion_id=None):
return threads, query_params
# discussion per page is fixed for now
def inline_discussion(request, course_id, discussion_id):
"""
Renders JSON for DiscussionModules
"""
threads, query_params = get_threads(request, course_id, discussion_id)
# TODO: Remove all of this stuff or switch back to server side rendering once templates are mustache again
# html = render_inline_discussion(request, course_id, threads, discussion_id=discussion_id, \
......@@ -159,6 +161,9 @@ def render_search_bar(request, course_id, discussion_id=None, text=''):
return render_to_string('discussion/_search_bar.html', context)
def forum_form_discussion(request, course_id):
"""
Renders the main Discussion page
"""
course = get_course_with_access(request.user, course_id, 'load')
category_map = utils.get_discussion_category_map(course)
threads, query_params = get_threads(request, course_id)
......
......@@ -1199,6 +1199,27 @@ body.discussion {
> header .vote-btn {
margin-top: 5px;
}
.post-tools {
.ui-icon {
display: inline;
float: right;
}
a {
display: inline;
float: left;
height: 26px;
padding: 0 12px;
border-radius: 3px;
border: 1px solid #b2b2b2;
@include linear-gradient(top, #fff 35%, #ebebeb);
font-size: 13px;
line-height: 24px;
color: #737373;
box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
width: 6em;
}
}
}
.discussion-post header,
......@@ -1541,6 +1562,7 @@ body.discussion {
}
.post-body {
font-size: 14px;
clear: both;
}
}
......
......@@ -12,8 +12,8 @@
</span>
</p>
<div class="local post-tools">
<a href="javascript:void(0)" class="expand-post">Expand...</a>
<a href="javascript:void(0)" class="collapse-post">Collapse...</a>
<a href="javascript:void(0)" class="expand-post">Expand<span class="ui-icon ui-icon-triangle-1-e" /></a>
<a href="javascript:void(0)" class="collapse-post">Collapse<span class="ui-icon ui-icon-triangle-1-s" /></a>
</div>
</header>
<div class="post-body">{{abbreviatedBody}}</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