get context, dependencies and admin scenarios running

This commit is contained in:
Reinier Balt 2012-05-01 15:45:58 +02:00
parent 7bce774daa
commit d7aebf03a0
16 changed files with 49 additions and 40 deletions

View file

@ -189,6 +189,10 @@ class ApplicationController < ActionController::Base
super # handle xml http auth via our own login code
end
end
def sanitize(arg)
ActionController::Base.helpers.sanitize(arg)
end
protected

View file

@ -28,7 +28,7 @@ class IntegrationsController < ApplicationController
def search_plugin
# TODO: ASSET PATH!!
@icon_data = [File.open(Rails.root + '/public/images/done.png').read].
@icon_data = [File.open(Rails.root + '/app/assets/images/done.png').read].
pack('m').gsub(/\n/, '')
render :layout => false

View file

@ -386,7 +386,7 @@ class TodosController < ApplicationController
@source_view = params['_source_view'] || 'todo'
@predecessor = current_user.todos.find_by_id(params['predecessor'])
@predecessors = @predecessor.predecessors
@todo = current_user.todos.find_by_id(params['successor']).includes(Todo::DEFAULT_INCLUDES)
@todo = current_user.todos.includes(Todo::DEFAULT_INCLUDES).find_by_id(params['successor'])
@original_state = @todo.state
unless @predecessor.completed?
@todo.add_predecessor(@predecessor)
@ -757,7 +757,7 @@ class TodosController < ApplicationController
# Set defaults for new_action
@initial_tags = @tag_name
unless @not_done_todos.empty?
@context = current_user.contexts.find_by_id(@not_done_todos[0].context_id)
@context = current_user.contexts.find(@not_done_todos.first.context_id)
end
# Set count badge to number of items with this tag