Added Favicon and default image for orbitbar

This commit is contained in:
saurabhbhatia 2013-10-16 18:48:21 +08:00
parent 155039ac16
commit d2459f42c0
2 changed files with 27 additions and 2 deletions

View File

@ -192,6 +192,32 @@
</div> </div>
</div> </div>
<div class="control-group">
<label class="control-label muted">Orbit Favicon</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">
<% if @site.favicon %>
<%= image_tag( @site.favicon, :size=>"120x120") rescue ''%>
<% else %>
<img class="pull-left upload-picture" src="/assets/default-img.png" />
<% end %>
</div>
<div class="fileupload-preview fileupload-exists thumbnail pull-left"></div>
<span class="btn btn-file">
<% if @site.favicon.file.present?%>
<%= f.file_field :favicon, :id => "input-upload", :class => 'fileupload-new', :onchange => "document.getElementById('fu').innerHTML = this.form.fu.value = this.value;" %>Change
<%else%>
<%= f.file_field :favicon, :id => "input-upload", :class => 'fileupload-new', :onchange => "document.getElementById('fu').innerHTML = this.form.fu.value = this.value;" %>Select Image
<%end%>
</span>
<a href="#" class="btn fileupload-exists" data-dismiss="fileupload">Cancel</a>
</div>
</div>
</div> </div>
</div> </div>

View File

@ -28,8 +28,7 @@
</li> </li>
</ul> </ul>
<% @url_path = "#{request.fullpath}".scan(/admin/)%> <% if @site.default_image.present?%>
<% if (@site.default_image.present? && (!@url_path.include? "admin"))%>
<style> <style>
#orbit-bar .orbitlogo { #orbit-bar .orbitlogo {
width: 20px; width: 20px;