mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-04-26 05:53:39 -04:00
Got some basic hierarchy set up for user view and template inheritance
This commit is contained in:
parent
e33bb44ffc
commit
10735867a4
3 changed files with 25 additions and 11 deletions
app
|
@ -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}
|
||||
|
||||
|
|
|
@ -1 +1 @@
|
|||
extends /templates/base
|
||||
extends /templates/kinds/user
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue