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

81 lines
4.1 KiB
Plaintext
Raw Normal View History

<ul class="nav pull-right" role="navigation">
<!-- search -->
<li id="search" class="searchClear">
2014-03-18 22:20:42 +00:00
<form id="search_form" method="get" action="/site_search">
<%= text_field_tag 'q','', {:class => "search-query input-medium", :placeholder => "Search", 'x-webkit-speech' => ''} %>
</form>
</li>
<!-- Language -->
<li id="orbit-language" class="dropdown">
2014-03-07 07:15:52 +00:00
<a href="#" role="button" class="dropdown-toggle" data-toggle="dropdown" title="<%= t('site.language')%>"><%= 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 %>
<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">
2014-03-07 07:15:52 +00:00
<a href="#login" role="button" data-toggle="modal" title="<%= t('login')%>">
<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="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>