Style-fix quotes and EOD newlines

This commit is contained in:
Josh Callebaut 2016-08-25 15:37:49 -07:00
parent 53e68a79a6
commit cb41100d2e
4 changed files with 17 additions and 19 deletions

View file

@ -32,5 +32,3 @@ block content
a(data-toggle='collapse' href='#'+level.get('slug')+'-intro-collapse') Intro a(data-toggle='collapse' href='#'+level.get('slug')+'-intro-collapse') Intro
.panel-collapse.collapse.intro(id=level.get('slug')+'-intro-collapse') .panel-collapse.collapse.intro(id=level.get('slug')+'-intro-collapse')
pre=levelObj.intro ? levelObj.intro.body : 'NOPE' pre=levelObj.intro ? levelObj.intro.body : 'NOPE'

View file

@ -25,9 +25,9 @@ module.exports = class LevelGuidesView extends RootView
levels: [] levels: []
onOverviewButtonClicked: (e) -> onOverviewButtonClicked: (e) ->
@$(".overview").toggleClass("in") @$('.overview').toggleClass('in')
onIntroButtonClicked: (e) -> onIntroButtonClicked: (e) ->
@$(".intro").toggleClass("in") @$('.intro').toggleClass('in')
initialize: () -> initialize: () ->
@ -46,7 +46,7 @@ module.exports = class LevelGuidesView extends RootView
levels = camp.get 'levels' levels = camp.get 'levels'
levels = new Levels() levels = new Levels()
@listenTo(levels, "sync", @onLevelsLoaded) @listenTo(levels, 'sync', @onLevelsLoaded)
levels.fetchForCampaign(campaignSlug) levels.fetchForCampaign(campaignSlug)
#for key, level of levels #for key, level of levels
@ -56,38 +56,38 @@ module.exports = class LevelGuidesView extends RootView
for level in lvlCollection.models for level in lvlCollection.models
#console.log level #console.log level
levelSlug = level.get 'slug' levelSlug = level.get 'slug'
overview = _.find(level.get('documentation').specificArticles, name:"Overview") overview = _.find(level.get('documentation').specificArticles, name:'Overview')
intro = _.find(level.get('documentation').specificArticles, name:"Intro") intro = _.find(level.get('documentation').specificArticles, name:'Intro')
#if intro and overview #if intro and overview
problems = [] problems = []
if not overview if not overview
problems.push "No Overview" problems.push 'No Overview'
else else
if not overview.i18n if not overview.i18n
problems.push "Overview doesn't have i18n field" problems.push 'Overview doesn't have i18n field'
if not overview.body if not overview.body
problems.push "Overview doesn't have a body" problems.push 'Overview doesn't have a body'
else else
if level.get('campaign')?.indexOf('web') is -1 if level.get('campaign')?.indexOf('web') is -1
jsIndex = overview.body.indexOf('```javascript') jsIndex = overview.body.indexOf('```javascript')
pyIndex = overview.body.indexOf('```python') pyIndex = overview.body.indexOf('```python')
if jsIndex is -1 and pyIndex isnt -1 or jsIndex isnt -1 and pyIndex is -1 if jsIndex is -1 and pyIndex isnt -1 or jsIndex isnt -1 and pyIndex is -1
problems.push "Overview is missing a language example." problems.push 'Overview is missing a language example.'
if not intro if not intro
problems.push "No Intro" problems.push 'No Intro'
else else
if not intro.i18n if not intro.i18n
problems.push "Intro doesn't have i18n field" problems.push 'Intro doesn't have i18n field'
if not intro.body if not intro.body
problems.push "Intro doesn't have a body" problems.push 'Intro doesn't have a body'
else else
if intro.body.indexOf('file/db') is -1 if intro.body.indexOf('file/db') is -1
problems.push "Intro is missing image" problems.push 'Intro is missing image'
if level.get('campaign')?.indexOf('web') is -1 if level.get('campaign')?.indexOf('web') is -1
jsIndex = intro.body.indexOf('```javascript') jsIndex = intro.body.indexOf('```javascript')
pyIndex = intro.body.indexOf('```python') pyIndex = intro.body.indexOf('```python')
if jsIndex is -1 and pyIndex isnt -1 or jsIndex isnt -1 and pyIndex is -1 if jsIndex is -1 and pyIndex isnt -1 or jsIndex isnt -1 and pyIndex is -1
problems.push "Intro is missing a language example." problems.push 'Intro is missing a language example.'
@levels.push @levels.push
level: level level: level
overview: overview overview: overview