From cd186aee56ff3dde637c962d2e4cb937b98e4073 Mon Sep 17 00:00:00 2001 From: riking Date: Wed, 18 Jun 2014 12:44:00 -0700 Subject: [PATCH] Allow a sepearate mobile logo URL --- .../javascripts/discourse/components/home-logo.js.es6 | 5 +++++ .../templates/components/home-logo.js.handlebars | 10 +++++++--- app/views/layouts/application.html.erb | 2 +- config/site_settings.yml | 3 +++ 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/app/assets/javascripts/discourse/components/home-logo.js.es6 b/app/assets/javascripts/discourse/components/home-logo.js.es6 index 9d8e6884330..5e393622b07 100644 --- a/app/assets/javascripts/discourse/components/home-logo.js.es6 +++ b/app/assets/javascripts/discourse/components/home-logo.js.es6 @@ -9,8 +9,13 @@ export default Ember.Component.extend({ return !Discourse.Mobile.mobileView && this.get("minimized"); }.property("minimized"), + showMobileLogo: function() { + return Discourse.Mobile.mobileView && !Ember.isBlank(this.get('mobileBigLogoUrl')); + }.property(), + smallLogoUrl: Discourse.computed.setting('logo_small_url'), bigLogoUrl: Discourse.computed.setting('logo_url'), + mobileBigLogoUrl: Discourse.computed.setting('mobile_logo_url'), title: Discourse.computed.setting('title'), click: function(e) { diff --git a/app/assets/javascripts/discourse/templates/components/home-logo.js.handlebars b/app/assets/javascripts/discourse/templates/components/home-logo.js.handlebars index cbac1477ebc..b2b8f9e6db7 100644 --- a/app/assets/javascripts/discourse/templates/components/home-logo.js.handlebars +++ b/app/assets/javascripts/discourse/templates/components/home-logo.js.handlebars @@ -6,10 +6,14 @@ {{/if}} {{else}} - {{#if bigLogoUrl}} - + {{#if showMobileLogo}} + {{else}} - + {{#if bigLogoUrl}} + + {{else}} + + {{/if}} {{/if}} {{/if}} diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 12003874876..eab4ec5bc6b 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -43,7 +43,7 @@
- +
diff --git a/config/site_settings.yml b/config/site_settings.yml index 7a9f2c2ac43..9e764dee8b0 100644 --- a/config/site_settings.yml +++ b/config/site_settings.yml @@ -35,6 +35,9 @@ required: digest_logo_url: client: false default: '' + mobile_logo_url: + client: true + default: '' favicon_url: client: true default: '/images/default-favicon.ico'