obsolete.ChilliProject/app/views/layouts/base.rhtml

145 lines
5.2 KiB
Plaintext

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title><%=h html_title %></title>
<meta name="description" content="<%= Redmine::Info.app_name %>" />
<meta name="keywords" content="issue,bug,tracker" />
<%= csrf_meta_tag %>
<%= favicon %>
<%= stylesheet_link_tag 'reset', :media => 'all' %>
<%= stylesheet_link_tag 'application', :media => 'all' %>
<%= stylesheet_link_tag 'print', :media => 'print' %>
<%= stylesheet_link_tag 'rtl', :media => 'all' if l(:direction) == 'rtl' %>
<!--[if lte IE 6]><%= stylesheet_link_tag 'ie6', :media => 'all' %><![endif]-->
<!--[if lte IE 7]><%= stylesheet_link_tag 'ie7', :media => 'all' %><![endif]-->
<!--[if gte IE 8]><![endif]-->
<%= javascript_include_tag 'jquery.1.3.2.min.js' %>
<%= javascript_include_tag 'jquery.menu_expand.js' %>
<%= javascript_tag('jQuery.noConflict();') %>
<%= javascript_heads %>
<%= stylesheet_link_tag 'jstoolbar' %>
<%= heads_for_theme %>
<% heads_for_wiki_formatter %>
<%= call_hook :view_layouts_base_html_head %>
<!-- page specific tags -->
<%= yield :header_tags -%>
</head>
<body class="<%=h body_css_classes %>">
<div id="wrapper">
<div id="top-menu">
<div id="account">
<% account_items = menu_items_for(:account_menu) %>
<ul id="account-info">
<%= content_tag('li', "#{l(:label_logged_as)} #{link_to_user(User.current, :format => :username)}", :id => '') if User.current.logged? %>
<% account_items.each do |item| %>
<%= render_menu_node(item) %>
<% end %>
</ul>
<%
items_for_main_level = []
items_for_more_level = []
menu_items_for(:top_menu) do |item|
if item.name == :home || item.name == :my_page
items_for_main_level << item
elsif item.name == :projects
# Remove
else
items_for_more_level << item
end
end
%>
<ul id="account-nav">
<% items_for_main_level.each do |item| %>
<%= render_menu_node(item) %>
<% end %>
<li class="drop-down">
<%= link_to l(:label_project_plural), { :controller => 'projects', :action => 'index' }, :class => "projects" %>
<ul style="display:none;">
<%
project_content = ''
project_tree(User.current.projects.all) do |project, level|
name_prefix = (level > 0 ? ('&nbsp;' * 2 * level + '&#187; ') : '')
project_content << content_tag(:li,
link_to(name_prefix + h(project), {:controller => 'projects', :action => 'show', :id => project, :jump => current_menu_item}))
end
%>
<%= project_content %>
</ul>
</li>
<li class="drop-down" id="more-menu">
<a class="more" href="#">More</a>
<ul style="display:none;">
<% items_for_more_level.each do |item| %>
<%= render_menu_node(item) %>
<% end %>
<%# TODO: Redmine defines these in a view, should be moved to a helper or data structure %>
<% if User.current.admin? %>
<% menu_items_for(:admin_menu) do |item| -%>
<li><%= link_to h(item.caption), item.url, item.html_options %></li>
<% end -%>
<% end %>
</ul>
</li>
<li>
<%= link_to l(:label_search), {:controller => 'search', :action => 'index', :id => @project}, :accesskey => accesskey(:search), :class => 'search' %>
<% form_tag({:controller => 'search', :action => 'index', :id => @project}, :method => :get, :id => 'nav-search' ) do %>
<%= hidden_field_tag(controller.default_search_scope, 1, :id => nil) if controller.default_search_scope %>
<%= text_field_tag 'q', @question, :size => 20, :class => 'small', :accesskey => accesskey(:quick_search) %>
<% end %>
</li>
</ul>
</div>
</div>
<% main_menu = render_main_menu(@project) %>
<% if has_content?(:sidebar) || !main_menu.blank? %>
<% display_sidebar = true %>
<% else %>
<% display_sidebar = false %>
<% end %>
<div id="main" class="<%= display_sidebar ? '' : "nosidebar" %>">
<h1 class="title"><%= page_header_title %></h1>
<% if display_sidebar %>
<div id="main-menu">
<%= main_menu %>
<!-- Sidebar -->
<div id="sidebar">
<%= yield :sidebar %>
<%= call_hook :view_layouts_base_sidebar %>
</div>
</div>
<%= expand_current_menu %>
<% end %>
<div class="<%= display_sidebar ? '' : "nosidebar" %>" id="content">
<%= render_flash_messages %>
<%= yield %>
<%= call_hook :view_layouts_base_content %>
<div style="clear:both;">&nbsp;</div>
</div>
</div>
<div id="footer">
<div class="bgl"><div class="bgr">
<%= l(:text_powered_by, :link => link_to(Redmine::Info.app_name, Redmine::Info.url)) %>
</div></div>
</div>
<div id="ajax-indicator" style="display:none;"><span><%= l(:label_loading) %></span></div>
</div>
<%= call_hook :view_layouts_base_body_bottom %>
</body>
</html>