removed dependency on datehelper
This commit is contained in:
@@ -4,9 +4,6 @@ from xmodule.x_module import XModule
|
||||
from xmodule.raw_module import RawDescriptor
|
||||
|
||||
import comment_client
|
||||
import dateutil
|
||||
from dateutil.tz import tzlocal
|
||||
from datehelper import time_ago_in_words
|
||||
|
||||
import json
|
||||
|
||||
|
||||
@@ -9,9 +9,6 @@ from django.contrib.auth.models import User
|
||||
from mitxmako.shortcuts import render_to_response, render_to_string
|
||||
from courseware.courses import get_course_with_access
|
||||
|
||||
from dateutil.tz import tzlocal
|
||||
from datehelper import time_ago_in_words
|
||||
|
||||
from urllib import urlencode
|
||||
from django_comment_client.permissions import check_permissions_by_view
|
||||
from django_comment_client.utils import merge_dict, extract, strip_none
|
||||
|
||||
@@ -1,71 +0,0 @@
|
||||
<%! from django_comment_client.helpers import url_for_tags, url_for_user %>
|
||||
<%! from datehelper import time_ago_in_words %>
|
||||
<%! from dateutil.parser import parse %>
|
||||
<%! from django_comment_client.helpers import close_thread_text, \
|
||||
url_for_tags, \
|
||||
url_for_user, \
|
||||
pluralize
|
||||
%>
|
||||
|
||||
<div class="discussion-content">
|
||||
<div class="discussion-content-wrapper">
|
||||
<div class="discussion-votes">
|
||||
<a class="discussion-vote discussion-vote-up" href="javascript:void(0)">▲</a>
|
||||
<div class="discussion-votes-point">${content['votes']['point']}</div>
|
||||
<a class="discussion-vote discussion-vote-down" href="javascript:void(0)">▼</a>
|
||||
</div>
|
||||
<div class="discussion-right-wrapper">
|
||||
<ul class="admin-actions">
|
||||
% if content['type'] == 'comment':
|
||||
<li><a href="javascript:void(0)" class="admin-endorse">Endorse</a></li>
|
||||
% endif
|
||||
<li><a href="javascript:void(0)" class="admin-edit">Edit</a></li>
|
||||
<li><a href="javascript:void(0)" class="admin-delete">Delete</a></li>
|
||||
% if content['type'] == "thread":
|
||||
<li><a class="admin-openclose" href="javascript:void(0);">${close_thread_text(content)}</a></li>
|
||||
% endif
|
||||
</ul>
|
||||
% if content['type'] == "thread":
|
||||
<a class="thread-title" name="${content['id']}" href="javascript:void(0)">${(content.get('highlighted_title') or content['title']) | h}</a>
|
||||
<div class="thread-raw-title" style="display: none">${content['title']}</div>
|
||||
% endif
|
||||
<div class="discussion-content-view">
|
||||
<a name="${content['id']}" style="width: 0; height: 0; padding: 0; border: none;"></a>
|
||||
<div class="content-body">${(content.get('highlighted_body') or content['body']) | h}</div>
|
||||
<div class="content-raw-body" style="display: none">${content['body'] | h}</div>
|
||||
% if content['type'] == "thread":
|
||||
<div class="thread-tags">
|
||||
% for tag in content['tags']:
|
||||
<a class="thread-tag" href="${url_for_tags(content['course_id'], [tag])}">${tag | h}</a>
|
||||
% endfor
|
||||
</div>
|
||||
<div class="thread-raw-tags" style="display: none">${",".join(content['tags']) | h}</div>
|
||||
% endif
|
||||
<div class="info">
|
||||
<div class="comment-time">
|
||||
${time_ago_in_words(parse(content['updated_at']))} ago by
|
||||
% if content['anonymous']:
|
||||
anonymous
|
||||
% else:
|
||||
<a href="${url_for_user(content['course_id'], content['user_id'])}">${content['username']}</a>
|
||||
% endif
|
||||
</div>
|
||||
<div class="comment-count">
|
||||
% if content.get('comments_count', -1) >= 0:
|
||||
% if discussion_type == 'user':
|
||||
<a href="javascript:void(0)" class="discussion-show-comments first-time">Show all comments (${content['comments_count']} total)</a>
|
||||
% else:
|
||||
<a href="javascript:void(0)" class="discussion-show-comments">Show ${content['comments_count']} ${pluralize('comment', content['comments_count'])}</a>
|
||||
% endif
|
||||
% endif
|
||||
</div>
|
||||
<ul class="discussion-actions">
|
||||
<li><a class="discussion-link discussion-reply discussion-reply-${content['type']}" href="javascript:void(0)">Reply</a></li>
|
||||
<li><div class="follow-wrapper"></div></li>
|
||||
<li><a class="discussion-link discussion-permanent-link" href="javascript:void(0)">Permanent Link</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
Reference in New Issue
Block a user