[#4177] Created a custom form for a Contract to match the comp.
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
config.gem 'formtastic', :version => '0.9.10'
|
||||
|
||||
require 'redmine'
|
||||
|
||||
Redmine::Plugin.register :redmine_contracts do
|
||||
@@ -12,7 +14,7 @@ Redmine::Plugin.register :redmine_contracts do
|
||||
requires_redmine_plugin :redmine_rate, :version_or_higher => '0.1.0'
|
||||
|
||||
project_module :contracts do
|
||||
permission :manage_budget, {:contracts => [:index] }, :public => true
|
||||
permission :manage_budget, {:contracts => [:index, :new] }, :public => true
|
||||
end
|
||||
|
||||
menu(:project_menu,
|
||||
@@ -20,6 +22,14 @@ Redmine::Plugin.register :redmine_contracts do
|
||||
{:controller => 'contracts', :action => 'index'},
|
||||
:caption => :text_contracts,
|
||||
:param => :project_id)
|
||||
|
||||
menu(:project_menu,
|
||||
:new_contract,
|
||||
{:controller => 'contracts', :action => 'new'},
|
||||
:caption => :text_new_contract,
|
||||
:param => :project_id,
|
||||
:parent => :contracts)
|
||||
|
||||
end
|
||||
|
||||
require 'dispatcher'
|
||||
@@ -29,6 +39,16 @@ Dispatcher.to_prepare :redmine_contracts do
|
||||
require_dependency 'inherited_resources'
|
||||
require_dependency 'inherited_resources/base'
|
||||
|
||||
# Load and bootstrap formtastic
|
||||
gem 'formtastic', :version => '0.9.10'
|
||||
require_dependency 'formtastic'
|
||||
require_dependency 'formtastic/layout_helper'
|
||||
ActionView::Base.send :include, Formtastic::SemanticFormHelper
|
||||
ActionView::Base.send :include, Formtastic::LayoutHelper
|
||||
|
||||
Formtastic::SemanticFormBuilder.all_fields_required_by_default = false
|
||||
Formtastic::SemanticFormBuilder.required_string = "<span class='required'> *</span>"
|
||||
|
||||
require_dependency 'project'
|
||||
Project.send(:include, RedmineContracts::Patches::ProjectPatch)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user