diff --git a/assets/js/components/bottom/links.js b/assets/js/components/bottom/links.js index e4b53afe..2e9df3c7 100644 --- a/assets/js/components/bottom/links.js +++ b/assets/js/components/bottom/links.js @@ -4,7 +4,7 @@ * @author Pierre HUBERT */ -const BottomLinks = [ +const BottomLinks = () => [ //Language selector { @@ -13,6 +13,14 @@ const BottomLinks = [ onclick: function(){ComunicWeb.components.langPicker.show();} }, + // Android application + { + innerHTML: tr("Android app"), + icon: "fa-android", + href: ServerConfig.conf.play_store_url, + target: "_blank" + }, + //About Comunic { innerLang: "bottom_bar_action_about", diff --git a/assets/js/components/bottom/main.js b/assets/js/components/bottom/main.js index a6bf6f71..c1a14d57 100644 --- a/assets/js/components/bottom/main.js +++ b/assets/js/components/bottom/main.js @@ -43,26 +43,27 @@ ComunicWeb.components.bottom.main = { innerHTML: "Comunic     " }); - BottomLinks.forEach(function(link){ + if(!signed_in()) + BottomLinks().forEach(function(link){ - var linkEl = createElem2({ - appendTo: leftElements, - type: "a", - href: link.href, - innerHTML: link.innerHTML, - innerLang: link.innerLang, - innerHTMLprefix: " " + var linkEl = createElem2({ + appendTo: leftElements, + type: "a", + href: link.href, + innerHTML: link.innerHTML, + innerLang: link.innerLang, + innerHTMLprefix: " " + }); + + if(link.target) + linkEl.setAttribute("target", link.target); + + if(link.onclick) + linkEl.onclick = link.onclick; + + add_space(leftElements); + add_space(leftElements); }); - - if(link.target) - linkEl.setAttribute("target", link.target); - - if(link.onclick) - linkEl.onclick = link.onclick; - - add_space(leftElements); - add_space(leftElements); - }); } } \ No newline at end of file diff --git a/assets/js/components/menuBar/authenticated.js b/assets/js/components/menuBar/authenticated.js index 3523dd93..7bf34c4d 100644 --- a/assets/js/components/menuBar/authenticated.js +++ b/assets/js/components/menuBar/authenticated.js @@ -197,7 +197,7 @@ ComunicWeb.components.menuBar.authenticated = { class: "divider" }); - BottomLinks.forEach(addMenuOption); + BottomLinks().forEach(addMenuOption); //Return dropdown content element diff --git a/assets/js/typings/ServerConfig.d.ts b/assets/js/typings/ServerConfig.d.ts index 27ff7331..a2acbb9a 100644 --- a/assets/js/typings/ServerConfig.d.ts +++ b/assets/js/typings/ServerConfig.d.ts @@ -25,6 +25,9 @@ declare interface DataConservationPolicySettings { } declare interface StaticServerConfig { + terms_url: string, + play_store_url: string, + android_direct_download_url: string, password_policy: PasswordPolicy, data_conservation_policy: DataConservationPolicySettings; } \ No newline at end of file