Orbit/app/views/layouts/_right_menu.html.erb

89 lines
4.5 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<ul class="nav pull-right" role="navigation">
<!-- search -->
<li id="search" class="searchClear">
<form method="get" action="http://www.google.com/custom">
<input type="hidden" name="client" value="pub-&amp" />
<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='<%= @site.search["domains"] rescue ''%>'>
<input type='hidden' name='sitesearch' value='<%= @site.search["sitesearch"] rescue '' %>'>
<%= text_field_tag 'q','', {:class => "search-query input-medium", :placeholder => t(:search_google), 'x-webkit-speech' => ''} %>
</form>
</li>
<!-- Language -->
<li id="orbit-language" class="dropdown">
<a href="#" role="button" class="dropdown-toggle" data-toggle="dropdown"><%= t(:_locale, :locale => I18n.locale) %></a>
<ul class="dropdown-menu" role="menu" aria-labelledby="orbit-language">
<% @site_in_use_locales.each do |locale| %>
<%= content_tag :li, (link_to t(:_locale, :locale => locale), add_locale(remove_locale((@referer || request.fullpath)), locale)), :class => (I18n.locale.eql?(locale.to_sym) ? 'active' : nil), tabindex: "-1" %>
<% end %>
</ul>
</li>
<% if user_signed_in? %>
<!-- user -->
<li id="orbit-user" class="dropdown">
<a href="#" role="button" class="dropdown-toggle" data-toggle="dropdown">
<%= image_tag 'menber-pic.png', class: "user-pic" %>
<span><%= current_user.name %></span>
</a>
<ul class="dropdown-menu" role="menu" aria-labelledby="orbit-user">
<li><%= link_to content_tag(:i, nil, class: 'icons-tools') + ' ' + t(:account_settings), desktop_path + "#settings-account", tabindex: '-1' %></li>
<li><%= link_to content_tag(:i, nil, class: 'icons-screen') + ' ' + t(:desktop), desktop_path, tabindex: '-1' %></li>
<li><%= link_to content_tag(:i, nil, class: 'icons-logout') + ' ' + t(:logout), destroy_user_session_path, tabindex: '-1' %></li>
<li class="divider"></li>
<li><a tabindex="-1" href="#"><i class="icons-lifebuoy"></i> <%= t(:help) %></a></li>
</ul>
</li>
<% else %>
<!-- login -->
<li id="orbit-login">
<a href="#login" role="button" data-toggle="modal">
<i class="icons-login"></i> <span class="hide"><%= t(:login) %></span>
</a>
</li>
<!-- Log in Modal -->
<div id="login" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="ModalLabel" aria-hidden="true">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3 id="ModalLabel"><%= t(:login_orbit) %></h3>
</div>
<div class="modal-body">
<%= form_for :user, url: user_session_path, html: {class: 'container'} do |f| %>
<div class="other-sign-in">
<% @request_hosts = request.host_with_port.split(".") %>
<a class="btn btn-primary" type="submit" href="https://adfs.ntu.edu.tw/adfs/ls/?wa=wsignin1.0&wtrealm=https://management.ntu.edu.tw/saml_login&wctx=<%= @request_hosts[0] %>">使用計中帳號登入</a>
<p>or</p>
</div>
<div class="input-prepend">
<span class="add-on">
<i class="icon-user"></i>
</span>
<%= f.text_field :user_id, class: "input-xlarge" , placeholder: t("users.user_id") %>
</div>
<div class="input-prepend">
<span class="add-on">
<i class="icon-lock"></i>
</span>
<%= f.password_field :password, class: "input-xlarge", placeholder: t(:password) %>
</div>
<div class="pull-left" style="width: 150px;">
<!-- <label class="checkbox">
<input type="checkbox" value="">
<small>Remember me</small>
</label> -->
<%= content_tag :button, t(:login), :type => :submit, :class => 'btn btn-primary' %>
</div>
<div class="pull-right">
<%= link_to content_tag(:small, t(:forgot_password)), new_user_password_path %>
</div>
<% end %>
</div>
<div class="modal-footer">
</div>
</div>
<% end %>
</ul>