codecombat/app/views/clans/ClanDetailsView.coffee
Matt Lott 482b66b8a4 Create and list clans
Replace mock data with some real functionality.
2015-04-01 11:56:48 -07:00

19 lines
582 B
CoffeeScript

RootView = require 'views/core/RootView'
template = require 'templates/clans/clan-details'
Clan = require 'models/Clan'
module.exports = class ClanDetailsView extends RootView
id: 'clan-details-view'
template: template
constructor: (options, @clanID) ->
super options
@clan = new Clan _id: @clanID
@supermodel.loadModel @clan, 'clan', cache: false
getRenderData: =>
context = super()
context.clan = @clan
context.isOwner = @clan.get('ownerID') is me.id
context.isMember = _.find(@clan.get('members'), (m) -> m.id is me.id) ? false
context