socialforge/app/views/layouts/_bootstrap_base_header.html...

90 lines
3.7 KiB
Plaintext
Raw Normal View History

2014-05-23 17:07:58 +08:00
<%
2014-05-26 11:27:10 +08:00
request.headers['REQUEST_URI'] = "" if request.headers['REQUEST_URI'].nil?
realUrl = request.original_url
if (realUrl.match(/forge\.trustie\.net\/*/))
@nav_dispaly_project_label = 1
@nav_dispaly_forum_label = 1
elsif (realUrl.match(/course\.trustie\.net\/*/))
@nav_dispaly_course_all_label = 1
@nav_dispaly_forum_label = 1
@nav_dispaly_course_label = nil
@nav_dispaly_store_all_label = 1
elsif (realUrl.match(/user\.trustie\.net\/*/))
@nav_dispaly_home_path_label = 1
@nav_dispaly_main_course_label = 1
@nav_dispaly_main_project_label = 1
@nav_dispaly_main_contest_label = 1
elsif (realUrl.match(/contest\.trustie\.net\/*/))
@nav_dispaly_contest_label = 1
@nav_dispaly_store_all_label = 1
else
@nav_dispaly_project_all_label = 1
@nav_dispaly_course_all_label = 1
@nav_dispaly_forum_label = 1
@nav_dispaly_bid_label = 1
@nav_dispaly_contest_label = 1
@nav_dispaly_store_all_label = 1
end
2014-05-23 17:07:58 +08:00
%>
2014-05-26 11:27:10 +08:00
<div class="navbar navbar-default navbar-fixed-top" role="navigation">
<div class="container">
2014-05-23 17:07:58 +08:00
<div class="navbar-header">
2014-05-26 11:27:10 +08:00
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<%=link_to image_tag("/images/logo5.png", class: 'navbar-brand', style:"width: 50px; height: 50px; padding:4px"), '/' %>
</div>
2014-05-23 17:07:58 +08:00
2014-05-26 11:27:10 +08:00
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">
<%= bootstrap_render_dynamic_nav if User.current.logged? || !Setting.login_required? -%>
<li class="dropdown hidden">
2014-05-23 17:07:58 +08:00
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Dropdown <b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="#">Action</a></li>
<li><a href="#">Another action</a></li>
<li><a href="#">Something else here</a></li>
<li class="divider"></li>
<li><a href="#">Separated link</a></li>
<li class="divider"></li>
<li><a href="#">One more separated link</a></li>
</ul>
</li>
</ul>
<form class="navbar-form navbar-left hidden" role="search">
<div class="form-group">
<input type="text" class="form-control" placeholder="Search">
</div>
<button type="submit" class="btn btn-default">Submit</button>
</form>
2014-05-24 12:11:14 +08:00
<ul class="nav navbar-nav navbar-right">
<li class="dropdown <%= "hidden" unless User.current.logged? %>">
2014-05-23 17:07:58 +08:00
<a href="#" class="dropdown-toggle" data-toggle="dropdown"><%=User.current%> <b class="caret"></b></a>
<ul class="dropdown-menu">
<li>
<%=link_to l(:label_my_message)+'('+User.current.count_new_jour.to_s+')', { :controller => 'users', :action => 'user_newfeedback', id: User.current.id, host: Setting.host_user }, {:class => 'my-message'} if User.current.logged? -%>
</li>
<li>
<%=link_to l(:label_my_course), {:controller => 'users', :action => 'user_courses', id: User.current.id, host: Setting.host_course} %>
</li>
<li>
<%=link_to l(:label_my_projects),{:controller => 'users', :action => 'user_projects', id: User.current.id, host: Setting.host_name} %>
</li>
2014-05-26 11:27:10 +08:00
<li class="divider"></li>
<li>
<%=link_to l(:label_user_edit), {:controller => 'my', :action=> 'account', host: Setting.host_user}%>
</li>
2014-05-26 11:27:10 +08:00
</ul>
</li>
<%= bootstrap_render_menu :account_menu -%>
</ul>
</div>
2014-05-23 17:07:58 +08:00
</div>
2014-05-26 11:27:10 +08:00
</div>
2014-05-23 17:07:58 +08:00