mirror of
https://github.com/TracksApp/tracks.git
synced 2025-12-24 03:00:12 +01:00
fix the deprecation warnings that were shown during the tests
This commit is contained in:
parent
a832417c59
commit
09830d044d
13 changed files with 23 additions and 22 deletions
|
|
@ -22,7 +22,7 @@ function clear_form() {
|
|||
}
|
||||
|
||||
function html_for_context_listing() {
|
||||
return "<%= @saved ? escape_javascript(render(:partial => 'context_listing', :locals => { :context_listing => @context })) : "" %>";
|
||||
return "<%= @saved ? escape_javascript(render(:partial => 'context_listing', :object => @context )) : "" %>";
|
||||
}
|
||||
|
||||
function html_for_error_messages() {
|
||||
|
|
|
|||
|
|
@ -17,5 +17,5 @@ function set_focus() {
|
|||
}
|
||||
|
||||
function html_for_edit_form() {
|
||||
return "<%= escape_javascript(render(:partial => 'context_form', :locals => { :context_form => @context })) %>"
|
||||
return "<%= escape_javascript(render(:partial => 'context_form', :object => @context)) %>"
|
||||
}
|
||||
|
|
@ -5,7 +5,7 @@
|
|||
<% end -%>
|
||||
<%= project.name -%></h2>
|
||||
<div id="<%= dom_id(project, "container")%>">
|
||||
<%= render :partial => "projects/project_settings", :locals => { :project => project, :collapsible => collapsible } %>
|
||||
<%= render :partial => "projects/project_settings", :object => project, :locals => { :collapsible => collapsible } %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
<% project = project_settings -%>
|
||||
<div id="<%= dom_id(project) %>" class="project">
|
||||
<div class="project_settings">This project
|
||||
<% if project.completed? -%>has been marked as completed
|
||||
|
|
|
|||
|
|
@ -41,5 +41,5 @@ function html_for_error_messages() {
|
|||
}
|
||||
|
||||
function html_for_project_listing() {
|
||||
return "<%= @saved ? escape_javascript(render(:partial => 'project_listing', :locals => { :project_listing => @project })) : "" %>";
|
||||
return "<%= @saved ? escape_javascript(render(:partial => 'project_listing', :object => @project)) : "" %>";
|
||||
}
|
||||
|
|
@ -17,5 +17,5 @@ function set_focus() {
|
|||
}
|
||||
|
||||
function html_for_edit_form() {
|
||||
return "<%= escape_javascript(render(:partial => 'project_form', :locals => { :project_form => @project })) %>"
|
||||
return "<%= escape_javascript(render(:partial => 'project_form', :object => @project)) %>"
|
||||
}
|
||||
|
|
@ -4,7 +4,7 @@
|
|||
</div>
|
||||
|
||||
<%= render :partial => @project, :locals => {:collapsible => false } %>
|
||||
<%= render :partial => "todos/deferred", :locals => { :deferred => @deferred, :collapsible => false, :append_descriptor => t('projects.todos_append'), :parent_container_type => 'project', :pending => @pending } %>
|
||||
<%= render :partial => "todos/deferred", :object => @deferred, :locals => { :collapsible => false, :append_descriptor => t('projects.todos_append'), :parent_container_type => 'project', :pending => @pending } %>
|
||||
<% unless @max_completed==0 -%>
|
||||
<%= render :partial => "todos/completed", :object => @done, :locals => { :collapsible => false, :suppress_project => true, :append_descriptor => t('projects.todos_append') } %>
|
||||
<% end -%>
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ function remove_and_re_add_project() {
|
|||
# render it into the function.
|
||||
-%>
|
||||
function html_for_project_listing() {
|
||||
return "<%= source_view_is(:project_list) ? escape_javascript(render(:partial => 'project_listing', :locals => { :project_listing => @project })) : "" %>";
|
||||
return "<%= source_view_is(:project_list) ? escape_javascript(render(:partial => 'project_listing', :object => @project )) : "" %>";
|
||||
}
|
||||
|
||||
function html_for_sidebar() {
|
||||
|
|
@ -79,7 +79,7 @@ function html_for_sidebar() {
|
|||
}
|
||||
|
||||
function html_for_project_settings() {
|
||||
return "<%= source_view_is(:project) ? escape_javascript(render(:partial => 'project_settings', :locals => { :project => @project })) : "" %>";
|
||||
return "<%= source_view_is(:project) ? escape_javascript(render(:partial => 'project_settings', :object => @project )) : "" %>";
|
||||
}
|
||||
|
||||
function html_for_error_messages() {
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ function add_todo_to_existing_context() {
|
|||
function update_predecessors() {
|
||||
<% @todo.uncompleted_predecessors.each do |p| -%>
|
||||
if ($('<%=item_container_id(p)%>')) {
|
||||
$('#<%=dom_id(p)%>').html('<%= escape_javascript(render(:partial => 'todos/todo', :locals => { :todo => p, :parent_container_type => parent_container_type, :source_view => @source_view }))%>');
|
||||
$('#<%=dom_id(p)%>').html('<%= escape_javascript(render(:partial => p, :locals => { :parent_container_type => parent_container_type, :source_view => @source_view }))%>');
|
||||
}
|
||||
<% end -%>
|
||||
}
|
||||
|
|
@ -59,9 +59,9 @@ function html_for_error_messages() {
|
|||
}
|
||||
|
||||
function html_for_new_context() {
|
||||
return "<%= @saved && @new_context_created ? escape_javascript(render(:partial => 'contexts/context', :locals => { :context => @todo.context, :collapsible => true })) : "" %>";
|
||||
return "<%= @saved && @new_context_created ? escape_javascript(render(:partial => @todo.context, :locals => { :collapsible => true })) : "" %>";
|
||||
}
|
||||
|
||||
function html_for_new_todo() {
|
||||
return "<%= @saved ? escape_javascript(render(:partial => 'todos/todo', :locals => { :todo => @todo, :parent_container_type => parent_container_type, :source_view => @source_view })) : "" %>";
|
||||
return "<%= @saved ? escape_javascript(render(:partial => @todo, :locals => { :parent_container_type => parent_container_type, :source_view => @source_view })) : "" %>";
|
||||
}
|
||||
|
|
@ -55,14 +55,14 @@ function add_todo_to_existing_context() {
|
|||
<% end
|
||||
show = should_show_new_item # to hide html if not necessary
|
||||
@todos.each do |todo|
|
||||
html = show ? escape_javascript(render(:partial => 'todos/todo', :locals => { :todo => todo, :parent_container_type => parent_container_type, :source_view => @source_view })) : "" -%>
|
||||
html = show ? escape_javascript(render(:partial => todo, :locals => { :parent_container_type => parent_container_type, :source_view => @source_view })) : "" -%>
|
||||
$('#<%=item_container_id(todo)%>').append('<%= html %>');
|
||||
$('#<%= dom_id(todo)%>').effect('highlight', {}, 3000);
|
||||
<% end %>
|
||||
}
|
||||
|
||||
function html_for_new_context() {
|
||||
return "<%= @saved && @new_context_created ? escape_javascript(render(:partial => 'contexts/context', :locals => { :context => @todo.context, :collapsible => true })) : "" %>";
|
||||
return "<%= @saved && @new_context_created ? escape_javascript(render(:partial => @todo.context, :locals => { :collapsible => true })) : "" %>";
|
||||
}
|
||||
|
||||
<% else # if @saved -%>
|
||||
|
|
|
|||
|
|
@ -60,13 +60,13 @@ function activate_pending_todos() {
|
|||
<% if source_view_is(:project) or source_view_is(:tag) %>
|
||||
$('#<%=dom_id(t)%>').remove();
|
||||
<% end -%>
|
||||
$('#<%=item_container_id(t)%>').append("<%=escape_javascript(render(:partial => 'todos/todo', :locals => { :todo => t, :parent_container_type => parent_container_type }))%>");
|
||||
$('#<%=item_container_id(t)%>').append("<%=escape_javascript(render(:partial => t, :locals => { :parent_container_type => parent_container_type }))%>");
|
||||
$('#<%= dom_id(t, 'line')%>').effect('highlight', {}, 2000 );
|
||||
<% end -%>
|
||||
}
|
||||
|
||||
function html_for_new_recurring_todo() {
|
||||
return "<%= @saved && @new_recurring_todo ? escape_javascript(render(:partial => 'todos/todo', :locals => { :todo => @new_recurring_todo, :parent_container_type => parent_container_type })) : "" %>";
|
||||
return "<%= @saved && @new_recurring_todo ? escape_javascript(render(:partial => @new_recurring_todo, :locals => { :parent_container_type => parent_container_type })) : "" %>";
|
||||
}
|
||||
|
||||
<% end
|
||||
|
|
|
|||
|
|
@ -91,7 +91,7 @@ function activate_pending_todos(next_steps) {
|
|||
next_steps.go();
|
||||
});
|
||||
<% end -%>
|
||||
$('#<%= item_container_id(t) %>').append("<%= escape_javascript(render(:partial => 'todos/todo', :locals => { :todo => t, :parent_container_type => parent_container_type }))%>");
|
||||
$('#<%= item_container_id(t) %>').append("<%= escape_javascript(render(:partial => t, :locals => { :parent_container_type => parent_container_type }))%>");
|
||||
highlight_todo('#<%= dom_id(t)%>');
|
||||
<% end -%>
|
||||
<% end -%>
|
||||
|
|
@ -105,7 +105,7 @@ function block_predecessors(next_steps) {
|
|||
$('#<%= dom_id(t) %>').fadeOut(400, function() {
|
||||
$('#<%= dom_id(t) %>').remove();
|
||||
<% if source_view_is(:project) or source_view_is(:tag) # Insert it in deferred/pending block if existing -%>
|
||||
$('#<%= item_container_id(t) %>').append("<%= escape_javascript(render(:partial => 'todos/todo', :locals => { :todo => t, :parent_container_type => parent_container_type }))%>");
|
||||
$('#<%= item_container_id(t) %>').append("<%= escape_javascript(render(:partial => t, :locals => { :parent_container_type => parent_container_type }))%>");
|
||||
highlight_todo('#<%= dom_id(t)%>');
|
||||
<% end -%>
|
||||
});
|
||||
|
|
@ -125,9 +125,9 @@ function remove_source_container(next_steps) {
|
|||
}
|
||||
|
||||
function html_for_todo() {
|
||||
return "<%= @saved ? escape_javascript(render(:partial => 'todos/todo', :locals => { :todo => @todo, :parent_container_type => "completed" })) : "" %>";
|
||||
return "<%= @saved ? escape_javascript(render(:partial => @todo, :locals => { :parent_container_type => "completed" })) : "" %>";
|
||||
}
|
||||
|
||||
function html_for_recurring_todo() {
|
||||
return "<%= @saved ? escape_javascript(render(:partial => 'todos/todo', :locals => { :todo => @new_recurring_todo, :parent_container_type => parent_container_type })) : "" %>";
|
||||
return "<%= @saved ? escape_javascript(render(:partial => @new_recurring_todo, :locals => { :parent_container_type => parent_container_type })) : "" %>";
|
||||
}
|
||||
|
|
@ -92,11 +92,11 @@ function insert_new_context_with_updated_todo(next_steps) {
|
|||
}
|
||||
|
||||
function html_for_todo() {
|
||||
return "<%= @saved ? escape_javascript(render(:partial => 'todos/todo', :locals => { :todo => @todo, :parent_container_type => parent_container_type })) : "" %>";
|
||||
return "<%= @saved ? escape_javascript(render(:partial => @todo, :locals => { :parent_container_type => parent_container_type })) : "" %>";
|
||||
}
|
||||
|
||||
function html_for_new_context() {
|
||||
return "<%= @saved && @new_context_created ? escape_javascript(render(:partial => 'contexts/context', :locals => { :context => @new_context, :collapsible => true })) : "" %>";
|
||||
return "<%= @saved && @new_context_created ? escape_javascript(render(:partial => @new_context, :locals => { :collapsible => true })) : "" %>";
|
||||
}
|
||||
|
||||
function html_for_error_messages() {
|
||||
|
|
@ -106,7 +106,7 @@ function html_for_error_messages() {
|
|||
function update_predecessors() {
|
||||
<% @todo.uncompleted_predecessors.each do |p| -%>
|
||||
if ($('#<%=item_container_id(p)%>')) {
|
||||
$('#<%=dom_id(p)%>').html('<%=escape_javascript(render(:partial => 'todos/todo', :locals => { :todo => p, :parent_container_type => parent_container_type }))%>');
|
||||
$('#<%=dom_id(p)%>').html('<%=escape_javascript(render(:partial => p, :locals => { :parent_container_type => parent_container_type }))%>');
|
||||
}
|
||||
<% end -%>
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue