Refactor DiplomatView to use view in template

This commit is contained in:
Scott Erickson 2015-10-26 14:46:35 -07:00
parent 45044d06a4
commit c10d11f61b
2 changed files with 1 additions and 8 deletions
app
templates/contribute
views/contribute

View file

@ -58,7 +58,7 @@ block content
//#contributor-list
// TODO: collect CodeCombat userids for these guys so we can include a tiled list
ul.diplomats
each stats, languageCode in languageStats
each stats, languageCode in view.calculateSpokenLanguageStats()
if !(stats.completion < 0.02 && !stats.diplomats.length)
li
a(href=stats.githubURL)

View file

@ -61,13 +61,6 @@ module.exports = class DiplomatView extends ContributeClassView
template: template
contributorClassName: 'diplomat'
getRenderData: ->
context = super()
context.viewName = @viewName
context.user = @user unless @user?.isAnonymous()
context.languageStats = @calculateSpokenLanguageStats()
context
calculateSpokenLanguageStats: ->
@locale ?= require 'locale/locale'
totalStrings = @countStrings @locale.en