Added Mobile Site Icon for the website

This commit is contained in:
saurabhbhatia 2013-12-09 14:54:36 +08:00
parent 050f2dedff
commit e15cf5cfca
3 changed files with 32 additions and 2 deletions

View File

@ -34,6 +34,7 @@ class Site
mount_uploader :default_image, ImageUploader mount_uploader :default_image, ImageUploader
mount_uploader :favicon, ImageUploader mount_uploader :favicon, ImageUploader
mount_uploader :mobile_icon, ImageUploader
field :search,:type => Hash field :search,:type => Hash
field :resque_namespace,:type => String, :default=>APP_CONFIG['orbit'] field :resque_namespace,:type => String, :default=>APP_CONFIG['orbit']

View File

@ -26,6 +26,35 @@
</div> </div>
</div> </div>
<div class="control-group">
<label class="control-label muted">Mobile Site Icon</label>
<div class="controls">
<!-- if this page editing please add class "fileupload-edit" -->
<div class="fileupload fileupload-new clearfix" data-provides="fileupload">
<div class="fileupload-new thumbnail pull-left" style="background:black;">
<% 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 %>
</div>
<div class="fileupload-preview fileupload-exists thumbnail pull-left"></div>
<% if @site.mobile_icon.present?%>
<span class="btn btn-file">
<%= f.file_field :mobile_icon, :id => "input-upload", :class => 'fileupload-new', :onchange => "document.getElementById('fu').innerHTML = this.form.fu.value = this.value;" %>Change
</span>
<%= f.check_box :remove_mobile_icon %>
Remove Icon
<%else%>
<span class="btn btn-file">
<%= f.file_field :mobile_icon, :id => "input-upload", :class => 'fileupload-new', :onchange => "document.getElementById('fu').innerHTML = this.form.fu.value = this.value;" %>Select Image
</span>
<%end%>
<a href="#" class="btn fileupload-exists" data-dismiss="fileupload">Cancel</a>
</div>
</div>
<div class="control-group"> <div class="control-group">
<label class="control-label muted">Select Announcement Categories</label> <label class="control-label muted">Select Announcement Categories</label>
<div class="controls"> <div class="controls">

View File

@ -1,6 +1,6 @@
<header class="header" data-role="header"> <header class="header" data-role="header">
<h1 class="openmenu"> <h1 class="openmenu">
<%= image_tag asset_path('mobile/logo.png') %> <%= image_tag( @site.mobile_icon, :size=>"120x120") rescue '' %>
</h1> </h1>
<i class="openmenu icons-arrow-down-5"></i> <i class="openmenu icons-arrow-down-5"></i>
<%= link_to mobile_dialog_language_path(:app => params[:app]), {:class => "ui-btn-right language", "data-iconpos" => "notext", "data-icon" => "search", "data-rel" => "dialog"} do %> <%= link_to mobile_dialog_language_path(:app => params[:app]), {:class => "ui-btn-right language", "data-iconpos" => "notext", "data-icon" => "search", "data-rel" => "dialog"} do %>