summaryrefslogtreecommitdiffstats
path: root/app/views/layouts/base.rhtml
blob: 9c81a313b3343996a8047bbf85fb7e623391228b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title><%= Setting.app_title + (@html_title ? ": #{@html_title}" : "") %></title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta name="description" content="redMine" />
<meta name="keywords" content="issue,bug,tracker" />
<!--[if IE]>
    <style type="text/css">
    body {behavior: url(<%= stylesheet_path "csshover.htc" %>);}
    </style>
<![endif]-->
<%= stylesheet_link_tag "application" %>
<%= stylesheet_link_tag "print", :media => "print" %>
<%= javascript_include_tag :defaults %>
<%= javascript_include_tag 'menu' %>
<%= stylesheet_link_tag 'jstoolbar' %>
<!-- page specific tags --><%= yield :header_tags %>
</head>

<body>
<div id="container" >

    <div id="header">
    <div style="float: left;">
        <h1><%= Setting.app_title %></h1>
        <h2><%= Setting.app_subtitle %></h2>
    </div>
    <div style="float: right; padding-right: 1em; padding-top: 0.2em;">
      <% if User.current.logged? %><small><%=l(:label_logged_as)%> <strong><%= User.current.login %></strong> -</small><% end %>
      <small><%= toggle_link l(:label_search), 'quick-search-form', :focus => 'quick-search-input' %></small>
      <% form_tag({:controller => 'search', :action => 'index', :id => @project}, :method => :get, :id => 'quick-search-form', :style => "display:none;" ) do %>
        <%= text_field_tag 'q', @question, :size => 15, :class => 'small', :id => 'quick-search-input' %>
      <% end %>
    </div>
    </div>
	
	<div id="navigation">
		<ul>
	<li><%= link_to l(:label_home), { :controller => 'welcome' }, :class => "icon icon-home" %></li>
	<li><%= link_to l(:label_my_page), { :controller => 'my', :action => 'page'}, :class => "icon icon-mypage" %></li>
	
	<% if User.current.memberships.any? %>
      <li class="submenu"><%= link_to l(:label_project_plural), { :controller => 'projects' }, :class => "icon icon-projects", :onmouseover => "buttonMouseover(event, 'menuAllProjects');" %></li>
	<% else %>
	  <li><%= link_to l(:label_project_plural), { :controller => 'projects' }, :class => "icon icon-projects" %></li>
	<% end %>
			
    <% if User.current.logged? %>
		<li><%= link_to l(:label_my_account), { :controller => 'my', :action => 'account' }, :class => "icon icon-user" %></li>
    <% end %>
			
	<% if User.current.admin? %>
		<li class="submenu"><%= link_to l(:label_administration), { :controller => 'admin' }, :class => "icon icon-admin", :onmouseover => "buttonMouseover(event, 'menuAdmin');" %></li>
	<% end %>
			
	<li class="right"><%= link_to l(:label_help), { :controller => 'help', :ctrl => params[:controller], :page => params[:action] }, :onclick => "window.open(this.href); return false;", :class => "icon icon-help" %></li>
	
	<% if User.current.logged? %>
		<li class="right"><%= link_to l(:label_logout), { :controller => 'account', :action => 'logout' }, :class => "icon icon-user" %></li>	
	<% else %>	
		<li class="right"><%= link_to l(:label_login), { :controller => 'account', :action => 'login' }, :class => "icon icon-user" %></li>
	<% end %>	
		</ul>		
	</div>

    <% if User.current.admin? %>
		<%= render :partial => 'admin/menu' %>        
    <% end %>

    <% if User.current.memberships.any? %>
        <div id="menuAllProjects" class="menu" onmouseover="menuMouseover(event)">
        <%= link_to l(:label_project_all), {:controller => 'projects' }, :class => "menuItem" %>
        <% User.current.memberships.find(:all, :limit => 20).each do |membership| %>
            <%= link_to membership.project.name, {:controller => 'projects',:action => 'show', :id => membership.project }, :class => "menuItem" %>
        <% end %>
        </div>
    <% end %>
	
	<div id="subcontent">	
		<% if @project && !@project.new_record? %>
			<h2><%= @project.name %></h2>
			<ul class="menublock">
            <% Redmine::MenuManager.allowed_items(:project_menu, current_role).each do |item| %>
            <% unless item.condition && !item.condition.call(@project) %>
                <li><%= link_to l(item.name), {item.param => @project}.merge(item.url) %></li>
            <% end %>
            <% end %>
			</ul>
		<% end %>
	</div>
	
	<div id="content">
	    <div id="flash">
		  <%= content_tag('div', flash[:error], :class => 'error') if flash[:error] %>
		  <%= content_tag('div', flash[:notice], :class => 'notice') if flash[:notice] %>
		</div>
		<%= yield %>
	</div>
	
	<div id="ajax-indicator" style="display:none;">
	   <span><%= l(:label_loading) %></span>
	</div>

	<div id="footer">
		<p><a href="http://www.redmine.org/">redMine</a> <small><%= Redmine::VERSION %> &copy 2006-2007 Jean-Philippe Lang</small></p>
	</div>

</div>
</body>
</html>