mirror of
https://github.com/TracksApp/tracks.git
synced 2025-12-16 23:30:12 +01:00
25 lines
589 B
Text
25 lines
589 B
Text
|
|
<% if @saved -%>
|
||
|
|
TracksForm.hide_errors();
|
||
|
|
add_note();
|
||
|
|
clear_form();
|
||
|
|
<% else -%>
|
||
|
|
TracksForm.show_errors(html_for_error_messages());
|
||
|
|
<% end -%>
|
||
|
|
|
||
|
|
function add_note() {
|
||
|
|
$('div#notes').append(html_for_note_summary());
|
||
|
|
$('#empty-n').hide();
|
||
|
|
}
|
||
|
|
|
||
|
|
function clear_form() {
|
||
|
|
$('#new-note').hide();
|
||
|
|
$('#edit-note-form').clearForm();
|
||
|
|
}
|
||
|
|
|
||
|
|
function html_for_error_messages() {
|
||
|
|
return "<%= escape_javascript(error_messages_for('project')) %>";
|
||
|
|
}
|
||
|
|
|
||
|
|
function html_for_note_summary() {
|
||
|
|
return "<%= @saved ? escape_javascript(render(:partial => 'notes_summary', :object => @note)) : "" %>";
|
||
|
|
}
|