From 9bf68d8fd65dbfe8173f021de229bc039e70f0c6 Mon Sep 17 00:00:00 2001 From: Bilal Date: Mon, 20 Jul 2020 20:02:07 +0200 Subject: [PATCH] add amendment field to contract template form --- app/controllers/contract_templates_controller.rb | 2 +- app/models/contract_template.rb | 1 + app/views/contract_templates/_form.html.erb | 7 ++++++- config/locales/en.yml | 1 + config/locales/es.yml | 1 + 5 files changed, 10 insertions(+), 2 deletions(-) diff --git a/app/controllers/contract_templates_controller.rb b/app/controllers/contract_templates_controller.rb index 10ed045..eabc95a 100644 --- a/app/controllers/contract_templates_controller.rb +++ b/app/controllers/contract_templates_controller.rb @@ -82,7 +82,7 @@ class ContractTemplatesController < ApplicationController params .require(:contract_template) .permit(:name, :release_type, :body, :guardian_clause, - :signature_legal_text, :fee, + :signature_legal_text, :fee, :amendment_clause, :applicable_medium_id, :applicable_medium_text, :territory_id, :territory_text, :term_id, :term_text, :accessibility, diff --git a/app/models/contract_template.rb b/app/models/contract_template.rb index e05ed72..a607b88 100644 --- a/app/models/contract_template.rb +++ b/app/models/contract_template.rb @@ -22,6 +22,7 @@ class ContractTemplate < ApplicationRecord has_rich_text :body has_rich_text :guardian_clause has_rich_text :signature_legal_text + has_rich_text :amendment_clause validates :name, presence: true validates :release_type, presence: true diff --git a/app/views/contract_templates/_form.html.erb b/app/views/contract_templates/_form.html.erb index 09a0203..15d37ff 100644 --- a/app/views/contract_templates/_form.html.erb +++ b/app/views/contract_templates/_form.html.erb @@ -2,7 +2,7 @@ <%= field_set_tag content_tag(:span, t(".release_info.heading"), class: "h6 text-muted text-uppercase") do %>
<%= form.text_field :name, wrapper_class: "col-sm-6" %> - <%= form.select :release_type, options_for_release_type_select(project, @release_type), { wrapper_class: "col-sm-6" }, data: { toggle: "collapse-select", target_show_values_mapping: { "#guardian_clause": %w(appearance talent misc medical), "#fee_field": %w(appearance talent location material acquired_media), "#exploitable_rights_fields": %w(appearance talent location material acquired_media), "#custom_fields": %w(medical misc) } }, class: "form-control custom-select" %> + <%= form.select :release_type, options_for_release_type_select(project, @release_type), { wrapper_class: "col-sm-6" }, data: { toggle: "collapse-select", target_show_values_mapping: { "#guardian_clause": %w(appearance talent misc medical), "#fee_field": %w(appearance talent location material acquired_media), "#exploitable_rights_fields": %w(appearance talent location material acquired_media), "#custom_fields": %w(medical misc), "#amendment_clause": %w(location) } }, class: "form-control custom-select" %>
<%= form.radio_button :accessibility, :public_template, label: "Public", wrapper_class: "mr-3" %> @@ -29,6 +29,11 @@ <%= form.rich_text_area :guardian_clause %> <% end %>
+
+ <%= form.form_group do %> + <%= form.rich_text_area :amendment_clause %> + <% end %> +