<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -144,6 +144,7 @@ class ContextsController &lt; ApplicationController
       @not_done = @not_done_todos.select {|t| t.context_id == @context.id } 
       @down_count = @not_done.size 
       cookies[:mobile_url]=request.request_uri
+      @mobile_from_context = @context.id
       render :action =&gt; 'mobile_show_context'
     end
   end</diff>
      <filename>app/controllers/contexts_controller.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,282 +1,283 @@
-class ProjectsController &lt; ApplicationController
-
-  helper :application, :todos, :notes
-  before_filter :set_source_view
-  before_filter :set_project_from_params, :only =&gt; [:update, :destroy, :show, :edit]
-  before_filter :default_context_filter, :only =&gt; [:create, :update]
-  skip_before_filter :login_required, :only =&gt; [:index]
-  prepend_before_filter :login_or_feed_token_required, :only =&gt; [:index]
-  session :off, :only =&gt; :index, :if =&gt; Proc.new { |req| ['rss','atom','txt'].include?(req.parameters[:format]) }
-
-  def index
-    @projects = current_user.projects(true)
-    if params[:projects_and_actions]
-      projects_and_actions
-    else      
-      @contexts = current_user.contexts(true)
-      init_not_done_counts(['project'])
-      if params[:only_active_with_no_next_actions]
-        @projects = @projects.select { |p| p.active? &amp;&amp; count_undone_todos(p) == 0 }
-      end
-      init_project_hidden_todo_counts(['project'])
-      respond_to do |format|
-        format.html  &amp;render_projects_html
-        format.m     &amp;render_projects_mobile
-        format.xml   { render :xml =&gt; @projects.to_xml( :except =&gt; :user_id )  }
-        format.rss   &amp;render_rss_feed
-        format.atom  &amp;render_atom_feed
-        format.text  &amp;render_text_feed
-      end
-    end
-  end
-
-  def projects_and_actions
-    @projects = @projects.select { |p| p.active? }
-    respond_to do |format|
-      format.text  { 
-        render :action =&gt; 'index_text_projects_and_actions', :layout =&gt; false, :content_type =&gt; Mime::TEXT
-      }
-    end
-  end
-
-  def show
-    init_data_for_sidebar unless mobile?
-    @projects = current_user.projects
-    @page_title = &quot;TRACKS::Project: #{@project.name}&quot;
-    @project.todos.send :with_scope, :find =&gt; { :include =&gt; [:context, :tags] } do
-      @not_done = @project.not_done_todos(:include_project_hidden_todos =&gt; true)
-      @deferred = @project.deferred_todos.sort_by { |todo| todo.show_from }
-      @done = @project.done_todos
-    end
-    
-    @max_completed = current_user.prefs.show_number_completed
-    
-    @count = @not_done.size
-    @down_count = @count + @deferred.size 
-    @next_project = current_user.projects.next_from(@project)
-    @previous_project = current_user.projects.previous_from(@project)
-    @default_project_context_name_map = build_default_project_context_name_map(@projects).to_json
-    respond_to do |format|
-      format.html
-      format.m     &amp;render_project_mobile
-      format.xml   { render :xml =&gt; @project.to_xml( :except =&gt; :user_id )  }
-    end
-  end
-  
-  # Example XML usage: curl -H 'Accept: application/xml' -H 'Content-Type:
-  # application/xml'
-  #                    -u username:password
-  #                    -d '&lt;request&gt;&lt;project&gt;&lt;name&gt;new project_name&lt;/name&gt;&lt;/project&gt;&lt;/request&gt;'
-  #                    http://our.tracks.host/projects
-  # 
-  def create
-    if params[:format] == 'application/xml' &amp;&amp; params['exception']
-      render_failure &quot;Expected post format is valid xml like so: &lt;request&gt;&lt;project&gt;&lt;name&gt;project name&lt;/name&gt;&lt;/project&gt;&lt;/request&gt;.&quot;
-      return
-    end
-    @project = current_user.projects.build
-    params_are_invalid = true
-    if (params['project'] || (params['request'] &amp;&amp; params['request']['project']))
-      @project.attributes = params['project'] || params['request']['project']
-      params_are_invalid = false
-    end
-    @go_to_project = params['go_to_project']
-    @saved = @project.save
-    @project_not_done_counts = { @project.id =&gt; 0 }
-    @active_projects_count = current_user.projects.count(:conditions =&gt; &quot;state = 'active'&quot;)
-    @contexts = current_user.contexts
-    respond_to do |format|
-      format.js { @down_count = current_user.projects.size }
-      format.xml do
-        if @project.new_record? &amp;&amp; params_are_invalid
-          render_failure &quot;Expected post format is valid xml like so: &lt;request&gt;&lt;project&gt;&lt;name&gt;project name&lt;/name&gt;&lt;/project&gt;&lt;/request&gt;.&quot;
-        elsif @project.new_record?
-          render_failure @project.errors.full_messages.join(', ')
-        else
-          head :created, :location =&gt; project_url(@project)
-        end
-      end
-    end
-  end
-
-  # Edit the details of the project
-  # 
-  def update
-    params['project'] ||= {}
-    if params['project']['state']
-      @state_changed = @project.state != params['project']['state']
-      logger.info &quot;@state_changed: #{@project.state} == #{params['project']['state']} != #{@state_changed}&quot;
-      @project.transition_to(params['project']['state'])
-      params['project'].delete('state')
-    end
-    success_text = if params['field'] == 'name' &amp;&amp; params['value']
-      params['project']['id'] = params['id'] 
-      params['project']['name'] = params['value'] 
-    end
-    @project.attributes = params['project']
-    if @project.save
-      if boolean_param('wants_render')
-        if (@project.hidden?)
-          @project_project_hidden_todo_counts = Hash.new
-          @project_project_hidden_todo_counts[@project.id] = @project.reload().not_done_todo_count(:include_project_hidden_todos =&gt; true)
-        else
-          @project_not_done_counts = Hash.new
-          @project_not_done_counts[@project.id] = @project.reload().not_done_todo_count(:include_project_hidden_todos =&gt; true)
-        end
-        @contexts = current_user.contexts
-        @active_projects_count = current_user.projects.count(:conditions =&gt; &quot;state = 'active'&quot;)
-        @hidden_projects_count = current_user.projects.count(:conditions =&gt; &quot;state = 'hidden'&quot;)
-        @completed_projects_count = current_user.projects.count(:conditions =&gt; &quot;state = 'completed'&quot;)
-        render :template =&gt; 'projects/update.js.rjs'
-        return
-      elsif boolean_param('update_status')
-        render :template =&gt; 'projects/update_status.js.rjs'
-        return
-      elsif boolean_param('update_default_context')
-        @initial_context_name = @project.default_context.name 
-        render :template =&gt; 'projects/update_default_context.js.rjs'
-        return
-      else
-        render :text =&gt; success_text || 'Success'
-        return
-      end
-    else
-      notify :warning, &quot;Couldn't update project&quot;
-      render :text =&gt; ''
-      return
-    end
-    render :template =&gt; 'projects/update.js.rjs'
-  end
-  
-  def edit
-    @contexts = current_user.contexts
-    respond_to do |format|
-      format.js
-    end
-  end
-  
-  def destroy
-    @project.destroy
-    @active_projects_count = current_user.projects.count(:conditions =&gt; &quot;state = 'active'&quot;)
-    @hidden_projects_count = current_user.projects.count(:conditions =&gt; &quot;state = 'hidden'&quot;)
-    @completed_projects_count = current_user.projects.count(:conditions =&gt; &quot;state = 'completed'&quot;)
-    respond_to do |format|
-      format.js { @down_count = current_user.projects.size }
-      format.xml { render :text =&gt; &quot;Deleted project #{@project.name}&quot; }
-    end
-  end
-  
-  def order
-    project_ids = params[&quot;list-active-projects&quot;] || params[&quot;list-hidden-projects&quot;] || params[&quot;list-completed-projects&quot;]    
-    projects = current_user.projects.update_positions( project_ids )
-    render :nothing =&gt; true
-  rescue
-    notify :error, $!
-    redirect_to :action =&gt; 'index'
-  end
-  
-  def alphabetize
-    @state = params['state']
-    @projects = current_user.projects.alphabetize(:state =&gt; @state) if @state
-    @contexts = current_user.contexts
-    init_not_done_counts(['project'])
-  end
-  
-  protected
-    
-  def render_projects_html
-    lambda do
-      @page_title = &quot;TRACKS::List Projects&quot;
-      @count = current_user.projects.size 
-      @active_projects = @projects.select{ |p| p.active? }
-      @hidden_projects = @projects.select{ |p| p.hidden? }
-      @completed_projects = @projects.select{ |p| p.completed? }
-      @no_projects = @projects.empty?
-      @projects.cache_note_counts
-      @new_project = current_user.projects.build
-      render
-    end
-  end
-
-  def render_projects_mobile
-    lambda do
-      @active_projects = @projects.select{ |p| p.active? }
-      @hidden_projects = @projects.select{ |p| p.hidden? }
-      @completed_projects = @projects.select{ |p| p.completed? }
-      @down_count = @active_projects.size + @hidden_projects.size + @completed_projects.size 
-      cookies[:mobile_url]=request.request_uri
-      render :action =&gt; 'index_mobile'
-    end
-  end
-    
-  def render_project_mobile
-    lambda do
-      if @project.default_context.nil?
-        @project_default_context = &quot;This project does not have a default context&quot;
-      else
-        @project_default_context = &quot;The default context for this project is &quot;+
-          @project.default_context.name
-      end
-      cookies[:mobile_url]=request.request_uri
-      render :action =&gt; 'project_mobile'
-    end
-  end
-
-  def render_rss_feed
-    lambda do
-      render_rss_feed_for @projects, :feed =&gt; feed_options,
-        :item =&gt; { :title =&gt; :name, :description =&gt; lambda { |p| summary(p) } }
-    end
-  end
-
-  def render_atom_feed
-    lambda do
-      render_atom_feed_for @projects, :feed =&gt; feed_options,
-        :item =&gt; { :description =&gt; lambda { |p| summary(p) },
-        :title =&gt; :name,
-        :author =&gt; lambda { |p| nil } }
-    end
-  end
-    
-  def feed_options
-    Project.feed_options(current_user)
-  end
-
-  def render_text_feed
-    lambda do
-      init_project_hidden_todo_counts(['project'])
-      render :action =&gt; 'index', :layout =&gt; false, :content_type =&gt; Mime::TEXT
-    end
-  end
-        
-  def set_project_from_params
-    @project = current_user.projects.find_by_params(params)
-  end
-    
-  def set_source_view
-    @source_view = params['_source_view'] || 'project'
-  end
-    
-  def default_context_filter
-    p = params['project']
-    p = params['request']['project'] if p.nil? &amp;&amp; params['request']
-    p = {} if p.nil?
-    default_context_name = p['default_context_name']
-    p.delete('default_context_name')
-
-    unless default_context_name.blank?
-      default_context = Context.find_or_create_by_name(default_context_name)
-      p['default_context_id'] = default_context.id
-    end
-  end
-
-  def summary(project)
-    project_description = ''
-    project_description += sanitize(markdown( project.description )) unless project.description.blank?
-    project_description += &quot;&lt;p&gt;#{count_undone_todos_phrase(p)}. &quot;
-    project_description += &quot;Project is #{project.state}.&quot;
-    project_description += &quot;&lt;/p&gt;&quot;
-    project_description
-  end
-
-end
+class ProjectsController &lt; ApplicationController
+
+  helper :application, :todos, :notes
+  before_filter :set_source_view
+  before_filter :set_project_from_params, :only =&gt; [:update, :destroy, :show, :edit]
+  before_filter :default_context_filter, :only =&gt; [:create, :update]
+  skip_before_filter :login_required, :only =&gt; [:index]
+  prepend_before_filter :login_or_feed_token_required, :only =&gt; [:index]
+  session :off, :only =&gt; :index, :if =&gt; Proc.new { |req| ['rss','atom','txt'].include?(req.parameters[:format]) }
+
+  def index
+    @projects = current_user.projects(true)
+    if params[:projects_and_actions]
+      projects_and_actions
+    else      
+      @contexts = current_user.contexts(true)
+      init_not_done_counts(['project'])
+      if params[:only_active_with_no_next_actions]
+        @projects = @projects.select { |p| p.active? &amp;&amp; count_undone_todos(p) == 0 }
+      end
+      init_project_hidden_todo_counts(['project'])
+      respond_to do |format|
+        format.html  &amp;render_projects_html
+        format.m     &amp;render_projects_mobile
+        format.xml   { render :xml =&gt; @projects.to_xml( :except =&gt; :user_id )  }
+        format.rss   &amp;render_rss_feed
+        format.atom  &amp;render_atom_feed
+        format.text  &amp;render_text_feed
+      end
+    end
+  end
+
+  def projects_and_actions
+    @projects = @projects.select { |p| p.active? }
+    respond_to do |format|
+      format.text  { 
+        render :action =&gt; 'index_text_projects_and_actions', :layout =&gt; false, :content_type =&gt; Mime::TEXT
+      }
+    end
+  end
+
+  def show
+    init_data_for_sidebar unless mobile?
+    @projects = current_user.projects
+    @page_title = &quot;TRACKS::Project: #{@project.name}&quot;
+    @project.todos.send :with_scope, :find =&gt; { :include =&gt; [:context, :tags] } do
+      @not_done = @project.not_done_todos(:include_project_hidden_todos =&gt; true)
+      @deferred = @project.deferred_todos.sort_by { |todo| todo.show_from }
+      @done = @project.done_todos
+    end
+    
+    @max_completed = current_user.prefs.show_number_completed
+    
+    @count = @not_done.size
+    @down_count = @count + @deferred.size 
+    @next_project = current_user.projects.next_from(@project)
+    @previous_project = current_user.projects.previous_from(@project)
+    @default_project_context_name_map = build_default_project_context_name_map(@projects).to_json
+    respond_to do |format|
+      format.html
+      format.m     &amp;render_project_mobile
+      format.xml   { render :xml =&gt; @project.to_xml( :except =&gt; :user_id )  }
+    end
+  end
+  
+  # Example XML usage: curl -H 'Accept: application/xml' -H 'Content-Type:
+  # application/xml'
+  #                    -u username:password
+  #                    -d '&lt;request&gt;&lt;project&gt;&lt;name&gt;new project_name&lt;/name&gt;&lt;/project&gt;&lt;/request&gt;'
+  #                    http://our.tracks.host/projects
+  # 
+  def create
+    if params[:format] == 'application/xml' &amp;&amp; params['exception']
+      render_failure &quot;Expected post format is valid xml like so: &lt;request&gt;&lt;project&gt;&lt;name&gt;project name&lt;/name&gt;&lt;/project&gt;&lt;/request&gt;.&quot;
+      return
+    end
+    @project = current_user.projects.build
+    params_are_invalid = true
+    if (params['project'] || (params['request'] &amp;&amp; params['request']['project']))
+      @project.attributes = params['project'] || params['request']['project']
+      params_are_invalid = false
+    end
+    @go_to_project = params['go_to_project']
+    @saved = @project.save
+    @project_not_done_counts = { @project.id =&gt; 0 }
+    @active_projects_count = current_user.projects.count(:conditions =&gt; &quot;state = 'active'&quot;)
+    @contexts = current_user.contexts
+    respond_to do |format|
+      format.js { @down_count = current_user.projects.size }
+      format.xml do
+        if @project.new_record? &amp;&amp; params_are_invalid
+          render_failure &quot;Expected post format is valid xml like so: &lt;request&gt;&lt;project&gt;&lt;name&gt;project name&lt;/name&gt;&lt;/project&gt;&lt;/request&gt;.&quot;
+        elsif @project.new_record?
+          render_failure @project.errors.full_messages.join(', ')
+        else
+          head :created, :location =&gt; project_url(@project)
+        end
+      end
+    end
+  end
+
+  # Edit the details of the project
+  # 
+  def update
+    params['project'] ||= {}
+    if params['project']['state']
+      @state_changed = @project.state != params['project']['state']
+      logger.info &quot;@state_changed: #{@project.state} == #{params['project']['state']} != #{@state_changed}&quot;
+      @project.transition_to(params['project']['state'])
+      params['project'].delete('state')
+    end
+    success_text = if params['field'] == 'name' &amp;&amp; params['value']
+      params['project']['id'] = params['id'] 
+      params['project']['name'] = params['value'] 
+    end
+    @project.attributes = params['project']
+    if @project.save
+      if boolean_param('wants_render')
+        if (@project.hidden?)
+          @project_project_hidden_todo_counts = Hash.new
+          @project_project_hidden_todo_counts[@project.id] = @project.reload().not_done_todo_count(:include_project_hidden_todos =&gt; true)
+        else
+          @project_not_done_counts = Hash.new
+          @project_not_done_counts[@project.id] = @project.reload().not_done_todo_count(:include_project_hidden_todos =&gt; true)
+        end
+        @contexts = current_user.contexts
+        @active_projects_count = current_user.projects.count(:conditions =&gt; &quot;state = 'active'&quot;)
+        @hidden_projects_count = current_user.projects.count(:conditions =&gt; &quot;state = 'hidden'&quot;)
+        @completed_projects_count = current_user.projects.count(:conditions =&gt; &quot;state = 'completed'&quot;)
+        render :template =&gt; 'projects/update.js.rjs'
+        return
+      elsif boolean_param('update_status')
+        render :template =&gt; 'projects/update_status.js.rjs'
+        return
+      elsif boolean_param('update_default_context')
+        @initial_context_name = @project.default_context.name 
+        render :template =&gt; 'projects/update_default_context.js.rjs'
+        return
+      else
+        render :text =&gt; success_text || 'Success'
+        return
+      end
+    else
+      notify :warning, &quot;Couldn't update project&quot;
+      render :text =&gt; ''
+      return
+    end
+    render :template =&gt; 'projects/update.js.rjs'
+  end
+  
+  def edit
+    @contexts = current_user.contexts
+    respond_to do |format|
+      format.js
+    end
+  end
+  
+  def destroy
+    @project.destroy
+    @active_projects_count = current_user.projects.count(:conditions =&gt; &quot;state = 'active'&quot;)
+    @hidden_projects_count = current_user.projects.count(:conditions =&gt; &quot;state = 'hidden'&quot;)
+    @completed_projects_count = current_user.projects.count(:conditions =&gt; &quot;state = 'completed'&quot;)
+    respond_to do |format|
+      format.js { @down_count = current_user.projects.size }
+      format.xml { render :text =&gt; &quot;Deleted project #{@project.name}&quot; }
+    end
+  end
+  
+  def order
+    project_ids = params[&quot;list-active-projects&quot;] || params[&quot;list-hidden-projects&quot;] || params[&quot;list-completed-projects&quot;]    
+    projects = current_user.projects.update_positions( project_ids )
+    render :nothing =&gt; true
+  rescue
+    notify :error, $!
+    redirect_to :action =&gt; 'index'
+  end
+  
+  def alphabetize
+    @state = params['state']
+    @projects = current_user.projects.alphabetize(:state =&gt; @state) if @state
+    @contexts = current_user.contexts
+    init_not_done_counts(['project'])
+  end
+  
+  protected
+    
+  def render_projects_html
+    lambda do
+      @page_title = &quot;TRACKS::List Projects&quot;
+      @count = current_user.projects.size 
+      @active_projects = @projects.select{ |p| p.active? }
+      @hidden_projects = @projects.select{ |p| p.hidden? }
+      @completed_projects = @projects.select{ |p| p.completed? }
+      @no_projects = @projects.empty?
+      @projects.cache_note_counts
+      @new_project = current_user.projects.build
+      render
+    end
+  end
+
+  def render_projects_mobile
+    lambda do
+      @active_projects = @projects.select{ |p| p.active? }
+      @hidden_projects = @projects.select{ |p| p.hidden? }
+      @completed_projects = @projects.select{ |p| p.completed? }
+      @down_count = @active_projects.size + @hidden_projects.size + @completed_projects.size 
+      cookies[:mobile_url]=request.request_uri
+      render :action =&gt; 'index_mobile'
+    end
+  end
+    
+  def render_project_mobile
+    lambda do
+      if @project.default_context.nil?
+        @project_default_context = &quot;This project does not have a default context&quot;
+      else
+        @project_default_context = &quot;The default context for this project is &quot;+
+          @project.default_context.name
+      end
+      cookies[:mobile_url]=request.request_uri
+      @mobile_from_project = @project.id
+      render :action =&gt; 'project_mobile'
+    end
+  end
+
+  def render_rss_feed
+    lambda do
+      render_rss_feed_for @projects, :feed =&gt; feed_options,
+        :item =&gt; { :title =&gt; :name, :description =&gt; lambda { |p| summary(p) } }
+    end
+  end
+
+  def render_atom_feed
+    lambda do
+      render_atom_feed_for @projects, :feed =&gt; feed_options,
+        :item =&gt; { :description =&gt; lambda { |p| summary(p) },
+        :title =&gt; :name,
+        :author =&gt; lambda { |p| nil } }
+    end
+  end
+    
+  def feed_options
+    Project.feed_options(current_user)
+  end
+
+  def render_text_feed
+    lambda do
+      init_project_hidden_todo_counts(['project'])
+      render :action =&gt; 'index', :layout =&gt; false, :content_type =&gt; Mime::TEXT
+    end
+  end
+        
+  def set_project_from_params
+    @project = current_user.projects.find_by_params(params)
+  end
+    
+  def set_source_view
+    @source_view = params['_source_view'] || 'project'
+  end
+    
+  def default_context_filter
+    p = params['project']
+    p = params['request']['project'] if p.nil? &amp;&amp; params['request']
+    p = {} if p.nil?
+    default_context_name = p['default_context_name']
+    p.delete('default_context_name')
+
+    unless default_context_name.blank?
+      default_context = Context.find_or_create_by_name(default_context_name)
+      p['default_context_id'] = default_context.id
+    end
+  end
+
+  def summary(project)
+    project_description = ''
+    project_description += sanitize(markdown( project.description )) unless project.description.blank?
+    project_description += &quot;&lt;p&gt;#{count_undone_todos_phrase(p)}. &quot;
+    project_description += &quot;Project is #{project.state}.&quot;
+    project_description += &quot;&lt;/p&gt;&quot;
+    project_description
+  end
+
+end</diff>
      <filename>app/controllers/projects_controller.rb</filename>
    </modified>
    <modified>
      <diff>@@ -33,6 +33,12 @@ class TodosController &lt; ApplicationController
       format.m {
         @new_mobile = true
         @return_path=cookies[:mobile_url]
+        @mobile_from_context = current_user.contexts.find_by_id(params[:from_context]) if params[:from_context]
+        @mobile_from_project = current_user.projects.find_by_id(params[:from_project]) if params[:from_project]
+        if params[:from_project] &amp;&amp; !params[:from_context]
+          # we have a project but not a context -&gt; use the default context
+          @mobile_from_context = @mobile_from_project.default_context
+        end
         render :action =&gt; &quot;new&quot; 
       }
     end
@@ -71,7 +77,7 @@ class TodosController &lt; ApplicationController
         # todo: use function for this fixed path
         @return_path='/mobile' if @return_path.nil?
         if @saved
-          redirect_to mobile_abbrev_url
+          redirect_to @return_path
         else
           @projects = current_user.projects.find(:all)
           @contexts = current_user.contexts.find(:all)</diff>
      <filename>app/controllers/todos_controller.rb</filename>
    </modified>
    <modified>
      <diff>@@ -114,11 +114,10 @@ module TodosHelper
     tags_except_starred = @todo.tags.reject{|t| t.name == Todo::STARRED_TAG_NAME}
     # removed the link. TODO: add link to mobile view of tagged actions
     tag_list = tags_except_starred.collect{|t| 
-      &quot;&lt;span class=\&quot;tag #{t.name.gsub(' ','-')}\&quot;&gt;&quot; + 
+      &quot;&lt;span class=\&quot;tag\&quot;&gt;&quot; + 
         link_to(t.name, {:action =&gt; &quot;tag&quot;, :controller =&gt; &quot;todos&quot;, :id =&gt; t.name+&quot;.m&quot;}) + 
-        #        link_to(t.name, formatted_tag_path(t, :m)) +
       &quot;&lt;/span&gt;&quot;}.join('')
-    &quot;&lt;span class='tags'&gt;#{tag_list}&lt;/span&gt;&quot;
+    &quot;&lt;span class=\&quot;tags\&quot;&gt;#{tag_list}&lt;/span&gt;&quot;
   end
   
   def deferred_due_date</diff>
      <filename>app/helpers/todos_helper.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,8 @@
-&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;
+&lt;%
+    new_todo_params = {}
+    new_todo_params[:from_project] = @mobile_from_project if @mobile_from_project
+    new_todo_params[:from_context] = @mobile_from_context if @mobile_from_context
+-%&gt;&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;
 &lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;
 &lt;head&gt;
 &lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=UTF-8&quot; /&gt;
@@ -10,7 +14,7 @@
       if !@prefs.nil? -%&gt;
 &lt;h1&gt;&lt;span class=&quot;count&quot;&gt;&lt;%= @down_count %&gt;&lt;/span&gt; &lt;%= 
         user_time.strftime(@prefs.title_date_format) -%&gt;&lt;/h1&gt;
-&lt;%=     (link_to(&quot;0-Add new action&quot;, formatted_new_todo_path(:m))+&quot; | &quot;) unless @new_mobile -%&gt;
+&lt;%=     (link_to(&quot;0-Add new action&quot;, formatted_new_todo_path(:m, new_todo_params))+&quot; | &quot;) unless @new_mobile -%&gt;
 &lt;%=     (link_to(&quot;1-Home&quot;, formatted_todos_path(:m))+&quot; | &quot;) unless @home -%&gt;
 &lt;%=     (link_to(&quot;2-Contexts&quot;, formatted_contexts_path(:m))+&quot; | &quot;) -%&gt;
 &lt;%=     (link_to(&quot;3-Projects&quot;, formatted_projects_path(:m))+&quot; | &quot;) -%&gt;</diff>
      <filename>app/views/layouts/mobile.m.erb</filename>
    </modified>
    <modified>
      <diff>@@ -1,26 +1,40 @@
-&lt;% @tag_list_text = &quot;&quot; 
-   @tag_list_text = tag_list_text if @todo -%&gt;
-&lt;span class=&quot;errors&quot;&gt;
-&lt;%= error_messages_for(&quot;todo&quot;) %&gt;
-&lt;/span&gt;
-&lt;% this_year = user_time.to_date.strftime(&quot;%Y&quot;).to_i
-if parent_container_type == 'show_mobile' -%&gt;
-&lt;p&gt;&lt;label for=&quot;todo_done&quot;&gt;Done?&lt;/label&gt;&amp;nbsp;&lt;%= check_box_tag(&quot;done&quot;, 1, @todo &amp;&amp; @todo.completed?, &quot;tabindex&quot; =&gt; 1) %&gt;&lt;/p&gt;
-&lt;% end -%&gt;
-&lt;h2&gt;&lt;label for=&quot;todo_description&quot;&gt;Description&lt;/label&gt;&lt;/h2&gt;
-&lt;%= text_field( &quot;todo&quot;, &quot;description&quot;, &quot;tabindex&quot; =&gt; 2) %&gt;
-&lt;h2&gt;&lt;label for=&quot;todo_notes&quot;&gt;Notes&lt;/label&gt;&lt;/h2&gt;
-&lt;%= text_area( &quot;todo&quot;, &quot;notes&quot;, &quot;cols&quot; =&gt; 30, &quot;rows&quot; =&gt; 5, &quot;tabindex&quot; =&gt; 3) %&gt;
-&lt;h2&gt;&lt;label for=&quot;todo_context_id&quot;&gt;Context&lt;/label&gt;&lt;/h2&gt;
-&lt;%= collection_select( &quot;todo&quot;, &quot;context_id&quot;, @contexts, &quot;id&quot;, &quot;name&quot;, {&quot;tabindex&quot; =&gt; 4} ) %&gt;
-&lt;h2&gt;&lt;label for=&quot;todo_project_id&quot;&gt;Project&lt;/label&gt;&lt;/h2&gt;
-&lt;%= collection_select( &quot;todo&quot;, &quot;project_id&quot;, @projects, &quot;id&quot;, &quot;name&quot;,
-                          {:include_blank =&gt; true}, {&quot;tabindex&quot; =&gt; 5} ) %&gt;
-&lt;h2&gt;&lt;label for=&quot;tag_list&quot;&gt;Tags (separate with commas)&lt;/label&gt;&lt;/h2&gt;
-&lt;%= text_field_tag &quot;tag_list&quot;, @tag_list_text, :size =&gt; 30, :tabindex =&gt; 6 %&gt; 
-&lt;h2&gt;&lt;label for=&quot;todo_due&quot;&gt;Due&lt;/label&gt;&lt;/h2&gt;
-&lt;%= date_select(&quot;todo&quot;, &quot;due&quot;, :order =&gt; [:day, :month, :year],
-                    :start_year =&gt; this_year, :include_blank =&gt; true) %&gt;
-&lt;h2&gt;&lt;label for=&quot;todo_show_from&quot;&gt;Show from&lt;/label&gt;&lt;/h2&gt;
-&lt;%= date_select(&quot;todo&quot;, &quot;show_from&quot;, :order =&gt; [:day, :month, :year], 
-                    :start_year =&gt; this_year, :include_blank =&gt; true) %&gt;
+&lt;% @tag_list_text = &quot;&quot; 
+   @tag_list_text = tag_list_text if @todo -%&gt;
+&lt;span class=&quot;errors&quot;&gt;
+&lt;%= error_messages_for(&quot;todo&quot;) %&gt;
+&lt;/span&gt;
+&lt;% this_year = user_time.to_date.strftime(&quot;%Y&quot;).to_i
+if parent_container_type == 'show_mobile' -%&gt;
+&lt;p&gt;&lt;label for=&quot;todo_done&quot;&gt;Done?&lt;/label&gt;&amp;nbsp;&lt;%= check_box_tag(&quot;done&quot;, 1, @todo &amp;&amp; @todo.completed?, &quot;tabindex&quot; =&gt; 1) %&gt;&lt;/p&gt;
+&lt;% end -%&gt;
+&lt;h2&gt;&lt;label for=&quot;todo_description&quot;&gt;Description&lt;/label&gt;&lt;/h2&gt;
+&lt;%= text_field( &quot;todo&quot;, &quot;description&quot;, &quot;tabindex&quot; =&gt; 2) %&gt;
+&lt;h2&gt;&lt;label for=&quot;todo_notes&quot;&gt;Notes&lt;/label&gt;&lt;/h2&gt;
+&lt;%= text_area( &quot;todo&quot;, &quot;notes&quot;, &quot;cols&quot; =&gt; 30, &quot;rows&quot; =&gt; 5, &quot;tabindex&quot; =&gt; 3) %&gt;
+&lt;h2&gt;&lt;label for=&quot;todo_context_id&quot;&gt;Context&lt;/label&gt;&lt;/h2&gt;
+&lt;%= unless @mobile_from_context
+  collection_select( &quot;todo&quot;, &quot;context_id&quot;, @contexts, &quot;id&quot;, &quot;name&quot;, {}, {&quot;tabindex&quot; =&gt; 4} ) 
+else
+  select_tag(&quot;todo[context_id]&quot;, options_from_collection_for_select(
+    @contexts, &quot;id&quot;, &quot;name&quot;, @mobile_from_context.id), 
+    {&quot;id&quot; =&gt; :todo_context_id, :tabindex =&gt; 4} )
+end %&gt;
+&lt;h2&gt;&lt;label for=&quot;todo_project_id&quot;&gt;Project&lt;/label&gt;&lt;/h2&gt;
+&lt;%= unless @mobile_from_project
+  collection_select( &quot;todo&quot;, &quot;project_id&quot;, @projects, &quot;id&quot;, &quot;name&quot;,
+                          {:include_blank =&gt; true}, {&quot;tabindex&quot; =&gt; 5} )
+else
+  # manually add blank option since :include_blank does not work 
+  # with options_from_collection_for_select
+  select_tag(&quot;todo[project_id]&quot;, &quot;&lt;option value=\&quot;\&quot;&gt;&lt;/option&gt;&quot;+options_from_collection_for_select(
+    @projects, &quot;id&quot;, &quot;name&quot;, @mobile_from_project.id), 
+    {&quot;id&quot; =&gt; :todo_project_id, :tabindex =&gt; 5} )
+end %&gt;
+&lt;h2&gt;&lt;label for=&quot;tag_list&quot;&gt;Tags (separate with commas)&lt;/label&gt;&lt;/h2&gt;
+&lt;%= text_field_tag &quot;tag_list&quot;, @tag_list_text, :size =&gt; 30, :tabindex =&gt; 6 %&gt; 
+&lt;h2&gt;&lt;label for=&quot;todo_due&quot;&gt;Due&lt;/label&gt;&lt;/h2&gt;
+&lt;%= date_select(&quot;todo&quot;, &quot;due&quot;, :order =&gt; [:day, :month, :year],
+                    :start_year =&gt; this_year, :include_blank =&gt; true) %&gt;
+&lt;h2&gt;&lt;label for=&quot;todo_show_from&quot;&gt;Show from&lt;/label&gt;&lt;/h2&gt;
+&lt;%= date_select(&quot;todo&quot;, &quot;show_from&quot;, :order =&gt; [:day, :month, :year], 
+                    :start_year =&gt; this_year, :include_blank =&gt; true) %&gt;</diff>
      <filename>app/views/todos/_edit_mobile.rhtml</filename>
    </modified>
    <modified>
      <diff>@@ -17,12 +17,12 @@ if @saved
     end
     
     # show new todo if the completed todo was recurring
-    unless @new_recurring_todo.nil?
+    unless @new_recurring_todo.nil? || @new_recurring_todo.deferred?
       page.call &quot;todoItems.ensureVisibleWithEffectAppear&quot;, item_container_id(@new_recurring_todo)
       page.insert_html :bottom, item_container_id(@new_recurring_todo), :partial =&gt; 'todos/todo', :locals =&gt; { :todo =&gt; @new_recurring_todo, :parent_container_type =&gt; parent_container_type }
       page.visual_effect :highlight, dom_id(@new_recurring_todo, 'line'), {'startcolor' =&gt; &quot;'#99ff99'&quot;}      
     else
-      page.notify :notice, &quot;There is no next action after the recurring action you just finished. The recurrence is completed&quot;, 6.0 unless @recurring_todo.nil?
+      page.notify :notice, &quot;There is no next action after the recurring action you just finished. The recurrence is completed&quot;, 6.0 unless @new_recurring_todo.deferred?
     end
     
   else</diff>
      <filename>app/views/todos/toggle_check.js.rjs</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>c6dc3fcd5b413c23ad25045fa4de05fff1ff708d</id>
    </parent>
  </parents>
  <author>
    <name>Reinier Balt</name>
    <email>lrbalt@gmail.com</email>
  </author>
  <url>http://github.com/bsag/tracks/commit/db86df5497f72b109f815c94a24ac9af3948349d</url>
  <id>db86df5497f72b109f815c94a24ac9af3948349d</id>
  <committed-date>2008-08-04T07:13:51-07:00</committed-date>
  <authored-date>2008-08-04T07:13:51-07:00</authored-date>
  <message>fixes for mobile view and for recurring todos

* fixed redirect to last page instead of /mobile after adding a new todo using mobile interface
* fixed adding new todo to tickler instead of home after marking a todo belonging an active recurring todo complete</message>
  <tree>33fdc79e565cb042821f08028c61b0aaacb91c63</tree>
  <committer>
    <name>Reinier Balt</name>
    <email>lrbalt@gmail.com</email>
  </committer>
</commit>
