move the two toggle links in top-right to view menu

This commit is contained in:
Reinier Balt 2013-06-11 16:13:46 +02:00
parent 7084c11263
commit be1a9528d5
6 changed files with 30 additions and 11 deletions

View file

@ -46,10 +46,6 @@
</h1> </h1>
</div> </div>
<div id="minilinks"> <div id="minilinks">
<%= link_to(t('layouts.toggle_contexts'), "#", {:title => t('layouts.toggle_contexts_title'), :id => "toggle-contexts-nav"}) %>
&nbsp;|&nbsp;
<%= link_to(t('layouts.toggle_notes'), "#", {:accesskey => "S", :title => t('layouts.toggle_notes_title'), :id => "toggle-notes-nav"}) %>
&nbsp;|&nbsp;
<%= link_to("#{t('common.logout')} (#{current_user.display_name}) &raquo;".html_safe, logout_path) %> <%= link_to("#{t('common.logout')} (#{current_user.display_name}) &raquo;".html_safe, logout_path) %>
</div> </div>
<div id="navcontainer"> <div id="navcontainer">
@ -66,13 +62,15 @@
<li><%= navigation_link( t('layouts.navigation.recurring_todos'), {:controller => "recurring_todos", :action => "index"}, :title => t('layouts.navigation.recurring_todos_title')) %></li> <li><%= navigation_link( t('layouts.navigation.recurring_todos'), {:controller => "recurring_todos", :action => "index"}, :title => t('layouts.navigation.recurring_todos_title')) %></li>
</ul> </ul>
</li> </li>
<li><a href="#"><%= t('layouts.navigation.view') %></a> <li id="menu_view"><a href="#" id="menu_view_link"><%= t('layouts.navigation.view') %></a>
<ul> <ul>
<li><%= navigation_link( t('layouts.navigation.calendar'), calendar_path, :title => t('layouts.navigation.calendar_title')) %></li> <li><%= navigation_link( t('layouts.navigation.calendar'), calendar_path, :title => t('layouts.navigation.calendar_title')) %></li>
<li><%= navigation_link( t('layouts.navigation.completed_tasks'), done_overview_path, {:accesskey=>"d", :title=>t('layouts.navigation.completed_tasks_title')} ) %></li> <li><%= navigation_link( t('layouts.navigation.completed_tasks'), done_overview_path, {:accesskey=>"d", :title=>t('layouts.navigation.completed_tasks_title')} ) %></li>
<li><%= navigation_link( t('layouts.navigation.feeds'), feeds_path, :title => t('layouts.navigation.feeds_title')) %></li> <li><%= navigation_link( t('layouts.navigation.feeds'), feeds_path, :title => t('layouts.navigation.feeds_title')) %></li>
<li><%= navigation_link( t('layouts.navigation.stats'), stats_path, :title => t('layouts.navigation.stats_title')) %></li> <li><%= navigation_link( t('layouts.navigation.stats'), stats_path, :title => t('layouts.navigation.stats_title')) %></li>
<li><hr/></li> <li><hr/></li>
<li id="menu_view_toggle_contexts"><%= link_to(t('layouts.toggle_contexts'), "#", {:title => t('layouts.toggle_contexts_title'), :id => "toggle-contexts-nav"}) %></li>
<li><%= link_to(t('layouts.toggle_notes'), "#", {:accesskey => "S", :title => t('layouts.toggle_notes_title'), :id => "toggle-notes-nav"}) %></li>
<%= group_view_by_menu_entry %> <%= group_view_by_menu_entry %>
</ul> </ul>
</li> </li>

View file

@ -11,7 +11,9 @@ When(/^I collapse the project container of "(.*?)"$/) do |project_name|
end end
When /^I toggle all collapsed context containers$/ do When /^I toggle all collapsed context containers$/ do
click_link 'Toggle collapsed contexts' open_view_menu do
click_link 'Toggle collapsed contexts'
end
end end
####### Context ####### ####### Context #######

View file

@ -30,7 +30,7 @@ When /^I edit the first note to "([^"]*)"$/ do |note_body|
end end
end end
When /^I toggle the note of "([^"]*)"$/ do |todo_description| When(/^I toggle the note of "([^"]*)"$/) do |todo_description|
todo = @current_user.todos.where(:description => todo_description).first todo = @current_user.todos.where(:description => todo_description).first
todo.should_not be_nil todo.should_not be_nil
@ -39,7 +39,9 @@ When /^I toggle the note of "([^"]*)"$/ do |todo_description|
end end
When /^I click Toggle Notes$/ do When /^I click Toggle Notes$/ do
click_link 'Toggle notes' open_view_menu do
click_link 'Toggle notes'
end
end end
When /^I toggle all notes$/ do When /^I toggle all notes$/ do

View file

@ -97,6 +97,23 @@ module TracksStepHelper
execute_javascript("$('#{sortable_css}').simulateDragSortable({move: #{delta}, handle: '.grip'});") execute_javascript("$('#{sortable_css}').simulateDragSortable({move: #{delta}, handle: '.grip'});")
end end
def open_view_menu
view_menu = "ul.sf-menu li#menu_view"
# click menu
view_menu_link = "#{view_menu} a#menu_view_link"
page.should have_css(view_menu_link, :visible => true)
page.find(view_menu_link).click
# wait for menu to be visible
view_menu_item = "#{view_menu} li#menu_view_toggle_contexts"
page.should have_css(view_menu_item)
within view_menu do
yield
end
end
def open_submenu_for(todo) def open_submenu_for(todo)
submenu_arrow = "div#line_todo_#{todo.id} img.todo-submenu" submenu_arrow = "div#line_todo_#{todo.id} img.todo-submenu"
page.should have_css(submenu_arrow, :visible=>true) page.should have_css(submenu_arrow, :visible=>true)