forked from saurabh/orbit4-5
Update sit initialize
This commit is contained in:
parent
fcb1907230
commit
f6adbaa4e0
|
@ -29,6 +29,7 @@ module ApplicationHelper
|
||||||
if site.sitemap_menu_in_header
|
if site.sitemap_menu_in_header
|
||||||
sub_menu_html = sub_menu_html + "<a href='/#{I18n.locale.to_s}#{site.site_map_link}'>Sitemap</a>"
|
sub_menu_html = sub_menu_html + "<a href='/#{I18n.locale.to_s}#{site.site_map_link}'>Sitemap</a>"
|
||||||
end
|
end
|
||||||
|
sub_menu_html = sub_menu_html.nil? ? "" : sub_menu_html
|
||||||
html = html.gsub("{{header-data}}",sub_menu_html)
|
html = html.gsub("{{header-data}}",sub_menu_html)
|
||||||
html.html_safe
|
html.html_safe
|
||||||
end
|
end
|
||||||
|
@ -44,6 +45,7 @@ module ApplicationHelper
|
||||||
if site.enable_terms_of_use
|
if site.enable_terms_of_use
|
||||||
site_footer = site_footer + "<a href='/#{I18n.locale.to_s}#{site.terms_of_use_link}'>Terms of use</a>"
|
site_footer = site_footer + "<a href='/#{I18n.locale.to_s}#{site.terms_of_use_link}'>Terms of use</a>"
|
||||||
end
|
end
|
||||||
|
site_footer = site_footer.nil? ? "" : site_footer
|
||||||
html = html.gsub("{{footer-data}}",site_footer)
|
html = html.gsub("{{footer-data}}",site_footer)
|
||||||
html.html_safe
|
html.html_safe
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,12 +1,17 @@
|
||||||
<ul class="nav pull-right" role="navigation">
|
<ul class="nav pull-right" role="navigation">
|
||||||
|
|
||||||
<!-- search -->
|
<!-- search -->
|
||||||
|
<%
|
||||||
|
google_search_cx = current_site.search['sitesearch'] rescue nil
|
||||||
|
unless google_search_cx.blank?
|
||||||
|
%>
|
||||||
<li id="search" class="searchClear">
|
<li id="search" class="searchClear">
|
||||||
<form id="search_form" method="get" action="http://www.google.com/cse" target="_blank">
|
<form id="search_form" method="get" action="http://www.google.com/cse" target="_blank">
|
||||||
<input type="hidden" name="cx" value="<%= current_site.search['sitesearch'] rescue "" %>">
|
<input type="hidden" name="cx" value="<%= google_search_cx %>">
|
||||||
<%= text_field_tag 'q', '', {:class => "search-query input-medium", :placeholder => t("search.sitesearch"), 'x-webkit-speech' => ''} %>
|
<%= text_field_tag 'q', '', {:class => "search-query input-medium", :placeholder => t("search.sitesearch"), 'x-webkit-speech' => ''} %>
|
||||||
</form>
|
</form>
|
||||||
</li>
|
</li>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
<!-- Language -->
|
<!-- Language -->
|
||||||
<li id="orbit-language" class="dropdown">
|
<li id="orbit-language" class="dropdown">
|
||||||
|
|
|
@ -68,12 +68,17 @@
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<ul class="orbit-bar-search-sign-language">
|
<ul class="orbit-bar-search-sign-language">
|
||||||
|
<%
|
||||||
|
google_search_cx = current_site.search['sitesearch'] rescue nil
|
||||||
|
unless google_search_cx.blank?
|
||||||
|
%>
|
||||||
<li>
|
<li>
|
||||||
<form id="search" method="get" action="http://www.google.com/cse" target="_blank">
|
<form id="search" method="get" action="http://www.google.com/cse" target="_blank">
|
||||||
<input type="hidden" name="cx" value="<%= current_site.search['sitesearch'] rescue "" %>">
|
<input type="hidden" name="cx" value="<%= google_search_cx %>">
|
||||||
<%= text_field_tag 'q', '', {:type => "search", :placeholder => t("search.sitesearch"), 'x-webkit-speech' => ''} %>
|
<%= text_field_tag 'q', '', {:type => "search", :placeholder => t("search.sitesearch"), 'x-webkit-speech' => ''} %>
|
||||||
</form>
|
</form>
|
||||||
</li>
|
</li>
|
||||||
|
<% end %>
|
||||||
<li>
|
<li>
|
||||||
<span id="language"><%= t(locale.to_s) %></span>
|
<span id="language"><%= t(locale.to_s) %></span>
|
||||||
<ul>
|
<ul>
|
||||||
|
|
|
@ -9,12 +9,13 @@ if Site.count == 0
|
||||||
site.title_translations = {:en=>"Orbit",:zh_tw=>"Orbit"}
|
site.title_translations = {:en=>"Orbit",:zh_tw=>"Orbit"}
|
||||||
site.valid_locales = [:en, :zh_tw]
|
site.valid_locales = [:en, :zh_tw]
|
||||||
site.in_use_locales = site.valid_locales
|
site.in_use_locales = site.valid_locales
|
||||||
|
site.template = Dir.glob("#{Rails.root}/app/templates/*").last.split('/').last
|
||||||
site.save
|
site.save
|
||||||
end
|
end
|
||||||
|
|
||||||
if Site.first.template.nil?
|
if Site.first.template.nil?
|
||||||
site = Site.first
|
site = Site.first
|
||||||
site.template = Dir.glob("#{Rails.root}/app/templates/#{Template::KEY}").first.split("/").last
|
site.template = Dir.glob("#{Rails.root}/app/templates/*").last.split('/').last
|
||||||
site.save
|
site.save
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -51,6 +52,7 @@ if User.count==0
|
||||||
profile = MemberProfile.new
|
profile = MemberProfile.new
|
||||||
profile.first_name_translations = {:en=>'Digital', :zh_tw=>'Digital'}
|
profile.first_name_translations = {:en=>'Digital', :zh_tw=>'Digital'}
|
||||||
profile.last_name_translations = {:en=>'Ruling', :zh_tw=>'Ruling'}
|
profile.last_name_translations = {:en=>'Ruling', :zh_tw=>'Ruling'}
|
||||||
|
profile.email = "orbit@rulingcom.com"
|
||||||
profile.save
|
profile.save
|
||||||
|
|
||||||
role.member_profiles << profile
|
role.member_profiles << profile
|
||||||
|
@ -62,4 +64,4 @@ if User.count==0
|
||||||
user.password = "bjo4xjp6"
|
user.password = "bjo4xjp6"
|
||||||
user.email = "orbit@rulingcom.com"
|
user.email = "orbit@rulingcom.com"
|
||||||
user.save
|
user.save
|
||||||
end
|
end
|
|
@ -1,4 +1,8 @@
|
||||||
Dir.glob("#{Rails.root}/app/templates/#{Site.first.template}").each do |path|
|
|
||||||
|
template = Site.first.template rescue nil
|
||||||
|
template = template.nil? ? Dir.glob("#{Rails.root}/app/templates/*").last.split('/').last : template
|
||||||
|
|
||||||
|
Dir.glob("#{Rails.root}/app/templates/#{template}").each do |path|
|
||||||
Rails.application.config.assets.paths << "#{path}/assets/stylesheets"
|
Rails.application.config.assets.paths << "#{path}/assets/stylesheets"
|
||||||
Rails.application.config.assets.paths << "#{path}/assets/javascripts"
|
Rails.application.config.assets.paths << "#{path}/assets/javascripts"
|
||||||
Rails.application.config.assets.paths << "#{path}/assets/images"
|
Rails.application.config.assets.paths << "#{path}/assets/images"
|
||||||
|
|
Loading…
Reference in New Issue