diff --git a/app/assets/images/pages/community/logo_github.png b/app/assets/images/pages/community/logo_github.png new file mode 100644 index 000000000..a7c81809f Binary files /dev/null and b/app/assets/images/pages/community/logo_github.png differ diff --git a/app/locale/en.coffee b/app/locale/en.coffee index f894dacbb..32f9a96aa 100644 --- a/app/locale/en.coffee +++ b/app/locale/en.coffee @@ -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" diff --git a/app/styles/community.sass b/app/styles/community.sass index 825c1c33b..c0956f79e 100644 --- a/app/styles/community.sass +++ b/app/styles/community.sass @@ -16,8 +16,7 @@ .logo-row padding-top: 10px - width: 80% - margin: 0 auto + text-align: center .logo-row img height: 50px diff --git a/app/templates/community-view.jade b/app/templates/community-view.jade index b13039bc2..b48e1514f 100644 --- a/app/templates/community-view.jade +++ b/app/templates/community-view.jade @@ -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") diff --git a/server_setup.coffee b/server_setup.coffee index 9c3283acf..5a5f2dcea 100644 --- a/server_setup.coffee +++ b/server_setup.coffee @@ -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}")