 if Backbone?
   class @DiscussionRouter extends Backbone.Router
     initialize: (options) ->
-        @route("#{DiscussionUtil.route_prefix}", "allThreads")
-        @route("#{DiscussionUtil.route_prefix}:forum_name/threads/:thread_id", "showThread")
+        @allThreadsRoute = DiscussionUtil.route_prefix
+        @singleThreadRoute = @getSingleThreadRoute(":forum_name", ":thread_id")
+
+        @route(@allThreadsRoute, "allThreads")
+        @route(@singleThreadRoute, "showThread")
 
         @discussion = options['discussion']
         @course_settings = options['course_settings']

        @listenTo( @newPostView, 'newPost:cancel', @hideNewPost )
        $('.new-post-btn').bind "click", @showNewPost
        $('.new-post-btn').bind "keydown", (event) => DiscussionUtil.activateOnSpace(event, @showNewPost)

    allThreads: ->
      @nav.updateSidebar()


    navigateToThread: (thread_id) =>
      thread = @discussion.get(thread_id)
      @navigate(@getSingleThreadRoute(thread.get("commentable_id"), thread_id), trigger: true)

    navigateToAllThreads: =>
      @navigate(@allThreadsRoute, trigger: true)

    showNewPost: (event) =>
      $('.forum-content').fadeOut(
