From e15cf5cfcad35c00e126f645af3cdaec9d8132ac Mon Sep 17 00:00:00 2001 From: saurabhbhatia Date: Mon, 9 Dec 2013 14:54:36 +0800 Subject: [PATCH] Added Mobile Site Icon for the website --- app/models/site.rb | 1 + .../admin/sites/responsive_setting.html.erb | 31 ++++++++++++++++++- app/views/mobile/_header.mobile.erb | 2 +- 3 files changed, 32 insertions(+), 2 deletions(-) diff --git a/app/models/site.rb b/app/models/site.rb index 95ba2d98..a31e568a 100644 --- a/app/models/site.rb +++ b/app/models/site.rb @@ -34,6 +34,7 @@ class Site mount_uploader :default_image, ImageUploader mount_uploader :favicon, ImageUploader + mount_uploader :mobile_icon, ImageUploader field :search,:type => Hash field :resque_namespace,:type => String, :default=>APP_CONFIG['orbit'] diff --git a/app/views/admin/sites/responsive_setting.html.erb b/app/views/admin/sites/responsive_setting.html.erb index 5c90bb83..10b7fe7d 100644 --- a/app/views/admin/sites/responsive_setting.html.erb +++ b/app/views/admin/sites/responsive_setting.html.erb @@ -26,6 +26,35 @@ +
+ +
+ +
+
+ <% if @site.mobile_icon.file.present? %> + <%= image_tag( @site.mobile_icon, :size=>"120x120") rescue ''%> + <% else %> + <%= image_tag "orbit-logo.png",:class => "pull-left upload-picture"%> + <% end %> +
+
+ <% if @site.mobile_icon.present?%> + + <%= f.file_field :mobile_icon, :id => "input-upload", :class => 'fileupload-new', :onchange => "document.getElementById('fu').innerHTML = this.form.fu.value = this.value;" %>Change + + <%= f.check_box :remove_mobile_icon %> + Remove Icon + <%else%> + + <%= f.file_field :mobile_icon, :id => "input-upload", :class => 'fileupload-new', :onchange => "document.getElementById('fu').innerHTML = this.form.fu.value = this.value;" %>Select Image + + <%end%> + Cancel + +
+
+
@@ -62,7 +91,7 @@ <%= f.check_box :mobile_api_openness_on , :class=>"toggle-check", :data=> { disabled: true } %> Make API available for Mobile Apps
-
+
diff --git a/app/views/mobile/_header.mobile.erb b/app/views/mobile/_header.mobile.erb index 3e0df561..f0120102 100644 --- a/app/views/mobile/_header.mobile.erb +++ b/app/views/mobile/_header.mobile.erb @@ -1,6 +1,6 @@

- <%= image_tag asset_path('mobile/logo.png') %> + <%= image_tag( @site.mobile_icon, :size=>"120x120") rescue '' %>

<%= link_to mobile_dialog_language_path(:app => params[:app]), {:class => "ui-btn-right language", "data-iconpos" => "notext", "data-icon" => "search", "data-rel" => "dialog"} do %>