Merge branch 'ticket/unstable/692-final-design' into unstable

This commit is contained in:
Eric Davis 2011-12-10 10:40:09 -08:00
commit ee48a8da4f
50 changed files with 636 additions and 468 deletions

View File

@ -19,6 +19,10 @@ class AdminController < ApplicationController
include SortHelper
menu_item :projects, :only => [:projects]
menu_item :plugins, :only => [:plugins]
menu_item :info, :only => [:info]
def index
@no_configuration_data = Redmine::DefaultData::Loader::no_data?
end

View File

@ -14,6 +14,7 @@
class LdapAuthSourcesController < AuthSourcesController
menu_item :ldap_authentication, :only => [:index]
protected
def auth_source_class

View File

@ -223,17 +223,15 @@ module ApplicationHelper
end
# Renders the project quick-jump box
def render_project_jump_box
projects = User.current.memberships.collect(&:project).compact.uniq
def render_project_jump_box(projects = [], html_options = {})
projects ||= User.current.memberships.collect(&:project).compact.uniq
if projects.any?
s = '<select onchange="if (this.value != \'\') { window.location = this.value; }">' +
"<option value=''>#{ l(:label_jump_to_a_project) }</option>" +
'<option value="" disabled="disabled">---</option>'
s << project_tree_options_for_select(projects, :selected => @project) do |p|
{ :value => url_for(:controller => 'projects', :action => 'show', :id => p, :jump => current_menu_item) }
end
s << '</select>'
s
# option_tags = content_tag :option, l(:label_jump_to_a_project), :value => ""
option_tags = (content_tag :option, "", :value => "" )
option_tags << project_tree_options_for_select(projects, :selected => @project) do |p|
{ :value => url_for(:controller => 'projects', :action => 'show', :id => p, :jump => current_menu_item) }
end
select_tag "", option_tags, html_options.merge({ :onchange => "if (this.value != \'\') { window.location = this.value; }" })
end
end
@ -746,7 +744,8 @@ module ApplicationHelper
div_class = 'toc'
div_class << ' right' if $1 == '>'
div_class << ' left' if $1 == '<'
out = "<ul class=\"#{div_class}\"><li>"
out = "<fieldset class='header_collapsible collapsible'><legend onclick='toggleFieldset(this);'></legend><div>"
out << "<ul class=\"#{div_class}\"><li>"
root = headings.map(&:first).min
current = root
started = false
@ -764,6 +763,7 @@ module ApplicationHelper
end
out << '</li></ul>' * (current - root)
out << '</li></ul>'
out << '</div></fieldset>'
end
end
end
@ -994,14 +994,21 @@ module ApplicationHelper
split_top_menu_into_main_or_more_menus[:more]
end
def help_menu_item
split_top_menu_into_main_or_more_menus[:help]
end
# Split the :top_menu into separate :main and :more items
def split_top_menu_into_main_or_more_menus
unless @top_menu_split
items_for_main_level = []
items_for_more_level = []
help_menu = nil
menu_items_for(:top_menu) do |item|
if item.name == :home || item.name == :my_page
items_for_main_level << item
elsif item.name == :help
help_menu = item
elsif item.name == :projects
# Remove, present in layout
else
@ -1010,7 +1017,8 @@ module ApplicationHelper
end
@top_menu_split = {
:main => items_for_main_level,
:more => items_for_more_level
:more => items_for_more_level,
:help => help_menu
}
end
@top_menu_split

View File

@ -58,7 +58,7 @@ module JournalsHelper
end
end
content_tag("div", "#{header}#{details}", :id => "change-#{journal.id}", :class => "journal")
return "#{header}#{details}"
end
def render_notes(model, journal, options={})

View File

@ -0,0 +1,33 @@
<div id="nav-login-content">
<% form_tag({:controller => "account", :action=> "login"}) do %>
<table>
<tr>
<td><label for="username-pulldown"><%= l(:field_login) %></label></td>
<td><label for="password-pulldown"><%= l(:field_password) %></label></td>
</tr>
<tr>
<td><%= text_field_tag 'username', nil, :tabindex => '1', :id => 'username-pulldown' %></td>
<td><%= password_field_tag 'password', nil, :tabindex => '1', :id => 'password-pulldown' %></td>
<td><input type="submit" name="login" value="<%=l(:button_login)%>" tabindex="1"/></td>
</tr>
</table>
<div id = "optional_login_fields" style = "top = 10px; white-space:nowrap">
<% if Setting.openid? %>
<%= text_field_tag "openid_url", nil, :placeholder => l(:field_identity_url), :tabindex => '1' %>
<% end %>
<% if Setting.autologin? %>
<label for="autologin"><%= check_box_tag 'autologin', 1, false, :tabindex => 1 %> <%= l(:label_stay_logged_in) %></label>
<% end %>
<% if Setting.lost_password? %>
<%= link_to l(:label_password_lost), {:controller => 'account', :action => 'lost_password'}, :tabindex => 1 %>
<% end %>
<% if !User.current.logged? && Setting.self_registration? %>
<%= "|" if Setting.lost_password? %>
<%= link_to l(:label_register), { :controller => 'account', :action => 'register' }, :tabindex => 1 %>
<% end %>
</div>
<% end %>
</div>

View File

@ -5,7 +5,7 @@
<table>
<tr>
<td align="right"><label for="username"><%=l(:field_login)%>:</label></td>
<td align="left"><%= text_field_tag 'username', nil, :tabindex => '1' %></td>
<td align="left"><%= text_field_tag 'username', nil, :tabindex => '2' %></td>
</tr>
<tr>
<td align="right"><label for="password"><%=l(:field_password)%>:</label></td>

View File

@ -1,3 +1 @@
<div id="admin-menu">
<%= render_menu :admin_menu %>
</div>
<%= render_menu :admin_menu %>

View File

@ -1,11 +1,9 @@
<div class="contextual">
<%= link_to_if_authorized(l(:button_update), {:controller => 'issues', :action => 'edit', :id => @issue }, :onclick => 'showAndScrollTo("update", "notes"); return false;', :class => 'icon icon-edit', :accesskey => accesskey(:edit)) %>
<%= link_to_if_authorized l(:button_log_time), {:controller => 'timelog', :action => 'new', :issue_id => @issue}, :class => 'icon icon-time-add' %>
<%= watcher_link(@issue, User.current, {:class => 'watcher_link', :replace => ['#watchers', '.watcher_link']}) %>
<%= link_to_if_authorized l(:button_duplicate), {:controller => 'issues', :action => 'new', :project_id => @project, :copy_from => @issue }, :class => 'icon icon-duplicate' %>
<%= link_to_if_authorized l(:button_copy), {:controller => 'issue_moves', :action => 'new', :id => @issue, :copy_options => {:copy => 't'}}, :class => 'icon icon-copy' %>
<%= link_to_if_authorized l(:button_move), {:controller => 'issue_moves', :action => 'new', :id => @issue}, :class => 'icon icon-move' %>
<%= link_to_if_authorized l(:button_delete), {:controller => 'issues', :action => 'destroy', :id => @issue}, :confirm => (@issue.leaf? ? l(:text_are_you_sure) : l(:text_are_you_sure_with_children)), :method => :post, :class => 'icon icon-del' %>
<div class="update button-large">
<%= link_to_if_authorized(l(:button_update), {:controller => 'issues', :action => 'edit', :id => @issue }, :onclick => 'showAndScrollTo("update", "notes"); return false;', :class => '', :accesskey => accesskey(:edit)) %>
</div>
</div>

View File

@ -38,7 +38,7 @@
<%= call_hook(:view_issues_edit_notes_bottom, { :issue => @issue, :notes => @notes, :form => f }) %>
</fieldset>
<fieldset id="attachments" class="collapsible collapsed borders"><legend onclick="toggleFieldset(this);"><%=l(:label_attachment_plural)%></legend>
<fieldset id="attachments" class="header_collapsible collapsible collapsed"><legend onclick="toggleFieldset(this);"><%=l(:label_attachment_plural)%></legend>
<div style="display: none;">
<%= render :partial => 'attachments/form' %>
</div>

View File

@ -1,16 +1,6 @@
<h3><%= l(:label_issue_plural) %></h3>
<%= link_to l(:label_issue_view_all), { :controller => 'issues', :action => 'index', :project_id => @project, :set_filter => 1 } %><br />
<% if @project %>
<%= link_to l(:field_summary), :controller => 'reports', :action => 'issue_report', :id => @project %><br />
<% end %>
<%= call_hook(:view_issues_sidebar_issues_bottom) %>
<% if User.current.allowed_to?(:view_calendar, @project, :global => true) %>
<%= link_to(l(:label_calendar), :controller => 'calendars', :action => 'show', :project_id => @project) %><br />
<% end %>
<% if User.current.allowed_to?(:view_gantt, @project, :global => true) %>
<%= link_to(l(:label_gantt), :controller => 'gantts', :action => 'show', :project_id => @project) %><br />
<% end %>
<%= call_hook(:view_issues_sidebar_planning_bottom) %>
<%= render_sidebar_queries %>

View File

@ -1,7 +1,6 @@
<div class="title-bar">
<h2><%= @query.new_record? ? l(:label_issue_plural) : h(@query.name) %></h2>
<% html_title(@query.new_record? ? l(:label_issue_plural) : h(@query.name)) %>
<div class="title-bar-extras">
@ -13,16 +12,18 @@
<%= render :partial => 'queries/new_issue_button' %>
</div>
<% html_title(@query.new_record? ? l(:label_issue_plural) : h(@query.name)) %>
<% form_tag({ :controller => 'queries', :action => 'new' }, :id => 'query_form') do %>
<%= hidden_field_tag('project_id', @project.to_param) if @project %>
<div id="query_form_content" class="hide-when-print">
<fieldset id="filters" class="collapsible <%= @query.new_record? ? "" : "collapsed" %>">
<fieldset id="filters" class="header_collapsible collapsible <%= @query.new_record? ? "" : "collapsed" %>">
<legend onclick="toggleFieldset(this);"><%= l(:label_filter_plural) %></legend>
<div class="filter-fields" style="<%= @query.new_record? ? "" : "display: none;" %>">
<%= render :partial => 'queries/filters', :locals => {:query => @query} %>
</div>
</fieldset>
<fieldset class="collapsible collapsed">
<fieldset id="column_options" class="header_collapsible collapsible collapsed">
<legend onclick="toggleFieldset(this);"><%= l(:label_options) %></legend>
<div style="display: none;">
<table>

View File

@ -1,5 +1,5 @@
<div class="title-bar" id="upper-title-bar">
<div class="subject"><%= content_tag('h2', h(@issue.subject)) %></div>
<div class="subject"><%= content_tag('h2', h(@issue.tracker.name) + ' #' +@issue.id.to_s) %></div>
<div class="title-bar-actions">
<%= render :partial => 'action_menu' %>
@ -11,8 +11,9 @@
<%= avatar(@issue.author, :size => "40") %>
</div>
<h3>
<%= h(@issue.tracker.name) %> #<%= @issue.id %>
<%=h(@issue.subject) %>
</h3>
<hr />
<p class="author">
<%= authoring @issue.created_on, @issue.author %>.
@ -24,47 +25,33 @@
<div class="meta">
<table class="attributes">
<tr>
<th class="status"><%=l(:field_status)%>:</th>
<td class="status"><%= h(@issue.status.name) %></td>
<th class="category"><%=l(:field_category)%>:</th>
<td class="category"><%=h(@issue.category ? @issue.category.name : "-") %></td>
<th class="start-date"><%=l(:field_start_date)%>:</th>
<td class="start-date"><%= format_date(@issue.start_date) %></td>
</tr>
<tr>
<th class="priority"><%=l(:field_priority)%>:</th>
<td class="priority"><%= h(@issue.priority.name) %></td>
<th class="fixed-version"><%=l(:field_fixed_version)%>:</th>
<td class="fixed-version"><%= @issue.fixed_version ? link_to_version(@issue.fixed_version) : "-" %></td>
<th class="due-date"><%=l(:field_due_date)%>:</th>
<td class="due-date"><%= format_date(@issue.due_date) %></td>
</tr>
<tr>
<th class="assigned-to"><%=l(:field_assigned_to)%>:</th>
<td class="assigned-to"><%= avatar(@issue.assigned_to, :size => "14") %><%= @issue.assigned_to ? link_to_user(@issue.assigned_to) : "-" %></td>
<th class="progress"><%=l(:field_done_ratio)%>:</th>
<td class="progress"><%= progress_bar @issue.done_ratio, :width => '80px', :legend => "#{@issue.done_ratio}%" %></td>
<tr>
<th class="status"><%=l(:field_status)%>:</th><td class="status"><%= h(@issue.status.name) %></td>
<th class="start-date"><%=l(:field_start_date)%>:</th><td class="start-date"><%= format_date(@issue.start_date) %></td>
</tr>
<tr>
<th class="priority"><%=l(:field_priority)%>:</th><td class="priority"><%= h(@issue.priority.name) %></td>
<th class="due-date"><%=l(:field_due_date)%>:</th><td class="due-date"><%= format_date(@issue.due_date) %></td>
</tr>
<tr>
<th class="assigned-to"><%=l(:field_assigned_to)%>:</th><td class="assigned-to"><%= avatar(@issue.assigned_to, :size => "14") %><%= @issue.assigned_to ? link_to_user(@issue.assigned_to) : "-" %></td>
<th class="progress"><%=l(:field_done_ratio)%>:</th><td class="progress"><%= progress_bar @issue.done_ratio, :width => '80px', :legend => "#{@issue.done_ratio}%" %></td>
</tr>
<tr>
<th class="category"><%=l(:field_category)%>:</th><td class="category"><%=h(@issue.category ? @issue.category.name : "-") %></td>
<% if User.current.allowed_to?(:view_time_entries, @project) %>
<th class="spent-time"><%=l(:label_spent_time)%>:</th>
<td class="spent-time"><%= @issue.spent_hours > 0 ? (link_to l_hours(@issue.spent_hours), {:controller => 'timelog', :action => 'index', :project_id => @project, :issue_id => @issue}) : "-" %></td>
<th class="spent-time"><%=l(:label_spent_time)%>:</th>
<td class="spent-time"><%= @issue.spent_hours > 0 ? (link_to l_hours(@issue.spent_hours), {:controller => 'timelog', :action => 'index', :project_id => @project, :issue_id => @issue}) : "-" %></td>
<% end %>
</tr>
<tr>
<th class="fixed-version"><%=l(:field_fixed_version)%>:</th><td class="fixed-version"><%= @issue.fixed_version ? link_to_version(@issue.fixed_version) : "-" %></td>
<% if @issue.estimated_hours %>
<th class="estimated-hours"><%=l(:field_estimated_hours)%>:</th>
<td class="estimated-hours"><%= l_hours(@issue.estimated_hours) %></td>
<th class="estimated-hours"><%=l(:field_estimated_hours)%>:</th><td class="estimated-hours"><%= l_hours(@issue.estimated_hours) %></td>
<% end %>
</tr>
<%= render_custom_fields_rows(@issue) %>
<%= call_hook(:view_issues_show_details_bottom, :issue => @issue) %>
</tr>
<%= render_custom_fields_rows(@issue) %>
<%= call_hook(:view_issues_show_details_bottom, :issue => @issue) %>
</table>
</div><!-- .meta -->
@ -107,6 +94,7 @@
<div id="relations">
<%= render :partial => 'relations' %>
</div>
<hr />
<% end %>
</div>
@ -120,7 +108,7 @@
<% if @journals.present? %>
<div id="history">
<h3><%=l(:label_history)%></h3>
<h3 class="rounded-background"><%=l(:label_history)%></h3>
<%= render :partial => 'history', :locals => { :issue => @issue, :journals => @journals } %>
</div>
<% end %>
@ -129,7 +117,6 @@
<div style="clear: both;"></div>
<div class="title-bar" id="lower-title-bar">
<h2><%= h @issue.subject %></h2>
<div class="title-bar-actions">
<%= render :partial => 'action_menu', :locals => {:replace_watcher => 'watcher2' } %>
</div>

View File

@ -1,5 +1,5 @@
<% @page_header_title = l(:label_administration) %>
<% content_for :sidebar do %>
<% content_for :main_menu do %>
<%= render :partial => 'admin/menu' %>
<% end %>

View File

@ -31,15 +31,16 @@
<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) %>
<div id="header">
<div id="logo"><%= link_to(h(Setting.app_title), home_path) %></div>
<div id="top-menu-items">
<div id="search">
<%= label_tag("q", l(:label_search), :class => "hidden-for-sighted") %>
<% form_tag({:controller => 'search', :action => 'index', :id => @project}, :method => :get) do %>
<%= hidden_field_tag(controller.default_search_scope, 1, :id => nil) if controller.default_search_scope %>
<%= text_field_tag 'q', @question, :size => 20, :class => 'search_field', :placeholder => l(:search_input_placeholder), :accesskey => accesskey(:quick_search) %>
<% end %>
</ul>
</div>
<% if User.current.logged? || !Setting.login_required? %>
<ul id="account-nav">
@ -61,12 +62,12 @@
</ul>
</li>
<li class="drop-down" id="more-menu">
<a class="more" href="#">More</a>
<a class="more" href="#">Modules</a>
<ul style="display:none;">
<% more_top_menu_items.each do |item| %>
<%= render_menu_node(item) %>
<% end %>
<%# TODO: Redmine defines these in a view, should be moved to a helper or data structure %>
<%# TODO: Extract to helper %>
<% if User.current.admin? %>
<% menu_items_for(:admin_menu) do |item| -%>
<li><%= link_to h(item.caption), item.url, item.html_options %></li>
@ -75,50 +76,67 @@
</ul>
</li>
<li>
<label for='q'>
<%= link_to l(:label_search), {:controller => 'search', :action => 'index', :id => @project}, :accesskey => accesskey(:search), :class => 'search' %>
</label>
<% 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 %>
<%= render_menu_node(help_menu_item) %>
<% unless User.current.logged? %>
<% if Setting.self_registration? %>
<li>
<%= link_to l(:label_register), { :controller => 'account', :action => 'register' } %>
</li>
<% end %>
<li id="login-menu" class="drop-down last-child">
<%= link_to l(:label_login), {:controller => 'account', :action => 'login'}, :class => 'login' %>
<div id="nav-login" style="display:none;">
<%= render :partial => 'account/login' %>
</div>
</li>
<% else %>
<li class="drop-down last-child">
<%= link_to_user(User.current) %>
<ul style="display:none;">
<% menu_items_for(:account_menu) do |item| %>
<%= render_menu_node(item) %>
<% end %>
</ul>
</li>
<% end %>
</li>
</ul>
<% end %>
</div>
</div>
<div id="breadcrumb">
<%= page_header_title %>
</div>
</div>
<% main_menu = render_main_menu(@project) %>
<% if has_content?(:sidebar) || !main_menu.blank? %>
<% if (side_displayed = has_content?(:sidebar) || has_content?(:main_menu) || !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 id="main" class="<%= side_displayed ? '' : "nosidebar" %>">
<% if (side_displayed) %>
<div id="main-menu">
<%= main_menu %>
<%= yield :main_menu %>
<% if display_sidebar %>
<!-- Sidebar -->
<div id="sidebar">
<%= yield :sidebar %>
<%= call_hook :view_layouts_base_sidebar %>
</div>
<% end %>
</div>
</div>
<%= expand_current_menu %>
<%= expand_current_menu %>
<% end %>
<div class="<%= display_sidebar ? '' : "nosidebar" %>" id="content">
<div class="<%= side_displayed ? '' : "nosidebar" %>" id="content">
<%= render_flash_messages %>
<%= yield %>
<%= call_hook :view_layouts_base_content %>
<div style="clear:both;">&nbsp;</div>
</div>
</div>
<div id="footer">

View File

@ -658,6 +658,7 @@ de:
label_roadmap_overdue: "%{value} verspätet"
label_roadmap_no_issues: Keine Tickets für diese Version
label_search: Suche
search_input_placeholder: Suche ...
label_result_plural: Resultate
label_all_words: Alle Wörter
label_wiki: Wiki

View File

@ -656,6 +656,7 @@ en:
label_roadmap_overdue: "%{value} late"
label_roadmap_no_issues: No issues for this version
label_search: Search
search_input_placeholder: search ...
label_result_plural: Results
label_all_words: All words
label_wiki: Wiki

View File

@ -166,12 +166,10 @@ Redmine::MenuManager.map :top_menu do |menu|
menu.push :my_page, { :controller => 'my', :action => 'page' }, :if => Proc.new { User.current.logged? }
menu.push :projects, { :controller => 'projects', :action => 'index' }, :caption => :label_project_plural
menu.push :administration, { :controller => 'admin', :action => 'index' }, :if => Proc.new { User.current.admin? }, :last => true
menu.push :help, Redmine::Info.help_url, :last => true
menu.push :help, Redmine::Info.help_url, :last => true, :caption => "?"
end
Redmine::MenuManager.map :account_menu do |menu|
menu.push :login, :signin_path, :if => Proc.new { !User.current.logged? }
menu.push :register, { :controller => 'account', :action => 'register' }, :if => Proc.new { !User.current.logged? && Setting.self_registration? }
menu.push :my_account, { :controller => 'my', :action => 'account' }, :if => Proc.new { User.current.logged? }
menu.push :logout, :signout_path, :if => Proc.new { User.current.logged? }
end

Binary file not shown.

After

Width:  |  Height:  |  Size: 197 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 155 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 195 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 190 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 475 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 217 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 222 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 267 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 252 B

After

Width:  |  Height:  |  Size: 121 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 197 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 214 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 194 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 211 B

BIN
public/images/icon_help.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 314 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 349 B

BIN
public/images/icon_home.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 580 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 556 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 369 B

After

Width:  |  Height:  |  Size: 501 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 333 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 286 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 228 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 226 B

View File

@ -469,18 +469,6 @@ jQuery.viewportHeight = function() {
jQuery(document).ready(function($) {
// show/hide header search box
$("#account a.search").live('click', function() {
var searchWidth = $("#account-nav").width();
$(this).toggleClass("open");
$("#nav-search").width(searchWidth).slideToggle(animationRate, function(){
$("#nav-search-box").select();
});
return false;
});
// file table thumbnails
$("table a.has-thumb").hover(function() {
$(this).removeAttr("title").toggleClass("active");
@ -546,45 +534,53 @@ jQuery(document).ready(function($) {
return false;
});
// remove .drop-down class from empty dropdowns
$("#account .drop-down").each(function(index) {
if ($(this).find("li").size() < 1) {
$(this).removeClass("drop-down");
}
});
// Toggle a top menu item open or closed, showing or hiding its submenu
function toggleTopMenu(menuItem) {
menuItem.toggleClass("open").find('ul').mySlide();
};
$("#account .drop-down").hover(function() {
$(this).addClass("open").find("ul").show();
$("#top-menu").addClass("open");
// Handle a single click event on the page to close an open menu item
function handleClickEventOnPageToCloseOpenMenu(openMenuItem) {
$('html').one("click", function(htmlEvent) {
if (openMenuItem.has(htmlEvent.target).length > 0) {
// Clicked on the open menu, let it bubble up
} else {
// Clicked elsewhere, close menu
toggleTopMenu(openMenuItem);
}
});
};
// wraps long dropdown menu in an overflow:auto div to keep long project lists on the page
var $projectDrop = $("#account .drop-down:has(.projects) ul");
// Click on the menu header with a dropdown menu
$('#account-nav .drop-down').live('click', function(event) {
var menuItem = $(this);
// only do the wrapping if it's the project dropdown, and more than 15 items
if ( $projectDrop.children().size() > 15 && $(this).find("> a").hasClass("projects") ) {
toggleTopMenu(menuItem);
var overflowHeight = 15 * $projectDrop.find("li:eq(1)").outerHeight() - 2;
if (menuItem.hasClass('open')) {
handleClickEventOnPageToCloseOpenMenu(menuItem);
}
return false;
});
$projectDrop
.wrapInner("<div class='overflow'></div>").end()
.find(".overflow").css({overflow: 'auto', height: overflowHeight, position: 'relative'})
.find("li a").css('paddingRight', '25px');
// Click on an actual item
$('#account-nav .drop-down ul a').live('click', function(event) {
event.stopPropagation();
});
// do hack-y stuff for IE6 & 7. don't ask why, I don't know.
if (parseInt($.browser.version, 10) < 8 && $.browser.msie) {
$projectDrop.find(".overflow").css({width: 325, zoom: '1'});
$projectDrop.find("li a").css('marginLeft', '-15px');
$("#top-menu").css('z-index', '10000');
}
}
}, function() {
$(this).removeClass("open").find("ul").hide();
$("#top-menu").removeClass("open");
});
// show/hide login box
$("#account-nav a.login").click(function() {
$(this).parent().toggleClass("open");
// Focus the username field if the login field has opened
$("#nav-login").slideToggle(animationRate, function () {
if ($(this).parent().hasClass("open")) {
$("input#username").focus()
}
});
return false;
});
// deal with potentially problematic super-long titles
$(".title-bar h2").css({paddingRight: $(".title-bar-actions").outerWidth() + 15 });
@ -608,4 +604,8 @@ jQuery(document).ready(function($) {
}
});
// Do not close the login window when using it
$('#nav-login-content').click(function(event){
event.stopPropagation();
});
});

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +0,0 @@
#context-menu ul { background:#F4F4F4 none repeat scroll 0 0;}
#context-menu a { border: none; }
#context-menu li a:hover { border: none; background-color:#f4f4f4; color:#333333; }
#context-menu li.folder a:hover { background-color:#f4f4f4; }

View File

@ -1,4 +1,4 @@
#context-menu { position: absolute; z-index: 40; font-size: 0.9em;}
#context-menu { position: absolute; z-index: 40; }
#context-menu ul, #context-menu li, #context-menu a {
display:block;
@ -48,5 +48,4 @@
/* selected element */
.context-menu-selection { background-color:#507AAA !important; color:#000 !important; }
.context-menu-selection a, .context-menu-selection a:hover { color:#000 !important; }
.context-menu-selection:hover { background-color:#507AAA !important; color:#000 !important; }

View File

@ -11,9 +11,6 @@ td.dropdown {
body .title-bar-extras {
overflow:hidden;
}
#main-menu a {
height:30px;
}
#main-menu, .title-bar {
z-index:4;
@ -45,4 +42,7 @@ body .file-thumbs a {
div.attachments {
position:relative;
z-index:4;
}
}
fieldset.collapsible.header_collapsible legend {
margin-left:-15px;
}

View File

@ -1390,7 +1390,7 @@ class IssuesControllerTest < ActionController::TestCase
def test_default_search_scope
get :index
assert_select "form#nav-search" do
assert_select "#search form" do
assert_select "input[type=hidden][name=issues][value=1]"
end
end

View File

@ -23,7 +23,7 @@ class LayoutTest < ActionController::IntegrationTest
assert_response :not_found
# UsersController uses the admin layout by default
assert_select "#admin-menu", :count => 0
assert_select "#main-menu", :count => 0
end
test "browsing to an unauthorized page should render the base layout" do
@ -33,7 +33,7 @@ class LayoutTest < ActionController::IntegrationTest
get "/admin"
assert_response :forbidden
assert_select "#admin-menu", :count => 0
assert_select "#main-menu", :count => 0
end
def test_top_menu_navigation_not_visible_when_login_required

View File

@ -42,9 +42,7 @@ class RedmineTest < ActiveSupport::TestCase
end
def test_account_menu
assert_number_of_items_in_menu :account_menu, 4
assert_menu_contains_item_named :account_menu, :login
assert_menu_contains_item_named :account_menu, :register
assert_number_of_items_in_menu :account_menu, 2
assert_menu_contains_item_named :account_menu, :my_account
assert_menu_contains_item_named :account_menu, :logout
end