Merge branch 'master' into production

This commit is contained in:
Matt Lott 2016-02-26 08:51:01 -08:00
commit 99cb3dbae6
22 changed files with 297 additions and 154 deletions

View file

@ -41,6 +41,15 @@ module.exports.connectionFailure = connectionFailure = ->
)
showErrorModal(html)
module.exports.showNotyNetworkError = (jqxhr) ->
noty({
text: jqxhr.responseText or 'Unknown error'
layout: 'topCenter'
type: 'error'
killer: false,
dismissQueue: true
})
showErrorModal = (html) ->
# TODO: make a views/modal/error_modal view for this to use so the template can reuse templates/core/modal-base?
$('#modal-wrapper').html(html)

View file

@ -93,3 +93,12 @@ module.exports.clearFormAlerts = (el) ->
$('.alert.alert-warning', el).remove()
el.find('.help-block.error-help-block').remove()
el.find('.help-block.warning-help-block').remove()
module.exports.updateSelects = (el) ->
el.find('select').each (i, select) ->
value = $(select).attr('value')
$(select).val(value)
module.exports.validateEmail = (email) ->
filter = /^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,63}$/i # https://news.ycombinator.com/item?id=5763990
return filter.test(email)

View file

@ -32,7 +32,7 @@ module.exports = nativeDescription: "한국어", englishDescription: "Korean", t
about: "소개"
contact: "문의"
twitter_follow: "팔로우"
teachers: "선생님"
teachers: "선생님"
careers: "채용"
modal:
@ -696,36 +696,36 @@ module.exports = nativeDescription: "한국어", englishDescription: "Korean", t
shift: "Shift"
run_code: "현재 코드 실행"
run_real_time: "실시간 코드 실행"
# continue_script: "Continue past current script."
# skip_scripts: "Skip past all skippable scripts."
# toggle_playback: "Toggle play/pause."
# scrub_playback: "Scrub back and forward through time."
# single_scrub_playback: "Scrub back and forward through time by a single frame."
# scrub_execution: "Scrub through current spell execution."
# toggle_debug: "Toggle debug display."
# toggle_grid: "Toggle grid overlay."
# toggle_pathfinding: "Toggle pathfinding overlay."
# beautify: "Beautify your code by standardizing its formatting."
# maximize_editor: "Maximize/minimize code editor."
continue_script: "이미 끝난 현재 스크립트를 진행합니다."
skip_scripts: "모든 스킬할 스크립트를 지납니다."
toggle_playback: "플레이/일시중지 전환."
scrub_playback: "다시 스크럽을 통해 시간을 전달합니다."
single_scrub_playback: "다시 스크럽을 통해 단일 프레임으로 시간을 전달합니다."
scrub_execution: "현재 주문하는것을 통해 스크럽합니다."
toggle_debug: "디버그 화면 전환."
toggle_grid: "디버그 오버레이 전환"
toggle_pathfinding: "길 찾아주는 오버레이 전환."
beautify: "서식을 표준화하여 코드를 아름답게합니다."
maximize_editor: "코드 에디터 최대/최소."
community:
main_title: "코드 컴뱃 커뮤니티"
# introduction: "Check out the ways you can get involved below and decide what sounds the most fun. We look forward to working with you!"
# level_editor_prefix: "Use the CodeCombat"
# level_editor_suffix: "to create and edit levels. Users have created levels for their classes, friends, hackathons, students, and siblings. If create a new level sounds intimidating you can start by forking one of ours!"
# thang_editor_prefix: "We call units within the game 'thangs'. Use the"
# thang_editor_suffix: "to modify the CodeCombat source artwork. Allow units to throw projectiles, alter the direction of an animation, change a unit's hit points, or upload your own vector sprites."
# article_editor_prefix: "See a mistake in some of our docs? Want to make some instructions for your own creations? Check out the"
# article_editor_suffix: "and help CodeCombat players get the most out of their playtime."
# find_us: "Find us on these sites"
# social_github: "Check out all our code on GitHub"
# social_blog: "Read the CodeCombat blog on Sett"
# social_discource: "Join the discussion on our Discourse forum"
# social_facebook: "Like CodeCombat on Facebook"
# social_twitter: "Follow CodeCombat on Twitter"
# social_gplus: "Join CodeCombat on Google+"
# social_hipchat: "Chat with us in the public CodeCombat Slack channel"
# contribute_to_the_project: "Contribute to the project"
introduction: "아래에서 당신이 참여할 수있는 방법을 확인하고 가장 재미있어보이는것을 결정합니다. 우리는 당신과 함께 협력하는것을 기대합니다!"
level_editor_prefix: "코드컴뱃을 사용"
level_editor_suffix: "만들거나 수정하는 레벨입니다. 사용자들은 자신의 학급, 친구, 해커 톤, 학생, 형제 자매에 대한 수준을 만들어왔습니다. 만약 새로운 레벨 소리를 새로만들겠다면 우리중 하나를 포크해서 시작해도됩니다!"
thang_editor_prefix: "우리는 게임 내의 'thangs'을 유닛이라고 부릅니다."
thang_editor_suffix: " CodeCombat 소스 작품을 수정하여 사용합니다.유닛들이 발사체를 던지는것을 허용하며, 애니메이션의 방향을 변경하고, 유닛의 타격지점을 변경하거나, 우리의 벡터 스프라이트를 업로드 할 수도 있습니다."
article_editor_prefix: "우리의 문서가 틀린것을 보았나요? 자신의 작품에 대한 몇가지 지침을 원하십니까? 체크아웃을 하거나"
article_editor_suffix: "코드컴뱃 플레이어를 도와 자신의 플레이 시간을 최대한 활용하게해주십시오."
find_us: "이 사이트에서 우리를 찾기"
social_github: "GitHub에서 우리의 모든 코드를 체크아웃하기"
social_blog: "Sett의 코드컴뱃 블로그 읽기"
social_discource: "토론 포럼에서 토론에 참여하기"
social_facebook: "Facebook에서 코드컴뱃 좋아요하기"
social_twitter: "Twitter에서 코드컴뱃 팔로우하기"
social_gplus: "Google+로 코드컴뱃 참여하기"
social_hipchat: "공용 코드컴뱃 슬랙 체널에서 우리와 대화하기"
contribute_to_the_project: "프로젝트에 기여하기"
clans:
clan: "클랜"
@ -733,16 +733,16 @@ module.exports = nativeDescription: "한국어", englishDescription: "Korean", t
new_name: "새로운 클랜 이름"
new_description: "새로운 클랜 설명"
make_private: "클랜을 비공개로 만들기"
# subs_only: "subscribers only"
subs_only: "오직 구독자만"
create_clan: "새로운 클랜 만들기"
private_preview: "미리보기"
# private_clans: "Private Clans"
private_clans: "비공개 클랜"
public_clans: "공개 클랜들"
my_clans: "내가 속한 클랜"
clan_name: "클랜 이름"
name: "이름"
chieftain: "클랜장"
# type: "Type"
type: "유형"
edit_clan_name: "클랜 이름 수정"
edit_clan_description: "클랜 설명 수정"
edit_name: "이름 변경"
@ -757,55 +757,55 @@ module.exports = nativeDescription: "한국어", englishDescription: "Korean", t
invite_1: "초대:"
invite_2: "*링크를 보내 클랜 초대하기"
members: "멤버들"
# progress: "Progress"
# not_started_1: "not started"
# started_1: "started"
# complete_1: "complete"
# exp_levels: "Expand levels"
progress: "진행"
not_started_1: "시작되지않음"
started_1: "시작됨"
complete_1: "완료"
exp_levels: "레벨 확장"
rem_hero: "영웅 삭제"
status: "상태"
# complete_2: "Complete"
# started_2: "Started"
# not_started_2: "Not Started"
# view_solution: "Click to view solution."
# view_attempt: "Click to view attempt."
# latest_achievement: "Latest Achievement"
# playtime: "Playtime"
# last_played: "Last played"
# leagues_explanation: "Play in a league against other clan members in these multiplayer arena instances."
# track_concepts1: "Track concepts"
# track_concepts2a: "learned by each student"
# track_concepts2b: "learned by each member"
# track_concepts3a: "Track levels completed for each student"
# track_concepts3b: "Track levels completed for each member"
# track_concepts4a: "See your students'"
# track_concepts4b: "See your members'"
# track_concepts5: "solutions"
# track_concepts6a: "Sort students by name or progress"
# track_concepts6b: "Sort members by name or progress"
# track_concepts7: "Requires invitation"
# track_concepts8: "to join"
# private_require_sub: "Private clans require a subscription to create or join."
complete_2: "완료"
started_2: "시작됨"
not_started_2: "시작되지않음"
view_solution: "해결책을 보려면 클릭."
view_attempt: "시도를 보려면 클릭."
latest_achievement: "최신 도전과제"
playtime: "플레이타임"
last_played: "마지막으로 플레이한"
leagues_explanation: "이러한 멀티 분야인 경우에는 다른 클랜들에 대한 리그에서 플레이합니다."
track_concepts1: "트랙 컨셉"
track_concepts2a: "학생으로부터 학습됨"
track_concepts2b: "맴버로부터 학습됨"
track_concepts3a: "각자 학생들로부터 트랙 레벨이 완료됨"
track_concepts3b: "각자 맴버들로부터 트랙 레벨이 완료됨"
track_concepts4a: "당신의 학생 보기'"
track_concepts4b: "당신의 맴버 보기'"
track_concepts5: "솔루션"
track_concepts6a: "이름이나 진행상황으로 정렬된 학생들"
track_concepts6b: "이름이나 진행상황으로 정렬된 맴버들"
track_concepts7: "초대장 필요"
track_concepts8: "으로 참여"
private_require_sub: "비공개 클랜을 만들거나 참여해서 구독하는것을 권장합니다."
# courses:
# course: "Course"
# courses: "courses"
# create_new_class: "Create New Class"
# not_enrolled: "You are not enrolled in this course."
# visit_pref: "Please visit the"
# visit_suf: "page to enroll."
# select_class: "Select one of your classes"
# unnamed: "*unnamed*"
# select: "Select"
# unnamed_class: "Unnamed Class"
# edit_settings: "edit class settings"
# edit_settings1: "Edit Class Settings"
# progress: "Class Progress"
# add_students: "Add Students"
# stats: "Statistics"
# total_students: "Total students:"
# average_time: "Average level play time:"
# total_time: "Total play time:"
courses:
course: "코스"
courses: "코스들"
create_new_class: "새로운 클래스 만들기"
not_enrolled: "이 과정에 등록 되지 않습니다."
visit_pref: "등록 페이지를"
visit_suf: "방문하십시오."
select_class: "당신의 클래스 중 하나를 선택하십시오"
unnamed: "*이름없음*"
select: "선택"
unnamed_class: "이름없는 클래스"
edit_settings: "클래스 세팅 수정"
edit_settings1: "클래스 세팅 수정"
progress: "클래스 진행상황"
add_students: "학생 추가"
stats: "통계"
total_students: "총 학생:"
average_time: "평균 수준의 플레이 시간:"
total_time: "총 플레이 시간:"
# average_levels: "Average levels completed:"
# total_levels: "Total levels completed:"
# furthest_level: "Furthest level completed:"
@ -1015,22 +1015,22 @@ module.exports = nativeDescription: "한국어", englishDescription: "Korean", t
classes:
archmage_title: "대마법사"
archmage_title_description: "(코더)"
# archmage_summary: "If you are a developer interested in coding educational games, become an archmage to help us build CodeCombat!"
archmage_summary: "당신이 만약 코딩 교육 게임에 관심있는 개발자라면, 코드컴뱃을 돕는 대마법사가 되어주십시오!"
artisan_title: "장인"
artisan_title_description: "(레벨 제작자)"
# artisan_summary: "Build and share levels for you and your friends to play. Become an Artisan to learn the art of teaching others to program."
artisan_summary: "레벨을 만들거나 공유하여 당신과 친구들이 플레이합니다. 다른 프로그램을 가르치는 예술 장인이 되어보십시오!"
adventurer_title: "모험가"
adventurer_title_description: "(레벨 테스터)"
# adventurer_summary: "Get our new levels (even our subscriber content) for free one week early and help us work out bugs before our public release."
adventurer_summary: "우리의 새로운 레벨을 (심지어 구독자의 컨텐츠도) 일주일 먼저 무료로 얻을 수 있고 공개 릴리즈 전에 버그를 제보하여 우리를 도와주십시오."
scribe_title: "작가"
scribe_title_description: "(기사 에디터)"
# scribe_summary: "Good code needs good documentation. Write, edit, and improve the docs read by millions of players across the globe."
scribe_summary: "좋은 코드는 좋은 문서가 필요합니다. 쓰기, 편집하고, 전 세계의 수백만 플레이어에 의해 판독된 문서를 향상시킬 수 있습니다."
diplomat_title: "외교관"
diplomat_title_description: "(번역가)"
# diplomat_summary: "CodeCombat is localized in 45+ languages by our Diplomats. Help us out and contribute translations."
diplomat_summary: "코드컴뱃은 Diplomats에 의해 45+ 언어로 지역화되었습니다. 우리를 도와 번역에 기여하십시오."
ambassador_title: "대사"
ambassador_title_description: "(지원)"
# ambassador_summary: "Tame our forum users and provide direction for those with questions. Our ambassadors represent CodeCombat to the world."
ambassador_summary: "포럼 사용자를 관리하는것과 질문들에 대한 방향을 제공합니다. 우리의 대사는 세계에 코드컴뱃을 나타냅니다."
editor:
main_title: "코드 컴뱃 에디터들"
@ -1038,7 +1038,7 @@ module.exports = nativeDescription: "한국어", englishDescription: "Korean", t
thang_title: "Thang 에디터"
level_title: "레벨 에디터"
achievement_title: "업적 에디터"
# poll_title: "Poll Editor"
poll_title: "투표 에디터"
back: "뒤로"
revert: "되돌리기"
revert_models: "모델 되돌리기"
@ -1047,34 +1047,34 @@ module.exports = nativeDescription: "한국어", englishDescription: "Korean", t
indoor: "내부"
desert: "사막"
grassy: "풀로 덮인"
# mountain: "Mountain"
# glacier: "Glacier"
mountain: ""
glacier: "빙하"
small: "작게"
large: "크게"
fork_title: "새 버전 가져오기"
fork_creating: "포크 생성중..."
# generate_terrain: "Generate Terrain"
generate_terrain: "지형 생성"
more: "더 보기"
wiki: "위키"
live_chat: "실시간 채팅"
# thang_main: "Main"
# thang_spritesheets: "Spritesheets"
# thang_colors: "Colors"
thang_main: "메인"
thang_spritesheets: "스프라이트시트"
thang_colors: "색갈"
level_some_options: "다른 옵션들?"
level_tab_thangs: "Thangs"
level_tab_scripts: "스크립트들"
level_tab_settings: "설정"
level_tab_components: "요소들"
level_tab_systems: "시스템"
# level_tab_docs: "Documentation"
level_tab_docs: "문서"
level_tab_thangs_title: "현재 Thangs"
# level_tab_thangs_all: "All"
level_tab_thangs_all: "모두"
level_tab_thangs_conditions: "컨디션 시작"
level_tab_thangs_add: "Thangs 추가"
# level_tab_thangs_search: "Search thangs"
# add_components: "Add Components"
# component_configs: "Component Configurations"
# config_thang: "Double click to configure a thang"
level_tab_thangs_search: "thangs 검색"
add_components: "구성요소 추가"
component_configs: "환경설정 구성요소"
config_thang: "thang을 설정하려면 더블클릭"
delete: "삭제"
duplicate: "복제"
stop_duplicate: "복제 중지"

View file

@ -81,10 +81,10 @@ module.exports = nativeDescription: "lietuvių kalba", englishDescription: "Lith
awaiting_levels_adventurer: "Prisijunk kaip Nuotykių Ieškotojas"
awaiting_levels_adventurer_suffix: "kad pamatytum juos pirmas."
adjust_volume: "Reguliuoti garsą"
# campaign_multiplayer: "Multiplayer Arenas"
# campaign_multiplayer_description: "... in which you code head-to-head against other players."
# campaign_old_multiplayer: "(Deprecated) Old Multiplayer Arenas"
# campaign_old_multiplayer_description: "Relics of a more civilized age. No simulations are run for these older, hero-less multiplayer arenas."
campaign_multiplayer: "Daugelio žaidėjų arenos"
campaign_multiplayer_description: "... kuriose tu prgramuoji kad įveiktum kitus žaidėjus."
campaign_old_multiplayer: "(Pasene) Senos daugelio žaidėjų Arenos"
campaign_old_multiplayer_description: "Civilizuoto amžiaus reliktai. Šios senos, be herojų arenos nesimuliuojamos."
share_progress_modal:
blurb: "Tau puikiai sekasi! Parodyk tėvams kiek jau išmokai su CodeCombat."
@ -187,7 +187,7 @@ module.exports = nativeDescription: "lietuvių kalba", englishDescription: "Lith
password: "Slaptažodis"
message: "Žinutė"
code: "Kodas"
# ladder: "Ladder"
ladder: "Rezultatų lentelė"
when: "Kai"
opponent: "Priešininkas"
rank: "Rangas"
@ -252,7 +252,7 @@ module.exports = nativeDescription: "lietuvių kalba", englishDescription: "Lith
victory_sign_up: "Užsiregistruokite, kad išsaugotumėte pažangą"
victory_sign_up_poke: "Norite išsaugoti savo kodą? Sukurkite paskyrą nemokamai!"
victory_rate_the_level: "Ar patiko šis lygis?"
# victory_return_to_ladder: "Return to Ladder"
victory_return_to_ladder: "Grįžti į razultatų lentelę"
victory_saving_progress: "Išsaugoma pažanga"
victory_go_home: "Į Pradžią"
victory_review: "Papasakok daugiau!"
@ -284,11 +284,11 @@ module.exports = nativeDescription: "lietuvių kalba", englishDescription: "Lith
problem_alert_title: "Taisyti kodą"
time_current: "Dabar:"
time_total: "Max:"
time_goto: "Eiti į:"
time_goto: "Eik į:"
non_user_code_problem_title: "Nepavyko pakrauti lygio"
infinite_loop_title: "Pastebėtas begalinis ciklas!"
# infinite_loop_description: "The initial code to build the world never finished running. It's probably either really slow or has an infinite loop. Or there might be a bug. You can either try running this code again or reset the code to the default state. If that doesn't fix it, please let us know."
# check_dev_console: "You can also open the developer console to see what might be going wrong."
check_dev_console: "Tu taipogi gali atsidaryti kūrėjo konsolę, kad sužinotum kas negerai."
check_dev_console_link: "(instrukcijos)"
infinite_loop_try_again: "Bandyk dar kartą"
infinite_loop_reset_level: "Pradėti lygi išnaujo"
@ -306,12 +306,12 @@ module.exports = nativeDescription: "lietuvių kalba", englishDescription: "Lith
tip_forums: "Aplankykite forumą ir parašykite mums Jūsų nuomonę!"
tip_baby_coders: "Ateityje ir kūdikiai bus Arkimagais."
# tip_morale_improves: "Loading will continue until morale improves."
# tip_all_species: "We believe in equal opportunities to learn programming for all species."
tip_all_species: "Mes tikime lygiomis galimybėmis visoms rūšims į programavimą."
# tip_reticulating: "Reticulating spines."
tip_harry: "Tu esi Burtininkas, "
# tip_great_responsibility: "With great coding skill comes great debug responsibility."
tip_great_responsibility: "Su puikiu programavimo įgudžiu ateina ir didelė atsakomybė."
# tip_munchkin: "If you don't eat your vegetables, a munchkin will come after you while you're asleep."
# tip_binary: "There are only 10 types of people in the world: those who understand binary, and those who don't."
tip_binary: "Pasaulyje yra tik 10 tipų žmonės: tie kurie supranta dvejetainius skaičius ir tie kurie ne."
# tip_commitment_yoda: "A programmer must have the deepest commitment, the most serious mind. ~ Yoda"
tip_no_try: "Daryk. Arba ne. Jokių 'pabandysiu'. - Yoda"
tip_patience: "Kantrybės turėti turi, jaunasis Padavane. - Yoda"
@ -399,22 +399,22 @@ module.exports = nativeDescription: "lietuvių kalba", englishDescription: "Lith
recovered: "Atstatyta deimantų pirkimo operacija. Prašome pakraukite puslapį iš naujo."
price: "x{{gems}} / mėn"
# subscribe:
# comparison_blurb: "Sharpen your skills with a CodeCombat subscription!"
# feature1: "110+ basic levels across 4 worlds"
# feature2: "10 powerful <strong>new heroes</strong> with unique skills!"
# feature3: "80+ bonus levels"
# feature4: "<strong>{{gems}} bonus gems</strong> every month!"
# feature5: "Video tutorials"
# feature6: "Premium email support"
# feature7: "Private <strong>Clans</strong>"
# free: "Free"
# month: "month"
subscribe:
comparison_blurb: "Pagerink savo įgudžius su CodeCombat prenumerata!"
feature1: "110+ įprastų lygių per 4 pasaulius"
feature2: "10 galingų <strong>naujų herojų</strong> su unikaliais įgudžiais!"
feature3: "80+ papildomų lygių"
feature4: "<strong>{{gems}} papildomi krystalai</strong> kiekvieną mėnesį!"
feature5: "Video pamokos"
feature6: "Papildomas el.pašto palaikymas"
feature7: "Privatūs <strong>Klanai</strong>"
free: "Nemokama"
month: "Mėnesis"
# must_be_logged: "You must be logged in first. Please create an account or log in from the menu above."
# subscribe_title: "Subscribe"
# unsubscribe: "Unsubscribe"
# confirm_unsubscribe: "Confirm Unsubscribe"
# never_mind: "Never Mind, I Still Love You"
subscribe_title: "Prenumerata"
unsubscribe: "Nebepremenuoruoti"
confirm_unsubscribe: "patvirtinti nebeprenumeravimą"
never_mind: "Nekreipk dėmesio, aš vis dar tave myliu."
# thank_you_months_prefix: "Thank you for supporting us these last"
# thank_you_months_suffix: "months."
# thank_you: "Thank you for supporting CodeCombat."
@ -475,7 +475,7 @@ module.exports = nativeDescription: "lietuvių kalba", englishDescription: "Lith
weapons: "Ginklai"
weapons_warrior: "Kardai - artimas atstumas, be Kerų"
weapons_ranger: "Arbaletai, Šautuvai - tolimas atstumas, be Kerų"
weapons_wizard: "stebuklų lazdelės ir skipetrai - tolimas atstumas, magija"
weapons_wizard: "stebuklų lazdelės ir skeptrai - tolimas atstumas, magija"
attack: "Žala" # Can also translate as "Attack"
health: "Sveikata"
speed: "Greitis"

View file

@ -22,7 +22,11 @@
li
height: 22pt
display: inline-block
margin: 10px 18px 0 18px
margin: 10px 0 0
@media (min-width: $screen-xs-min)
margin: 10px 5px 0
@media (min-width: $screen-sm-min)
margin: 10px 18px 0
a
color: white
text-transform: uppercase

View file

@ -20,7 +20,7 @@ iframe
.selectable
cursor: pointer
.modal-dialog
.modal-dialog.game
padding: 5px
margin-top: 30px
margin-bottom: 0px

View file

@ -15,9 +15,10 @@ $forest: #20572B
.style-flat
background: white
color: black
// Fonts
h1, h2, h3, h4, h5, h6
h1, h2, h3, h4, h5, h6, .text-h1, .text-h2, .text-h3, .text-h4, .text-h5, .text-h6
// Unsetting game styles
font-variant: normal
color: black
@ -200,6 +201,9 @@ $forest: #20572B
a.btn-primary-alt
color: $navy
// base-flat.jade
#footer
background-image: url("/images/pages/home/footer_background.png")
height: 229px
@ -237,3 +241,16 @@ $forest: #20572B
img
width: 150px
margin: 0 10px
// modal-base-flat.jade
&.modal-content
padding: 10px
border-radius: 0
box-shadow: 0 3px 9px rgba(0, 0, 0, 0.5)
.button.close
position: absolute
top: 10px
left: 10px

View file

@ -1,4 +1,4 @@
extends /templates/core/modal-base
extends /templates/core/modal-base-flat
block modal-header-content
h3 Administer User

View file

@ -24,13 +24,7 @@ block content
th Phone
th Status
tbody
- var numReviewed = 0
- var maxReviewedShown = 1000
each trialRequest in trialRequests
if trialRequest.get('status') !== 'submitted'
- numReviewed++
if numReviewed > maxReviewedShown
- break
tr
td.created= trialRequest.get('created').substring(0, 10)
td.reviewed

View file

@ -1,5 +1,8 @@
#loading-error.text-center
if jqxhr.status === 401
if !jqxhr
h1(data-i18n="loading_error.unknown")
else if jqxhr.status === 401
h1
span.spr 401:
span(data-i18n="loading_error.login_required")

View file

@ -0,0 +1,32 @@
.modal-dialog
.modal-content.style-flat
block modal-header
.modal-header
if view.closeButton
.button.close(type="button", data-dismiss="modal", aria-hidden="true") &times;
block modal-header-content
if view.options.headerContent
h3!= view.options.headerContent
else
h3 man bites God
block modal-body
.modal-body
block modal-body-content
if view.options.bodyContent
div!= view.options.bodyContent
else
p Man Bites God are the bad boys of the Melbourne live music and comedy scene. It is like being drowned in a bathtub of harmony.
img(src="http://www.manbitesgod.com/images/picturecoupleb.jpg")
img(src="http://www.manbitesgod.com/images/manrantb.jpg")
.modal-body.wait.secret
block modal-body-wait-content
h3 Reticulating Splines...
.progress.progress-striped.active
.progress-bar
block modal-footer
.modal-footer
block modal-footer-content
button.btn.btn-primary(type="button", data-dismiss="modal", aria-hidden="true", data-i18n="modal.okay") Okay

View file

@ -1,4 +1,4 @@
.modal-dialog
.modal-dialog.game
.background-wrapper
.modal-content
block modal-header

View file

@ -67,11 +67,14 @@ module.exports = class AboutView extends RootView
@scrollToLink('#contact')
onRightPressed: (event) ->
# Special handling, otherwise after you click the control, keyboard presses move the slide twice
return if event.type is 'keydown' and $(document.activeElement).is('.carousel-control')
if $('#screenshot-lightbox').data('bs.modal')?.isShown
event.preventDefault()
$('#screenshot-carousel').carousel('next')
onLeftPressed: (event) ->
return if event.type is 'keydown' and $(document.activeElement).is('.carousel-control')
if $('#screenshot-lightbox').data('bs.modal')?.isShown
event.preventDefault()
$('#screenshot-carousel').carousel('prev')

View file

@ -55,7 +55,7 @@ module.exports = class NewHomeView extends RootView
middle: {'introduction-to-computer-science': '1-3', 'computer-science-5': '7-10', default: '5-8', total: '25-35 hours (about one semester)'}
high: {'introduction-to-computer-science': '1', 'computer-science-5': '6-9', default: '5-6', total: '22-28 hours (about one semester)'}
level = if e then $(e.target).val() else 'middle'
@$el.find('#courses-container .course-details').each ->
@$el.find('#courses-row .course-details').each ->
slug = $(@).data('course-slug')
duration = levels[level][slug] or levels[level].default
$(@).find('.course-duration .course-hours').text duration

View file

@ -66,8 +66,8 @@ module.exports = class AccountSettingsView extends CocoView
renderData =
confirmTitle: 'Are you really sure?'
confirmBody: 'This will completely delete your account. This action CANNOT be undone. Are you entirely sure?'
confirmDecline: 'Not really'
confirmConfirm: 'Definitely'
confirmDecline: 'Cancel'
confirmConfirm: 'DELETE Your Account'
confirmModal = new ConfirmModal renderData
confirmModal.on 'confirm', @deleteAccount
@openModalView confirmModal
@ -76,9 +76,9 @@ module.exports = class AccountSettingsView extends CocoView
@validateCredentialsForDestruction @$el.find('#reset-progress-form'), =>
renderData =
confirmTitle: 'Are you really sure?'
confirmBody: 'This will completely erase your progress: code, levels, achievements, earned gems, etc. This action CANNOT be undone. Are you entirely sure?'
confirmDecline: 'Not really'
confirmConfirm: 'Definitely'
confirmBody: 'This will completely erase your progress: code, levels, achievements, earned gems, and course work. This action CANNOT be undone. Are you entirely sure?'
confirmDecline: 'Cancel'
confirmConfirm: 'Erase ALL Progress'
confirmModal = new ConfirmModal renderData
confirmModal.on 'confirm', @resetProgress
@openModalView confirmModal

View file

@ -6,7 +6,6 @@ Prepaid = require 'models/Prepaid'
module.exports = class AdministerUserModal extends ModalView
id: "administer-user-modal"
template: template
plain: true
events:
'click #save-changes': 'onSaveChanges'

View file

@ -138,7 +138,10 @@ module.exports = class LevelGuideView extends CocoView
tag.height = @helpVideoHeight
tag.width = @helpVideoWidth
tag.allowFullscreen = true
@$el.find('#help-video-player').replaceWith(tag)
tag.mozAllowFullscreen = true
$tag = $(tag)
$tag.attr('webkitallowfullscreen', true) # strong arm Safari into working
@$el.find('#help-video-player').replaceWith($tag)
@onMessageReceived = (e) =>
data = JSON.parse(e.data)

50
server/lib/closeIO.coffee Normal file
View file

@ -0,0 +1,50 @@
config = require '../../server_config'
log = require 'winston'
request = require 'request'
apiKey = config.closeIO?.apiKey
module.exports =
logError: (msg) ->
log.error("Close.io Error: #{msg}")
createSalesLead: (user, email, newLeadData) ->
return @logError('No API key available') unless apiKey
@getLead email, (error, lead) =>
return @logError(JSON.stringify(error)) if error
return if lead
@createLead(user, email, newLeadData)
createLead: (user, email, newLeadData) ->
name = newLeadData.name ? email
postData =
display_name: newLeadData.organization ? name
name: newLeadData.organization ? name
contacts: [{
emails: [{email: email}]
name: name
}]
custom: {}
postData.contacts[0].phones = [phone: newLeadData.phone] if newLeadData.phone
for key, val of newLeadData
continue if key in ['name', 'organization', 'phone']
continue if _.isEmpty(val)
postData.custom[key] = val
postData.custom['userID'] = user.get('_id').valueOf() if user
options =
uri: 'https://' + apiKey + ':X@app.close.io/api/v1/lead/',
body: JSON.stringify(postData)
request.post options, (error, response, body) =>
return @logError(JSON.stringify(error)) if error
getLead: (email, done) ->
uri = 'https://' + apiKey + ':X@app.close.io/api/v1/lead/?query=email_address:' + email
request.get uri, (error, response, body) =>
return done(error) if error
leads = JSON.parse(body)
return done("Unexpected leads format: " + body) unless leads.data?
if leads.data?.length is 1
return done(null, leads.data[0])
else if leads.data?.length > 1
return done('ERROR: multiple leads returned for ' + email + ' ' + leads.data.length)
return done()

View file

@ -3,6 +3,7 @@ errors = require '../commons/errors'
wrap = require 'co-express'
Promise = require 'bluebird'
database = require '../commons/database'
mongoose = require 'mongoose'
module.exports =
names: (Model, options={}) -> wrap (req, res) ->

View file

@ -1,3 +1,4 @@
closeIO = require '../lib/closeIO'
log = require 'winston'
mongoose = require 'mongoose'
config = require '../../server_config'
@ -26,18 +27,36 @@ TrialRequestSchema.pre 'save', (next) ->
TrialRequestSchema.post 'save', (doc) ->
if doc.get('status') is 'approved'
emailParams =
recipient:
address: doc.get('properties')?.email
email_id: sendwithus.templates.teacher_free_trial
sendwithus.api.send emailParams, (err, result) =>
log.error "sendwithus trial request approved error: #{err}, result: #{result}" if err
unless trialProperties = doc.get('properties')
log.error "Saving approved trial request #{doc.id} with no properties!"
return
# Subscribe to teacher news group
User.findById doc.get('applicant'), (err, user) =>
if err
log.error "Trial request user find error: #{err}"
return
# Send trial approved email
email = trialProperties.email ? user.get('emailLower')
emailParams =
recipient:
address: email
email_id: sendwithus.templates.teacher_free_trial
sendwithus.api.send emailParams, (err, result) =>
log.error "sendwithus trial request approved error: #{err}, result: #{result}" if err
closeIO.createSalesLead(user, email,
name: trialProperties.name
organization: trialProperties.organization
location: _.filter(_.at(trialProperties, 'city', 'state', 'country')).join(' ')
educationLevel: (trialProperties.educationLevel or []).join(', ')
numStudents: trialProperties.numStudents
role: trialProperties.role
phone: trialProperties.phoneNumber
notes: trialProperties.notes
)
# Subscribe to teacher news group
emails = _.cloneDeep(user.get('emails') ? {})
emails.teacherNews ?= {}
emails.teacherNews.enabled = true

View file

@ -34,6 +34,9 @@ else
config.apple =
verifyURL: process.env.COCO_APPLE_VERIFY_URL or 'https://sandbox.itunes.apple.com/verifyReceipt'
config.closeIO =
apiKey: process.env.COCO_CLOSEIO_API_KEY or ''
config.stripe =
secretKey: process.env.COCO_STRIPE_SECRET_KEY or 'sk_test_MFnZHYD0ixBbiBuvTlLjl2da'

View file

@ -110,9 +110,6 @@ describe 'CocoModel', ->
expect(request).toBeUndefined()
xdescribe 'Achievement polling', ->
NewAchievementCollection = require 'collections/NewAchievementCollection'
EarnedAchievement = require 'models/EarnedAchievement'
# TODO: Figure out how to do debounce in tests so that this test doesn't need to use keepDoingUntil
it 'achievements are polled upon saving a model', (done) ->
@ -173,4 +170,4 @@ describe 'CocoModel', ->
})
m.updateI18NCoverage()
expect(JSON.stringify(m.get('i18nCoverage'))).toBe('["es"]')
expect(JSON.stringify(m.get('i18nCoverage'))).toBe('["es"]')