mirror of
https://github.com/TracksApp/tracks.git
synced 2025-12-30 05:48:50 +01:00
31 lines
1 KiB
Text
31 lines
1 KiB
Text
<% if @saved -%>
|
|
TracksPages.page_notify('notice', "<%=@status_message%>", 5);
|
|
add_recurring_todo_to_active_container();
|
|
replace_form_with_empty_form();
|
|
$( "#new-recurring-todo" ).dialog( "close" );
|
|
TracksPages.set_page_badge(<%= @down_count %>);
|
|
<% else -%>
|
|
TracksPages.show_errors(html_for_error_messages());
|
|
<% end -%>
|
|
|
|
function replace_form_with_empty_form() {
|
|
$('div.recurring_container').html(html_for_empty_form());
|
|
}
|
|
|
|
function add_recurring_todo_to_active_container() {
|
|
$('#recurring_todos_container').append(html_for_recurring_todo());
|
|
$('#<%= dom_id(@recurring_todo)%>').effect('highlight', {}, 2000 );
|
|
$('#recurring-todos-empty-nd').hide();
|
|
}
|
|
|
|
function html_for_recurring_todo() {
|
|
return "<%= @saved ? escape_javascript(render(:partial => @recurring_todo)) : "" %>";
|
|
}
|
|
|
|
function html_for_empty_form() {
|
|
return "<%= @saved ? escape_javascript(render(:partial => 'recurring_todo_form')) : "" %>";
|
|
}
|
|
|
|
function html_for_error_messages() {
|
|
return "<%= escape_javascript(get_list_of_error_messages_for(@recurring_todo)) %>";
|
|
}
|