   @use 'Storage'
   @use 'Session'
 
-  get_user = (username, cb) ->
+  getUser = (username, cb) ->
     user = @session('user/' + username)
     if user
       cb(user)
     else
       $.get('/user/' + username, {}, (data) -> cb(data))
 
-  format_date = (timestamp) ->
+  formatDate = (timestamp) ->
     pad = (number) ->
       if number < 10 
         '0' + number


  @before (context) ->
    @user = @session('user')
    @get_user = (username, data) -> get_user.apply(@, [username, data])
    if context.path != '#/login'
      if !@user
        $('.user-info').fadeOut()

        token: @session('token')
    }, (data) ->
      content = showdown.makeHtml($('.post-source').val())
      context.render('templates/post.template', {post: {content: content, user: context.user, date: formatDate(data.date)}}).then (postnode) ->
        $(postnode).hide().appendTo('.thread').slideDown()
        $('.new-post').detach().appendTo('.thread')
        $('.post-preview').click()
