candidate without inline

This commit is contained in:
Your Name
2013-03-13 18:40:10 -04:00
parent 08bc073fa5
commit 117be695cb
4 changed files with 21 additions and 3 deletions

View File

@@ -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()))

View File

@@ -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'])

View File

@@ -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

View File

@@ -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: