Commit 117be695 by Your Name

candidate without inline

parent 08bc073f
......@@ -58,9 +58,23 @@ if Backbone?
@current_page = response.page
sortByDate: (thread) ->
if thread.get('pinned')
#use tomorrow's date
today = new Date();
new Date(today.getTime() + (24 * 60 * 60 * 1000));
else
thread.get("created_at")
sortByDateRecentFirst: (thread) ->
if thread.get('pinned')
#use tomorrow's date
today = new Date();
-(new Date(today.getTime() + (24 * 60 * 60 * 1000)));
else
-(new Date(thread.get("created_at")).getTime())
#return String.fromCharCode.apply(String,
# _.map(thread.get("created_at").split(""),
......
......@@ -92,6 +92,7 @@ def get_threads(request, course_id, discussion_id=None, per_page=THREADS_PER_PAG
#now add the group name if the thread has a group id
for thread in threads:
if thread.get('group_id'):
thread['group_name'] = get_cohort_by_id(course_id, thread.get('group_id')).name
thread['group_string'] = "This post visible only to Group %s." % (thread['group_name'])
......
......@@ -6,6 +6,9 @@
<div class="discussion-post">
<header>
%if thread['pinned']
PINNED
%endif
%if thread['group_id']
<div class="group-visibility-label">This post visible only to group ${cohort_dictionary[thread['group_id']]}. </div>
%endif
......
......@@ -46,7 +46,7 @@
<div class="post-body">${'<%- body %>'}</div>
% if has_permission(user, 'change_permission', course.id):
% if course and has_permission(user, 'openclose_thread', course.id):
<div class="admin-pin discussion-pin notpinned" data-role="thread-pin" data-tooltip="pin this thread">
<i class="icon"></i><span class="pin-label">Pin Thread</span></div>
%else:
......
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