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