480 lines
24 KiB
Plaintext
480 lines
24 KiB
Plaintext
<% if params[:is_frontend_view] == "true" %>
|
|
<% OrbitHelper.render_css_in_head(["basic/icon","lib/orbit_bar/orbit-bar-mobile"]) %>
|
|
<% 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-mobile" %>
|
|
<%= stylesheet_link_tag "lib/orbit_bar/orbit-bar" %>
|
|
<% end %>
|
|
<div id="orbit-bar">
|
|
<% if current_user.nil? %>
|
|
<input type="checkbox" id="open-orbit-login">
|
|
<label for="open-orbit-login" class="cover"></label>
|
|
<div class="login-window">
|
|
<div class="login-header">
|
|
<label for="open-orbit-login" class="close">close</label>
|
|
<h3><%= t(:login)+' ' +((current_site.title.nil? && current_site.title.blank? && current_site.mobile_orbit_bar_title.nil? && current_site.mobile_orbit_bar_title.blank?) ? "Orbit" : [current_site.mobile_orbit_bar_title,current_site.title].select{|title| !title.nil? && !title.blank?}.first) %></h3>
|
|
</div>
|
|
<div class="login-body">
|
|
<%= form_tag "/sessions?locale=#{locale.to_s}", method: "post", :class => "container" do |f| %>
|
|
<div class="prepend input-group">
|
|
<span class="add input-group-addon"><i class="icon-user"></i></span>
|
|
<input class="input" id="user_user_id" name="user_name" placeholder="<%= t("users.user_id") %>" size="30" type="text">
|
|
</div>
|
|
<div class="prepend input-group">
|
|
<span class="add input-group-addon"><i class="icon-lock"></i></span>
|
|
<input class="input" id="user_password" name="password" placeholder="<%= t(:password) %>" size="30" type="password">
|
|
</div>
|
|
<div class="login-submit-wrap">
|
|
<div class="submit">
|
|
<button class="login-btn" type="submit"><%= t(:login) %></button>
|
|
</div>
|
|
<% if current_site.google_oauth_enabled %>
|
|
<div class="google-login">
|
|
<a class="login-btn" href="/auth/google_oauth2">
|
|
<i class="fa fa-google-plus"></i> Sign in
|
|
</a>
|
|
</div>
|
|
<% end %>
|
|
</div>
|
|
<div class="login-sign-up-btn"><a href="/users/new">Sign up now</a></div>
|
|
<% end %>
|
|
</div>
|
|
|
|
</div>
|
|
<% end %>
|
|
<input type="checkbox" id="open-orbit-nav">
|
|
<div class="orbit-bar-inner" <%=((current_site.orbit_bar_background_color.blank? rescue true) ? nil : "style=background-color:#{current_site.orbit_bar_background_color};")%>>
|
|
<label for="open-orbit-nav" <%=((current_site.orbit_bar_text_color.blank? rescue true) ? nil : "style=color:#{current_site.orbit_bar_text_color};border-color:#{current_site.orbit_bar_text_color};")%>>
|
|
<i class="icons-list-2"></i>
|
|
</label>
|
|
<h2 class="orbit-bar-title">
|
|
<a href="/" <%=((current_site.orbit_bar_text_color.blank? rescue true) ? nil : "style=color:#{current_site.orbit_bar_text_color};")%>><%= (current_site.title.nil? && current_site.title.blank? && current_site.mobile_orbit_bar_title.nil? && current_site.mobile_orbit_bar_title.blank?) ? "Orbit" : [current_site.mobile_orbit_bar_title,current_site.title].select{|title| !title.nil? && !title.blank?}.first %></a>
|
|
</h2>
|
|
<ul class="orbit-bar-menu">
|
|
<li>
|
|
<span class="orbit-bar-logo">
|
|
<img src="<%= current_site.default_image.url.nil? ? '/assets/orbit-logo.png' : current_site.default_image.url %>" alt="Orbit Bar Logo" />
|
|
</span>
|
|
<% if !current_user.nil? %>
|
|
<ul class="sub_orbit_bar">
|
|
<li>
|
|
<a href="/<%= locale.to_s %>/admin/dashboards" class="sub_orbit_bar_text">
|
|
<i class="icons-gauge"></i> <%= t(:dashboard_) %>
|
|
</a>
|
|
</li>
|
|
<li>
|
|
<a href="/<%= locale.to_s %>/admin/members?at=thumbnail" class="sub_orbit_bar_text">
|
|
<i class="icons-users"></i> <%= t(:community_) %>
|
|
</a>
|
|
</li>
|
|
<% if current_user.is_admin? %>
|
|
<li class="divider"></li>
|
|
<li>
|
|
<a href="/<%= locale.to_s %>/admin/sites" tabindex="-1" class="sub_orbit_bar_text">
|
|
<i class="icons-cog"></i> <%= t(:settings) %>
|
|
</a>
|
|
</li>
|
|
<% end %>
|
|
</ul>
|
|
<% end %>
|
|
</li>
|
|
<li>
|
|
<a href="/" class="orbit-bar-home" <%=((current_site.orbit_bar_text_color.blank? rescue true) ? nil : "style=color:#{current_site.orbit_bar_text_color};")%>>
|
|
<i class="icons-house"></i>
|
|
</a>
|
|
</li>
|
|
<% if !current_user.nil? && current_user.is_admin? && TicketStatus.unread.count > 0 %>
|
|
<li>
|
|
<a href="/admin/sites" class="orbit-bar-notification">
|
|
<i class="icons-mail"></i>
|
|
</a>
|
|
</li>
|
|
<% end %>
|
|
</ul>
|
|
<ul class="orbit-bar-search-sign-language" <%=((current_site.orbit_bar_background_color.blank? rescue true) ? nil : "style=background-color:#{current_site.orbit_bar_background_color};")%>>
|
|
<style>
|
|
@media screen and (min-width:539px){
|
|
.orbit-bar-search-sign-language{
|
|
max-height:100%;
|
|
}
|
|
}
|
|
</style>
|
|
<%
|
|
google_search_cx = current_site.search['sitesearch'] rescue nil
|
|
is_google_seach_cx = google_search_cx =~ /^[0-9]+\:[0-9A-Za-z]+$/
|
|
if !google_search_cx.blank? and is_google_seach_cx
|
|
%>
|
|
<li style="background-color:transparent;">
|
|
<form id="search" method="get" action="https://www.google.com/cse" target="_blank" <%=((current_site.orbit_bar_background_color.blank? rescue true) ? nil : "style=border:0;")%>>
|
|
<input type="hidden" name="cx" value="<%= google_search_cx %>">
|
|
<%= text_field_tag 'q', '', {:type => "search", :placeholder => t("search.sitesearch"), 'x-webkit-speech' => ''} %>
|
|
</form>
|
|
</li>
|
|
<%
|
|
else
|
|
if !google_search_cx.blank? and !is_google_seach_cx
|
|
search_domain = google_search_cx
|
|
else
|
|
search_domain = request.host_with_port
|
|
end
|
|
%>
|
|
<li>
|
|
<form id="search" method="get" action="https://www.google.com/custom" target="_blank">
|
|
<input type="hidden" name="client" value="pub-&" />
|
|
<input type="hidden" name="ie" id="ie" value="utf-8" />
|
|
<input type="hidden" name="oe" id="oe" value="utf-8" />
|
|
<input type="hidden" name="cof" id="cof" value="AH:center;AWFID:03de271f1940eea3;" />
|
|
<input type='hidden' name='domains' value='<%= search_domain %>'>
|
|
<input type='hidden' name='sitesearch' value='<%= search_domain %>'>
|
|
<%= text_field_tag 'q', '', {:type => "search", :placeholder => t("search.sitesearch"), 'x-webkit-speech' => ''} %>
|
|
</form>
|
|
</li>
|
|
<% end %>
|
|
<li style="background-color:transparent;" <%= current_user.nil? ? 'class=mobile_login_bar' : nil %>>
|
|
<% if current_site.enable_language_options %>
|
|
<% if @site_in_use_locales.count > 1 || current_site.enable_zh_cn %>
|
|
<% zh_cn_added = 0 %>
|
|
<% locale = session[:zh_cn] ? :zh_cn : I18n.locale %>
|
|
<span id="language" <%=((current_site.orbit_bar_text_color.blank? rescue true) ? nil : "style=color:#{current_site.orbit_bar_text_color};")%>><i class="icons-earth orbit-bar-language-icon"></i><span class="orbit-bar-language-text">Language</span></span>
|
|
<ul <%=((current_site.orbit_bar_submenu_background_color.blank? rescue true) ? nil : "style=background-color:#{current_site.orbit_bar_submenu_background_color};")%>>
|
|
<% @site_in_use_locales.each do |l| %>
|
|
<%
|
|
case l
|
|
when :en
|
|
accesskey = "e"
|
|
when :zh_tw
|
|
accesskey = "t"
|
|
end
|
|
%>
|
|
<% if l.to_s == I18n.locale.to_s and !session['zh_cn'] %>
|
|
<li class="<%= (l == I18n.locale and !session['zh_cn']) ? "active" : "" %>" <%=(current_site.orbit_bar_submenu_text_color.blank? rescue true) ? nil : "style=color:#{current_site.orbit_bar_submenu_text_color}!important;"%>>
|
|
<%= t((l==:zh_tw ? :zh_tw_ : :_locale ), :locale => l) %>
|
|
</li>
|
|
<% else %>
|
|
<li class="<%= (l == I18n.locale and !session['zh_cn']) ? "active" : "" %>">
|
|
<a accesskey="<%= accesskey %>" href="<%= switch_language(l) %>" <%=(current_site.orbit_bar_submenu_text_color.blank? rescue true) ? nil : "style=color:#{current_site.orbit_bar_submenu_text_color}!important;"%>><%= t((l==:zh_tw ? :zh_tw_ : :_locale ), :locale => l) %></a>
|
|
</li>
|
|
<% end %>
|
|
<% if current_site.enable_zh_cn and zh_cn_added == 0 and !request.path.include?("/admin/") %>
|
|
<% zh_cn_added = 1 %>
|
|
<% accesskey = "s" %>
|
|
<% if locale == :zh_cn %>
|
|
<li class="active">
|
|
<%= t(:zh_cn, :locale => :zh_tw) %>
|
|
</li>
|
|
<% else %>
|
|
<li>
|
|
<a accesskey="<%= accesskey %>" href="<%= switch_language(:zh_cn) %>" <%=(current_site.orbit_bar_submenu_text_color.blank? rescue true) ? nil : "style=color:#{current_site.orbit_bar_submenu_text_color}!important;"%>><%= t(:zh_cn, :locale => :zh_tw) %></a>
|
|
</li>
|
|
<% end %>
|
|
<% end %>
|
|
<% end %>
|
|
</ul>
|
|
<% end %>
|
|
<% end %>
|
|
</li>
|
|
<% if !current_user.nil? %>
|
|
<li style="background-color:transparent;">
|
|
<span id="user" style="float:left; <%=((current_site.orbit_bar_text_color.blank? rescue true) ? nil : 'color:'+current_site.orbit_bar_text_color+';')%>"><%= current_user.member_profile.name.nil? ? current_user.user_name : current_user.member_profile.name %></span>
|
|
<span style="vertical-align: -webkit-baseline-middle;"><a href="/logout" <%=((current_site.orbit_bar_text_color.blank? rescue true) ? nil : "style=color:#{current_site.orbit_bar_text_color};")%>><i style="vertical-align:middle;font-style: inherit;"><%= t(:logout) %></i><i class="icons-logout" style="vertical-align:middle;"></i></a></span>
|
|
<ul>
|
|
<li><%= link_to content_tag(:i, nil, class: 'icons-tools') + ' ' + t("users.change_passwd"),admin_member_edit_passwd_path(current_user.member_profile.to_param), tabindex: '-1' , style: ((current_site.orbit_bar_submenu_text_color.blank? rescue true) ? nil : "color:#{current_site.orbit_bar_submenu_text_color};") %></li>
|
|
<li><%= link_to content_tag(:i, nil, class: 'icons-vcard') + ' ' + t("users.user_basic_data"),admin_member_path(current_user.member_profile.to_param), tabindex: '-1' , style: ((current_site.orbit_bar_submenu_text_color.blank? rescue true) ? nil : "color:#{current_site.orbit_bar_submenu_text_color};") %></li>
|
|
<% if current_user.is_admin? && params[:is_frontend_view] == "true" %>
|
|
<li>
|
|
<% if params[:editmode] == "on" %>
|
|
<a tabindex="-1" href="<%= request.fullpath.split("?").first %>" style="color:red;"><i class="icons-bolt"></i>Edit Mode Off</a>
|
|
<% else %>
|
|
<a tabindex="-1" href="<%= request.fullpath + "#{(request.query_parameters.empty? ? "?" : "&")}editmode=on" %>" <%=(current_site.orbit_bar_submenu_text_color.blank? rescue true) ? nil : "style=color:#{current_site.orbit_bar_submenu_text_color};"%>><i class="icons-bolt"></i>Edit Mode On</a>
|
|
<% end %>
|
|
</li>
|
|
<% end %>
|
|
<li>
|
|
<a href="/logout" <%=(current_site.orbit_bar_submenu_text_color.blank? rescue true) ? nil : "style=color:#{current_site.orbit_bar_submenu_text_color};"%>><i class="icons-logout"></i><%= t(:logout) %></a>
|
|
</li>
|
|
</ul>
|
|
</li>
|
|
<% else %>
|
|
<li class="mobile_login_bar">
|
|
<a id="accesskey_login" class="sr-only" accesskey="L" href="/<%= "#{locale.to_s}" %>/accesskey" title="Login">:::</a>
|
|
<label for="open-orbit-login" <%=((current_site.orbit_bar_text_color.blank? rescue true) ? nil : "style=color:#{current_site.orbit_bar_text_color};")%>>
|
|
<i style="font-style: inherit;font-size: 0.8rem;width: 2.875em;text-align: right;vertical-align: middle;"><%= t(:login) %></i>
|
|
<i class="icons-login" style="font-size: 1.4em;width: 1.875em;text-align: left;vertical-align: middle;"></i>
|
|
</label>
|
|
</li>
|
|
<% end %>
|
|
</ul>
|
|
|
|
|
|
|
|
<ul class="orbit-bar-mobile-sign-language" <%=((current_site.orbit_bar_background_color.blank? rescue true) ? nil : "style=background-color:#{current_site.orbit_bar_background_color};")%>>
|
|
<li>
|
|
<% if current_site.enable_language_options %>
|
|
<% if @site_in_use_locales.count > 1 || current_site.enable_zh_cn %>
|
|
<% zh_cn_added = 0 %>
|
|
<% locale = session[:zh_cn] ? :zh_cn : I18n.locale %>
|
|
<span id="language" class="mobile-button" <%=((current_site.orbit_bar_text_color.blank? rescue true) ? nil : "style=color:#{current_site.orbit_bar_text_color};")%>><i class="icons-earth orbit-bar-language-icon"></i><span class="orbit-bar-language-text">Language</span></span>
|
|
<ul>
|
|
<% @site_in_use_locales.each do |l| %>
|
|
<%
|
|
case l
|
|
when :en
|
|
accesskey = "e"
|
|
when :zh_tw
|
|
accesskey = "t"
|
|
end
|
|
%>
|
|
<% if l.to_s == I18n.locale.to_s and !session['zh_cn'] %>
|
|
<li class="<%= (l == I18n.locale and !session['zh_cn']) ? "active" : "" %>">
|
|
<%= t((l==:zh_tw ? :zh_tw_ : :_locale ), :locale => l) %>
|
|
</li>
|
|
<% else %>
|
|
<li class="<%= (l == I18n.locale and !session['zh_cn']) ? "active" : "" %>">
|
|
<a accesskey="<%= accesskey %>" href="<%= switch_language(l) %>"><%= t((l==:zh_tw ? :zh_tw_ : :_locale ), :locale => l) %></a>
|
|
</li>
|
|
<% end %>
|
|
<% if current_site.enable_zh_cn and zh_cn_added == 0 and !request.path.include?("/admin/") %>
|
|
<% zh_cn_added = 1 %>
|
|
<% accesskey = "s" %>
|
|
<% if locale == :zh_cn %>
|
|
<li class="active">
|
|
<%= t(:zh_cn, :locale => :zh_tw) %>
|
|
</li>
|
|
<% else %>
|
|
<li>
|
|
<a accesskey="<%= accesskey %>" href="<%= switch_language(:zh_cn) %>"><%= t(:zh_cn, :locale => :zh_tw) %></a>
|
|
</li>
|
|
<% end %>
|
|
<% end %>
|
|
<% end %>
|
|
</ul>
|
|
<% end %>
|
|
<% end %>
|
|
</li>
|
|
<% if !current_user.nil? %>
|
|
<li>
|
|
<span id="user" class="mobile-button" <%=((current_site.orbit_bar_text_color.blank? rescue true) ? nil : "style=color:#{current_site.orbit_bar_text_color};")%>><i class="icons-user"></i><span><%= current_user.member_profile.name.nil? ? current_user.user_name : current_user.member_profile.name %></span></span>
|
|
<ul>
|
|
<li><%= link_to content_tag(:i, nil, class: 'icons-tools') + ' ' + t("users.change_passwd"),admin_member_edit_passwd_path(current_user.member_profile.to_param), tabindex: '-1' %></li>
|
|
<li><%= link_to content_tag(:i, nil, class: 'icons-vcard') + ' ' + t("users.user_basic_data"),admin_member_path(current_user.member_profile.to_param), tabindex: '-1' %></li>
|
|
<% if current_user.is_admin? && params[:is_frontend_view] == "true" %>
|
|
<li>
|
|
<% if params[:editmode] == "on" %>
|
|
<a tabindex="-1" href="<%= request.fullpath.split("?").first %>" style="color:red;"><i class="icons-bolt"></i>Edit Mode Off</a>
|
|
<% else %>
|
|
<a tabindex="-1" href="<%= request.fullpath + "#{(request.query_parameters.empty? ? "?" : "&")}editmode=on" %>"><i class="icons-bolt"></i>Edit Mode On</a>
|
|
<% end %>
|
|
</li>
|
|
<% end %>
|
|
<li>
|
|
<a href="/logout"><i class="icons-logout"></i><%= t(:logout) %></a>
|
|
</li>
|
|
</ul>
|
|
</li>
|
|
<% else %>
|
|
<li>
|
|
<a id="accesskey_login" class="sr-only" accesskey="L" href="/<%= "#{locale.to_s}" %>/accesskey" title="Login">:::</a>
|
|
<label for="open-orbit-login" <%=((current_site.orbit_bar_text_color.blank? rescue true) ? nil : "style=color:#{current_site.orbit_bar_text_color};")%>>
|
|
<i class="icons-login"></i>
|
|
</label>
|
|
</li>
|
|
<% end %>
|
|
</ul>
|
|
|
|
|
|
|
|
</div>
|
|
</div>
|
|
<% if(current_site.is_hidden_orbit_bar && !current_site.orbit_bar_background_color.blank? rescue false) %>
|
|
<div class="orbitbar-line" style="background-color:<%=current_site.orbit_bar_background_color%>;height: 0.3em;position: fixed;z-index: 1000;width: 100%;top: 0;"></div>
|
|
<% end %>
|
|
<script type="text/javascript">
|
|
$("#open-orbit-login").on("change",function(){
|
|
if($(this).is(":checked")){
|
|
$("#user_user_id").focus();
|
|
}
|
|
})
|
|
$(".login-body form").on("submit",function(){
|
|
$(this).append("<input type='hidden' name='referer_url' value='<%= request.original_url %>'/>");
|
|
})
|
|
<%
|
|
for_js = @site_in_use_locales.map{|l| l.to_s}
|
|
for_js << "zh_cn" if current_site.enable_zh_cn
|
|
%>
|
|
var I18n = {
|
|
get locale(){ return "<%= (session[:locale] == 'zh_tw' ? (session[:zh_cn] ? 'zh_cn' : 'zh_tw' ) : session[:locale]) %>"},
|
|
get validLocales(){return <%= for_js.to_json.html_safe %>},
|
|
set locale(v){return false},
|
|
set validLocales(v){return false}
|
|
};
|
|
</script>
|
|
|
|
|
|
<!-- ika modify -->
|
|
<script type="text/javascript">
|
|
// reset orbit-nav check
|
|
$( "#open-orbit-nav" ).prop( "checked", false );
|
|
|
|
|
|
$('.orbit-bar-mobile-sign-language .mobile-button').click(function(){
|
|
$('.orbit-bar-mobile-sign-language .mobile-button').not($(this)).removeClass('toggled');
|
|
$('.orbit-bar-mobile-sign-language .mobile-button').not($(this)).siblings('ul').removeClass('show');
|
|
// $('.orbit-bar-menu').hide();
|
|
// $('.orbit-bar-search-sign-language').hide();
|
|
$( "#open-orbit-nav" ).prop( "checked", false );
|
|
$('.sidebar2').removeClass('menu-toggle');
|
|
$(this).toggleClass('toggled');
|
|
$(this).siblings('ul').toggleClass('show');
|
|
});
|
|
|
|
$('#open-orbit-nav').click(function(){
|
|
$( "#dashboards #open-orbit-nav" ).prop( "checked", false );
|
|
$( "#users #open-orbit-nav" ).prop( "checked", false );
|
|
$( "#sideset #open-orbit-nav" ).prop( "checked", false );
|
|
|
|
$('.orbit-bar-mobile-sign-language .mobile-button').removeClass('toggled');
|
|
$('.orbit-bar-mobile-sign-language li ul').removeClass('show');
|
|
$('#dashboards .orbit-bar-menu').hide();
|
|
$('#dashboards .orbit-bar-search-sign-language').hide();
|
|
|
|
$('body').toggleClass('noScroll');
|
|
//show menu
|
|
$('.sidebar2').toggleClass('menu-toggle');
|
|
})
|
|
|
|
$('.sub-nav-block h4').click(function(){
|
|
$('.sub-nav-block h4').not($(this)).siblings($('.nav-list')).slideUp();
|
|
$(this).siblings($('.nav-list')).slideDown();
|
|
})
|
|
</script>
|
|
<% if current_site.is_hidden_orbit_bar %>
|
|
<style>
|
|
.orbit-bar--active {
|
|
margin-top: 2.5em !important;
|
|
}
|
|
.orbit-bar--active .orbit-bar-toggle-icon {
|
|
-webkit-transform: rotate(-180deg);
|
|
transform: rotate(-180deg);
|
|
-webkit-transform-origin: center 0.5625em;
|
|
transform-origin: center 0.5625em;
|
|
}
|
|
.has-orbit-bar .orbit-bar-inner {
|
|
margin-top: -2.5em;
|
|
}
|
|
.has-orbit-bar .orbit-bar-inner {
|
|
-webkit-transition: <%=current_site.orbit_bar_animation_time.blank? ? '0.3s' : current_site.orbit_bar_animation_time rescue '0.3s' %> all ease-in;
|
|
transition: <%=current_site.orbit_bar_animation_time.blank? ? '0.3s' : current_site.orbit_bar_animation_time rescue '0.3s' %> all ease-in;
|
|
}
|
|
.orbit-bar--active .orbit-bar-inner {
|
|
margin-top: 0;
|
|
}
|
|
body {
|
|
-webkit-transition: <%=current_site.orbit_bar_animation_time.blank? ? '0.3s' : current_site.orbit_bar_animation_time rescue '0.3s' %> margin ease-in;
|
|
transition: <%=current_site.orbit_bar_animation_time.blank? ? '0.3s' : current_site.orbit_bar_animation_time rescue '0.3s' %> margin ease-in;
|
|
margin-top: 0 !important;
|
|
}
|
|
.has-orbit-bar .orbit-bar-toggle:hover {
|
|
background-color: <%=current_site.orbit_bar_background_color.blank? ? '#144893' : current_site.orbit_bar_background_color rescue '#144893' %>;
|
|
opacity: 1;
|
|
}
|
|
.has-orbit-bar .orbit-bar-toggle {
|
|
-webkit-transition: <%=current_site.orbit_bar_animation_time.blank? ? '0.3s' : current_site.orbit_bar_animation_time rescue '0.3s' %> all ease-in;
|
|
transition: <%=current_site.orbit_bar_animation_time.blank? ? '0.3s' : current_site.orbit_bar_animation_time rescue '0.3s' %> all ease-in;
|
|
position: absolute;
|
|
top: 0;
|
|
right: 0;
|
|
cursor: pointer;
|
|
color: <%=current_site.orbit_bar_text_color.blank? ? '#fff' : current_site.orbit_bar_text_color rescue '#fff' %>;
|
|
padding: 0.3125em 0.625em;
|
|
background-color: <%=current_site.orbit_bar_background_color.blank? ? '#144893' : current_site.orbit_bar_background_color rescue '#144893' %>;
|
|
opacity: 0.5;
|
|
}
|
|
.orbit-bar--active .orbit-bar-toggle {
|
|
opacity: 1;
|
|
top: 2.5em;
|
|
}
|
|
</style>
|
|
<% if !(OrbitHelper.request || request).env["REQUEST_URI"].include?('admin') %>
|
|
<script>
|
|
var barState = window.localStorage.getItem('barState');
|
|
function extendBar() {
|
|
var $bar = $('#orbit-bar');
|
|
var activeCls = 'orbit-bar--active';
|
|
var noAnimationCls = 'orbit-bar--no-animation';
|
|
var openState = 'open';
|
|
var closeState = 'close';
|
|
var $body = $(document.body);
|
|
function createToggle() {
|
|
var $el = $('<div class="orbit-bar-toggle"><i class="orbit-bar-toggle-icon fa fa-chevron-down"></i></div>');
|
|
$el.on('click', function(e) {
|
|
e.preventDefault();
|
|
$body.removeClass(noAnimationCls);
|
|
if (!$body.hasClass(activeCls)) {
|
|
$body.addClass(activeCls);
|
|
window.localStorage.setItem('barState', openState);
|
|
} else {
|
|
$body.removeClass(activeCls);
|
|
window.localStorage.setItem('barState', closeState);
|
|
}
|
|
$('.orbitbar-line').slideToggle();
|
|
});
|
|
$bar.prepend($el);
|
|
}
|
|
$body.addClass('has-orbit-bar');
|
|
$bar.find('.orbit-bar-inner').show();
|
|
// check bar state from localstorage
|
|
if (barState) {
|
|
if (barState === openState) {
|
|
$body.addClass(activeCls);
|
|
$body.addClass(noAnimationCls);
|
|
|
|
} else {
|
|
$body.removeClass(activeCls);
|
|
}
|
|
}
|
|
createToggle();
|
|
};
|
|
$(document).ready(function(){
|
|
if($('body').attr('id') != 'sideset')
|
|
extendBar();
|
|
})
|
|
</script>
|
|
<% end %>
|
|
<% end %>
|
|
<style>
|
|
@media screen and (min-width:539px){
|
|
<% if(!current_site.orbit_bar_submenu_background_color.blank? rescue false)%>
|
|
.sub_orbit_bar{
|
|
background-color:<%=current_site.orbit_bar_submenu_background_color %>!important;
|
|
}
|
|
.orbit-bar-menu{
|
|
background-color:transparent!important;
|
|
}
|
|
<%end%>
|
|
<% if(!current_site.orbit_bar_submenu_text_color.blank? rescue false)%>
|
|
.sub_orbit_bar_text{
|
|
color:<%=current_site.orbit_bar_submenu_text_color%>!important;
|
|
}
|
|
<%end%>
|
|
}
|
|
@media screen and (max-width:538px){
|
|
<% if(!current_site.orbit_bar_background_color.blank? rescue false)%>
|
|
.sub_orbit_bar{
|
|
background-color:<%=current_site.orbit_bar_background_color%>!important;
|
|
}
|
|
.orbit-bar-menu{
|
|
background-color:<%=current_site.orbit_bar_background_color%>!important;
|
|
}
|
|
<%end%>
|
|
<% if(!current_site.orbit_bar_text_color.blank? rescue false)%>
|
|
.sub_orbit_bar_text{
|
|
color:<%=current_site.orbit_bar_text_color%>!important;
|
|
}
|
|
<%end%>
|
|
.mobile_login_bar{
|
|
width: 50%!important;
|
|
}
|
|
}
|
|
</style>
|