fix orbit bar css for the software

This commit is contained in:
Harry Bomrah 2015-05-20 21:13:39 +08:00
parent 8dac8273f7
commit a440076916
3 changed files with 18 additions and 3 deletions

View File

@ -432,7 +432,8 @@ class PagesController < ApplicationController
end
@layout_html = render_to_string(@file)
doc = Nokogiri::HTML(@layout_html, nil, "UTF-8")
head = doc.css("head")
head[0].inner_html = head.inner_html + OrbitHelper.get_css_to_render_in_head
@part_partials.each do |key, partial|
html_string = ""
partial.each do |p|

View File

@ -339,6 +339,18 @@ module OrbitHelper
!$mobile.blank?
end
def self.render_css_in_head(css=[])
@css_to_render_in_head = css
end
def self.get_css_to_render_in_head
css_html = ""
@css_to_render_in_head.each do |css|
css_html = css_html + "<link rel='stylesheet' media='screen' href='/assets/#{css}'>\n"
end
return css_html
end
# ===============================================================
# Breadcrumbs
# ===============================================================

View File

@ -1,7 +1,9 @@
<%# content_for :page_specific_css do -%>
<% if params[:is_frontend_view] == "true" %>
<% OrbitHelper.render_css_in_head(["basic/icon","lib/orbit_bar/orbit-bar"]) %>
<% else %>
<%= stylesheet_link_tag "basic/icon" %>
<%= stylesheet_link_tag "lib/orbit_bar/orbit-bar" %>
<%# end -%>
<% end %>
<div id="orbit-bar">
<% if current_user.nil? %>
<input type="checkbox" id="open-orbit-login">