Fix #969 by implementing a new mobile view for notes.

Did not create tests for it
This commit is contained in:
Reinier Balt 2010-08-03 22:27:54 +02:00
parent 2c6d514970
commit 110d3daf95
5 changed files with 23 additions and 2 deletions

View file

@ -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

View file

@ -13,6 +13,7 @@ end -%>
-%><span class="m_t">
<% 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' -%>
<%= "<span class=\"prj\"> (" +
link_to(mobile_todo.project.name, project_path(mobile_todo.project, :format => 'm')) +

View file

@ -0,0 +1,5 @@
<h2>Next action description (<%= link_to "Go back", @return_path %>)</h2>
<%= link_to @todo.description, todo_path(@todo, :format => 'm') -%></h2>
<h2>Notes</h2>
<%= format_note(@todo.notes) %>
<%= link_to "Back", @return_path %>

View file

@ -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

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB