candidate without inline
This commit is contained in:
@@ -58,10 +58,24 @@ if Backbone?
|
||||
@current_page = response.page
|
||||
|
||||
sortByDate: (thread) ->
|
||||
thread.get("created_at")
|
||||
|
||||
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) ->
|
||||
-(new Date(thread.get("created_at")).getTime())
|
||||
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(""),
|
||||
# ((c) -> return 0xffff - c.charChodeAt()))
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user