Got some basic hierarchy set up for user view and template inheritance

This commit is contained in:
Ruben Vereecken 2014-07-06 21:10:28 +02:00
parent e33bb44ffc
commit 10735867a4
3 changed files with 25 additions and 11 deletions
app
templates
views/kinds

View file

@ -1,3 +1,12 @@
extends /templates/base
// User pages might have some user page specific header, if not remove this
block content
div
ol.breadcrumb
li
- var userName = user.get('name');
a(href="/user/#{user.id}") #{userName}
li.active
| #{currentUserView}

View file

@ -1 +1 @@
extends /templates/base
extends /templates/kinds/user

View file

@ -6,14 +6,19 @@ module.exports = class UserView extends RootView
template: template
className: 'user-view'
constructor: (options, nameOrID) ->
# TODO Ruben Assume ID for now
user = new User nameOrID
user.fetch
success: ->
console.log 'helabaaa'
error: (model, response, options) ->
console.log response
console.log options
constructor: (options, @nameOrID) ->
super options
# TODO Ruben Assume ID for now
@user = @supermodel.loadModel(new User(_id: nameOrID), 'user').model
onLoaded: ->
@render()
getRenderData: ->
context = super()
context.currentUserView = 'Achievements'
context.user = @user
context
isMe: -> @nameOrID is me.id