Included a new taskboard card configurations controller which uses the pdf export plugin to export cards instead of the stories controller.

pull/6827/head
Richard 11 years ago
parent f6de8edde9
commit c72b718e4c
  1. 3
      app/controllers/rb_stories_controller.rb
  2. 12
      app/helpers/rb_master_backlogs_helper.rb
  3. 2
      app/views/rb_taskboard_card_configurations/index.html.erb
  4. 3
      config/routes.rb
  5. 4
      spec/routing/rb_stories_routing_spec.rb
  6. 51
      spec/routing/rb_taskboard_card_configurations_routing_spec.rb

@ -37,9 +37,6 @@ class RbStoriesController < RbApplicationController
unloadable
include OpenProject::PdfExport::TaskboardCard
def index
end
def create
params['author_id'] = User.current.id
story = Story.create_and_position(params, :project => @project,

@ -82,15 +82,17 @@ module RbMasterBacklogsHelper
:project_id => @project,
:sprint_id => backlog.sprint)
items[:configs] = link_to(l(:label_sprint_cards),
:controller => '/rb_taskboard_card_configurations',
:action => 'index',
:project_id => @project,
:sprint_id => backlog.sprint)
items[:configs] = taskboard_modal_link(@project, backlog)
items
end
def taskboard_modal_link(project, backlog, options = {})
path = backlogs_project_sprint_taskboard_card_configurations_path(@project.id, backlog.sprint.id)
html_id = "modal_work_package_#{SecureRandom.hex(10)}"
link_to(I18n.t('label_backlogs_taskboard_card_export'), path, options.merge(:id => html_id, :'data-modal' => ''))
end
def sprint_backlog_menu_items_for(backlog)
items = {}

@ -1,7 +1,7 @@
<div class='contextual'></div>
<h2>
<%= l(:label_backlogs_tasboard_card_config_select) %>
<%= l(:label_backlogs_taskboard_card_config_select) %>
</h2>
<% @configs.each do |config| %>

@ -58,10 +58,11 @@ OpenProject::Application.routes.draw do
resources :tasks, :controller => :rb_tasks, :only => [:create, :update]
resources :taskboard_card_configurations, :controller => :rb_taskboard_card_configurations, :only => [:index, :show] do
resources :stories, :controller => :rb_stories, :only => [:index]
end
resources :stories, :controller => :rb_stories, :only => [:index, :create, :update]
resources :stories, :controller => :rb_stories, :only => [:create, :update]
end
end
end

@ -37,10 +37,6 @@ require 'spec_helper'
describe RbStoriesController do
describe "routing" do
it { get('/projects/project_42/sprints/21/stories').should route_to(:controller => 'rb_stories',
:action => 'index',
:project_id => 'project_42',
:sprint_id => '21') }
it { post('/projects/project_42/sprints/21/stories').should route_to(:controller => 'rb_stories',
:action => 'create',
:project_id => 'project_42',

@ -0,0 +1,51 @@
#-- copyright
# OpenProject Backlogs Plugin
#
# Copyright (C)2013 the OpenProject Foundation (OPF)
# Copyright (C)2011 Stephan Eckardt, Tim Felgentreff, Marnen Laibow-Koser, Sandro Munda
# Copyright (C)2010-2011 friflaj
# Copyright (C)2010 Maxime Guilbot, Andrew Vit, Joakim Kolsjö, ibussieres, Daniel Passos, Jason Vasquez, jpic, Emiliano Heyns
# Copyright (C)2009-2010 Mark Maglana
# Copyright (C)2009 Joe Heck, Nate Lowrie
#
# This program is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License version 3.
#
# OpenProject Backlogs is a derivative work based on ChiliProject Backlogs.
# The copyright follows:
# Copyright (C) 2010-2011 - Emiliano Heyns, Mark Maglana, friflaj
# Copyright (C) 2011 - Jens Ulferts, Gregor Schmidt - Finn GmbH - Berlin, Germany
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# See doc/COPYRIGHT.rdoc for more details.
#++
require 'spec_helper'
describe RbTaskboardCardConfigurationsController do
describe "routing" do
it { get('/projects/project_42/sprints/21/taskboard_card_configurations/10').should route_to(:controller => 'rb_taskboard_card_configurations',
:action => 'show',
:project_id => 'project_42',
:sprint_id => '21',
:id => '10') }
it { get('/projects/project_42/sprints/21/taskboard_card_configurations').should route_to(:controller => 'rb_taskboard_card_configurations',
:action => 'index',
:project_id => 'project_42',
:sprint_id => '21') }
end
end
Loading…
Cancel
Save