Adding basic Deliverable controller and index page. #1135

This commit is contained in:
Eric Davis
2008-05-20 16:19:15 -07:00
parent 439a649b40
commit 15cc2c992d
4 changed files with 36 additions and 0 deletions

View File

@@ -0,0 +1,18 @@
class DeliverablesController < ApplicationController
unloadable
layout 'base'
before_filter :find_project, :authorize, :get_settings
def index
@deliverables = Deliverable.find(:all)
end
private
def find_project
@project = Project.find(params[:id])
end
def get_settings
# @settings = Setting.plugin_budget_plugin
end
end

View File

@@ -0,0 +1 @@
<h1>Deliverables</h1>

View File

@@ -7,4 +7,11 @@ Redmine::Plugin.register :budget_plugin do
author 'Eric Davis <edavis@littlestreamsoftware.com>'
description 'This is a budget plugin to track deliverables and budgets on a project'
version '0.0.0'
project_module :budget_module do
permission :view_budget, { :deliverables => [:index]}
permission :manage_budget, { :deliverables => [:new, :edit, :create, :update, :destroy]}
end
menu :project_menu, :budget, :controller => "deliverables", :action => 'index'
end

View File

@@ -0,0 +1,10 @@
require File.dirname(__FILE__) + '/../spec_helper'
describe DeliverablesController do
#Delete this example and add some real ones
it "should use DeliverablesController" do
controller.should be_an_instance_of(DeliverablesController)
end
end