diff --git a/tracks/app/controllers/context_controller.rb b/tracks/app/controllers/context_controller.rb index 641b1cbe..778a0435 100644 --- a/tracks/app/controllers/context_controller.rb +++ b/tracks/app/controllers/context_controller.rb @@ -41,7 +41,6 @@ class ContextController < ApplicationController # def show @context = Context.find(@params["id"]) - @places = Context.find_all @projects = Project.find_all @page_title = "Context: #{@context.name.capitalize}" @not_done = Todo.find_all( "context_id=#{@context.id} AND done=0", "created ASC" ) diff --git a/tracks/app/controllers/project_controller.rb b/tracks/app/controllers/project_controller.rb index 3edffa12..dfbc9a75 100644 --- a/tracks/app/controllers/project_controller.rb +++ b/tracks/app/controllers/project_controller.rb @@ -87,23 +87,5 @@ class ProjectController < ApplicationController end end - - # Toggles the 'done' status of the action - def toggle_check - item = Todo.find( @params['id'] ) - - case item.done - when 0: item.done = 1; item.completed = Time.now() - when 1: item.done = 0; item.completed = nil - end - - if item.save - flash["confirmation"] = "Marked next action as completed" - redirect_to( :action => "list" ) - else - flash["warning"] = "Couldn't mark next action as completed" - redirect_to( :action => "list" ) - end - end end diff --git a/tracks/app/controllers/todo_controller.rb b/tracks/app/controllers/todo_controller.rb index 6fa630bd..7480127d 100644 --- a/tracks/app/controllers/todo_controller.rb +++ b/tracks/app/controllers/todo_controller.rb @@ -12,8 +12,8 @@ class TodoController < ApplicationController # def list @page_title = "List tasks" - @places = Context.find_all @projects = Project.find_all + @places = Context.find_all @done = Todo.find_all( "done=1", "completed DESC", 5 ) @count = Todo.count( "done=0" ) end diff --git a/tracks/app/helpers/application_helper.rb b/tracks/app/helpers/application_helper.rb index 09b7ec69..689810bd 100644 --- a/tracks/app/helpers/application_helper.rb +++ b/tracks/app/helpers/application_helper.rb @@ -49,5 +49,15 @@ module ApplicationHelper end end + def get_projects() + @projects = Project.find_all + return @@projects + end + + def get_contexts() + @places = Context.find_all + return @@places + end + end diff --git a/tracks/app/views/context/list.rhtml b/tracks/app/views/context/list.rhtml index d49bcf52..5565cfa5 100644 --- a/tracks/app/views/context/list.rhtml +++ b/tracks/app/views/context/list.rhtml @@ -1,6 +1,6 @@
- +
<% row = 1 %> <% for @context in @contexts %> <% if row % 2 == 0 %> diff --git a/tracks/app/views/context/show.rhtml b/tracks/app/views/context/show.rhtml index f681f248..1a8512eb 100644 --- a/tracks/app/views/context/show.rhtml +++ b/tracks/app/views/context/show.rhtml @@ -21,9 +21,7 @@


<%= text_field( "new_item", "due", {"size" => 10, "maxlength" => 10} ) %> diff --git a/tracks/app/views/project/_not_done.rhtml b/tracks/app/views/project/_not_done.rhtml new file mode 100644 index 00000000..e24caa63 --- /dev/null +++ b/tracks/app/views/project/_not_done.rhtml @@ -0,0 +1,16 @@ +<% @item = not_done %> + + + + + \ No newline at end of file diff --git a/tracks/app/views/project/list.rhtml b/tracks/app/views/project/list.rhtml index 18b4a76b..ba936023 100644 --- a/tracks/app/views/project/list.rhtml +++ b/tracks/app/views/project/list.rhtml @@ -1,6 +1,6 @@
-
<%= check_box( "item", "done", "onclick" => "document.location.href='/todo/toggle_check/#{@item.id}'" ) %><%= link_to( $edit_img, { :action => "edit", :id => @item.id }, :title => "Edit item" ) + " " + link_to($delete_img, { :controller => "todo", :action => "destroy", :id => @item.id }, :title => "Delete item", :confirm => "Are you sure you want to delete this entry: #{@item.description}" ) + " " %><%= due_date( @item.due ) %> + <%= @item.description %> + <% if @item.project_id %> + <%= link_to( "[C]", { :controller => "context", :action => "show", :id => @item.context_id }, :title => "View context: #{@item.context['name'].capitalize}" ) %> + <% end %> + <% if @item.notes? %> + <%= "" + $notes_img + "" %> + <% m_notes = markdown( @item.notes ) %> + <%= "
" + m_notes + "
" %> + <% end %> +
+
<% row = 1 %> <% for @project in @projects %> <% if row % 2 == 0 %> diff --git a/tracks/app/views/project/show.rhtml b/tracks/app/views/project/show.rhtml index b34558a2..3dd1c70b 100644 --- a/tracks/app/views/project/show.rhtml +++ b/tracks/app/views/project/show.rhtml @@ -6,32 +6,10 @@ <% if @not_done == [] %>

There are no next actions yet in this project

<% else %> - +
+ <%= render_collection_of_partials "not_done", @not_done %> +
<% end %>
@@ -49,9 +27,7 @@



diff --git a/tracks/app/views/todo/list.rhtml b/tracks/app/views/todo/list.rhtml index a89e880f..c3c54ae8 100644 --- a/tracks/app/views/todo/list.rhtml +++ b/tracks/app/views/todo/list.rhtml @@ -38,17 +38,13 @@





diff --git a/tracks/public/stylesheets/standard.css b/tracks/public/stylesheets/standard.css index 52717333..b796728b 100644 --- a/tracks/public/stylesheets/standard.css +++ b/tracks/public/stylesheets/standard.css @@ -239,10 +239,6 @@ li { font-size: 1.1em; padding: 3px 0px; } - -td { - border: 1px solid #999; - } .even_row { background: #fff; @@ -251,7 +247,11 @@ td { .odd_row { background: #EDF3FE; } - + +table.list { + border: 1px solid #999; + } + .next_actions td { border: none; padding-top: 3px;