Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
a1dc49cc
Commit
a1dc49cc
authored
Jan 13, 2014
by
Greg Price
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove defunct forum post tagging code
parent
167cf94a
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
28 changed files
with
18 additions
and
347 deletions
+18
-347
common/static/coffee/src/discussion/discussion_router.coffee
+0
-3
common/static/coffee/src/discussion/utils.coffee
+0
-15
common/static/coffee/src/discussion/views/discussion_thread_edit_view.coffee
+0
-1
common/static/coffee/src/discussion/views/discussion_thread_list_view.coffee
+0
-5
common/static/coffee/src/discussion/views/discussion_thread_view.coffee
+0
-38
common/static/coffee/src/discussion/views/discussion_thread_view_inline.coffee
+0
-3
common/static/coffee/src/discussion/views/new_post_inline_vew.coffee
+0
-13
common/static/coffee/src/discussion/views/new_post_view.coffee
+0
-6
lms/djangoapps/django_comment_client/base/tests.py
+3
-3
lms/djangoapps/django_comment_client/base/urls.py
+0
-1
lms/djangoapps/django_comment_client/base/views.py
+2
-11
lms/djangoapps/django_comment_client/forum/views.py
+1
-11
lms/djangoapps/django_comment_client/mustache_helpers.py
+0
-6
lms/djangoapps/django_comment_client/utils.py
+1
-6
lms/lib/comment_client/comment_client.py
+0
-17
lms/lib/comment_client/thread.py
+2
-2
lms/static/css/vendor/jquery.tagsinput.css
+0
-7
lms/static/js/jquery.tagsinput.js
+0
-0
lms/static/sass/_discussion.scss
+6
-119
lms/static/sass/course/_discussions-inline.scss
+2
-35
lms/templates/discussion/_inline_new_post.html
+0
-5
lms/templates/discussion/_js_head_dependencies.html
+0
-2
lms/templates/discussion/_new_post.html
+0
-5
lms/templates/discussion/_search_bar.html
+1
-5
lms/templates/discussion/_trending_tags.html
+0
-14
lms/templates/discussion/_underscore_templates.html
+0
-6
lms/templates/discussion/mustache/_inline_discussion.mustache
+0
-4
lms/templates/discussion/mustache/_inline_discussion_cohorted.mustache
+0
-4
No files found.
common/static/coffee/src/discussion/discussion_router.coffee
View file @
a1dc49cc
...
...
@@ -41,9 +41,6 @@ if Backbone?
@
main
.
render
()
@
main
.
on
"thread:responses:rendered"
,
=>
@
nav
.
updateSidebar
()
@
main
.
on
"tag:selected"
,
(
tag
)
=>
search
=
"[
#{
tag
}
]"
@
nav
.
setAndSearchFor
(
search
)
navigateToThread
:
(
thread_id
)
=>
thread
=
@
discussion
.
get
(
thread_id
)
...
...
common/static/coffee/src/discussion/utils.coffee
View file @
a1dc49cc
...
...
@@ -75,7 +75,6 @@ class @DiscussionUtil
undo_vote_for_comment
:
"/courses/
#{
$$course_id
}
/discussion/comments/
#{
param
}
/unvote"
upload
:
"/courses/
#{
$$course_id
}
/discussion/upload"
search
:
"/courses/
#{
$$course_id
}
/discussion/forum/search"
tags_autocomplete
:
"/courses/
#{
$$course_id
}
/discussion/threads/tags/autocomplete"
retrieve_discussion
:
"/courses/
#{
$$course_id
}
/discussion/forum/
#{
param
}
/inline"
retrieve_single_thread
:
"/courses/
#{
$$course_id
}
/discussion/forum/
#{
param
}
/threads/
#{
param1
}
"
openclose_thread
:
"/courses/
#{
$$course_id
}
/discussion/threads/
#{
param
}
/close"
...
...
@@ -157,20 +156,6 @@ class @DiscussionUtil
[
event
,
selector
]
=
eventSelector
.
split
(
' '
)
$local
(
selector
).
unbind
(
event
)[
event
]
handler
@
processTag
:
(
text
)
->
text
.
toLowerCase
()
@
tagsInputOptions
:
->
autocomplete_url
:
@
urlFor
(
'tags_autocomplete'
)
autocomplete
:
remoteDataType
:
'json'
interactive
:
true
height
:
'30px'
width
:
'100%'
defaultText
:
"Tag your post: press enter after each tag"
removeWithBackspace
:
true
preprocessTag
:
@
processTag
@
formErrorHandler
:
(
errorsField
)
->
(
xhr
,
textStatus
,
error
)
->
response
=
JSON
.
parse
(
xhr
.
responseText
)
...
...
common/static/coffee/src/discussion/views/discussion_thread_edit_view.coffee
View file @
a1dc49cc
...
...
@@ -16,7 +16,6 @@ if Backbone?
@
$el
.
html
(
@
template
(
@
model
.
toJSON
()))
@
delegateEvents
()
DiscussionUtil
.
makeWmdEditor
@
$el
,
$
.
proxy
(
@
$
,
@
),
"edit-post-body"
@
$
(
".edit-post-tags"
).
tagsInput
DiscussionUtil
.
tagsInputOptions
()
@
update
:
(
event
)
->
...
...
common/static/coffee/src/discussion/views/discussion_thread_list_view.coffee
View file @
a1dc49cc
...
...
@@ -393,11 +393,6 @@ if Backbone?
text
=
@
$
(
".post-search-field"
).
val
()
@
searchFor
(
text
)
setAndSearchFor
:
(
text
)
->
@
showSearch
()
@
$
(
".post-search-field"
).
val
(
text
)
@
searchFor
(
text
)
searchFor
:
(
text
,
callback
,
value
)
->
@
mode
=
'search'
@
current_search
=
text
...
...
common/static/coffee/src/discussion/views/discussion_thread_view.coffee
View file @
a1dc49cc
...
...
@@ -4,10 +4,6 @@ if Backbone?
events
:
"click .discussion-submit-post"
:
"submitComment"
# TODO tags
# Until we decide what to do w/ tags, removing them.
#"click .thread-tag": "tagSelected"
$
:
(
selector
)
->
@
$el
.
find
(
selector
)
...
...
@@ -27,10 +23,6 @@ if Backbone?
@
renderShowView
()
@
renderAttrs
()
# TODO tags
# Until we decide what to do w/ tags, removing them.
#@renderTags()
@
$
(
"span.timeago"
).
timeago
()
@
makeWmdEditor
"reply-body"
@
renderResponses
()
...
...
@@ -40,21 +32,6 @@ if Backbone?
if
@
responsesRequest
?
@
responsesRequest
.
abort
()
# TODO tags
# Until we decide what to do w/ tags, removing them.
#renderTags: ->
# # tags
# for tag in @model.get("tags")
# if !tags
# tags = $('<div class="thread-tags">')
# tags.append("<a href='#' class='thread-tag'>#{tag}</a>")
# @$(".post-body").after(tags)
# TODO tags
# Until we decide what to do w tags, removing them.
#tagSelected: (e) ->
# @trigger "tag:selected", $(e.target).html()
renderResponses
:
->
setTimeout
(
=>
@
$el
.
find
(
".loading"
).
show
()
...
...
@@ -116,10 +93,6 @@ if Backbone?
newTitle
=
@
editView
.
$
(
".edit-post-title"
).
val
()
newBody
=
@
editView
.
$
(
".edit-post-body textarea"
).
val
()
# TODO tags
# Until we decide what to do w/ tags, removing them.
#newTags = @editView.$(".edit-post-tags").val()
url
=
DiscussionUtil
.
urlFor
(
'update_thread'
,
@
model
.
id
)
DiscussionUtil
.
safeAjax
...
...
@@ -133,31 +106,20 @@ if Backbone?
title
:
newTitle
body
:
newBody
# TODO tags
# Until we decide what to do w/ tags, removing them.
#tags: newTags
error
:
DiscussionUtil
.
formErrorHandler
(
@
$
(
".edit-post-form-errors"
))
success
:
(
response
,
textStatus
)
=>
# TODO: Move this out of the callback, this makes it feel sluggish
@
editView
.
$
(
".edit-post-title"
).
val
(
""
).
attr
(
"prev-text"
,
""
)
@
editView
.
$
(
".edit-post-body textarea"
).
val
(
""
).
attr
(
"prev-text"
,
""
)
@
editView
.
$
(
".edit-post-tags"
).
val
(
""
)
@
editView
.
$
(
".edit-post-tags"
).
importTags
(
""
)
@
editView
.
$
(
".wmd-preview p"
).
html
(
""
)
@
model
.
set
title
:
newTitle
body
:
newBody
tags
:
response
.
content
.
tags
@
createShowView
()
@
renderShowView
()
# TODO tags
# Until we decide what to do w/ tags, removing them.
#@renderTags()
createEditView
:
()
->
if
@
showView
?
...
...
common/static/coffee/src/discussion/views/discussion_thread_view_inline.coffee
View file @
a1dc49cc
...
...
@@ -32,9 +32,6 @@ if Backbone?
@
renderShowView
()
@
renderAttrs
()
# TODO tags commenting out til we decide what to do with tags
#@renderTags()
@
$
(
"span.timeago"
).
timeago
()
@
$el
.
find
(
'.post-extended-content'
).
hide
()
if
@
expanded
...
...
common/static/coffee/src/discussion/views/new_post_inline_vew.coffee
View file @
a1dc49cc
...
...
@@ -9,9 +9,6 @@ if Backbone?
DiscussionUtil
.
makeWmdEditor
@
$el
,
$
.
proxy
(
@
$
,
@
),
"new-post-body"
# TODO tags: commenting out til we know what to do with them
#@$(".new-post-tags").tagsInput DiscussionUtil.tagsInputOptions()
events
:
"submit .new-post-form"
:
"createPost"
...
...
@@ -27,9 +24,6 @@ if Backbone?
body
=
@
$
(
".new-post-body"
).
find
(
".wmd-input"
).
val
()
group
=
@
$
(
".new-post-group option:selected"
).
attr
(
"value"
)
# TODO tags: commenting out til we know what to do with them
#tags = @$(".new-post-tags").val()
anonymous
=
false
||
@
$
(
"input.discussion-anonymous"
).
is
(
":checked"
)
anonymous_to_peers
=
false
||
@
$
(
"input.discussion-anonymous-to-peers"
).
is
(
":checked"
)
follow
=
false
||
@
$
(
"input.discussion-follow"
).
is
(
":checked"
)
...
...
@@ -48,9 +42,6 @@ if Backbone?
body
:
body
group_id
:
group
# TODO tags: commenting out til we know what to do with them
#tags: tags
anonymous
:
anonymous
anonymous_to_peers
:
anonymous_to_peers
auto_subscribe
:
follow
...
...
@@ -63,8 +54,4 @@ if Backbone?
@
$
(
".new-post-title"
).
val
(
""
).
attr
(
"prev-text"
,
""
)
@
$
(
".new-post-body textarea"
).
val
(
""
).
attr
(
"prev-text"
,
""
)
# TODO tags, commenting out til we know what to do with them
#@$(".new-post-tags").val("")
#@$(".new-post-tags").importTags("")
@
collection
.
add
thread
common/static/coffee/src/discussion/views/new_post_view.coffee
View file @
a1dc49cc
...
...
@@ -15,8 +15,6 @@ if Backbone?
DiscussionUtil
.
makeWmdEditor
@
$el
,
$
.
proxy
(
@
$
,
@
),
"new-post-body"
@
$
(
".new-post-tags"
).
tagsInput
DiscussionUtil
.
tagsInputOptions
()
if
@
$
(
$
(
".topic_menu li a"
)[
0
]).
attr
(
'cohorted'
)
!=
"True"
$
(
'.choose-cohort'
).
hide
();
...
...
@@ -126,7 +124,6 @@ if Backbone?
event
.
preventDefault
()
title
=
@
$
(
".new-post-title"
).
val
()
body
=
@
$
(
".new-post-body"
).
find
(
".wmd-input"
).
val
()
tags
=
@
$
(
".new-post-tags"
).
val
()
group
=
@
$
(
".new-post-group option:selected"
).
attr
(
"value"
)
anonymous
=
false
||
@
$
(
"input.discussion-anonymous"
).
is
(
":checked"
)
...
...
@@ -145,7 +142,6 @@ if Backbone?
data
:
title
:
title
body
:
body
tags
:
tags
anonymous
:
anonymous
anonymous_to_peers
:
anonymous_to_peers
auto_subscribe
:
follow
...
...
@@ -158,8 +154,6 @@ if Backbone?
@
$el
.
hide
()
@
$
(
".new-post-title"
).
val
(
""
).
attr
(
"prev-text"
,
""
)
@
$
(
".new-post-body textarea"
).
val
(
""
).
attr
(
"prev-text"
,
""
)
@
$
(
".new-post-tags"
).
val
(
""
)
@
$
(
".new-post-tags"
).
importTags
(
""
)
@
$
(
".wmd-preview p"
).
html
(
""
)
@
collection
.
add
thread
...
...
lms/djangoapps/django_comment_client/base/tests.py
View file @
a1dc49cc
...
...
@@ -71,7 +71,7 @@ class ViewsTestCase(UrlResetMixin, ModuleStoreTestCase):
"user_id":"1","username":"robot",
\
"votes":{"count":0,"up_count":0,
\
"down_count":0,"point":0},
\
"abuse_flaggers":[],
"tags":[],
\
"abuse_flaggers":[],
\
"type":"thread","group_id":null,
\
"pinned":false,
\
"endorsed":false,
\
...
...
@@ -119,7 +119,7 @@ class ViewsTestCase(UrlResetMixin, ModuleStoreTestCase):
"user_id":"1","username":"robot",
\
"votes":{"count":0,"up_count":0,
\
"down_count":0,"point":0},
\
"abuse_flaggers":[1],
"tags":[],
\
"abuse_flaggers":[1],
\
"type":"thread","group_id":null,
\
"pinned":false,
\
"endorsed":false,
\
...
...
@@ -179,7 +179,7 @@ class ViewsTestCase(UrlResetMixin, ModuleStoreTestCase):
"user_id":"1","username":"robot",
\
"votes":{"count":0,"up_count":0,
\
"down_count":0,"point":0},
\
"abuse_flaggers":[],
"tags":[],
\
"abuse_flaggers":[],
\
"type":"thread","group_id":null,
\
"pinned":false,
\
"endorsed":false,
\
...
...
lms/djangoapps/django_comment_client/base/urls.py
View file @
a1dc49cc
...
...
@@ -2,7 +2,6 @@ from django.conf.urls.defaults import url, patterns
urlpatterns
=
patterns
(
'django_comment_client.base.views'
,
# nopep8
url
(
r'upload$'
,
'upload'
,
name
=
'upload'
),
url
(
r'threads/tags/autocomplete$'
,
'tags_autocomplete'
,
name
=
'tags_autocomplete'
),
url
(
r'threads/(?P<thread_id>[\w\-]+)/update$'
,
'update_thread'
,
name
=
'update_thread'
),
url
(
r'threads/(?P<thread_id>[\w\-]+)/reply$'
,
'create_comment'
,
name
=
'create_comment'
),
url
(
r'threads/(?P<thread_id>[\w\-]+)/delete'
,
'delete_thread'
,
name
=
'delete_thread'
),
...
...
lms/djangoapps/django_comment_client/base/views.py
View file @
a1dc49cc
...
...
@@ -85,7 +85,7 @@ def create_thread(request, course_id, commentable_id):
else
:
anonymous_to_peers
=
False
thread
=
cc
.
Thread
(
**
extract
(
post
,
[
'body'
,
'title'
,
'tags'
]))
thread
=
cc
.
Thread
(
**
extract
(
post
,
[
'body'
,
'title'
]))
thread
.
update_attributes
(
**
{
'anonymous'
:
anonymous
,
'anonymous_to_peers'
:
anonymous_to_peers
,
...
...
@@ -142,7 +142,7 @@ def update_thread(request, course_id, thread_id):
Given a course id and thread id, update a existing thread, used for both static and ajax submissions
"""
thread
=
cc
.
Thread
.
find
(
thread_id
)
thread
.
update_attributes
(
**
extract
(
request
.
POST
,
[
'body'
,
'title'
,
'tags'
]))
thread
.
update_attributes
(
**
extract
(
request
.
POST
,
[
'body'
,
'title'
]))
thread
.
save
()
if
request
.
is_ajax
():
return
ajax_content_response
(
request
,
course_id
,
thread
.
to_dict
())
...
...
@@ -527,15 +527,6 @@ def search_similar_threads(request, course_id, commentable_id):
})
@require_GET
def
tags_autocomplete
(
request
,
course_id
):
value
=
request
.
GET
.
get
(
'q'
,
None
)
results
=
[]
if
value
:
results
=
cc
.
tags_autocomplete
(
value
)
return
JsonResponse
(
results
)
@require_POST
@login_required
@csrf.csrf_exempt
...
...
lms/djangoapps/django_comment_client/forum/views.py
View file @
a1dc49cc
...
...
@@ -38,7 +38,6 @@ def get_threads(request, course_id, discussion_id=None, per_page=THREADS_PER_PAG
'sort_key'
:
'date'
,
'sort_order'
:
'desc'
,
'text'
:
''
,
'tags'
:
''
,
'commentable_id'
:
discussion_id
,
'course_id'
:
course_id
,
'user_id'
:
request
.
user
.
id
,
...
...
@@ -80,7 +79,7 @@ def get_threads(request, course_id, discussion_id=None, per_page=THREADS_PER_PAG
strip_none
(
extract
(
request
.
GET
,
[
'page'
,
'sort_key'
,
'sort_order'
,
'text'
,
'
tags'
,
'
commentable_ids'
,
'flagged'
])))
'commentable_ids'
,
'flagged'
])))
threads
,
page
,
num_pages
=
cc
.
Thread
.
search
(
query_params
)
...
...
@@ -201,9 +200,6 @@ def forum_form_discussion(request, course_id):
# query_params={'follower_id': request.user.id},
#)
#trending_tags = cc.search_trending_tags(
# course_id,
#)
with
newrelic
.
agent
.
FunctionTrace
(
nr_transaction
,
"get_cohort_info"
):
cohorts
=
get_course_cohorts
(
course_id
)
cohorted_commentables
=
get_cohorted_commentables
(
course_id
)
...
...
@@ -214,7 +210,6 @@ def forum_form_discussion(request, course_id):
'csrf'
:
csrf
(
request
)[
'csrf_token'
],
'course'
:
course
,
#'recent_active_threads': recent_active_threads,
#'trending_tags': trending_tags,
'staff_access'
:
has_access
(
request
.
user
,
course
,
'staff'
),
'threads'
:
saxutils
.
escape
(
json
.
dumps
(
threads
),
escapedict
),
'thread_pages'
:
query_params
[
'num_pages'
],
...
...
@@ -284,10 +279,6 @@ def single_thread(request, course_id, discussion_id, thread_id):
# query_params={'follower_id': request.user.id},
#)
#trending_tags = cc.search_trending_tags(
# course_id,
#)
with
newrelic
.
agent
.
FunctionTrace
(
nr_transaction
,
"get_metadata_for_threads"
):
annotated_content_info
=
utils
.
get_metadata_for_threads
(
course_id
,
threads
,
request
.
user
,
user_info
)
...
...
@@ -304,7 +295,6 @@ def single_thread(request, course_id, discussion_id, thread_id):
'annotated_content_info'
:
saxutils
.
escape
(
json
.
dumps
(
annotated_content_info
),
escapedict
),
'course'
:
course
,
#'recent_active_threads': recent_active_threads,
#'trending_tags': trending_tags,
'course_id'
:
course
.
id
,
# TODO: Why pass both course and course.id to template?
'thread_id'
:
thread_id
,
'threads'
:
saxutils
.
escape
(
json
.
dumps
(
threads
),
escapedict
),
...
...
lms/djangoapps/django_comment_client/mustache_helpers.py
View file @
a1dc49cc
from
.utils
import
url_for_tags
as
_url_for_tags
import
django.core.urlresolvers
as
urlresolvers
import
sys
import
inspect
...
...
@@ -21,10 +19,6 @@ def url_for_user(content, user_id):
return
urlresolvers
.
reverse
(
'django_comment_client.forum.views.user_profile'
,
args
=
[
content
[
'course_id'
],
user_id
])
def
url_for_tags
(
content
,
tags
):
# assume that attribute 'tags' is in the format u'a, b, c'
return
_url_for_tags
(
content
[
'course_id'
],
tags
)
def
close_thread_text
(
content
):
if
content
.
get
(
'closed'
):
return
'Re-open thread'
...
...
lms/djangoapps/django_comment_client/utils.py
View file @
a1dc49cc
...
...
@@ -306,10 +306,6 @@ def get_metadata_for_threads(course_id, threads, user, user_info):
# put this method in utils.py to avoid circular import dependency between helpers and mustache_helpers
def
url_for_tags
(
course_id
,
tags
):
return
reverse
(
'django_comment_client.forum.views.forum_form_discussion'
,
args
=
[
course_id
])
+
'?'
+
urllib
.
urlencode
({
'tags'
:
tags
})
def
render_mustache
(
template_name
,
dictionary
,
*
args
,
**
kwargs
):
template
=
edxmako
.
lookup
[
'main'
]
.
get_template
(
template_name
)
.
source
return
pystache
.
render
(
template
,
dictionary
)
...
...
@@ -336,7 +332,6 @@ def extend_content(content):
content_info
=
{
'displayed_title'
:
content
.
get
(
'highlighted_title'
)
or
content
.
get
(
'title'
,
''
),
'displayed_body'
:
content
.
get
(
'highlighted_body'
)
or
content
.
get
(
'body'
,
''
),
'raw_tags'
:
','
.
join
(
content
.
get
(
'tags'
,
[])),
'permalink'
:
permalink
(
content
),
'roles'
:
roles
,
'updated'
:
content
[
'created_at'
]
!=
content
[
'updated_at'
],
...
...
@@ -365,7 +360,7 @@ def safe_content(content):
'endorsed'
,
'parent_id'
,
'thread_id'
,
'votes'
,
'closed'
,
'created_at'
,
'updated_at'
,
'depth'
,
'type'
,
'commentable_id'
,
'comments_count'
,
'at_position_list'
,
'children'
,
'highlighted_title'
,
'highlighted_body'
,
'courseware_title'
,
'courseware_url'
,
'
tags'
,
'
unread_comments_count'
,
'courseware_title'
,
'courseware_url'
,
'unread_comments_count'
,
'read'
,
'group_id'
,
'group_name'
,
'group_string'
,
'pinned'
,
'abuse_flaggers'
,
'stats'
...
...
lms/lib/comment_client/comment_client.py
View file @
a1dc49cc
...
...
@@ -22,26 +22,9 @@ def search_recent_active_threads(course_id, recursive=False, query_params={}, *a
return
perform_request
(
'get'
,
_url_for_search_recent_active_threads
(),
attributes
,
*
args
,
**
kwargs
)
def
search_trending_tags
(
course_id
,
query_params
=
{},
*
args
,
**
kwargs
):
default_params
=
{
'course_id'
:
course_id
}
attributes
=
dict
(
default_params
.
items
()
+
query_params
.
items
())
return
perform_request
(
'get'
,
_url_for_search_trending_tags
(),
attributes
,
*
args
,
**
kwargs
)
def
tags_autocomplete
(
value
,
*
args
,
**
kwargs
):
return
perform_request
(
'get'
,
_url_for_threads_tags_autocomplete
(),
{
'value'
:
value
},
*
args
,
**
kwargs
)
def
_url_for_search_similar_threads
():
return
"{prefix}/search/threads/more_like_this"
.
format
(
prefix
=
settings
.
PREFIX
)
def
_url_for_search_recent_active_threads
():
return
"{prefix}/search/threads/recent_active"
.
format
(
prefix
=
settings
.
PREFIX
)
def
_url_for_search_trending_tags
():
return
"{prefix}/search/tags/trending"
.
format
(
prefix
=
settings
.
PREFIX
)
def
_url_for_threads_tags_autocomplete
():
return
"{prefix}/threads/tags/autocomplete"
.
format
(
prefix
=
settings
.
PREFIX
)
lms/lib/comment_client/thread.py
View file @
a1dc49cc
...
...
@@ -16,7 +16,7 @@ class Thread(models.Model):
updatable_fields
=
[
'title'
,
'body'
,
'anonymous'
,
'anonymous_to_peers'
,
'course_id'
,
'closed'
,
'
tags'
,
'
user_id'
,
'commentable_id'
,
'group_id'
,
'group_name'
,
'pinned'
'closed'
,
'user_id'
,
'commentable_id'
,
'group_id'
,
'group_name'
,
'pinned'
]
initializable_fields
=
updatable_fields
...
...
@@ -34,7 +34,7 @@ class Thread(models.Model):
'recursive'
:
False
}
params
=
merge_dict
(
default_params
,
strip_blank
(
strip_none
(
query_params
)))
if
query_params
.
get
(
'text'
)
or
query_params
.
get
(
'tags'
)
:
if
query_params
.
get
(
'text'
):
url
=
cls
.
url
(
action
=
'search'
)
else
:
url
=
cls
.
url
(
action
=
'get_all'
,
params
=
extract
(
params
,
'commentable_id'
))
...
...
lms/static/css/vendor/jquery.tagsinput.css
deleted
100644 → 0
View file @
167cf94a
div
.tagsinput
{
border
:
1px
solid
#CCC
;
background
:
#FFF
;
padding
:
5px
;
width
:
300px
;
height
:
100px
;
overflow-y
:
auto
;}
div
.tagsinput
span
.tag
{
border
:
1px
solid
#a5d24a
;
-moz-border-radius
:
2px
;
-webkit-border-radius
:
2px
;
display
:
block
;
float
:
left
;
padding
:
5px
;
text-decoration
:
none
;
background
:
#cde69c
;
color
:
#638421
;
margin-right
:
5px
;
margin-bottom
:
5px
;
font-family
:
helvetica
;
font-size
:
13px
;}
div
.tagsinput
span
.tag
a
{
font-weight
:
bold
;
color
:
#82ad2b
;
text-decoration
:
none
;
font-size
:
11px
;
}
div
.tagsinput
input
{
width
:
80px
;
margin
:
0px
;
font-family
:
helvetica
;
font-size
:
13px
;
border
:
1px
solid
transparent
;
padding
:
5px
;
background
:
transparent
;
color
:
#000
;
outline
:
0px
;
margin-right
:
5px
;
margin-bottom
:
5px
;
}
div
.tagsinput
div
{
display
:
block
;
float
:
left
;
}
.tags_clear
{
clear
:
both
;
width
:
100%
;
height
:
0px
;
}
.not_valid
{
background
:
#FBD8DB
!important
;
color
:
#90111A
!important
;}
lms/static/js/jquery.tagsinput.js
deleted
100644 → 0
View file @
167cf94a
This diff is collapsed.
Click to expand it.
lms/static/sass/_discussion.scss
View file @
a1dc49cc
...
...
@@ -309,7 +309,7 @@ body.discussion {
}
}
.edit-post-title
,
.edit-post-tags
{
.edit-post-title
{
width
:
100%
;
height
:
40px
;
padding
:
0
10px
;
...
...
@@ -322,21 +322,6 @@ body.discussion {
box-shadow
:
0
1px
3px
rgba
(
0
,
0
,
0
,
0
.15
)
inset
;
}
.tagsinput
{
padding
:
10px
;
@include
box-sizing
(
border-box
);
border
:
1px
solid
#aaa
;
border-radius
:
3px
;
background
:
#fff
;
font-family
:
'Monaco'
,
monospace
;
font-size
:
13px
;
line-height
:
1
.6
;
box-shadow
:
0
1px
3px
rgba
(
0
,
0
,
0
,
0
.3
)
inset
;
span
.tag
{
margin-bottom
:
0
;
}
}
}
.new-post-form
{
...
...
@@ -369,22 +354,6 @@ body.discussion {
box-shadow
:
0
1px
3px
rgba
(
0
,
0
,
0
,
0
.3
)
inset
;
}
.tagsinput
{
padding
:
10px
;
@include
box-sizing
(
border-box
);
border
:
1px
solid
#333
;
border-radius
:
3px
;
background
:
#fff
;
font-family
:
'Monaco'
,
monospace
;
font-size
:
13px
;
line-height
:
1
.6
;
box-shadow
:
0
1px
3px
rgba
(
0
,
0
,
0
,
0
.3
)
inset
;
span
.tag
{
margin-bottom
:
0
;
}
}
.new-post-body
.wmd-preview
{
@include
discussion-wmd-preview
;
position
:
relative
;
...
...
@@ -409,8 +378,7 @@ body.discussion {
font-size
:
11px
;
}
.new-post-title
,
.new-post-tags
{
.new-post-title
{
width
:
100%
;
height
:
40px
;
padding
:
0
10px
;
...
...
@@ -418,15 +386,12 @@ body.discussion {
border-radius
:
3px
;
border
:
1px
solid
#333
;
font-size
:
16px
;
font-weight
:
700
;
font-family
:
'Open Sans'
,
sans-serif
;
color
:
#333
;
box-shadow
:
0
1px
3px
rgba
(
0
,
0
,
0
,
0
.3
)
inset
;
}
.new-post-title
{
font-weight
:
700
;
}
.submit
{
@include
blue-button
;
float
:
left
;
...
...
@@ -462,20 +427,6 @@ body.discussion {
.thread-tags
{
margin-top
:
$baseline
;
}
.thread-tag
{
margin-right
:
5px
;
padding
:
3px
$baseline
/
2
6px
;
border
:
1px
solid
#90c4d7
;
border-radius
:
3px
;
background
:
#c5eeff
;
color
:
#333
;
font-size
:
13px
;
}
.thread-title
{
display
:
block
;
margin-bottom
:
$baseline
;
...
...
@@ -2175,8 +2126,7 @@ body.discussion {
text-transform
:
uppercase
;
}
.new-post-title
,
.new-post-tags
{
.new-post-title
{
width
:
100%
;
height
:
40px
;
padding
:
0
$baseline
/
2
;
...
...
@@ -2184,31 +2134,12 @@ body.discussion {
border-radius
:
3px
;
border
:
1px
solid
#333
;
font-size
:
16px
;
font-weight
:
700
;
font-family
:
'Open Sans'
,
sans-serif
;
color
:
#333
;
box-shadow
:
0
1px
3px
rgba
(
0
,
0
,
0
,
0
.3
)
inset
;
}
.new-post-title
{
font-weight
:
700
;
}
.tagsinput
{
padding
:
$baseline
/
2
;
@include
box-sizing
(
border-box
);
border
:
1px
solid
#333
;
border-radius
:
3px
;
background
:
$white
;
font-family
:
'Monaco'
,
monospace
;
font-size
:
13px
;
line-height
:
1
.6
;
box-shadow
:
0
1px
3px
rgba
(
0
,
0
,
0
,
0
.3
)
inset
;
span
.tag
{
margin-bottom
:
0
;
}
}
.submit
{
@include
blue-button
;
float
:
left
;
...
...
@@ -2242,20 +2173,6 @@ body.discussion {
}
}
.thread-tags
{
margin
:
$baseline
0
;
}
.thread-tag
{
padding
:
3px
$baseline
/
2
6px
;
margin-right
:
5px
;
border-radius
:
3px
;
color
:
#333
;
background
:
#c5eeff
;
border
:
1px
solid
#90c4d7
;
font-size
:
13px
;
}
.thread-title
{
display
:
block
;
margin-bottom
:
$baseline
;
...
...
@@ -2519,7 +2436,7 @@ body.discussion {
}
}
.edit-post-title
,
.edit-post-tags
{
.edit-post-title
{
width
:
100%
;
height
:
40px
;
padding
:
0
$baseline
/
2
;
...
...
@@ -2531,36 +2448,6 @@ body.discussion {
color
:
#333
;
box-shadow
:
0
1px
3px
rgba
(
0
,
0
,
0
,
0
.15
)
inset
;
}
.tagsinput
{
padding
:
$baseline
/
2
;
@include
box-sizing
(
border-box
);
border
:
1px
solid
#aaa
;
border-radius
:
3px
;
background
:
$white
;
font-family
:
'Monaco'
,
monospace
;
font-size
:
13px
;
line-height
:
1
.6
;
box-shadow
:
0
1px
3px
rgba
(
0
,
0
,
0
,
0
.3
)
inset
;
span
.tag
{
margin-bottom
:
0
;
}
}
}
.thread-tags
{
margin
:
$baseline
0
;
}
.thread-tag
{
padding
:
3px
$baseline
/
2
6px
;
margin-right
:
5px
;
border-radius
:
3px
;
color
:
#333
;
background
:
#c5eeff
;
border
:
1px
solid
#90c4d7
;
font-size
:
13px
;
}
}
...
...
lms/static/sass/course/_discussions-inline.scss
View file @
a1dc49cc
...
...
@@ -233,8 +233,7 @@
text-transform
:
uppercase
;
}
.new-post-title
,
.new-post-tags
{
.new-post-title
{
width
:
100%
;
height
:
40px
;
padding
:
0
10px
;
...
...
@@ -242,31 +241,12 @@
border-radius
:
3px
;
border
:
1px
solid
#333
;
font-size
:
16px
;
font-weight
:
700
;
font-family
:
'Open Sans'
,
sans-serif
;
color
:
#333
;
box-shadow
:
0
1px
3px
rgba
(
0
,
0
,
0
,
0
.3
)
inset
;
}
.new-post-title
{
font-weight
:
700
;
}
.tagsinput
{
padding
:
10px
;
box-sizing
:
border-box
;
border
:
1px
solid
#333
;
border-radius
:
3px
;
background
:
#fff
;
font-family
:
'Monaco'
,
monospace
;
font-size
:
13px
;
line-height
:
1
.6
;
box-shadow
:
0
1px
3px
rgba
(
0
,
0
,
0
,
0
.3
)
inset
;
span
.tag
{
margin-bottom
:
0
;
}
}
.submit
{
@include
blue-button
;
float
:
left
;
...
...
@@ -300,19 +280,6 @@
}
}
.thread-tags
{
margin-top
:
20px
;
}
.thread-tag
{
padding
:
3px
10px
6px
;
border-radius
:
3px
;
color
:
#333
;
background
:
#c5eeff
;
border
:
1px
solid
#90c4d7
;
font-size
:
13px
;
}
.thread-title
{
display
:
block
;
margin-bottom
:
20px
;
...
...
lms/templates/discussion/_inline_new_post.html
View file @
a1dc49cc
...
...
@@ -42,11 +42,6 @@
<div
class=
"new-post-body"
name=
"body"
placeholder=
"Enter your question or comment…"
></div>
<!---<div class="new-post-preview"><span class="new-post-preview-label">Preview</span></div>-->
</div>
## TODO commenting out tags til we figure out what to do with them
##
<div
class=
"form-row"
>
##
<label
class=
"sr"
for=
"new-inline-post-tags"
>
${_("Add post tags")}
</label>
##
<input
type=
"text"
id=
"new-inline-post-tags"
class=
"new-post-tags"
name=
"tags"
placeholder=
"Tags"
>
##
</div>
<input
type=
"submit"
id=
"new-inline-post-submit"
class=
"submit"
value=
"${_("
Add
post
")}"
>
<a
href=
"#"
class=
"new-post-cancel"
>
${_("Cancel")}
</a>
</div>
...
...
lms/templates/discussion/_js_head_dependencies.html
View file @
a1dc49cc
...
...
@@ -7,11 +7,9 @@
<script
type=
"text/javascript"
src=
"${static.url('js/Markdown.Editor.js')}"
></script>
<script
type=
"text/javascript"
src=
"${static.url('js/jquery.autocomplete.js')}"
></script>
<script
type=
"text/javascript"
src=
"${static.url('js/jquery.timeago.js')}"
></script>
<script
type=
"text/javascript"
src=
"${static.url('js/jquery.tagsinput.js')}"
></script>
<script
type=
"text/javascript"
src=
"${static.url('js/mustache.js')}"
></script>
<script
type=
"text/javascript"
src=
"${static.url('js/vendor/URI.min.js')}"
></script>
<script
type=
"text/javascript"
src=
"${static.url('js/vendor/underscore-min.js')}"
></script>
<script
type=
"text/javascript"
src=
"${static.url('js/vendor/backbone-min.js')}"
></script>
<link
href=
"${static.url('css/vendor/jquery.tagsinput.css')}"
rel=
"stylesheet"
type=
"text/css"
>
<link
href=
"${static.url('css/vendor/jquery.autocomplete.css')}"
rel=
"stylesheet"
type=
"text/css"
>
lms/templates/discussion/_new_post.html
View file @
a1dc49cc
...
...
@@ -73,11 +73,6 @@
<div
class=
"new-post-body"
name=
"body"
placeholder=
"Enter your question or comment…"
></div>
<!---<div class="new-post-preview"><span class="new-post-preview-label">Preview</span></div>-->
</div>
## TODO tags commenting out til we figure out what to do w/ tags
##
<div
class=
"form-row"
>
##
<label
class=
"sr"
for=
"new-post-tags"
>
${_("Add post tags")}
</label>
##
<input
type=
"text"
id=
"new-post-tags"
class=
"new-post-tags"
name=
"tags"
placeholder=
"Tags"
>
##
</div>
<input
type=
"submit"
id=
"new-post-submit"
class=
"submit"
value=
"${_("
Add
post
")}"
>
<a
href=
"#"
class=
"new-post-cancel"
>
${_("Cancel")}
</a>
</div>
...
...
lms/templates/discussion/_search_bar.html
View file @
a1dc49cc
...
...
@@ -10,10 +10,6 @@ def base_url_for_search():
%
>
<form
action=
"${base_url_for_search()}"
method=
"get"
class=
"discussion-search-form"
>
% if query_params.get('tags', None):
<input
class=
"search-input"
type=
"text"
value=
"[${tags | h}]${text | h}"
id=
"keywords"
autocomplete=
"off"
/>
% else:
<input
class=
"search-input"
type=
"text"
value=
"${text | h}"
id=
"keywords"
autocomplete=
"off"
/>
% endif
<input
class=
"search-input"
type=
"text"
value=
"${text | h}"
id=
"keywords"
autocomplete=
"off"
/>
<div
class=
"discussion-link discussion-search-link"
href=
"javascript:void(0)"
>
${_("Search posts")}
</div>
</form>
lms/templates/discussion/_trending_tags.html
deleted
100644 → 0
View file @
167cf94a
<
%!
import
django_comment_client
.
helpers
as
helpers
%
>
% if trending_tags:
<article
class=
"discussion-sidebar-tags sidebar-module"
>
<header>
<h4>
Recent Tags
</h4>
</header>
<ol
class=
"discussion-sidebar-tags-list"
>
% for tag, count in trending_tags:
<li><a
href=
"${helpers.url_for_tags(course.id, tag) | h}"
class=
"thread-tag"
>
${tag | h}
</a><span
class=
"sidebar-tag-count"
>
×
${count | h}
</span></li>
% endfor
<ol>
</article>
% endif
lms/templates/discussion/_underscore_templates.html
View file @
a1dc49cc
...
...
@@ -91,12 +91,6 @@
<
div
class
=
"form-row"
>
<
div
class
=
"edit-post-body"
name
=
"body"
>
$
{
"<%- body %>"
}
<
/div
>
<
/div
>
##
TODO
tags
##
Until
we
decide
what
to
do
with
tags
,
commenting
them
out
.
##
<
div
class
=
"form-row"
>
##
<
label
class
=
"sr"
for
=
"edit-post-tags"
>
$
{
_
(
"Edit post tags"
)}
<
/label
>
##
<
input
type
=
"text"
id
=
"edit-post-tags"
class
=
"edit-post-tags"
name
=
"tags"
placeholder
=
"Tags"
value
=
"${"
<%-
tags
%>
"}"
>
##
<
/div
>
<
input
type
=
"submit"
id
=
"edit-post-submit"
class
=
"post-update"
value
=
"${_("
Update
post
")}"
>
<
a
href
=
"#"
class
=
"post-cancel"
>
$
{
_
(
"Cancel"
)}
<
/a
>
<
/div
>
...
...
lms/templates/discussion/mustache/_inline_discussion.mustache
View file @
a1dc49cc
...
...
@@ -12,10 +12,6 @@
<div
class=
"new-post-body"
name=
"body"
placeholder=
"Enter your question or comment…"
></div>
<!---<div class="new-post-preview"><span class="new-post-preview-label">Preview</span></div>-->
</div>
{{! TODO tags: Getting rid of tags for now. }}
{{!<div class="form-row">}}
{{! <input type="text" class="new-post-tags" name="tags" placeholder="Tags">}}
{{!</div>}}
<input
type=
"submit"
class=
"submit"
value=
"Add post"
>
<a
href=
"#"
class=
"new-post-cancel"
>
Cancel
</a>
<div
class=
"options"
>
...
...
lms/templates/discussion/mustache/_inline_discussion_cohorted.mustache
View file @
a1dc49cc
...
...
@@ -12,10 +12,6 @@
<div
class=
"new-post-body"
name=
"body"
placeholder=
"Enter your question or comment…"
></div>
<!---<div class="new-post-preview"><span class="new-post-preview-label">Preview</span></div>-->
</div>
{{! TODO tags: Getting rid of tags for now. }}
{{!<div class="form-row">}}
{{! <input type="text" class="new-post-tags" name="tags" placeholder="Tags">}}
{{!</div>}}
<input
type=
"submit"
class=
"submit"
value=
"Add post"
>
<a
href=
"#"
class=
"new-post-cancel"
>
Cancel
</a>
<div
class=
"options"
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment