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

115 lines
5.2 KiB
Plaintext
Raw Normal View History

<header id="orbit-bar" class="navbar">
<div class="navbar-inner">
<div class="container clear">
<div class="dropdown orbit-logo pull-left">
<% if !current_user.nil? %>
<a class="brand dropdown-toggle" data-toggle="dropdown" href="#">Orbit</a>
<ul class="dropdown-menu">
2012-09-12 11:12:50 +00:00
<li><%= link_to content_tag(:i, nil, :class => 'icons-dashboard') + t(:dashboard_), admin_dashboards_path %></li>
<li><%#= link_to content_tag(:i, nil, :class => 'icons-content') + t(:content) %></li>
<li><%#= link_to content_tag(:i, nil, :class => 'icons-member') + t(:member), admin_users_path %></li>
<li><%#= link_to content_tag(:i, nil, :class => 'icons-asset') + t(:asset), admin_assets_path %></li>
<li class="divider"></li>
2012-09-12 11:12:50 +00:00
<li><%= link_to content_tag(:i, nil, :class => 'icons-structure') + t(:structure), admin_items_path %></li>
<li><%= link_to content_tag(:i, nil, :class => 'icons-cog') + t('site.settings'), admin_site_site_info_path(@site) %></li>
<li><%#= link_to content_tag(:i, nil, :class => 'icons-plus-cube') + t(':add_item') %></li>
</ul>
<% else %>
<a class="brand dropdown-toggle" data-toggle="dropdown" href="/">Orbit</a>
<% end -%>
</div>
<ul class="nav">
<li><%= link_to t(:homepage), root_path, :class => 'orbit-bar-home' %></li>
2012-05-09 07:20:09 +00:00
<li><a class="orbit-bar-desktop" href="https://i.nccu.edu.tw/Login.aspx?ReturnUrl=/Default.aspx" target="_blank">Desktop</a></li>
</ul>
<ul class="nav pull-right">
<li class="dropdown language">
<a class="dropdown-toggle orbit-bar-language" href="#" data-toggle="dropdown">language</a>
<ul class="dropdown-menu language-menu">
<% @site_in_use_locales.each do |locale| %>
2012-02-28 20:56:52 +00:00
<%= content_tag :li, (link_to t(:_locale, :locale => locale), add_locale(remove_locale((referer rescue request.fullpath)), locale)), :class => (I18n.locale.eql?(locale.to_sym) ? 'active' : nil) %>
<% end %>
</ul>
</li>
2012-04-06 10:06:57 +00:00
2012-05-04 11:11:28 +00:00
<li class="search clear" title="<%= t :search_nccu %>">
2012-04-06 10:06:57 +00:00
<a class="orbit-bar-search" href="#">search</a>
2012-07-25 09:20:25 +00:00
<form class="navbar-search" 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;" />
2012-07-25 09:44:50 +00:00
<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 span3",:placeholder=> t(:search_nccu) ,:disabled=> ((@site.search["sitesearch"] || @site.search["domains"] ).blank? rescue true)}%>
2012-04-06 10:06:57 +00:00
</form>
</li>
<% if user_signed_in? %>
2012-02-29 08:01:50 +00:00
<li class="dropdown active">
<a class="orbit-bar-account" href="#" data-toggle="dropdown">
2012-03-19 07:49:40 +00:00
<img class="member-img" src="/assets/person.png" />
2012-02-29 08:01:50 +00:00
<%#= image_tag current_user.avatar.thumb.url, :class => 'member-img' %>
<span class="member-name"><%= current_user.name %></span>
</a>
<ul class="dropdown-menu account-menu">
<li>
<a href="#">
<i class="icons-wrench"></i>
<%= t(:account_settings) %>
</a>
</li>
<li>
<a class="orbit-bar-desktop" href="#">
<i class="icons-desktop"></i>
<%= t(:desktop) %>
</a>
</li>
2012-02-29 08:01:50 +00:00
<li><%= link_to content_tag(:i, nil, :class => 'icons-out') + ' ' + t(:logout), destroy_user_session_path %></li>
<li class="divider"></li>
<li>
<a href="#">
<i class="icons-help"></i>
<%= t(:help) %>
</a>
</li>
</ul>
</li>
<% else %>
2012-02-19 08:33:22 +00:00
<li class="dropdown bar-login">
<a class="dropdown-toggle orbit-bar-member" href="#"><%= t(:login) %></a>
2012-02-19 08:33:22 +00:00
<div class="dropdown-menu">
<ul class="log">
<li class="title hide"></li>
2012-02-19 08:33:22 +00:00
<%= form_for :user, :url => user_session_path do |f| %>
<li>
<div class="input-prepend">
<span class="add-on"><i class="icon-user"></i></span>
2012-03-06 08:41:06 +00:00
<%= f.text_field :nccu_ldap_uid, :class => 'span2', :placeholder => t('nccu_c.nccu_ldap_uid'), :size => 16 %>
2012-02-19 08:33:22 +00:00
</div>
</li>
<li>
<div class="input-prepend">
<span class="add-on"><i class="icon-lock"></i></span>
<%= f.password_field :password, :class => 'span2', :placeholder => t(:password), :size => 16 %>
</div>
</li>
<li class="clear hide">
2012-02-19 08:33:22 +00:00
<%= link_to t(:forgot_password), new_user_password_path, :class => 'forgot' %>
</li>
<li>
<%= content_tag :button, t(:login), :type => :submit, :class => 'btn btn-primary' %>
2012-07-03 07:59:25 +00:00
2012-02-19 08:33:22 +00:00
</li>
<li class="divider hide"><span><%= t(:or_lower) %></span></li>
2012-02-19 08:33:22 +00:00
<% end %>
</ul>
<%#= link_to t(:register), new_user_registration_path, :class => 'btn btn-danger register' %>
2012-02-19 08:33:22 +00:00
</div>
</li>
<% end %>
</ul>
</div>
</div>
</header>