Commit 53a1611e by Ibrahim Awwal

Change following=>followed.

parent ef8ca23d
......@@ -2,7 +2,7 @@ from django.conf.urls.defaults import url, patterns
import django_comment_client.forum.views
urlpatterns = patterns('django_comment_client.forum.views',
url(r'users/(?P<user_id>\w+)/following$', 'following_threads', name='following_threads'),
url(r'users/(?P<user_id>\w+)/followed$', 'followed_threads', name='followed_threads'),
url(r'users/(?P<user_id>\w+)$', 'user_profile', name='user_profile'),
url(r'(?P<discussion_id>[\w\-]+)/threads/(?P<thread_id>\w+)$', 'single_thread', name='single_thread'),
url(r'(?P<discussion_id>[\w\-]+)/inline$', 'inline_discussion', name='inline_discussion'),
......
......@@ -279,7 +279,7 @@ def user_profile(request, course_id, user_id):
raise Http404
def following_threads(request, course_id, user_id):
def followed_threads(request, course_id, user_id):
course = get_course_with_access(request.user, course_id, 'load')
try:
profiled_user = cc.User(id=user_id, course_id=course_id)
......
......@@ -26,7 +26,6 @@ if Backbone?
model
retrieveAnotherPage: (mode, options={}, sort_options={})->
# TODO: I really feel that this belongs in DiscussionThreadListView
@current_page += 1
data = { page: @current_page }
switch mode
......@@ -37,8 +36,8 @@ if Backbone?
data['commentable_ids'] = options.commentable_ids
when 'all'
url = DiscussionUtil.urlFor 'threads'
when 'following'
url = DiscussionUtil.urlFor 'following_threads', options.user_id
when 'followed'
url = DiscussionUtil.urlFor 'followed_threads', options.user_id
data['sort_key'] = sort_options.sort_key || 'date'
data['sort_order'] = sort_options.sort_order || 'desc'
DiscussionUtil.safeAjax
......
......@@ -66,7 +66,7 @@ class @DiscussionUtil
permanent_link_thread : "/courses/#{$$course_id}/discussion/forum/#{param}/threads/#{param1}"
permanent_link_comment : "/courses/#{$$course_id}/discussion/forum/#{param}/threads/#{param1}##{param2}"
user_profile : "/courses/#{$$course_id}/discussion/forum/users/#{param}"
following_threads : "/courses/#{$$course_id}/discussion/forum/users/#{param}/following"
followed_threads : "/courses/#{$$course_id}/discussion/forum/users/#{param}/followed"
threads : "/courses/#{$$course_id}/discussion/forum"
}[name]
......
......@@ -128,7 +128,7 @@ if Backbone?
when 'search'
options.search_text = @current_search
options.commentable_ids = @discussionIds
when 'following'
when 'followed'
options.user_id = window.user.id
@collection.retrieveAnotherPage(@mode, options, {sort_key: @sortBy})
......@@ -257,7 +257,7 @@ if Backbone?
@$(".post-search-field").val("")
@retrieveAllThreads()
else if discussionId == "#following"
@retrieveFollowing(event)
@retrieveFollowed(event)
# Retrieve following
else
discussionIds = _.map item.find(".board-name[data-discussion_id]"), (board) -> $(board).data("discussion_id").id
......@@ -388,8 +388,8 @@ if Backbone?
scrollTarget = Math.max(scrollTop - itemFromTop - $(".browse-topic-drop-menu").height() + $(items[index]).height(), scrollTarget)
$(".browse-topic-drop-menu").scrollTop(scrollTarget)
retrieveFollowing: (event)=>
@mode = 'following'
retrieveFollowed: (event)=>
@mode = 'followed'
@collection.reset()
@collection.current_page = 0
@loadMorePages(event)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment