Issues 13 and 14. Contributor pages, and fixed the scrolling bug better than before

This commit is contained in:
Tom Steinbrecher 2014-01-06 00:56:32 -05:00
parent 34dd42a7ca
commit 75894d1160
16 changed files with 847 additions and 0 deletions

View file

@ -0,0 +1,41 @@
.contribute_class
#homepage_screenshot
margin: 20px 0px
.signature
text-align: right
a
cursor: pointer
.class_image
float: left
width: 150px
margin: 10px 10px 20px 20px
#contribute-nav
float: left
max-width: 20%
width: 250px
box-sizing: border-box
margin-left: 20px
padding-top: 40px
li
float: none
width: 100%
.class_main
margin-left: 25%
padding: 40px
box-sizing: border-box
.header-scrolling-fix
padding-top: 65px !important
.well
padding: 5px 5px 5px 30px
.saved-notification
display: none
float: right

View file

@ -0,0 +1,78 @@
extends /templates/base
block content
div.contribute_class
ul.contribute_class.affix.nav.nav-list.nav-pills#contribute-nav
li
h3 Character Classes
li
a(href="//contribute#archmage") Archmage (Coder)
li
a(href="//contribute#artisan") Artisan (Level Builder)
li
a(href="//contribute#adventurer") Adventurer (Level Playtester)
li
a(href="//contribute#scribe") Scribe (Article Editor)
li
a(href="//contribute#diplomat") Diplomat (Translator)
li
a(href="//contribute#ambassador") Ambassador (Support)
li
a(href="//contribute#counselor") Counselor (Expert/Teacher)
div.class-main#adventurer-main
.class_image
img(src="/images/pages/contribute/adventurer.png", alt="")
h2 Adventurer (Level Playtester)
p Let's be clear about your role: you are the tank. You're going to take heavy damage.
| We need people to try out brand-new levels and help identify how to make things better.
| The pain will be enormous; making good games is a long process and no one gets
| it right the first time.
| If you can endure and have a high constitution score, then this class might be for you.
h4 Class Attributes
ul
li A thirst for learning. You want to learn how to code and we want to teach you how to code.
| You'll probably be doing most of the teaching in this case, though.
li Charismatic. Be gentle but articulate about what needs improving, and offer suggestions
| on how to improve.
h4 How To Join
p Either get together with (or recruit!) an Artisan and work with them, or
| check the box below to receive emails when there are new levels to test.
| We'll also be posting about levels to review on our networks like
a(href="http://discourse.codecombat.com/category/adventurer") our forum
| ,
a(href="https://www.facebook.com/codecombat") Facebook
| ,
a(href="http://www.reddit.com/r/CodeCombat/") Reddit
| ,
a(href="https://twitter.com/CodeCombat") Twitter
| , and
a(href="https://plus.google.com/115285980638641924488/posts") Google+
| , so if you prefer to be notified those ways, sign up there!
if me.attributes.anonymous
div#sign-up.alert.alert-info
strong Hey there!
| To subscribe for class emails, you'll need to
a(data-toggle="coco-modal", data-target="modal/signup") create an account
| first .
label.checkbox(for="tester").well
input(type='checkbox', name="tester", id="tester")
| Get emails when there are new levels to test.
.saved-notification ✓ Saved
h4 Changes are saved automatically when you toggle checkboxes.
#Contributors
h3 Our Brave Adventurers:
ul.adventurers
li Kieizroe
div.clearfix

View file

@ -0,0 +1,69 @@
extends /templates/base
block content
div.contribute_class
ul.contribute_class.affix.nav.nav-list.nav-pills#contribute-nav
li
h3 Character Classes
li
a(href="//contribute#archmage") Archmage (Coder)
li
a(href="//contribute#artisan") Artisan (Level Builder)
li
a(href="//contribute#adventurer") Adventurer (Level Playtester)
li
a(href="//contribute#scribe") Scribe (Article Editor)
li
a(href="//contribute#diplomat") Diplomat (Translator)
li
a(href="//contribute#ambassador") Ambassador (Support)
li
a(href="//contribute#counselor") Counselor (Expert/Teacher)
div.class-main#ambassador-main
.class_image
img(src="/images/pages/contribute/ambassador.png", alt="")
h2 Ambassador (Support)
p This is a community we're building, and you are the connections.
| We've got Olark chats, emails, and social networks with lots of people to talk with
| and help get acquainted with the game and learn from.
| If you want to help people get involved and have fun, and get a good feel of the pulse of
| CodeCombat and where we're going, then this class might be for you.
h4 Class Attributes
ul
li Communication skills. Be able to identify the problems players are having
| and help them solve them. Also, keep the rest of us informed about what
| players are saying, what they like and don't like and want more of!
h4 How to Join
p
a(title='Contact', tabindex=-1, data-toggle="coco-modal", data-target="modal/contact") Contact us
| , tell us a little about yourself, what you've done and what you'd
| be interested in doing. We'll go from there!
p
strong Note
| : One of our top priorities is to build multiplayer where players having difficulty
| solving levels can summon higher level wizards to help them.
| This will be a great way for ambassadors to do their thing. We'll keep you posted!
if me.attributes.anonymous
div#sign-up.alert.alert-info
strong Hey there!
| To subscribe for class emails, you'll need to
a(data-toggle="coco-modal", data-target="modal/signup") create an account
| first .
label.checkbox(for="support").well
input(type='checkbox', name="support", id="support")
| Get emails on support updates and multiplayer developments.
.saved-notification ✓ Saved
h4 Changes are saved automatically when you toggle checkboxes.
div.clearfix

View file

@ -0,0 +1,89 @@
extends /templates/base
block content
div.contribute_class
ul.contribute_class.affix.nav.nav-list.nav-pills#contribute-nav
li
h3 Character Classes
li
a(href="//contribute#archmage") Archmage (Coder)
li
a(href="//contribute#artisan") Artisan (Level Builder)
li
a(href="//contribute#adventurer") Adventurer (Level Playtester)
li
a(href="//contribute#scribe") Scribe (Article Editor)
li
a(href="//contribute#diplomat") Diplomat (Translator)
li
a(href="//contribute#ambassador") Ambassador (Support)
li
a(href="//contribute#counselor") Counselor (Expert/Teacher)
div.class-main#archmage-main
.class_image
img(src="/images/pages/contribute/archmage.png", alt="")
h2 Archmage (Coder)
p One of the best parts about building games is they synthesize so many different things.
| Graphics, sound, real-time networking, social networking, and of course many of the
| more common aspects of programming, from low-level database management,
| and server administration to user facing design and interface building.
| There's a lot to do, and if you're an experienced programmer with a hankering
| to really dive into the nitty-gritty of CodeCombat, this class might be for you.
p Right now we have open-sourced two of our tools on the project:
a(href="https://github.com/codecombat/aether") Aether
| and
a(href="https://github.com/codecombat/treema") Treema
| . We are also open sourcing everything momentarily, so stay tuned for access to the main repo!
| We would love to have your help building out the best programming game ever.
h4 Class Attributes
ul
li Knowledge in
a(href="http://coffeescript.org/") CoffeeScript
| , or a desire to learn. Most of our code is in this language.
| If you're a fan of Ruby or Python, you'll feel right at home.
| It's just JavaScript, but with a nicer syntax.
li Some experience in programming and personal initiative.
| We'll help you get oriented, but we can't spend much time training you.
h4 How To Join
p
| Anyone can help out! Just check out our
a(title='GitHub', tabindex=-1) GitHub
| to get started, and check the box below to mark yourself as a brave Archmage.
| Want to chat about what to do or how to get more deeply involved?
a(title='Contact', tabindex=-1, data-toggle="coco-modal", data-target="modal/contact") Contact us
| , tell us a little about yourself, what you've done and what you'd
| be interested in working on. We'll go from there!
if me.attributes.anonymous
div#sign-up.alert.alert-info
strong Hey there!
| To subscribe for class emails, you'll need to
a(data-toggle="coco-modal", data-target="modal/signup") create an account
| first .
label.checkbox(for="developer").well
input(type='checkbox', name="developer", id="developer")
| Get emails on new coding opportunities and announcements.
.saved-notification ✓ Saved
h4 Changes are saved automatically when you toggle checkboxes.
#Contributors
h3 Our Magical Archmages:
ul.archmages
li David Golds
li Zach Martin
li Tom Steinbrecher
li Mischa Lewis-Norelle
li Sébastien Moratinos
div.clearfix

View file

@ -0,0 +1,79 @@
extends /templates/base
block content
div.contribute_class
ul.contribute_class.affix.nav.nav-list.nav-pills#contribute-nav
li
h3 Character Classes
li
a(href="//contribute#archmage") Archmage (Coder)
li
a(href="//contribute#artisan") Artisan (Level Builder)
li
a(href="//contribute#adventurer") Adventurer (Level Playtester)
li
a(href="//contribute#scribe") Scribe (Article Editor)
li
a(href="//contribute#diplomat") Diplomat (Translator)
li
a(href="//contribute#ambassador") Ambassador (Support)
li
a(href="//contribute#counselor") Counselor (Expert/Teacher)
div.class-main#artisan-main
.class_image
img(src="/images/pages/contribute/artisan.png", alt="")
h2 Artisan (Level Builder)
p We must construct additional levels!
| People be clamoring for more content, and we can only build so many ourselves.
| Right now your workstation is level one; our level editor is barely
| usable even by its creators, so be wary.
| If you have visions of campaigns spanning for-loops to
a(href="http://stackoverflow.com/questions/758088/seeking-contrived-example-code-continuations/758105#758105") Mondo Bizzaro
| to then this class might be for you.
h4 Class Attributes
ul
li Any experience in building content like this would be nice, such as using
| Blizzard's level editors. But not required!
li A hankering to do a whole lot of testing and iteration.
| To make good levels, you need to take it to others and watch them play it,
| and be prepared to find a lot of things to fix.
li For the time being, endurance en par with an Adventurer.
| Our Level Editor is super preliminary and frustrating to use. You have been warned!
h4 How To Join
p The Level Editor is live! Go forth and fiddle with it.
| Right now for the sake of security, you can't make Components (the most powerful part of level building)
| but be in touch with us and we'll see if we can make what you need.
| See the
a(href="https://docs.google.com/document/d/117tMcL95T1KY8BDisr0iGi5Frb2ZvBJTC0us5hyQkJY/edit?usp=sharing") preliminary documentation
| for more info, and please comment on it so we can make the whole system better.
if me.attributes.anonymous
div#sign-up.alert.alert-info
strong Hey there!
| To subscribe for class emails, you'll need to
a(data-toggle="coco-modal", data-target="modal/signup") create an account
| first .
label.checkbox(for="level_creator").well
input(type='checkbox', name="level_creator", id="level_creator")
| Get emails on level editor updates and announcements.
.saved-notification ✓ Saved
h4 Changes are saved automatically when you toggle checkboxes.
#Contributors
h3 Our Creative Artisans:
ul.artisans
li Sootn
li Zach Martin
li Aftermath
li mcdavid1991
div.clearfix

View file

@ -0,0 +1,55 @@
extends /templates/base
block content
div.contribute_class
ul.contribute_class.affix.nav.nav-list.nav-pills#contribute-nav
li
h3 Character Classes
li
a(href="//contribute#archmage") Archmage (Coder)
li
a(href="//contribute#artisan") Artisan (Level Builder)
li
a(href="//contribute#adventurer") Adventurer (Level Playtester)
li
a(href="//contribute#scribe") Scribe (Article Editor)
li
a(href="//contribute#diplomat") Diplomat (Translator)
li
a(href="//contribute#ambassador") Ambassador (Support)
li
a(href="//contribute#counselor") Counselor (Expert/Teacher)
div.class-main#sounselor-main
.class_image
img(src="/images/pages/contribute/counselor.png", alt="")
h2 Counselor (Expert)
p Do you have life experience?
| A different perspective on things that can help us decide how to shape CodeCombat?
| Of all these roles, this will probably take the least time, but
| individually you may make the most difference.
| We're on the lookout for wisened sages, particularly in areas like: teaching,
| game development, open source project management, technical recruiting, entrepreneurship,
| or design.
p Or really anything that is relevant to the development of CodeCombat.
| If you have knowledge and want to share it to help grow this project, then
| this class might be for you.
h4 Class Attributes
ul
li Experience, in any of the areas above or something you think might be helpful.
li A little bit of free time!
h4 How to Join
p
a(title='Contact', tabindex=-1, data-toggle="coco-modal", data-target="modal/contact") Contact us
| , tell us a little about yourself, what you've done and what you'd
| be interested in doing. We'll put you in our contact list and be in touch
| when we could use advice (not too often).
div.clearfix

View file

@ -0,0 +1,71 @@
extends /templates/base
block content
div.contribute_class
ul.contribute_class.affix.nav.nav-list.nav-pills#contribute-nav
li
h3 Character Classes
li
a(href="//contribute#archmage") Archmage (Coder)
li
a(href="//contribute#artisan") Artisan (Level Builder)
li
a(href="//contribute#adventurer") Adventurer (Level Playtester)
li
a(href="//contribute#scribe") Scribe (Article Editor)
li
a(href="//contribute#diplomat") Diplomat (Translator)
li
a(href="//contribute#ambassador") Ambassador (Support)
li
a(href="//contribute#counselor") Counselor (Expert/Teacher)
div.class-main#diplomat-main
.class_image
img(src="/images/pages/contribute/diplomat.png", alt="")
h3 Diplomat (Translator)
p So, if there's one thing we learned from the
a(href="blog.codecombat.com/post/64658141307/codecombat-in-y-combinator") launch in October
| , it's that there
| is sizeable interest in CodeCombat in other countries, particularly Brazil!
| We're building a corps of translators eager to turn one set of words into
| another set of words to get CodeCombat as accessible across the world as possible.
| If you like getting sneak peeks at upcoming content and getting these levels to
| your fellow nationals ASAP, then this class might be for you.
h4 Class Attributes
ul
li Fluency in English and the language you would like to translate to.
| When conveying complicated ideas, it's important to have a strong grasp in both!
h4 How to Join
p We've started a lot of initial translations at
a(href="https://docs.google.com/a/codecombat.com/spreadsheet/ccc?key=0AjsR1nOoMQ4MdFBqS1NqUmRTVG1hbEMxWTZEd1JrNXc&usp=drive_web#gid=0") this Google Doc
| , so check it out and add things for your language. Also, check this box below to
| keep up-to-date on new internationalization developments!
if me.attributes.anonymous
div#sign-up.alert.alert-info
strong Hey there!
| To subscribe for class emails, you'll need to
a(data-toggle="coco-modal", data-target="modal/signup") create an account
| first .
label.checkbox(for="translator").well
input(type='checkbox', name="translator", id="translator")
| Get emails about i18n developments and levels to translate.
.saved-notification ✓ Saved
h4 Changes are saved automatically when you toggle checkboxes.
#Contributors
h3 Our Magical Archmages:
ul.archmages
li David Golds
li Zach Martin
div.clearfix

View file

@ -0,0 +1,84 @@
extends /templates/base
block content
div.contribute_class
ul.contribute_class.affix.nav.nav-list.nav-pills#contribute-nav
li
h3 Character Classes
li
a(href="//contribute#archmage") Archmage (Coder)
li
a(href="//contribute#artisan") Artisan (Level Builder)
li
a(href="//contribute#adventurer") Adventurer (Level Playtester)
li
a(href="//contribute#scribe") Scribe (Article Editor)
li
a(href="//contribute#diplomat") Diplomat (Translator)
li
a(href="//contribute#ambassador") Ambassador (Support)
li
a(href="//contribute#counselor") Counselor (Expert/Teacher)
div.class-main#diplomat-main
.class_image
img(src="/images/pages/contribute/diplomat.png", alt="")
h2 Diplomat (Translator)
p So, if there's one thing we learned from the
a(href="blog.codecombat.com/post/64658141307/codecombat-in-y-combinator") launch in October
| , it's that there
| is sizeable interest in CodeCombat in other countries, particularly Brazil!
| We're building a corps of translators eager to turn one set of words into
| another set of words to get CodeCombat as accessible across the world as possible.
| If you like getting sneak peeks at upcoming content and getting these levels to
| your fellow nationals ASAP, then this class might be for you.
h4 Class Attributes
ul
li Fluency in English and the language you would like to translate to.
| When conveying complicated ideas, it's important to have a strong grasp in both!
h4 How to Join
p We've started a lot of initial translations at
a(href="https://docs.google.com/a/codecombat.com/spreadsheet/ccc?key=0AjsR1nOoMQ4MdFBqS1NqUmRTVG1hbEMxWTZEd1JrNXc&usp=drive_web#gid=0") this Google Doc
| , so check it out and add things for your language. Also, check this box below to
| keep up-to-date on new internationalization developments!
if me.attributes.anonymous
div#sign-up.alert.alert-info
strong Hey there!
| To subscribe for class emails, you'll need to
a(data-toggle="coco-modal", data-target="modal/signup") create an account
| first .
label.checkbox(for="translator").well
input(type='checkbox', name="translator", id="translator")
| Get emails about i18n developments and levels to translate.
.saved-notification ✓ Saved
h4 Changes are saved automatically when you toggle checkboxes.
#Contributors
h3 Our Translating Diplomats:
ul.diplomats
li Turkish - Nazım Gediz Aydındoğmuş
li Brazilian Portuguese - Gutenberg Barros, Kieizroe, Matthew Burt
li Portugal Portuguese - Matthew Burt
li German - Dirk, Anon
li Thai - Kamolchanok Jittrepit
li Greek - Stergios
li Latin American Spanish - Jesús Ruppel, Matthew Burt, Mariano Luzza
li Spain Spanish - Matthew Burt, Anon
li French - Xeonarno, Anon
li Hungarian - Anon
li Japanese - g1itch
li Chinese - spacepope
li Polish - Anon
li Danish - Anon
li Slovak - Anon
div.clearfix

View file

@ -0,0 +1,70 @@
extends /templates/base
block content
div.contribute_class
ul.contribute_class.affix.nav.nav-list.nav-pills#contribute-nav
li
h3 Character Classes
li
a(href="//contribute#archmage") Archmage (Coder)
li
a(href="//contribute#artisan") Artisan (Level Builder)
li
a(href="//contribute#adventurer") Adventurer (Level Playtester)
li
a(href="//contribute#scribe") Scribe (Article Editor)
li
a(href="//contribute#diplomat") Diplomat (Translator)
li
a(href="//contribute#ambassador") Ambassador (Support)
li
a(href="//contribute#counselor") Counselor (Expert/Teacher)
div.class-main#scribe-main
.class_image
img(src="/images/pages/contribute/scribe.png", alt="")
h2 Scribe (Article Editor)
p CodeCombat isn't just going to be a bunch of levels.
| It will also include a resource for knowledge, a wiki of programming concepts that levels can hook into.
| That way rather than each Artisan having to describe in detail what a comparison operator is, they
| can simply link their level to the Article describing them that is already written for the player's edification.
| Something along the lines of what the
a(href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide") Mozilla Developer Network
| has built. If your idea of fun is articulating the concepts of programming in Markdown form,
| then this class might be for you.
h4 Class Attributes
ul
li Skill in words is pretty much all you need.
| Not only grammar and spelling, but able to convey complicated ideas to others.
h4 How To Join
p
a(title='Contact', tabindex=-1, data-toggle="coco-modal", data-target="modal/contact") Contact us
| , tell us a little about yourself, your experience with programming and
| what sort of things you'd like to write about. We'll go from there!
if me.attributes.anonymous
div#sign-up.alert.alert-info
strong Hey there!
| To subscribe for class emails, you'll need to
a(data-toggle="coco-modal", data-target="modal/signup") create an account
| first .
label.checkbox(for="article_editor").well
input(type='checkbox', name="article_editor", id="article_editor")
| Get emails about article writing announcements.
.saved-notification ✓ Saved
h4 Changes are saved automatically when you toggle checkboxes.
#Contributors
h3 Our Diligent Scribes:
ul.scribes
li Ryan Faidley
div.clearfix

View file

@ -0,0 +1,34 @@
View = require 'views/kinds/RootView'
template = require 'templates/contribute/adventurer'
{me} = require('lib/auth')
module.exports = class ArchmageView extends View
id: "adventurer-view"
template: template
events:
'change input[type="checkbox"]': 'onCheckboxChanged'
afterRender: ->
super()
checkboxes = @$el.find('input[type="checkbox"]').toArray()
_.forEach checkboxes, (el) ->
el = $(el)
if el.attr('name') in me.get('emailSubscriptions')
el.prop('checked', true)
onCheckboxChanged: (e) ->
el = $(e.target)
checked = el.prop('checked')
subscription = el.attr('name')
subscriptions = me.get('emailSubscriptions') ? []
if checked and not (subscription in subscriptions)
subscriptions.push(subscription)
if me.get 'anonymous'
@openModalView new SignupModalView()
if not checked
subscriptions = _.without subscriptions, subscription
el.parent().find('.saved-notification').finish().show('fast').delay(3000).fadeOut(2000)
me.set('emailSubscriptions', subscriptions)
me.save()

View file

@ -0,0 +1,34 @@
View = require 'views/kinds/RootView'
template = require 'templates/contribute/ambassador'
{me} = require('lib/auth')
module.exports = class ArchmageView extends View
id: "ambassador-view"
template: template
events:
'change input[type="checkbox"]': 'onCheckboxChanged'
afterRender: ->
super()
checkboxes = @$el.find('input[type="checkbox"]').toArray()
_.forEach checkboxes, (el) ->
el = $(el)
if el.attr('name') in me.get('emailSubscriptions')
el.prop('checked', true)
onCheckboxChanged: (e) ->
el = $(e.target)
checked = el.prop('checked')
subscription = el.attr('name')
subscriptions = me.get('emailSubscriptions') ? []
if checked and not (subscription in subscriptions)
subscriptions.push(subscription)
if me.get 'anonymous'
@openModalView new SignupModalView()
if not checked
subscriptions = _.without subscriptions, subscription
el.parent().find('.saved-notification').finish().show('fast').delay(3000).fadeOut(2000)
me.set('emailSubscriptions', subscriptions)
me.save()

View file

@ -0,0 +1,34 @@
View = require 'views/kinds/RootView'
template = require 'templates/contribute/archmage'
{me} = require('lib/auth')
module.exports = class ArchmageView extends View
id: "archmage-view"
template: template
events:
'change input[type="checkbox"]': 'onCheckboxChanged'
afterRender: ->
super()
checkboxes = @$el.find('input[type="checkbox"]').toArray()
_.forEach checkboxes, (el) ->
el = $(el)
if el.attr('name') in me.get('emailSubscriptions')
el.prop('checked', true)
onCheckboxChanged: (e) ->
el = $(e.target)
checked = el.prop('checked')
subscription = el.attr('name')
subscriptions = me.get('emailSubscriptions') ? []
if checked and not (subscription in subscriptions)
subscriptions.push(subscription)
if me.get 'anonymous'
@openModalView new SignupModalView()
if not checked
subscriptions = _.without subscriptions, subscription
el.parent().find('.saved-notification').finish().show('fast').delay(3000).fadeOut(2000)
me.set('emailSubscriptions', subscriptions)
me.save()

View file

@ -0,0 +1,34 @@
View = require 'views/kinds/RootView'
template = require 'templates/contribute/artisan'
{me} = require('lib/auth')
module.exports = class ArchmageView extends View
id: "artisan-view"
template: template
events:
'change input[type="checkbox"]': 'onCheckboxChanged'
afterRender: ->
super()
checkboxes = @$el.find('input[type="checkbox"]').toArray()
_.forEach checkboxes, (el) ->
el = $(el)
if el.attr('name') in me.get('emailSubscriptions')
el.prop('checked', true)
onCheckboxChanged: (e) ->
el = $(e.target)
checked = el.prop('checked')
subscription = el.attr('name')
subscriptions = me.get('emailSubscriptions') ? []
if checked and not (subscription in subscriptions)
subscriptions.push(subscription)
if me.get 'anonymous'
@openModalView new SignupModalView()
if not checked
subscriptions = _.without subscriptions, subscription
el.parent().find('.saved-notification').finish().show('fast').delay(3000).fadeOut(2000)
me.set('emailSubscriptions', subscriptions)
me.save()

View file

@ -0,0 +1,7 @@
View = require 'views/kinds/RootView'
template = require 'templates/contribute/counselor'
{me} = require('lib/auth')
module.exports = class ArchmageView extends View
id: "counselor-view"
template: template

View file

@ -0,0 +1,34 @@
View = require 'views/kinds/RootView'
template = require 'templates/contribute/diplomat'
{me} = require('lib/auth')
module.exports = class ArchmageView extends View
id: "diplomat-view"
template: template
events:
'change input[type="checkbox"]': 'onCheckboxChanged'
afterRender: ->
super()
checkboxes = @$el.find('input[type="checkbox"]').toArray()
_.forEach checkboxes, (el) ->
el = $(el)
if el.attr('name') in me.get('emailSubscriptions')
el.prop('checked', true)
onCheckboxChanged: (e) ->
el = $(e.target)
checked = el.prop('checked')
subscription = el.attr('name')
subscriptions = me.get('emailSubscriptions') ? []
if checked and not (subscription in subscriptions)
subscriptions.push(subscription)
if me.get 'anonymous'
@openModalView new SignupModalView()
if not checked
subscriptions = _.without subscriptions, subscription
el.parent().find('.saved-notification').finish().show('fast').delay(3000).fadeOut(2000)
me.set('emailSubscriptions', subscriptions)
me.save()

View file

@ -0,0 +1,34 @@
View = require 'views/kinds/RootView'
template = require 'templates/contribute/scribe'
{me} = require('lib/auth')
module.exports = class ArchmageView extends View
id: "scribe-view"
template: template
events:
'change input[type="checkbox"]': 'onCheckboxChanged'
afterRender: ->
super()
checkboxes = @$el.find('input[type="checkbox"]').toArray()
_.forEach checkboxes, (el) ->
el = $(el)
if el.attr('name') in me.get('emailSubscriptions')
el.prop('checked', true)
onCheckboxChanged: (e) ->
el = $(e.target)
checked = el.prop('checked')
subscription = el.attr('name')
subscriptions = me.get('emailSubscriptions') ? []
if checked and not (subscription in subscriptions)
subscriptions.push(subscription)
if me.get 'anonymous'
@openModalView new SignupModalView()
if not checked
subscriptions = _.without subscriptions, subscription
el.parent().find('.saved-notification').finish().show('fast').delay(3000).fadeOut(2000)
me.set('emailSubscriptions', subscriptions)
me.save()