Skip to content

Commit

Permalink
Fixed drag and drop, edit functionality.
Browse files Browse the repository at this point in the history
  • Loading branch information
den-plugins committed Jan 6, 2012
1 parent 6f7a5eb commit 1bc277d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
10 changes: 7 additions & 3 deletions app/controllers/task_boards_controller.rb
Expand Up @@ -5,7 +5,7 @@ class TaskBoardsController < ApplicationController
before_filter :get_project, :authorize, :only => [:index, :show]
before_filter :set_cache_buster
before_filter :get_issue, :only => [:update_issue_status, :update_issue, :add_comment, :get_comment]
before_filter :get_members, :only => [:update_issue_status, :update_issue, :show]
before_filter :get_dependencies, :only => [:update_issue_status, :update_issue]

def set_cache_buster
response.headers["Cache-Control"] = "no-cache, no-store, max-age=0, must-revalidate"
Expand All @@ -28,6 +28,7 @@ def index
end

def show
get_members
@show_bugs = params[:show_bugs] ? true : false
@statuses = IssueStatus.all(:order => "position asc")
@version = Version.find params[:version_id]
Expand Down Expand Up @@ -112,7 +113,6 @@ def show
end

def update_issue_status
get_project
@status = IssueStatus.find(params[:status_id])
@issue.init_journal(User.current, "")
@selected_resource = params[:selected_resource] ? params[:selected_resource] : ""
Expand Down Expand Up @@ -149,7 +149,6 @@ def update_issue_status

def update_issue
#TODO Permissions trapping - view
get_project
@issue.init_journal(User.current, '')
@issue.update_attributes(params[:issue])
@selected_resource = params[:selected_resource] ? params[:selected_resource] : ""
Expand Down Expand Up @@ -212,6 +211,11 @@ def get_members
@members = @project.members.find(:all, :include => [:user], :order => "users.firstname ASC")
end

def get_dependencies
get_project
get_members
end

def ordered_keys(values)
values.keys.sort{|x,y| values[x][:order] <=> values[y][:order]}
end
Expand Down
2 changes: 1 addition & 1 deletion app/views/task_boards/show.html.erb
Expand Up @@ -83,7 +83,7 @@
<%= select_tag "selected_resource",
"<option id='selected_resource_blank' value='#{resource_blank}'>
#{resource_blank}
</option>" + options_from_collection_for_select(@project.members.sort_by(&:name), "user_id", "name", @selected_resource.to_i),
</option>" + options_from_collection_for_select(@members.sort_by(&:name), "user_id", "name", @selected_resource.to_i),
:onchange => "filterByResource();" %>
<% end %>
Expand Down

0 comments on commit 1bc277d

Please sign in to comment.