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
505fb681
Commit
505fb681
authored
Aug 27, 2012
by
Matthew Mongeau
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Initial work on single thread view.
parent
4215f0e4
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
59 additions
and
3 deletions
+59
-3
lms/djangoapps/django_comment_client/forum/views.py
+4
-0
lms/static/sass/_discussion.scss
+22
-0
lms/templates/discussion/_single_thread.html
+3
-1
lms/templates/discussion/index.html
+3
-2
lms/templates/discussion/single_thread.html
+27
-0
No files found.
lms/djangoapps/django_comment_client/forum/views.py
View file @
505fb681
...
...
@@ -176,6 +176,7 @@ def forum_form_discussion(request, course_id):
def
render_single_thread
(
request
,
discussion_id
,
course_id
,
thread_id
):
thread
=
cc
.
Thread
.
find
(
thread_id
)
.
retrieve
(
recursive
=
True
)
.
to_dict
()
threads
,
query_params
=
get_threads
(
request
,
course_id
)
user_info
=
cc
.
User
.
from_django_user
(
request
.
user
)
.
to_dict
()
...
...
@@ -188,6 +189,7 @@ def render_single_thread(request, discussion_id, course_id, thread_id):
'course_id'
:
course_id
,
'request'
:
request
,
'discussion_data'
:
json
.
dumps
({
discussion_id
:
[
utils
.
safe_content
(
thread
)]
}),
'threads'
:
threads
,
}
return
render_to_string
(
'discussion/_single_thread.html'
,
context
)
...
...
@@ -209,6 +211,7 @@ def single_thread(request, course_id, discussion_id, thread_id):
else
:
course
=
get_course_with_access
(
request
.
user
,
course_id
,
'load'
)
threads
,
query_params
=
get_threads
(
request
,
course_id
)
recent_active_threads
=
cc
.
search_recent_active_threads
(
course_id
,
...
...
@@ -229,6 +232,7 @@ def single_thread(request, course_id, discussion_id, thread_id):
'recent_active_threads'
:
recent_active_threads
,
'trending_tags'
:
trending_tags
,
'course_id'
:
course
.
id
,
'threads'
:
threads
,
}
return
render_to_response
(
'discussion/single_thread.html'
,
context
)
...
...
lms/static/sass/_discussion.scss
View file @
505fb681
...
...
@@ -19,6 +19,28 @@
vertical-align
:
baseline
;
}
.discussion
{
display
:
table-cell
;
vertical-align
:
top
;
width
:
72
.3%
;
padding
:
40px
;
h1
{
font-size
:
28px
;
font-weight
:
700
;
}
.posted-details
{
font-size
:
12px
;
font-style
:
italic
;
color
:
#737373
;
}
p
+
p
{
margin-top
:
20px
;
}
}
.discussion-sidebar
{
display
:
table-cell
;
...
...
lms/templates/discussion/_single_thread.html
View file @
505fb681
<
%
namespace
name=
"renderer"
file=
"_content_renderer.html"
/>
<section
class=
"discussion"
_id=
"${discussion_id | h}"
>
<a
class=
"discussion-title"
href=
"javascript:void(0)"
>
Discussion
</a>
<a
class=
"discussion-title"
href=
"javascript:void(0)"
>
${thread['title'] | h}
</a>
<p
class=
"posted-details"
><span
class=
"timeago"
title=
"${thread['created_at'] | h}"
>
sometime
</span>
by
<a
href=
"#"
>
Foo
</a></p>
<div
class=
"threads"
>
${renderer.render_content_with_comments(thread)}
</div>
</section>
<
%
include
file=
"_js_data.html"
/>
<script
type=
"text/javascript"
>
$
(
document
).
ready
(
function
()
{
$
(
"span.timeago"
).
timeago
()
})
</script>
lms/templates/discussion/index.html
View file @
505fb681
<
%!
import
django_comment_client
.
helpers
as
helpers
%
>
<
%
inherit
file=
"../main.html"
/>
<
%
namespace
name=
'static'
file=
'../static_content.html'
/>
<
%
block
name=
"bodyclass"
>
discussion
</
%
block>
...
...
@@ -30,13 +31,13 @@
<div
class=
"post-list-wrapper"
>
<ul
class=
"post-list"
>
% for thread in threads:
<li><a
href=
"
#
"
><span
class=
"title"
>
${thread['title'] | h}
</span>
<span
class=
"comments"
>
${thread['comments_count'] | h}
</span><span
class=
"votes"
>
+${thread['votes']['up_count'] | h}
</span></a></li>
<li><a
href=
"
${helpers.permalink(thread) | h}
"
><span
class=
"title"
>
${thread['title'] | h}
</span>
<span
class=
"comments"
>
${thread['comments_count'] | h}
</span><span
class=
"votes"
>
+${thread['votes']['up_count'] | h}
</span></a></li>
% endfor
</ul>
</div>
</article>
<section
class=
"discussion-content"
>
Oh
This page intentionally left blank
</section>
</div>
...
...
lms/templates/discussion/single_thread.html
View file @
505fb681
<
%!
import
django_comment_client
.
helpers
as
helpers
%
>
<
%
inherit
file=
"../main.html"
/>
<
%
namespace
name=
'static'
file=
'../static_content.html'
/>
<
%
block
name=
"bodyclass"
>
discussion
</
%
block>
...
...
@@ -16,6 +17,32 @@
<
%
include
file=
"../courseware/course_navigation.html"
args=
"active_page='discussion'"
/>
<section
class=
"container"
>
<div
class=
"discussion-wrapper"
>
<article
class=
"discussion-sidebar"
>
<div
class=
"board-selector"
>
<a
href=
"#"
class=
"board-drop-btn"
>
Homework / Week 1
<span
class=
"drop-arrow"
>
▾
</span></a>
<div
class=
"board-drop-menu"
>
</div>
</div>
<div
class=
"sort-bar"
>
<a
href=
"#"
><span
class=
"sort-label"
>
Sort by:
</span>
most recent
<span
class=
"drop-arrow"
>
▾
</span></a>
</div>
<div
class=
"post-list-wrapper"
>
<ul
class=
"post-list"
>
% for thread in threads:
<li><a
href=
"${helpers.permalink(thread) | h}"
><span
class=
"title"
>
${thread['title'] | h}
</span>
<span
class=
"comments"
>
${thread['comments_count'] | h}
</span><span
class=
"votes"
>
+${thread['votes']['up_count'] | h}
</span></a></li>
% endfor
</ul>
</div>
</article>
<section
class=
"discussion-content"
>
${content.decode('utf-8')}
</section>
</div>
</section>
<section
class=
"container"
>
<div
class=
"course-wrapper"
>
<section
aria-label=
"Course Navigation"
class=
"course-index"
>
<nav>
...
...
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