Merge branch 'master' into production

This commit is contained in:
Nick Winter 2015-08-08 11:28:49 -07:00
commit c351f09a61
5 changed files with 6 additions and 3 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

View file

@ -766,6 +766,7 @@
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"

View file

@ -16,8 +16,7 @@
.logo-row
padding-top: 10px
width: 80%
margin: 0 auto
text-align: center
.logo-row img
height: 50px

View file

@ -47,6 +47,9 @@ block content
.logo-row
a(href="https://github.com/codecombat/codecombat")
img(src="/images/pages/community/logo_github.png", data-i18n="[data-content]community.social_github" data-content="Check out all our code on GitHub")
a(href="http://blog.codecombat.com")
img(src="/images/pages/community/logo_sett.png", data-i18n="[data-content]community.social_blog" data-content="Read the CodeCombat blog on Sett")

View file

@ -84,7 +84,7 @@ setupChinaRedirectMiddleware = (app) ->
speaksChinese = firstLanguage and firstLanguage.indexOf('zh') isnt -1
unless config.tokyo
ip = req.headers['x-forwarded-for'] or req.connection.remoteAddress
ip = ip?.split(' ')[0] # If there are two IP addresses, say because of CloudFlare, we just take the first.
ip = ip?.split(/,? /)[0] # If there are two IP addresses, say because of CloudFlare, we just take the first.
geo = geoip.lookup(ip)
if speaksChinese or geo?.country is "CN"
log.info("Should we redirect to Tokyo server? speaksChinese: #{speaksChinese}, firstLanguage: #{firstLanguage}, ip: #{ip}, geo: #{geo} -- so redirecting? #{geo?.country is 'CN' and speaksChinese}")