Commit 6a816e45 by Rocky Duan

watch/unwatch, vote status enabled in all views

parent e6d437b6
...@@ -95,6 +95,7 @@ def render_discussion(request, threads, discussion_id=None, search_text=''): ...@@ -95,6 +95,7 @@ def render_discussion(request, threads, discussion_id=None, search_text=''):
'threads': threads, 'threads': threads,
'discussion_id': discussion_id, 'discussion_id': discussion_id,
'search_bar': render_search_bar(request, discussion_id, text=search_text), 'search_bar': render_search_bar(request, discussion_id, text=search_text),
'user_info': comment_client.get_user_info(request.user.id, raw=True),
} }
return render_to_string('discussion/inline.html', context) return render_to_string('discussion/inline.html', context)
...@@ -139,6 +140,7 @@ def forum_form_discussion(request, course_id, discussion_id): ...@@ -139,6 +140,7 @@ def forum_form_discussion(request, course_id, discussion_id):
def render_single_thread(request, thread_id): def render_single_thread(request, thread_id):
context = { context = {
'thread': comment_client.get_thread(thread_id, recursive=True), 'thread': comment_client.get_thread(thread_id, recursive=True),
'user_info': comment_client.get_user_info(request.user.id, raw=True),
} }
return render_to_string('discussion/single_thread.html', context) return render_to_string('discussion/single_thread.html', context)
...@@ -149,7 +151,7 @@ def single_thread(request, thread_id): ...@@ -149,7 +151,7 @@ def single_thread(request, thread_id):
'init': '', 'init': '',
'content': render_single_thread(request, thread_id), 'content': render_single_thread(request, thread_id),
'accordion': '', 'accordion': '',
'user_info': json.dumps(comment_client.get_user_info(request.user.id)), 'user_info': comment_client.get_user_info(request.user.id, raw=True),
} }
return render_to_response('discussion/index.html', context) return render_to_response('discussion/index.html', context)
......
...@@ -8,10 +8,6 @@ ...@@ -8,10 +8,6 @@
</%block> </%block>
<%block name="js_extra"> <%block name="js_extra">
<script type="text/javascript">
var user_info = JSON.parse('${user_info}');
</script>
</%block> </%block>
##<%include file="../course_navigation.html" args="active_page='discussion'" /> ##<%include file="../course_navigation.html" args="active_page='discussion'" />
......
...@@ -14,3 +14,8 @@ ...@@ -14,3 +14,8 @@
${renderer.render_thread(thread, edit_thread=False, show_comments=False)} ${renderer.render_thread(thread, edit_thread=False, show_comments=False)}
% endfor % endfor
</section> </section>
<script type="text/javascript">
var user_info = JSON.parse('${user_info}');
</script>
...@@ -4,3 +4,8 @@ ...@@ -4,3 +4,8 @@
<a class="discussion-title" href="javascript:void(0)">Discussion</a> <a class="discussion-title" href="javascript:void(0)">Discussion</a>
${renderer.render_thread(thread, edit_thread=True, show_comments=True)} ${renderer.render_thread(thread, edit_thread=True, show_comments=True)}
</section> </section>
<script type="text/javascript">
var user_info = JSON.parse('${user_info}');
</script>
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