From c3e3fee963df4b81129121152c88231dd55bea1d Mon Sep 17 00:00:00 2001 From: Ibrahim Awwal Date: Thu, 6 Sep 2012 23:37:43 -0700 Subject: [PATCH] Convert expand/collapse into buttons and change default sort order to date. Buttons should be styled better but I don't know how to do it. --- .../django_comment_client/forum/views.py | 9 ++++++-- lms/static/sass/_discussion.scss | 22 +++++++++++++++++++ .../mustache/_inline_thread.mustache | 4 ++-- 3 files changed, 31 insertions(+), 4 deletions(-) diff --git a/lms/djangoapps/django_comment_client/forum/views.py b/lms/djangoapps/django_comment_client/forum/views.py index c21bfcbd6f..14ed01cc18 100644 --- a/lms/djangoapps/django_comment_client/forum/views.py +++ b/lms/djangoapps/django_comment_client/forum/views.py @@ -111,7 +111,7 @@ def get_threads(request, course_id, discussion_id=None): default_query_params = { 'page': 1, 'per_page': THREADS_PER_PAGE, - 'sort_key': 'activity', + 'sort_key': 'date', 'sort_order': 'desc', 'text': '', 'tags': '', @@ -129,8 +129,10 @@ def get_threads(request, course_id, discussion_id=None): return threads, query_params -# discussion per page is fixed for now def inline_discussion(request, course_id, discussion_id): + """ + Renders JSON for DiscussionModules + """ threads, query_params = get_threads(request, course_id, discussion_id) # TODO: Remove all of this stuff or switch back to server side rendering once templates are mustache again # html = render_inline_discussion(request, course_id, threads, discussion_id=discussion_id, \ @@ -159,6 +161,9 @@ def render_search_bar(request, course_id, discussion_id=None, text=''): return render_to_string('discussion/_search_bar.html', context) def forum_form_discussion(request, course_id): + """ + Renders the main Discussion page + """ course = get_course_with_access(request.user, course_id, 'load') category_map = utils.get_discussion_category_map(course) threads, query_params = get_threads(request, course_id) diff --git a/lms/static/sass/_discussion.scss b/lms/static/sass/_discussion.scss index 62534f48c6..488eaab732 100644 --- a/lms/static/sass/_discussion.scss +++ b/lms/static/sass/_discussion.scss @@ -1199,6 +1199,27 @@ body.discussion { > header .vote-btn { margin-top: 5px; } + + .post-tools { + .ui-icon { + display: inline; + float: right; + } + a { + display: inline; + float: left; + height: 26px; + padding: 0 12px; + border-radius: 3px; + border: 1px solid #b2b2b2; + @include linear-gradient(top, #fff 35%, #ebebeb); + font-size: 13px; + line-height: 24px; + color: #737373; + box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1); + width: 6em; + } + } } .discussion-post header, @@ -1541,6 +1562,7 @@ body.discussion { } .post-body { font-size: 14px; + clear: both; } } diff --git a/lms/templates/discussion/mustache/_inline_thread.mustache b/lms/templates/discussion/mustache/_inline_thread.mustache index b45f3ff47b..b2c29aab07 100644 --- a/lms/templates/discussion/mustache/_inline_thread.mustache +++ b/lms/templates/discussion/mustache/_inline_thread.mustache @@ -12,8 +12,8 @@

- Expand... - Collapse... + Expand + Collapse
{{abbreviatedBody}}