rebase to master to include i18n changes and fix merge conflicts

This commit is contained in:
Reinier Balt 2011-01-19 10:13:56 +01:00
parent 7a74025253
commit 97e8602ef9
13 changed files with 43 additions and 34 deletions

View file

@ -124,12 +124,12 @@ class TodosController < ApplicationController
@initial_context_name = params['default_context_name']
@initial_project_name = params['default_project_name']
@default_tags = @todo.project.default_tags unless @todo.project.nil?
@status_message = 'Added new next action'
@status_message += ' to tickler' if @todo.deferred?
@status_message += ' in pending state' if @todo.pending?
@status_message += ' in hidden state' if @todo.hidden?
@status_message = 'Added new project / ' + @status_message if @new_project_created
@status_message = 'Added new context / ' + @status_message if @new_context_created
@status_message = t('todos.added_new_next_action')
@status_message += ' ' + t('todos.to_tickler') if @todo.deferred?
@status_message += ' ' + t('todos.in_pending_state') if @todo.pending?
@status_message += ' ' + t('todos.in_hidden_state') if @todo.hidden?
@status_message = t('todos.added_new_project') + ' / ' + @status_message if @new_project_created
@status_message = t('todos.added_new_context') + ' / ' + @status_message if @new_context_created
end
render :action => 'create'
end
@ -190,6 +190,11 @@ class TodosController < ApplicationController
@saved = false;
@default_tags = current_user.projects.find_by_name(@initial_project_name).default_tags unless @initial_project_name.blank?
end
@status_message = @todos.size > 1 ? t('todos.added_new_next_action_plural') : t('todos.added_new_next_action_singular')
@status_message = t('todos.added_new_project') + ' / ' + @status_message if @new_project_created
@status_message = t('todos.added_new_context') + ' / ' + @status_message if @new_context_created
render :action => 'create_multiple'
end
format.xml do

View file

@ -11,6 +11,10 @@
TracksPages.show_edit_errors(html_for_error_messages());
<% end %>
<% if @saved
# only add these js functions if the project is saved
-%>
function update_project_list_page() {
<% if @state_changed -%>
remove_and_re_add_project();
@ -82,6 +86,9 @@ function html_for_project_settings() {
return "<%= source_view_is(:project) ? escape_javascript(render(:partial => 'project_settings', :object => @project )) : "" %>";
}
<% end # if @saved
-%>
function html_for_error_messages() {
return "<%= escape_javascript(error_messages_for('project')) %>";
}

View file

@ -21,13 +21,7 @@
-%>
function set_notification() {
<%-
status_message = 'Added new next action'
status_message += 's' if @todos.size > 1
status_message = 'Added new project / ' + status_message if @new_project_created
status_message = 'Added new context / ' + status_message if @new_context_created
-%>
TracksPages.page_notify('notice', "<%=status_message%>", 5);
TracksPages.page_notify('notice', "<%=@status_message%>", 5);
}
function clear_form() {

View file

@ -49,10 +49,10 @@ function show_new_todo_if_todo_was_recurring() {
TodoItemsContainer.ensureVisibleWithEffectAppear("<%=item_container_id(@new_recurring_todo)%>");
$('#<%=item_container_id(@new_recurring_todo)%>').append(html_for_new_recurring_todo());
$('#<%= dom_id(@new_recurring_todo, 'line')%>').effect('highlight', {}, 2000 );
TracksPages.page_notify('notice', "Action was deleted. Because this action is recurring, a new action was added", 5);
TracksPages.page_notify('notice', "<%=t('todos.recurring_action_deleted')%>", 5);
<% else -%>
<% if @todo.recurring_todo.todos.active.count == 0 && @new_recurring_todo.nil? -%>
TracksPages.page_notify('notice', "There is no next action after the recurring action you just deleted. The recurrence is completed", 5);
TracksPages.page_notify('notice', "<%=t('todos.completed_recurrence_completed')%>", 5);
<% end -%>
<% end -%>
<% end -%>
@ -75,5 +75,4 @@ function html_for_new_recurring_todo() {
<% end
# if @saved
-%>
>>>>>>> get destroying of actions working
-%>

View file

@ -528,8 +528,11 @@ en:
completed_in_archive: "There are {{count}} completed actions in the archive."
completed_more_than_x_days_ago: "Completed more than {{count}} days ago"
added_new_next_action: "Added new next action"
added_new_next_action_singular: "Added new next action"
added_new_next_action_plural: "Added new next actions"
to_tickler: "to tickler"
in_pending_state: "in pending state"
in_hidden_state: "in hidden state"
recurring_action_deleted: "Action was deleted. Because this action is recurring, a new action was added"
completed_recurrence_completed: "There is no next action after the recurring action you just deleted. The recurrence is completed"
error_deleting_item: "There was an error deleting the item {{description}}"

View file

@ -17,7 +17,7 @@ Feature: Manage users
Scenario: Add new account
When I go to the manage users page
And I follow "Signup new user"
And I follow "Sign up new user"
Then I should be on the signup page
When I submit the signup form with username "new.user", password "secret123" and confirm with "secret123"
Then I should be on the manage users page

View file

@ -26,7 +26,7 @@ Feature: Show statistics
And I should see "you have a total of 9 actions"
And I should see "2 of these are completed"
Then I should see "Totals"
And I should see "Actions"
And I should see "actions"
And I should see "Contexts"
And I should see "Projects"
And I should see "Tags"

View file

@ -74,9 +74,4 @@ end
Then /^he should see that a context named "([^\"]*)" is not present$/ do |context_name|
Then "I should not see \"#{context_name} (\""
end
Then /^I should see feeds for "([^"]*)" in list of "([^"]*)"$/ do |name, list_type|
xpath= "//div[@id='feeds-for-#{list_type}']//strong"
name.should == response.selenium.get_text("xpath=#{xpath}")
end
end

View file

@ -1,9 +1,9 @@
Then /^I should see a message that you need a context to get feeds for contexts$/ do
Then "I should see \"There need to be at least one context before you can request a feed\""
Then "I should see \"There needs to be at least one context before you can request a feed\""
end
Then /^I should see a message that you need a project to get feeds for projects$/ do
Then "I should see \"There need to be at least one project before you can request a feed\""
Then "I should see \"There needs to be at least one project before you can request a feed\""
end
Then /^I should see feeds for projects$/ do
@ -29,3 +29,9 @@ Then /^I should see "([^"]*)" as the selected context$/ do |context_name|
scope.should have_selector("option[selected=\"selected\"]", :content => context_name)
end
end
Then /^I should see feeds for "([^"]*)" in list of "([^"]*)"$/ do |name, list_type|
selenium.wait_for :wait_for => :ajax, :javascript_framework => :jquery
xpath= "//div[@id='feeds-for-#{list_type}']//strong"
name.should == response.selenium.get_text("xpath=#{xpath}")
end

View file

@ -12,5 +12,4 @@ end
Then /^the multiple action form should not be visible$/ do
selenium.is_visible("todo_multi_add").should == false
end
end

View file

@ -236,4 +236,4 @@ end
Then /^a confirmation for adding a new context "([^"]*)" should be asked$/ do |context_name|
selenium.get_confirmation.should == "New context \"#{context_name}\" will be also created. Are you sure?"
end
end

View file

@ -513,7 +513,8 @@ var ContextListPage = {
/* delete a context using the x button */
$('a.delete_context_button').live('click', function(evt){
if(confirm("Are you sure that you want to "+this.title+"? Be aware that this will also delete all (repeating) actions in this context!")){
/* TODO: move from this.title to this.x-messsage or something similar */
if(confirm(this.title)){
delete_with_ajax_and_block_element(this.href, $(this).parents('.context'));
}
return false;

View file

@ -126,9 +126,9 @@ class TodosControllerTest < ActionController::TestCase
def test_update_todo_to_deferred_is_reflected_in_badge_count
login_as(:admin_user)
get :index
assert_equal 10, assigns['count']
assert_equal 11, assigns['count']
xhr :post, :update, :id => 1, :_source_view => 'todo', "context_name"=>"library", "project_name"=>"Make more money than Billy Gates", "todo"=>{"id"=>"1", "notes"=>"", "description"=>"Call Warren Buffet to find out how much he makes per day", "due"=>"30/11/2006", "show_from"=>"30/11/2030"}, "tag_list"=>"foo bar"
assert_equal 9, assigns['down_count']
assert_equal 10, assigns['down_count']
end
def test_update_todo
@ -313,7 +313,7 @@ class TodosControllerTest < ActionController::TestCase
def test_mobile_index_assigns_down_count
login_as(:admin_user)
get :index, { :format => "m" }
assert_equal 10, assigns['down_count']
assert_equal 11, assigns['down_count']
end
def test_mobile_create_action_creates_a_new_todo