From 847fa907c351daad719669e0502aa900e81b2534 Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Tue, 4 Aug 2015 20:57:11 +0200 Subject: [PATCH] Fixed org logo detection in wizard. --- .../javascripts/app/controllers/getting_started.js.coffee | 5 +++++ app/controllers/getting_started_controller.rb | 7 +++++++ lib/static_assets.rb | 6 ++++++ 3 files changed, 18 insertions(+) diff --git a/app/assets/javascripts/app/controllers/getting_started.js.coffee b/app/assets/javascripts/app/controllers/getting_started.js.coffee index 8d76bdcc0..87b375439 100644 --- a/app/assets/javascripts/app/controllers/getting_started.js.coffee +++ b/app/assets/javascripts/app/controllers/getting_started.js.coffee @@ -287,6 +287,11 @@ class Base extends App.ControllerContent @navigate '#import/' + data.import_backend return + # import config options + if data.config + for key, value of data.config + App.Config.set(key, value) + # render page @render() ) diff --git a/app/controllers/getting_started_controller.rb b/app/controllers/getting_started_controller.rb index 4147f56df..ab9df6295 100644 --- a/app/controllers/getting_started_controller.rb +++ b/app/controllers/getting_started_controller.rb @@ -977,8 +977,15 @@ curl http://localhost/api/v1/getting_started -v -u #{login}:#{password} system_online_service: Setting.get('system_online_service'), addresses: addresses, groups: groups, + config: config, } true end + def config + { + product_logo: Setting.get('product_logo') + } + end + end diff --git a/lib/static_assets.rb b/lib/static_assets.rb index 981368bee..2ce877a28 100644 --- a/lib/static_assets.rb +++ b/lib/static_assets.rb @@ -45,6 +45,7 @@ returns preferences: { 'Content-Type' => content_type }, + created_by_id: 1, ) filename(file) end @@ -91,6 +92,7 @@ returns preferences: { 'Content-Type' => content_type }, + created_by_id: 1, ) StaticAssets.sync filename(file) @@ -142,6 +144,10 @@ generate filename based on Store model extention = '.jpg' elsif file.preferences['Content-Type'] =~ /png/i extention = '.png' + elsif file.preferences['Content-Type'] =~ /gif/i + extention = '.gif' + elsif file.preferences['Content-Type'] =~ /svg/i + extention = '.svg' end "#{hash}#{extention}" end