       res.render "index", author: res.locals.author, blocks: blocks.models
 
 @index = (req, res, next) ->
-
   return next() unless res.locals.author
 
   channels = new UserBlocks null,

      res.locals.sd.USER = author.toJSON()
    complete: -> next()

isAdmin = (user) ->
  _.find sd.ADMIN_SLUGS?.split(','), (slug) -> slug is user?.get('slug')

showTips = (req, res) ->
  (req.user?.id is res.locals.author.id and req.user?.get('show_tour') isnt false)


      id: req.params.username
      per: 2,
      perBlocks: 5
      page: parseInt(req.query.page, 10) or 1
      q: req.query.q
      sort: req.query.sort?.toUpperCase() or 'UPDATED_AT'

@channelsAPI = (req, res, next) ->
  send = channelsVariables req
  graphQL send
    .then (response) ->
      res.setHeader 'Content-Type', 'application/json'
