OpenProject is the leading open source project management software.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
openproject/app/controllers/rb_stories_controller.rb

43 lines
1.0 KiB

include RbCommonHelper
class RbStoriesController < RbApplicationController
unloadable
include Cards
def index
cards = TaskboardCards.new(current_language)
if params[:sprint_id]
14 years ago
@sprint.stories.each { |story| cards.add(story) }
else
Story.product_backlog(@project).each { |story| cards.add(story, false) }
end
respond_to do |format|
format.pdf { send_data(cards.pdf.render, :disposition => 'attachment', :type => 'application/pdf') }
end
end
def create
params['author_id'] = User.current.id
story = Story.create_and_position(params)
status = (story.id ? 200 : 400)
respond_to do |format|
format.html { render :partial => "story", :object => story, :status => status }
end
end
def update
story = Story.find(params[:id])
result = story.update_and_position!(params)
story.reload
status = (result ? 200 : 400)
respond_to do |format|
format.html { render :partial => "story", :object => story, :status => status }
end
end
end