diff --git a/app/controllers/contexts_controller.rb b/app/controllers/contexts_controller.rb index 6be16f2c..b9c1aa47 100644 --- a/app/controllers/contexts_controller.rb +++ b/app/controllers/contexts_controller.rb @@ -207,8 +207,8 @@ class ContextsController < ApplicationController @active_contexts = current_user.contexts.active @hidden_contexts = current_user.contexts.hidden @down_count = @active_contexts.size + @hidden_contexts.size - cookies[:mobile_url]= {:value => request.request_uri, :secure => SITE_CONFIG['secure_cookies']} - render :action => 'index_mobile' + cookies[:mobile_url]= {:value => request.fullpath, :secure => SITE_CONFIG['secure_cookies']} + render end end @@ -217,9 +217,9 @@ class ContextsController < ApplicationController @page_title = "TRACKS::List actions in "+@context.name @not_done = @not_done_todos.select {|t| t.context_id == @context.id } @down_count = @not_done.size - cookies[:mobile_url]= {:value => request.request_uri, :secure => SITE_CONFIG['secure_cookies']} + cookies[:mobile_url]= {:value => request.fullpath, :secure => SITE_CONFIG['secure_cookies']} @mobile_from_context = @context.id - render :action => 'mobile_show_context' + render end end diff --git a/app/controllers/feedlist_controller.rb b/app/controllers/feedlist_controller.rb index 16d1ddc7..f0e0e991 100644 --- a/app/controllers/feedlist_controller.rb +++ b/app/controllers/feedlist_controller.rb @@ -6,7 +6,7 @@ class FeedlistController < ApplicationController @page_title = 'TRACKS::Feeds' unless mobile? - init_data_for_sidebar + init_data_for_sidebar else @projects = current_user.projects @contexts = current_user.contexts @@ -21,7 +21,7 @@ class FeedlistController < ApplicationController respond_to do |format| format.html { render :layout => 'standard' } - format.m { render :action => 'mobile_index' } + format.m end end diff --git a/app/controllers/login_controller.rb b/app/controllers/login_controller.rb index df44a246..fb421026 100644 --- a/app/controllers/login_controller.rb +++ b/app/controllers/login_controller.rb @@ -39,7 +39,7 @@ class LoginController < ApplicationController end respond_to do |format| format.html - format.m { render :action => 'login_mobile.html.erb', :layout => 'mobile' } + format.m { render :action => 'login', :layout => 'mobile' } end end diff --git a/app/controllers/notes_controller.rb b/app/controllers/notes_controller.rb index 4081611a..fc63407a 100644 --- a/app/controllers/notes_controller.rb +++ b/app/controllers/notes_controller.rb @@ -18,7 +18,7 @@ class NotesController < ApplicationController @page_title = "TRACKS::Note " + @note.id.to_s respond_to do |format| format.html - format.m { render :action => 'note_mobile' } + format.m end end @@ -29,7 +29,7 @@ class NotesController < ApplicationController @saved = @note.save respond_to do |format| - format.js + format.js format.xml do if @saved head :created, :location => note_url(@note), :text => "new note with id #{@note.id}" diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index 711f6dff..1f931324 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -324,8 +324,8 @@ class ProjectsController < ApplicationController @hidden_projects = current_user.projects.hidden @completed_projects = current_user.projects.completed @down_count = @active_projects.size + @hidden_projects.size + @completed_projects.size - cookies[:mobile_url]= {:value => request.request_uri, :secure => SITE_CONFIG['secure_cookies']} - render :action => 'index_mobile' + cookies[:mobile_url]= {:value => request.fullpath, :secure => SITE_CONFIG['secure_cookies']} + render end end @@ -336,9 +336,9 @@ class ProjectsController < ApplicationController else @project_default_context = t('projects.default_context', :context => @project.default_context.name) end - cookies[:mobile_url]= {:value => request.request_uri, :secure => SITE_CONFIG['secure_cookies']} + cookies[:mobile_url]= {:value => request.fullpath, :secure => SITE_CONFIG['secure_cookies']} @mobile_from_project = @project.id - render :action => 'project_mobile' + render end end diff --git a/app/controllers/todos_controller.rb b/app/controllers/todos_controller.rb index f62e6b9b..37c3a4cd 100644 --- a/app/controllers/todos_controller.rb +++ b/app/controllers/todos_controller.rb @@ -132,7 +132,7 @@ class TodosController < ApplicationController @page_title = t('todos.mobile_todos_page_title') @home = true - cookies[:mobile_url]= { :value => request.request_uri, :secure => SITE_CONFIG['secure_cookies']} + cookies[:mobile_url]= { :value => request.fullpath, :secure => SITE_CONFIG['secure_cookies']} determine_down_count render :action => 'index' @@ -158,7 +158,6 @@ class TodosController < ApplicationController # we have a project but not a context -> use the default context @mobile_from_context = @mobile_from_project.default_context end - render :action => "new" } end end @@ -369,7 +368,6 @@ class TodosController < ApplicationController @contexts = current_user.contexts @edit_mobile = true @return_path=cookies[:mobile_url] ? cookies[:mobile_url] : mobile_path - render :template => "/todos/edit_mobile.html.erb" } end end @@ -693,7 +691,7 @@ class TodosController < ApplicationController @hidden_contexts = current_user.contexts.hidden @completed_projects = current_user.projects.completed end - format.m { render :action => 'mobile_list_deferred' } + format.m format.xml { render :xml => @not_done_todos.to_xml( *to_xml_params ) } end end @@ -774,8 +772,7 @@ class TodosController < ApplicationController respond_to do |format| format.html format.m { - cookies[:mobile_url]= {:value => request.request_uri, :secure => SITE_CONFIG['secure_cookies']} - render :action => "mobile_tag" + cookies[:mobile_url]= {:value => request.fullpath, :secure => SITE_CONFIG['secure_cookies']} } format.text { render :action => 'index', :layout => false, :content_type => Mime::TEXT @@ -980,7 +977,7 @@ class TodosController < ApplicationController redirect_to home_path, "Viewing note of todo is not implemented" } format.m { - render:action => "mobile_show_notes" + render :action => "show_notes" } end end diff --git a/app/helpers/projects_helper.rb b/app/helpers/projects_helper.rb index d1f9dd51..68308b0d 100644 --- a/app/helpers/projects_helper.rb +++ b/app/helpers/projects_helper.rb @@ -32,21 +32,16 @@ module ProjectsHelper end def project_next_prev_mobile - html = '
' - html + return content_tag(:ul, "#{prev_project}#{next_project}".html_safe, :class=>"next-prev-project").html_safe end def link_to_delete_project(project, descriptor = sanitize(project.name)) diff --git a/app/helpers/todos_helper.rb b/app/helpers/todos_helper.rb index 1b092feb..a655ef7a 100644 --- a/app/helpers/todos_helper.rb +++ b/app/helpers/todos_helper.rb @@ -135,7 +135,7 @@ module TodosHelper end def tag_span (tag, mobile=false) - content_tag(:span, :class => "tag #{tag.name.gsub(' ','-')}") { link_to(tag.name, (mobile ? mobile_tag_path(tag.name) : tag_path(tag.name))) } + content_tag(:span, :class => "tag #{tag.name.gsub(' ','-')}") { link_to(tag.name, tag_path(tag.name, :format => mobile ? :m : :html)) } end def tag_list(todo=@todo, mobile=false) @@ -143,17 +143,11 @@ module TodosHelper end def tag_list_mobile(todo=@todo) - unless todo.tags.all_except_starred.empty? - return tag_list(todo, true) - else - return "" - end + todo.tags.all_except_starred.empty? ? "" : tag_list(todo, true) end def deferred_due_date(todo=@todo) - if todo.deferred? && todo.due - t('todos.action_due_on', :date => format_date(todo.due)) - end + t('todos.action_due_on', :date => format_date(todo.due)) if todo.deferred? && todo.due end def project_and_context_links(todo, parent_container_type, opts = {}) diff --git a/app/views/contexts/_context.m.erb b/app/views/contexts/_context.m.erb new file mode 100644 index 00000000..6e9174af --- /dev/null +++ b/app/views/contexts/_context.m.erb @@ -0,0 +1,14 @@ +<% +# select actions from this context +@not_done = @not_done_todos.select {|t| t.context_id == context.id } + +if not @not_done.empty? + # only show a context when there are actions in it + -%> +