Merge pull request #11838 from edx/jia/TNL-3818

TNL-3818: fixed recent activity mapping in thread-list sort
This commit is contained in:
wajeeha-khalid
2016-04-13 20:57:52 +05:00
9 changed files with 20 additions and 18 deletions

View File

@@ -332,6 +332,7 @@ def make_minimal_cs_thread(overrides=None):
"anonymous_to_peers": False,
"created_at": "1970-01-01T00:00:00Z",
"updated_at": "1970-01-01T00:00:00Z",
"last_activity_at": "1970-01-01T00:00:00Z",
"thread_type": "discussion",
"title": "dummy",
"body": "dummy",

View File

@@ -94,7 +94,7 @@ def get_threads(request, course, discussion_id=None, per_page=THREADS_PER_PAGE):
default_query_params = {
'page': 1,
'per_page': per_page,
'sort_key': 'date',
'sort_key': 'activity',
'sort_order': 'desc',
'text': '',
'course_id': unicode(course.id),

View File

@@ -654,7 +654,7 @@ def prepare_content(content, course_key, is_staff=False, course_is_cohorted=None
'read', 'group_id', 'group_name', 'pinned', 'abuse_flaggers',
'stats', 'resp_skip', 'resp_limit', 'resp_total', 'thread_type',
'endorsed_responses', 'non_endorsed_responses', 'non_endorsed_resp_total',
'endorsement', 'context'
'endorsement', 'context', 'last_activity_at'
]
if (content.get('anonymous') is False) and ((content.get('anonymous_to_peers') is False) or is_staff):

View File

@@ -20,7 +20,7 @@ class Thread(models.Model):
'highlighted_body', 'endorsed', 'read', 'group_id', 'group_name', 'pinned',
'abuse_flaggers', 'resp_skip', 'resp_limit', 'resp_total', 'thread_type',
'endorsed_responses', 'non_endorsed_responses', 'non_endorsed_resp_total',
'context',
'context', 'last_activity_at',
]
# updateable_fields are sent in PUT requests

View File

@@ -54,7 +54,7 @@
<span class="sr">${_("Sort:")}</span>
<select class="forum-nav-sort-control">
## Translators: This is a menu option for sorting forum threads
<option value="date">${_("by recent activity")}</option>
<option value="activity">${_("by recent activity")}</option>
## Translators: This is a menu option for sorting forum threads
<option value="comments">${_("by most activity")}</option>
## Translators: This is a menu option for sorting forum threads