[#4567] Replace inline errors with regular Redmine error messages

This commit is contained in:
Eric Davis
2010-09-29 09:50:18 -07:00
parent 2a60d283a4
commit f3fc82d9dc
6 changed files with 12 additions and 1 deletions

View File

@@ -8,7 +8,9 @@ class ContractsController < InheritedResources::Base
before_filter :require_admin, :only => :destroy
def create
create! { contract_url(@project, resource) }
create! do |success, failure|
success.html { redirect_to contract_url(@project, resource) }
end
end
def update

View File

@@ -6,6 +6,8 @@
<%= content_tag(:h2, h(l(:text_edit_contract_name, :name => resource.name))) %>
<%= error_messages_for 'contract' %>
<% semantic_form_for resource, :url => contract_path(@project, resource), :html => {:class => 'tabular'} do |form| %>
<%= render :partial => 'form', :object => form, :locals => {:cancel_path => contract_path(@project, resource)} %>
<% end %>

View File

@@ -1,5 +1,7 @@
<%= content_tag(:h2, l(:text_new_contract)) %>
<%= error_messages_for 'contract' %>
<% semantic_form_for resource, :html => {:class => 'tabular'} do |form| %>
<%= render :partial => 'form', :object => form, :locals => {:cancel_path => contracts_path} %>
<% end %>

View File

@@ -2,6 +2,8 @@
<%= content_tag(:h2, h(l(:text_edit_deliverable_title, :title => resource.title))) %>
<%= error_messages_for 'deliverable' %>
<% semantic_form_for [@project, @contract, setup_nested_deliverable_records(resource)], :url => contract_deliverable_path(@project, @contract, resource), :html => {:class => 'deliverable tabular'} do |form| %>
<%= render :partial => 'form', :object => form, :locals => {:cancel_path => contract_path(@project, @contract)} %>
<% end %>

View File

@@ -2,6 +2,8 @@
<%= content_tag(:h2, l(:text_new_deliverable)) %>
<%= error_messages_for 'deliverable' %>
<% semantic_form_for [@project, @contract, setup_nested_deliverable_records(resource)], :url => contract_deliverables_path(@project, @contract), :html => {:class => 'deliverable tabular'} do |form| %>
<%= render :partial => 'form', :object => form, :locals => {:cancel_path => contract_path(@project, @contract)} %>
<% end %>

View File

@@ -77,6 +77,7 @@ Dispatcher.to_prepare :redmine_contracts do
Formtastic::SemanticFormBuilder.all_fields_required_by_default = false
Formtastic::SemanticFormBuilder.required_string = "<span class='required'> *</span>"
Formtastic::SemanticFormBuilder.inline_errors = :none
require_dependency 'payment_term' # Load so Enumeration will pick up the subclass in dev