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
ff4d0637
Commit
ff4d0637
authored
Jul 31, 2012
by
Brittany Cheng
Browse files
Options
Browse Files
Download
Plain Diff
merging styles
parents
643316a1
20f958e6
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
54 additions
and
19 deletions
+54
-19
common/static/js/vendor/jquery.tagsinput.js
+2
-1
lms/djangoapps/django_comment_client/forum/views.py
+4
-4
lms/static/coffee/src/discussion.coffee
+46
-6
lms/static/sass/_discussion.scss
+1
-1
lms/templates/discussion/inline.html
+1
-7
No files found.
common/static/js/vendor/jquery.tagsinput.js
View file @
ff4d0637
...
...
@@ -227,6 +227,7 @@
markup
=
markup
+
'</div><div class="tags_clear"></div></div>'
;
$
(
markup
).
insertAfter
(
this
);
$
(
data
.
holder
).
css
(
'width'
,
settings
.
width
);
$
(
data
.
holder
).
css
(
'min-height'
,
settings
.
height
);
...
...
@@ -240,6 +241,7 @@
$
(
data
.
fake_input
).
css
(
'color'
,
settings
.
placeholderColor
);
$
(
data
.
fake_input
).
resetAutosize
(
settings
);
$
(
data
.
fake_input
).
doAutosize
(
settings
);
$
(
data
.
holder
).
bind
(
'click'
,
data
,
function
(
event
)
{
$
(
event
.
data
.
fake_input
).
focus
();
});
...
...
@@ -260,7 +262,6 @@
if
(
jQuery
.
Autocompleter
!==
undefined
)
{
onSelectCallback
=
settings
.
autocomplete
.
onItemSelect
;
settings
.
autocomplete
.
onItemSelect
=
function
()
{
console
.
log
(
"here"
);
$
(
data
.
real_input
).
addTag
(
$
(
data
.
fake_input
).
val
(),
{
focus
:
true
,
unique
:
(
settings
.
unique
)});
$
(
data
.
fake_input
).
resetAutosize
(
settings
);
if
(
onSelectCallback
)
{
...
...
lms/djangoapps/django_comment_client/forum/views.py
View file @
ff4d0637
...
...
@@ -29,11 +29,12 @@ def render_accordion(request, course, discussion_id):
return
render_to_string
(
'discussion/accordion.html'
,
context
)
def
render_discussion
(
request
,
course_id
,
threads
,
discussion_id
=
None
,
search_text
=
''
):
def
render_discussion
(
request
,
course_id
,
threads
,
discussion_id
=
None
,
with_search_bar
=
True
,
search_text
=
''
):
context
=
{
'threads'
:
threads
,
'discussion_id'
:
discussion_id
,
'search_bar'
:
render_search_bar
(
request
,
course_id
,
discussion_id
,
text
=
search_text
),
'search_bar'
:
''
if
not
with_search_bar
\
else
render_search_bar
(
request
,
course_id
,
discussion_id
,
text
=
search_text
),
'user_info'
:
comment_client
.
get_user_info
(
request
.
user
.
id
,
raw
=
True
),
'tags'
:
comment_client
.
get_threads_tags
(
raw
=
True
),
'course_id'
:
course_id
,
...
...
@@ -41,9 +42,8 @@ def render_discussion(request, course_id, threads, discussion_id=None, search_te
return
render_to_string
(
'discussion/inline.html'
,
context
)
def
inline_discussion
(
request
,
course_id
,
discussion_id
):
print
"rendering inline"
threads
=
comment_client
.
get_threads
(
discussion_id
,
recursive
=
False
)
html
=
render_discussion
(
request
,
course_id
,
threads
,
discussion_id
)
html
=
render_discussion
(
request
,
course_id
,
threads
,
discussion_id
=
discussion_id
)
return
HttpResponse
(
html
,
content_type
=
"text/plain"
)
def
render_search_bar
(
request
,
course_id
,
discussion_id
=
None
,
text
=
''
):
...
...
lms/static/coffee/src/discussion.coffee
View file @
ff4d0637
...
...
@@ -29,6 +29,17 @@ generateDiscussionLink = (cls, txt, handler) ->
Discussion
=
newPostTemplate
:
"""
<form class="new-post-form" _id="{{discussion_id}}">
<ul class="discussion-errors"></ul>
<input type="text" class="new-post-title title-input" placeholder="Title"/>
<div class="new-post-body body-input"></div>
<input class="new-post-tags" placeholder="Tags"/>
<a class="discussion-submit-post control-button" href="javascript:void(0)">Submit</a>
<a class="discussion-cancel-post control-button" href="javascript:void(0)">Cancel</a>
</form>
"""
replyTemplate
:
"""
<form class="discussion-reply-new">
<ul class="discussion-errors"></ul>
...
...
@@ -169,9 +180,7 @@ Discussion =
watchDiscussion
=
generateDiscussionLink
(
"discussion-watch-discussion"
,
"Watch"
,
handleWatchDiscussion
)
$local
(
".discussion-title-wrapper"
).
append
(
watchDiscussion
)
newPostBody
=
$
(
discussion
).
find
(
".new-post-body"
)
if
newPostBody
.
length
Markdown
.
makeWmdEditor
newPostBody
,
"-new-post-body-
#{
$
(
discussion
).
attr
(
'_id'
)
}
"
,
Discussion
.
urlFor
(
'upload'
)
initializeWatchThreads
=
(
index
,
thread
)
->
$thread
=
$
(
thread
)
...
...
@@ -192,7 +201,6 @@ Discussion =
Discussion
.
handleAnchorAndReload
(
response
)
,
'json'
if
id
in
$$user_info
.
subscribed_thread_ids
unwatchThread
=
generateDiscussionLink
(
"discussion-unwatch-thread"
,
"Unwatch"
,
handleUnwatchThread
)
$local
(
".info"
).
append
(
unwatchThread
)
...
...
@@ -406,7 +414,7 @@ Discussion =
else
window
.
location
=
Discussion
.
urlFor
(
'search'
)
+
'?text='
+
encodeURI
(
text
)
handleSubmitNew
Thread
=
(
elem
)
->
handleSubmitNew
Post
=
(
elem
)
->
title
=
$local
(
".new-post-title"
).
val
()
body
=
$local
(
"#wmd-input-new-post-body-
#{
id
}
"
).
val
()
tags
=
$local
(
".new-post-tags"
).
val
()
...
...
@@ -419,6 +427,38 @@ Discussion =
else
Discussion
.
handleAnchorAndReload
(
response
)
,
'json'
handleCancelNewPost
=
(
elem
)
->
$local
(
".new-post-form"
).
hide
()
$local
(
".discussion-new-post"
).
show
()
handleNewPost
=
(
elem
)
->
newPostForm
=
$local
(
".new-post-form"
)
if
newPostForm
.
length
newPostForm
.
show
()
$
(
elem
).
hide
()
else
view
=
{
discussion_id
:
id
}
$discussionNonContent
.
append
Mustache
.
render
Discussion
.
newPostTemplate
,
view
newPostBody
=
$
(
discussion
).
find
(
".new-post-body"
)
if
newPostBody
.
length
Markdown
.
makeWmdEditor
newPostBody
,
"-new-post-body-
#{
$
(
discussion
).
attr
(
'_id'
)
}
"
,
Discussion
.
urlFor
(
'upload'
)
$local
(
".new-post-tags"
).
tagsInput
autocomplete_url
:
Discussion
.
urlFor
(
'tags_autocomplete'
)
autocomplete
:
remoteDataType
:
'json'
interactive
:
true
defaultText
:
"Tag your post: press enter after each tag"
height
:
"30px"
width
:
"85%"
removeWithBackspace
:
true
$local
(
".discussion-submit-post"
).
click
->
handleSubmitNewPost
(
this
)
$local
(
".discussion-cancel-post"
).
click
->
handleCancelNewPost
(
this
)
$
(
elem
).
hide
()
$local
(
".discussion-search-form"
).
submit
(
event
)
->
event
.
preventDefault
()
...
...
@@ -427,7 +467,7 @@ Discussion =
handleSearch
(
text
,
isSearchWithinBoard
)
$local
(
".discussion-new-post"
).
click
->
handle
SubmitNewThread
(
this
)
handle
NewPost
(
this
)
$local
(
".discussion-search"
).
click
->
$local
(
".new-post-form"
).
submit
()
...
...
lms/static/sass/_discussion.scss
View file @
ff4d0637
...
...
@@ -152,7 +152,7 @@ $discussion_input_width: 90%;
width
:
inherit
;
}
}
.discussion-content-edit
,
.discussion-reply-new
{
.discussion-content-edit
,
.discussion-reply-new
,
.new-post-form
{
.control-button
{
display
:
inline-block
;
}
...
...
lms/templates/discussion/inline.html
View file @
ff4d0637
...
...
@@ -6,13 +6,7 @@
<a
class=
"discussion-title"
href=
"javascript:void(0)"
>
Discussion
</a>
</div>
${search_bar}
<form
class=
"new-post-form"
_id=
"${discussion_id}"
>
<ul
class=
"discussion-errors"
></ul>
<input
type=
"text"
class=
"new-post-title title-input"
placeholder=
"Title"
/>
<div
class=
"new-post-body body-input"
></div>
<input
class=
"new-post-tags"
placeholder=
"Tags"
/>
<a
class=
"discussion-new-post control-button"
href=
"javascript:void(0)"
>
New Post
</a>
</form>
<a
class=
"discussion-new-post control-button"
href=
"javascript:void(0)"
>
New Post
</a>
</div>
% for thread in threads:
${renderer.render_thread(course_id, thread, edit_thread=False, show_comments=False)}
...
...
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