Project

General

Profile

Patch #4218 » css-project-dropdown.diff

Patch (v1) - Alex Bevilacqua, 2009-11-14 15:40

View differences:

app/helpers/application_helper.rb (working copy)
161 161
      s
162 162
    end
163 163
  end
164

  
165
	def render_project_mega_dropdown
166
		projects = User.current.projects.all
167
		if projects.any?
168
			s = '<ul id="project_dropdown">' +
169
						'<li class="dropdown">'+
170
						"<h2><a href='#'>#{ l(:label_jump_to_a_project) }</h2>"+
171
						"<div>"
172
			projects.each do |p|
173
				s << '<a href="'+ url_for(:controller => 'projects', :action => 'show', :id => p) + '">' + p.name + '</a><br />'
174
      end		
175
			s << '</div>'
176
			s << '</li>'
177
			s << '</ul>'
178
		end
179
	end
164 180
  
165 181
  def project_tree_options_for_select(projects, options = {})
166 182
    s = ''
app/views/layouts/base.rhtml (working copy)
6 6
<meta name="description" content="<%= Redmine::Info.app_name %>" />
7 7
<meta name="keywords" content="issue,bug,tracker" />
8 8
<%= stylesheet_link_tag 'application', :media => 'all' %>
9
<%= javascript_include_tag :defaults %>
9
<%= javascript_include_tag :defaults, 'jquery', 'jquery.hoverintent' %>
10
<script language="Javascript">
11
	$(document).ready(function() {		
12
		function addDropdown(){
13
			$(this).addClass("hovering");
14
			}
15

  
16
		function removeDropdown(){
17
			$(this).removeClass("hovering");
18
			}
19

  
20
	var dropdownConfig = {
21
			 interval: 250,
22
			 sensitivity: 4,
23
			 over: addDropdown,
24
			 timeout: 500,
25
			 out: removeDropdown
26
	};
27

  
28
	$("li.dropdown").hoverIntent(dropdownConfig)
29
	});
30
</script>
10 31
<%= heads_for_wiki_formatter %>
11 32
<!--[if IE]>
12 33
    <style type="text/css">
......
30 51
      
31 52
<div id="header">
32 53
    <div id="quick-search">
54
        <%= render_project_mega_dropdown %>
33 55
        <% form_tag({:controller => 'search', :action => 'index', :id => @project}, :method => :get ) do %>
34 56
        <%= hidden_field_tag(controller.default_search_scope, 1, :id => nil) if controller.default_search_scope %>
35 57
        <%= link_to l(:label_search), {:controller => 'search', :action => 'index', :id => @project}, :accesskey => accesskey(:search) %>:
36 58
        <%= text_field_tag 'q', @question, :size => 20, :class => 'small', :accesskey => accesskey(:quick_search) %>
37
        <% end %>
38
        <%= render_project_jump_box %>
59
        <% end %>        
39 60
    </div>
40 61
    
41 62
    <h1><%= page_header_title %></h1>
public/stylesheets/application.css (working copy)
808 808
  #content { width: 99%; margin: 0; padding: 0; border: 0; background: #fff; overflow: visible !important;}
809 809
	#wiki_add_attachment { display:none; }
810 810
}
811

  
812
#project_dropdown { float: left; margin: 0; padding: 0.3em 0em; }
813
#project_dropdown li { -webkit-box-shadow: 0.25em 0.25em 1em rgba(0,0,0,0.25); -moz-box-shadow: rgba(0,0,0,0.25) 0.25em 0.25em 1em;	background: #f6f6f6; padding: 0.5em 1.5em; border-radius: 1em; position: relative; display: inline; margin: 0.1em 1em; }
814
#project_dropdown h2, ul h3 { font-size: 100%; font-weight: normal; display: inline; }
815
#project_dropdown li a { color: #000; text-decoration: none; padding: 0 0.4em; }
816
#project_dropdown li a:hover { text-decoration: none; }
817
#project_dropdown li.dropdown a { background: transparent url(arrow.gif) center right no-repeat; padding: 0 1.2em; }
818
#project_dropdown li.dropdown a:hover { text-decoration: none; }
819
#project_dropdown div { display: none; }
820
#project_dropdown li.dropdown div { background: #f6f6f6; border-radius: 1em; border-color: #e4e4e4;	-webkit-box-shadow: 0.25em 0.25em 1em rgba(0,0,0,0.25);	-moz-box-shadow: rgba(0,0,0,0.25) 0.25em 0.25em 1em; position: absolute;	color: #f1938c;	padding: 1.5em 2em;	 z-index: 10;	 min-width: 18em;	right: -10px;	padding-top: 2em; }
821
#project_dropdown li.hovering div { display: block; }
822
#project_dropdown li.dropdown div a { color: #333; padding: 0; background-image: none; }
823
#project_dropdown li.dropdown div a:hover { text-decoration: underline; }
824
#project_dropdown li div a.more { font-weight: bold; }
825
#project_dropdown div h3 { font-weight: bold; font-size: 1.1em; }
826
#project_dropdown div p { margin: 0 0 0.8em 0; padding: 0; }
(3-3/4)