orbit-4-2/app/views/layouts/_right_menu.html.erb

103 lines
5.2 KiB
Plaintext
Raw Permalink Normal View History

<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>
2014-02-11 06:42:12 +00:00
<!-- ntu sites -->
<li id="orbit-tag" class="dropdown">
<a class="dropdown-toggle orbit-bar-language" data-icons="&#xe02d;" href="#" data-toggle="dropdown"></a>
<ul class="dropdown-menu language-menu">
<% t('ntu.site_names').each do |site| %>
<li><%= link_to site[1], get_link(site[0]) %></li>
<% end %>
</ul>
</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("users.change_passwd"), admin_users_new_interface_setting_account_path(current_user), tabindex: '-1' %></li>
<li><%= link_to content_tag(:i, nil, class: 'icons-vcard') + ' ' + t("users.user_basic_data"), admin_users_new_interface_edit_user_data_path(current_user), tabindex: '-1' %></li>
<% if @site.desktop_closed %>
<li><%= link_to content_tag(:i, nil, class: 'icons-screen') + ' ' + t(:desktop), desktop_path, tabindex: '-1' %></li>
<% end %>
2014-02-11 06:42:12 +00:00
<li><%= link_to content_tag(:i, nil, class: 'icons-logout') + ' ' + t(:logout), user_logout_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| %>
2014-02-11 06:42:12 +00:00
<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://galogin.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" name="user[remember_me]" value="1" checked="checked" />
<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>