Add pagination to forum user profile page

This commit is contained in:
Greg Price
2014-04-16 11:11:41 -04:00
parent 643069c64c
commit 0e59038c72
11 changed files with 362 additions and 66 deletions

View File

@@ -299,8 +299,8 @@ class UserProfileTestCase(ModuleStoreTestCase):
self.assertEqual(response.status_code, 200)
self.assertEqual(response['Content-Type'], 'text/html; charset=utf-8')
html = response.content
self.assertRegexpMatches(html, r'var \$\$course_id = \"{}\"'.format(self.course.id))
self.assertRegexpMatches(html, r'var \$\$profiled_user_id = \"{}\"'.format(self.profiled_user.id))
self.assertRegexpMatches(html, r'data-page="1"')
self.assertRegexpMatches(html, r'data-num-pages="1"')
self.assertRegexpMatches(html, r'<span>1</span> discussion started')
self.assertRegexpMatches(html, r'<span>2</span> comments')
self.assertRegexpMatches(html, r'&quot;id&quot;: &quot;{}&quot;'.format(self.TEST_THREAD_ID))

View File

@@ -353,6 +353,8 @@ def user_profile(request, course_id, user_id):
'threads': saxutils.escape(json.dumps(threads), escapedict),
'user_info': saxutils.escape(json.dumps(user_info), escapedict),
'annotated_content_info': saxutils.escape(json.dumps(annotated_content_info), escapedict),
'page': query_params['page'],
'num_pages': query_params['num_pages'],
# 'content': content,
}