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
77900bd7
Commit
77900bd7
authored
Aug 06, 2012
by
Rocky Duan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
simple blank slate
parent
42cab659
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
34 additions
and
11 deletions
+34
-11
lms/djangoapps/django_comment_client/forum/views.py
+7
-1
lms/templates/discussion/_blank_slate.html
+7
-0
lms/templates/discussion/_forum.html
+10
-5
lms/templates/discussion/_inline.html
+10
-5
No files found.
lms/djangoapps/django_comment_client/forum/views.py
View file @
77900bd7
...
@@ -22,6 +22,11 @@ import dateutil
...
@@ -22,6 +22,11 @@ import dateutil
THREADS_PER_PAGE
=
5
THREADS_PER_PAGE
=
5
PAGES_NEARBY_DELTA
=
2
PAGES_NEARBY_DELTA
=
2
def
_should_perform_search
(
request
):
return
bool
(
request
.
GET
.
get
(
'text'
,
False
)
or
\
request
.
GET
.
get
(
'tags'
,
False
))
def
render_accordion
(
request
,
course
,
discussion_id
):
def
render_accordion
(
request
,
course
,
discussion_id
):
discussion_info
=
utils
.
get_categorized_discussion_info
(
request
,
course
)
discussion_info
=
utils
.
get_categorized_discussion_info
(
request
,
course
)
...
@@ -56,6 +61,7 @@ def render_discussion(request, course_id, threads, discussion_id=None, \
...
@@ -56,6 +61,7 @@ def render_discussion(request, course_id, threads, discussion_id=None, \
'user_info'
:
comment_client
.
get_user_info
(
request
.
user
.
id
,
raw
=
True
),
'user_info'
:
comment_client
.
get_user_info
(
request
.
user
.
id
,
raw
=
True
),
'course_id'
:
course_id
,
'course_id'
:
course_id
,
'request'
:
request
,
'request'
:
request
,
'performed_search'
:
_should_perform_search
(
request
),
'pages_nearby_delta'
:
PAGES_NEARBY_DELTA
,
'pages_nearby_delta'
:
PAGES_NEARBY_DELTA
,
'discussion_type'
:
discussion_type
,
'discussion_type'
:
discussion_type
,
'base_url'
:
base_url
,
'base_url'
:
base_url
,
...
@@ -81,7 +87,7 @@ def get_threads(request, course_id, discussion_id):
...
@@ -81,7 +87,7 @@ def get_threads(request, course_id, discussion_id):
'tags'
:
request
.
GET
.
get
(
'tags'
,
''
),
'tags'
:
request
.
GET
.
get
(
'tags'
,
''
),
}
}
if
query_params
[
'text'
]
or
query_params
[
'tags'
]:
#TODO do tags search without sunspot
if
_should_perform_search
(
request
):
query_params
[
'commentable_id'
]
=
discussion_id
query_params
[
'commentable_id'
]
=
discussion_id
threads
,
page
,
num_pages
=
comment_client
.
search_threads
(
course_id
,
recursive
=
False
,
query_params
=
utils
.
strip_none
(
query_params
))
threads
,
page
,
num_pages
=
comment_client
.
search_threads
(
course_id
,
recursive
=
False
,
query_params
=
utils
.
strip_none
(
query_params
))
else
:
else
:
...
...
lms/templates/discussion/_blank_slate.html
0 → 100644
View file @
77900bd7
<div
class=
"blank-state"
>
% if performed_search:
There is no result matching your search parameters.
% else:
There is no post here yet. Be the first one to post!
% endif
</div>
lms/templates/discussion/_forum.html
View file @
77900bd7
...
@@ -15,11 +15,16 @@
...
@@ -15,11 +15,16 @@
<div
class=
"discussion-new-post control-button"
href=
"javascript:void(0)"
>
New Post
</div>
<div
class=
"discussion-new-post control-button"
href=
"javascript:void(0)"
>
New Post
</div>
</div>
</div>
<
%
include
file=
"_sort.html"
/>
<
%
include
file=
"_sort.html"
/>
<div
class=
"threads"
>
% if len(threads) == 0:
% for thread in threads:
<
%
include
file=
"_blank_slate.html"
/>
${renderer.render_thread(course_id, thread, show_comments=False)}
<div
class=
"threads"
></div>
% endfor
% else:
</div>
<div
class=
"threads"
>
% for thread in threads:
${renderer.render_thread(course_id, thread, show_comments=False)}
% endfor
</div>
% endif
<
%
include
file=
"_paginator.html"
/>
<
%
include
file=
"_paginator.html"
/>
</section>
</section>
...
...
lms/templates/discussion/_inline.html
View file @
77900bd7
...
@@ -8,11 +8,16 @@
...
@@ -8,11 +8,16 @@
<div
class=
"discussion-new-post control-button"
href=
"javascript:void(0)"
>
New Post
</div>
<div
class=
"discussion-new-post control-button"
href=
"javascript:void(0)"
>
New Post
</div>
<
%
include
file=
"_sort.html"
/>
<
%
include
file=
"_sort.html"
/>
</div>
</div>
<div
class=
"threads"
>
% if len(threads) == 0:
% for thread in threads:
<
%
include
file=
"_blank_slate.html"
/>
${renderer.render_thread(course_id, thread, show_comments=False)}
<div
class=
"threads"
></div>
% endfor
% else:
</div>
<div
class=
"threads"
>
% for thread in threads:
${renderer.render_thread(course_id, thread, show_comments=False)}
% endfor
</div>
% endif
<
%
include
file=
"_paginator.html"
/>
<
%
include
file=
"_paginator.html"
/>
</section>
</section>
...
...
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