<%= render :partial => "shared/add_new_item_form" %>
-<%= render "shared/sidebar" %>
+<%= render "sidebar/sidebar" %>
\ No newline at end of file
diff --git a/tracks/app/views/feed/index.rhtml b/tracks/app/views/feed/index.rhtml
index 9e9bbb5c..4a1b6f0e 100644
--- a/tracks/app/views/feed/index.rhtml
+++ b/tracks/app/views/feed/index.rhtml
@@ -78,5 +78,5 @@
-
Toggle notes |
+ <%= link_to_function("Toggle notes", nil, {:accesskey => "S", :title => "Toggle all notes"}) do |page|
+ page.select('.notes').each { |e| e.toggle }
+ end
+ -%> |
<% if @user.is_admin? -%>
<%= link_to "Add users", :controller => "login", :action => "signup" %> |
<% end -%>
diff --git a/tracks/app/views/project/show.rhtml b/tracks/app/views/project/show.rhtml
index f1abe1e1..f31e0948 100644
--- a/tracks/app/views/project/show.rhtml
+++ b/tracks/app/views/project/show.rhtml
@@ -45,5 +45,5 @@
<%= render :partial => "shared/add_new_item_form" %>
- <%= render "shared/sidebar" %>
+ <%= render "sidebar/sidebar" %>
diff --git a/tracks/app/views/shared/_add_new_item_form.rhtml b/tracks/app/views/shared/_add_new_item_form.rhtml
index 3b11ce67..cad1a981 100644
--- a/tracks/app/views/shared/_add_new_item_form.rhtml
+++ b/tracks/app/views/shared/_add_new_item_form.rhtml
@@ -46,15 +46,15 @@ Event.observe($('todo_project_name'), "click", projectAutoCompleter.activate.bin
Due
-<%= text_field("todo", "due", "size" => 10, "class" => "Date", "onFocus" => "Calendar.setup", "tabindex" => 5, "autocomplete" => "off") %>
+<%= text_field("todo", "due", "size" => 10, "class" => "Date", "onfocus" => "Calendar.setup", "tabindex" => 5, "autocomplete" => "off") %>
Show from
- <%= text_field("todo", "show_from", "size" => 10, "class" => "Date", "onFocus" => "Calendar.setup", "tabindex" => 6, "autocomplete" => "off") %>
+ <%= text_field("todo", "show_from", "size" => 10, "class" => "Date", "onfocus" => "Calendar.setup", "tabindex" => 6, "autocomplete" => "off") %>
<%= source_view_tag( @source_view ) %>
-
+
<% end -%>
<%= observe_field "todo_due",
diff --git a/tracks/app/views/shared/sidebar.rhtml b/tracks/app/views/shared/sidebar.rhtml
deleted file mode 100644
index f2805c4a..00000000
--- a/tracks/app/views/shared/sidebar.rhtml
+++ /dev/null
@@ -1,44 +0,0 @@
-
Active Projects:
-
- <% for project in @projects.select{|p| p.active? } -%>
-
- <% end -%>
-
-
-<% if @user.preference.show_hidden_projects_in_sidebar %>
-
Hidden Projects:
-
- <% for project in @projects.select{|p| p.hidden? } -%>
-
- <% end -%>
-
-<% end %>
-
-<% if @user.preference.show_completed_projects_in_sidebar %>
-
Completed Projects:
-
- <% for project in @projects.select{|p| p.completed? } -%>
-
- <% end -%>
-
-<% end %>
-
-
Active Contexts:
-
- <% for context in @contexts.reject{|c| c.hide? } -%>
-
- <% end -%>
-
-
-<% if @user.preference.show_hidden_contexts_in_sidebar %>
-
Hidden Contexts:
-
- <% for context in @contexts.reject{|c| !c.hide? } -%>
-
- <% end -%>
-
-<% end %>
diff --git a/tracks/app/views/sidebar/_context.rhtml b/tracks/app/views/sidebar/_context.rhtml
new file mode 100644
index 00000000..8295d64e
--- /dev/null
+++ b/tracks/app/views/sidebar/_context.rhtml
@@ -0,0 +1 @@
+
<%= link_to( sanitize(context.name), { :controller => "context", :action => "show", :name => urlize(context.name) } ) + " (" + count_undone_todos(context,"actions") + ")"%>
diff --git a/tracks/app/views/sidebar/_context_list.rhtml b/tracks/app/views/sidebar/_context_list.rhtml
new file mode 100644
index 00000000..def5cad2
--- /dev/null
+++ b/tracks/app/views/sidebar/_context_list.rhtml
@@ -0,0 +1,8 @@
+
<%= list_name %>
+
+<% if contexts.empty? -%>
+ None
+<% else -%>
+ <%= render :partial => "sidebar/context", :collection => contexts -%>
+<% end -%>
+
\ No newline at end of file
diff --git a/tracks/app/views/sidebar/_project.rhtml b/tracks/app/views/sidebar/_project.rhtml
new file mode 100644
index 00000000..176f8a48
--- /dev/null
+++ b/tracks/app/views/sidebar/_project.rhtml
@@ -0,0 +1 @@
+
<%= link_to( sanitize(project.name), { :controller => "project", :action => "show", :name => urlize(project.name) } ) + " (" + count_undone_todos(project,"actions") + ")" %>
diff --git a/tracks/app/views/sidebar/_project_list.rhtml b/tracks/app/views/sidebar/_project_list.rhtml
new file mode 100644
index 00000000..457726f7
--- /dev/null
+++ b/tracks/app/views/sidebar/_project_list.rhtml
@@ -0,0 +1,8 @@
+
<%= list_name %>
+
+<% if projects.empty? %>
+ None
+<% else %>
+ <%= render :partial => "sidebar/project", :collection => projects %>
+<% end %>
+
\ No newline at end of file
diff --git a/tracks/app/views/sidebar/sidebar.rhtml b/tracks/app/views/sidebar/sidebar.rhtml
new file mode 100644
index 00000000..e2756ec7
--- /dev/null
+++ b/tracks/app/views/sidebar/sidebar.rhtml
@@ -0,0 +1,29 @@
+
\ No newline at end of file
diff --git a/tracks/app/views/todo/_done.rhtml b/tracks/app/views/todo/_done.rhtml
index b3fbaf2e..a40b5dcc 100644
--- a/tracks/app/views/todo/_done.rhtml
+++ b/tracks/app/views/todo/_done.rhtml
@@ -15,7 +15,7 @@
<% end %>
<% if done.notes? -%>
- <%= toggle_show_notes( done ) %>
+ <%= render :partial => "todo/toggle_notes", :locals => { :item => done } %>
<% end -%>
<% end %>
diff --git a/tracks/app/views/todo/_edit_form.rhtml b/tracks/app/views/todo/_edit_form.rhtml
index 039b56a6..f6ce82ca 100644
--- a/tracks/app/views/todo/_edit_form.rhtml
+++ b/tracks/app/views/todo/_edit_form.rhtml
@@ -36,11 +36,11 @@
Due
-
+
Show from
-
+
<% if controller.controller_name == "project" || @item.deferred? -%>
diff --git a/tracks/app/views/todo/_item.rhtml b/tracks/app/views/todo/_item.rhtml
index f1f8c997..a121ac17 100644
--- a/tracks/app/views/todo/_item.rhtml
+++ b/tracks/app/views/todo/_item.rhtml
@@ -35,7 +35,7 @@
<% end -%>
<% if item.notes? -%>
- <%= toggle_show_notes( item ) %>
+ <%= render :partial => "todo/toggle_notes", :locals => { :item => item } %>
<% end -%>
diff --git a/tracks/app/views/todo/index.rhtml b/tracks/app/views/todo/index.rhtml
index e48ff323..242e38cd 100644
--- a/tracks/app/views/todo/index.rhtml
+++ b/tracks/app/views/todo/index.rhtml
@@ -10,5 +10,5 @@
<%= render :partial => "shared/add_new_item_form" %>
- <%= render "shared/sidebar" %>
+ <%= render "sidebar/sidebar" %>
\ No newline at end of file
diff --git a/tracks/app/views/todo/tickler.rhtml b/tracks/app/views/todo/tickler.rhtml
index 07ec3e22..5269b098 100644
--- a/tracks/app/views/todo/tickler.rhtml
+++ b/tracks/app/views/todo/tickler.rhtml
@@ -17,5 +17,5 @@
<%= render :partial => "shared/add_new_item_form" %>
- <%= render "shared/sidebar" %>
+ <%= render "sidebar/sidebar" %>
\ No newline at end of file
diff --git a/tracks/public/javascripts/toggle_notes.js b/tracks/public/javascripts/toggle_notes.js
deleted file mode 100644
index 5ad9f810..00000000
--- a/tracks/public/javascripts/toggle_notes.js
+++ /dev/null
@@ -1,12 +0,0 @@
-function toggleAll(className) {
- document.getElementsByClassName(className).each(function(elem){
- if (elem.style.display == 'block')
- {
- elem.style.display = 'none';
- }
- else
- {
- elem.style.display = 'block';
- }
- });
-}
\ No newline at end of file