diff --git a/app/controllers/todos_controller.rb b/app/controllers/todos_controller.rb index 425ec678..dc865d81 100644 --- a/app/controllers/todos_controller.rb +++ b/app/controllers/todos_controller.rb @@ -8,7 +8,7 @@ class TodosController < ApplicationController append_before_filter :init, :except => [ :destroy, :completed, :completed_archive, :check_deferred, :toggle_check, :toggle_star, :edit, :update, :create, :calendar, :auto_complete_for_predecessor, :remove_predecessor, :add_predecessor] - append_before_filter :get_todo_from_params, :only => [ :edit, :toggle_check, :toggle_star, :show, :update, :destroy, :remove_predecessor] + append_before_filter :get_todo_from_params, :only => [ :edit, :toggle_check, :toggle_star, :show, :update, :destroy, :remove_predecessor, :show_notes] protect_from_forgery :except => [:auto_complete_for_predecessor] def index @@ -736,7 +736,19 @@ class TodosController < ApplicationController @project.save! redirect_to project_url(@project) end - + + def show_notes + @return_path=cookies[:mobile_url] ? cookies[:mobile_url] : mobile_path + respond_to do |format| + format.html { + redirect_to home_path, "Viewing note of todo is not implemented" + } + format.m { + render:action => "mobile_show_notes" + } + end + end + private def get_todo_from_params diff --git a/app/views/todos/_mobile_todo.rhtml b/app/views/todos/_mobile_todo.rhtml index 9e358ffa..39a705df 100644 --- a/app/views/todos/_mobile_todo.rhtml +++ b/app/views/todos/_mobile_todo.rhtml @@ -13,6 +13,7 @@ end -%> -%> <% end -%> <%= date_span -%> <%= link_to mobile_todo.description, todo_path(mobile_todo, :format => 'm') -%> +<%= link_to(image_tag("mobile_notes.png", :border => "0"), mobile_todo_show_notes_path(mobile_todo, :format => 'm')) -%> <% if parent_container_type == 'context' or parent_container_type == 'tag' -%> <%= " (" + link_to(mobile_todo.project.name, project_path(mobile_todo.project, :format => 'm')) + diff --git a/app/views/todos/mobile_show_notes.rhtml b/app/views/todos/mobile_show_notes.rhtml new file mode 100644 index 00000000..58281343 --- /dev/null +++ b/app/views/todos/mobile_show_notes.rhtml @@ -0,0 +1,5 @@ +

Next action description (<%= link_to "Go back", @return_path %>)

+<%= link_to @todo.description, todo_path(@todo, :format => 'm') -%> +

Notes

+<%= format_note(@todo.notes) %> +<%= link_to "Back", @return_path %> \ No newline at end of file diff --git a/config/routes.rb b/config/routes.rb index 9fe57d6b..bca2a5de 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -48,6 +48,9 @@ ActionController::Routing::Routes.draw do |map| todos.mobile 'mobile', :action => "index", :format => 'm' todos.mobile_abbrev 'm', :action => "index", :format => 'm' todos.mobile_abbrev_new 'm/new', :action => "new", :format => 'm' + + todos.mobile_todo_show_notes 'todos/notes/:id.m', :action => "show_notes", :format => 'm' + todos.todo_show_notes 'todos/notes/:id', :action => "show_notes" end map.root :controller => 'todos' # Make OpenID happy because it needs #root_url defined diff --git a/public/images/mobile_notes.png b/public/images/mobile_notes.png new file mode 100644 index 00000000..77886b40 Binary files /dev/null and b/public/images/mobile_notes.png differ