From fd8221b8690609ba37e5cce92e609ee516bb359b Mon Sep 17 00:00:00 2001 From: Henry Oswald Date: Thu, 21 Aug 2014 17:58:25 +0100 Subject: [PATCH] make it possible to hide a lng --- .../web/app/coffee/infrastructure/ExpressLocals.coffee | 2 +- services/web/app/views/layout/footer.jade | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/services/web/app/coffee/infrastructure/ExpressLocals.coffee b/services/web/app/coffee/infrastructure/ExpressLocals.coffee index 62be91eaee..0fd68ebba0 100644 --- a/services/web/app/coffee/infrastructure/ExpressLocals.coffee +++ b/services/web/app/coffee/infrastructure/ExpressLocals.coffee @@ -141,7 +141,7 @@ module.exports = (app)-> app.use (req, res, next)-> subdomain = _.find Settings.i18n.subdomainLang, (subdomain)-> - subdomain.lngCode == req.showUserOtherLng + subdomain.lngCode == req.showUserOtherLng and !subdomain.hide res.locals.recomendSubdomain = subdomain res.locals.currentLngCode = req.lng next() diff --git a/services/web/app/views/layout/footer.jade b/services/web/app/views/layout/footer.jade index 17907f9e3e..260a7c205b 100644 --- a/services/web/app/views/layout/footer.jade +++ b/services/web/app/views/layout/footer.jade @@ -19,10 +19,11 @@ footer.site-footer ul.dropdown-menu(role="menu") li.dropdown-header #{translate("language")} each subdomainDetails, subdomain in settings.i18n.subdomainLang - li.lngOption - a.menu-indent(href=subdomainDetails.url+currentUrl) - img(src="/img/flags/24/#{subdomainDetails.lngCode}.png") - | #{translate(subdomainDetails.lngCode)} + if !subdomainDetails.hide + li.lngOption + a.menu-indent(href=subdomainDetails.url+currentUrl) + img(src="/img/flags/24/#{subdomainDetails.lngCode}.png") + | #{translate(subdomainDetails.lngCode)} each item in nav.left_footer li