2015-03-06 09:13:09 +00:00
|
|
|
|
<%# content_for :page_specific_css do -%>
|
2014-05-24 09:12:19 +00:00
|
|
|
|
<%= stylesheet_link_tag "basic/icon" %>
|
|
|
|
|
<%= 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">×</label>
|
2014-05-25 12:47:44 +00:00
|
|
|
|
<h3><%= t(:login_orbit) %></h3>
|
2014-05-24 09:12:19 +00:00
|
|
|
|
</div>
|
|
|
|
|
<div class="login-body">
|
|
|
|
|
<%= form_tag "/sessions?locale=#{locale.to_s}", method: "post", :class => "container" do |f| %>
|
2014-08-15 02:29:17 +00:00
|
|
|
|
<input type="hidden" name="referer_url" value="<%= request.original_url %>">
|
2014-05-26 06:23:12 +00:00
|
|
|
|
<div class="prepend">
|
|
|
|
|
<span class="add"><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">
|
2014-05-24 09:12:19 +00:00
|
|
|
|
</div>
|
2014-05-26 06:23:12 +00:00
|
|
|
|
<div class="prepend">
|
|
|
|
|
<span class="add"><i class="icon-lock"></i></span>
|
|
|
|
|
<input class="input" id="user_password" name="password" placeholder="<%= t(:password) %>" size="30" type="password">
|
2014-05-24 09:12:19 +00:00
|
|
|
|
</div>
|
|
|
|
|
<div class="submit">
|
2014-05-25 12:47:44 +00:00
|
|
|
|
<button type="submit"><%= t(:login) %></button>
|
2014-05-24 09:12:19 +00:00
|
|
|
|
</div>
|
2014-05-27 10:18:23 +00:00
|
|
|
|
<div>Or</div>
|
|
|
|
|
<a href="/users/new">Sign up</a>
|
2014-05-24 09:12:19 +00:00
|
|
|
|
<% end %>
|
|
|
|
|
</div>
|
2015-03-04 10:31:36 +00:00
|
|
|
|
<% if current_site.google_oauth_enabled %>
|
|
|
|
|
<div class="pull-right">
|
|
|
|
|
<a href="/auth/google_oauth2"><img src="/assets/sign-in-with-google.png" width="185px" /></a>
|
|
|
|
|
</div>
|
|
|
|
|
<% end %>
|
2014-05-24 09:12:19 +00:00
|
|
|
|
</div>
|
|
|
|
|
<% end %>
|
|
|
|
|
<input type="checkbox" id="open-orbit-nav">
|
|
|
|
|
<div class="orbit-bar-inner">
|
|
|
|
|
<label for="open-orbit-nav">
|
|
|
|
|
<i class="icons-list-2"></i>
|
|
|
|
|
</label>
|
2014-10-22 06:51:14 +00:00
|
|
|
|
<h2 class="orbit-bar-title">
|
2014-05-24 09:12:19 +00:00
|
|
|
|
<a href="/">Orbit</a>
|
2014-10-22 06:51:14 +00:00
|
|
|
|
</h2>
|
2014-05-24 09:12:19 +00:00
|
|
|
|
<ul class="orbit-bar-menu">
|
|
|
|
|
<li>
|
2014-05-27 10:18:23 +00:00
|
|
|
|
<span class="orbit-bar-logo">
|
|
|
|
|
<img src="<%= current_site.default_image.url.nil? ? '/assets/orbit-logo.png' : current_site.default_image.url %>" />
|
|
|
|
|
</span>
|
2014-05-24 09:12:19 +00:00
|
|
|
|
<% if !current_user.nil? %>
|
|
|
|
|
<ul>
|
|
|
|
|
<li>
|
|
|
|
|
<a href="/<%= locale.to_s %>/admin/dashboards">
|
2014-05-25 12:47:44 +00:00
|
|
|
|
<i class="icons-gauge"></i> <%= t(:dashboard_) %>
|
2014-05-24 09:12:19 +00:00
|
|
|
|
</a>
|
|
|
|
|
</li>
|
|
|
|
|
<li>
|
|
|
|
|
<a href="/<%= locale.to_s %>/admin/members">
|
2014-05-25 12:47:44 +00:00
|
|
|
|
<i class="icons-users"></i> <%= t(:member_) %>
|
2014-05-24 09:12:19 +00:00
|
|
|
|
</a>
|
|
|
|
|
</li>
|
2014-10-20 11:50:16 +00:00
|
|
|
|
<% if current_user.is_admin? %>
|
|
|
|
|
<li class="divider"></li>
|
|
|
|
|
<li>
|
|
|
|
|
<a href="/<%= locale.to_s %>/admin/items" tabindex="-1">
|
|
|
|
|
<i class="icons-cog"></i> <%= t(:settings) %>
|
|
|
|
|
</a>
|
|
|
|
|
</li>
|
|
|
|
|
<% end %>
|
2014-05-24 09:12:19 +00:00
|
|
|
|
</ul>
|
|
|
|
|
<% end %>
|
|
|
|
|
</li>
|
|
|
|
|
<li>
|
|
|
|
|
<a href="/" class="orbit-bar-home">
|
|
|
|
|
<i class="icons-house"></i>
|
|
|
|
|
</a>
|
|
|
|
|
</li>
|
|
|
|
|
</ul>
|
|
|
|
|
<ul class="orbit-bar-search-sign-language">
|
2014-05-26 04:57:47 +00:00
|
|
|
|
<%
|
|
|
|
|
google_search_cx = current_site.search['sitesearch'] rescue nil
|
2014-09-11 11:08:39 +00:00
|
|
|
|
is_google_seach_cx = google_search_cx =~ /^[0-9]+\:[0-9A-Za-z]+$/
|
|
|
|
|
if !google_search_cx.blank? and is_google_seach_cx
|
2014-05-26 04:57:47 +00:00
|
|
|
|
%>
|
2014-05-24 09:12:19 +00:00
|
|
|
|
<li>
|
|
|
|
|
<form id="search" method="get" action="http://www.google.com/cse" target="_blank">
|
2014-05-26 04:57:47 +00:00
|
|
|
|
<input type="hidden" name="cx" value="<%= google_search_cx %>">
|
2014-05-25 12:47:44 +00:00
|
|
|
|
<%= text_field_tag 'q', '', {:type => "search", :placeholder => t("search.sitesearch"), 'x-webkit-speech' => ''} %>
|
2014-05-24 09:12:19 +00:00
|
|
|
|
</form>
|
|
|
|
|
</li>
|
2014-09-11 11:08:39 +00:00
|
|
|
|
<%
|
|
|
|
|
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="http://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>
|
2014-05-26 04:57:47 +00:00
|
|
|
|
<% end %>
|
2014-05-24 09:12:19 +00:00
|
|
|
|
<li>
|
2014-10-21 07:27:43 +00:00
|
|
|
|
<% if @site_in_use_locales.count > 1 || current_site.enable_zh_cn %>
|
2014-07-09 02:05:02 +00:00
|
|
|
|
<% locale = session[:zh_cn] ? :zh_cn : I18n.locale %>
|
|
|
|
|
<span id="language"><%= t((locale==:zh_tw ? :zh_tw_ : locale.to_s)) %></span>
|
2014-05-24 09:12:19 +00:00
|
|
|
|
<ul>
|
2014-09-11 10:18:34 +00:00
|
|
|
|
<% @site_in_use_locales.each do |l| %>
|
2014-07-09 02:05:02 +00:00
|
|
|
|
<li class="<%= (l == I18n.locale and !session['zh_cn']) ? "active" : "" %>">
|
|
|
|
|
<a href="<%= switch_language(l) %>"><%= t((l==:zh_tw ? :zh_tw_ : :_locale ), :locale => l) %></a>
|
2014-05-24 09:12:19 +00:00
|
|
|
|
</li>
|
2014-08-08 03:46:21 +00:00
|
|
|
|
<% if current_site.enable_zh_cn and l == :zh_tw and !request.path.include?("/admin/") %>
|
2014-07-09 02:05:02 +00:00
|
|
|
|
<li class="<%= locale==:zh_cn ? "active" : "" %>">
|
|
|
|
|
<a href="<%= switch_language(:zh_cn) %>"><%= t(:zh_cn, :locale => :zh_tw) %></a>
|
|
|
|
|
</li>
|
|
|
|
|
<% end %>
|
2014-05-24 09:12:19 +00:00
|
|
|
|
<% end %>
|
|
|
|
|
</ul>
|
2014-10-20 11:50:16 +00:00
|
|
|
|
<% end %>
|
2014-05-24 09:12:19 +00:00
|
|
|
|
</li>
|
|
|
|
|
<% if !current_user.nil? %>
|
|
|
|
|
<li>
|
2014-05-26 08:48:06 +00:00
|
|
|
|
<span id="user"><%= current_user.member_profile.name.nil? ? current_user.user_name : current_user.member_profile.name %></span>
|
2014-05-24 09:12:19 +00:00
|
|
|
|
<ul>
|
2014-07-22 01:58:41 +00:00
|
|
|
|
<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>
|
2014-05-24 09:12:19 +00:00
|
|
|
|
<li>
|
2014-05-25 12:47:44 +00:00
|
|
|
|
<a href="/logout"><i class="icons-logout"></i><%= t(:logout) %></a>
|
2014-05-24 09:12:19 +00:00
|
|
|
|
</li>
|
|
|
|
|
</ul>
|
|
|
|
|
</li>
|
|
|
|
|
<% else %>
|
|
|
|
|
<li>
|
|
|
|
|
<label for="open-orbit-login">
|
|
|
|
|
<i class="icons-login"></i>
|
|
|
|
|
</label>
|
|
|
|
|
</li>
|
|
|
|
|
<% end %>
|
|
|
|
|
</ul>
|
|
|
|
|
</div>
|
2014-12-10 10:09:50 +00:00
|
|
|
|
</div>
|
|
|
|
|
<script type="text/javascript">
|
|
|
|
|
$("#open-orbit-login").on("change",function(){
|
|
|
|
|
if($(this).is(":checked")){
|
|
|
|
|
$("#user_user_id").focus();
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
</script>
|