refactor application.rb further and migrate recurring todos

next: get tests for recurring todos
This commit is contained in:
Reinier Balt 2010-12-03 17:52:24 +01:00
parent 484356fe07
commit cafa774b4c
33 changed files with 688 additions and 571 deletions

View file

@ -4,7 +4,7 @@
<% else -%>
TracksPages.hide_errors();
hide_empty_message();
set_page_badge(<%= @down_count %>);
TracksPages.set_page_badge(<%= @down_count %>);
update_active_projects_container();
add_project();
clear_form();
@ -13,19 +13,23 @@
TracksPages.show_errors(html_for_error_messages());
<% end -%>
/* TODO: make this generic for all pages with lists */
function hide_empty_message() {
$('projects-empty-nd').hide();
}
/* TODO: refactor and move this to application.js */
function add_project() {
$('#list-active-projects').append(html_for_project_listing());
}
/* TODO: refactor and move this to application.js */
function clear_form() {
$('#project_form').clearForm();
$('#project_form input:text:first').focus();
}
/* TODO: refactor and move this to application.js */
function update_active_projects_container() {
ProjectListPage.set_state_container_visibility('active', true);
ProjectListPage.update_state_count('active', <%=@active_projects_count%>);