diff --git a/app/controllers/members_controller.rb b/app/controllers/members_controller.rb
index 763bc01..d5407a8 100644
--- a/app/controllers/members_controller.rb
+++ b/app/controllers/members_controller.rb
@@ -72,6 +72,30 @@ def member_params
:membership_expires_at,
:privacy_disclaimer,
:picture_disclaimer,
+ :first_parent_first_name,
+ :first_parent_last_name,
+ :first_parent_born_at,
+ :first_parent_born_in,
+ :first_parent_tax_code,
+ :first_parent_citizenship,
+ :first_parent_address,
+ :first_parent_postal_code,
+ :first_parent_municipality,
+ :first_parent_province,
+ :first_parent_telephone,
+ :first_parent_email,
+ :second_parent_first_name,
+ :second_parent_last_name,
+ :second_parent_born_at,
+ :second_parent_born_in,
+ :second_parent_tax_code,
+ :second_parent_citizenship,
+ :second_parent_address,
+ :second_parent_postal_code,
+ :second_parent_municipality,
+ :second_parent_province,
+ :second_parent_telephone,
+ :second_parent_email,
group_ids: [],
tag_ids: []
)
diff --git a/app/views/members/_form.html.erb b/app/views/members/_form.html.erb
index 5411b56..1c6ea0d 100644
--- a/app/views/members/_form.html.erb
+++ b/app/views/members/_form.html.erb
@@ -14,6 +14,54 @@
<%= f.input :province, wrapper_html: { class: 'col-sm-2' } %>
<%= f.input :telephone, wrapper_html: { class: 'col-sm-6' } %>
<%= f.input :email, wrapper_html: { class: 'col-sm-6' } %>
+
+
+
+
+
+ <%= f.input :first_parent_first_name, wrapper_html: { class: 'col-sm-6' } %>
+ <%= f.input :first_parent_last_name, wrapper_html: { class: 'col-sm-6' } %>
+ <%= f.input :first_parent_born_at, start_year: Date.today.year - 90, end_year: Date.today.year - 5 %>
+ <%= f.input :first_parent_born_in %>
+ <%= f.input :first_parent_tax_code %>
+ <%= f.input :first_parent_citizenship, wrapper_html: { class: 'col-sm-6' } %>
+ <%= f.input :first_parent_address, wrapper_html: { class: 'col-sm-6' } %>
+ <%= f.input :first_parent_postal_code, wrapper_html: { class: 'col-sm-2' } %>
+ <%= f.input :first_parent_municipality, wrapper_html: { class: 'col-sm-8' } %>
+ <%= f.input :first_parent_province, wrapper_html: { class: 'col-sm-2' } %>
+ <%= f.input :first_parent_telephone, wrapper_html: { class: 'col-sm-6' } %>
+ <%= f.input :first_parent_email, wrapper_html: { class: 'col-sm-6' } %>
+
+
+
+
+
+
+
+ <%= f.input :second_parent_first_name, wrapper_html: { class: 'col-sm-6' } %>
+ <%= f.input :second_parent_last_name, wrapper_html: { class: 'col-sm-6' } %>
+ <%= f.input :second_parent_born_at, start_year: Date.today.year - 90, end_year: Date.today.year - 5 %>
+ <%= f.input :second_parent_born_in %>
+ <%= f.input :second_parent_tax_code %>
+ <%= f.input :second_parent_citizenship, wrapper_html: { class: 'col-sm-6' } %>
+ <%= f.input :second_parent_address, wrapper_html: { class: 'col-sm-6' } %>
+ <%= f.input :second_parent_postal_code, wrapper_html: { class: 'col-sm-2' } %>
+ <%= f.input :second_parent_municipality, wrapper_html: { class: 'col-sm-8' } %>
+ <%= f.input :second_parent_province, wrapper_html: { class: 'col-sm-2' } %>
+ <%= f.input :second_parent_telephone, wrapper_html: { class: 'col-sm-6' } %>
+ <%= f.input :second_parent_email, wrapper_html: { class: 'col-sm-6' } %>
+
+
+
+
<%= I18n.t('membership.name') %>
@@ -30,6 +78,8 @@
%>
<%= f.association :tags, collection: @club.tags, as: :check_boxes %>
<%= f.association :groups, collection: @club.groups, as: :check_boxes %>
+ <%= f.input :privacy_disclaimer %>
+ <%= f.input :picture_disclaimer %>
<%= f.file_field :picture %>
<%=
if member.picture.present?
diff --git a/config/locales/it.yml b/config/locales/it.yml
index a972fe2..11f868e 100644
--- a/config/locales/it.yml
+++ b/config/locales/it.yml
@@ -61,6 +61,8 @@ it:
updated: Collaboratore aggiornato
destroyed: Collaboratore cancellato
members:
+ first_parent: Primo genitore
+ second_parent: Secondo genitore
header: Membri
select: Seleziona membro
new: Nuovo membro
@@ -168,6 +170,28 @@ it:
municipality: Comune
groups: Gruppi
tags: Attributi
+ privacy_disclaimer: liberatoria privacy
+ picture_disclaimer: liberatoria foto
+ first_parent_name: Primo genitore Nome
+ first_parent_first_name: Primo genitore Nome
+ first_parent_last_name: Primo genitore Cognome
+ first_parent_born_in: Primo genitore Nato a
+ first_parent_born_at: Primo genitore Nato il
+ first_parent_citizenship: Primo genitore Cittadinanza
+ first_parent_address: Primo genitore Indirizzo
+ first_parent_postal_code: Primo genitore CAP
+ first_parent_email: Primo genitore Email
+ first_parent_municipality: Primo genitore Comune
+ second_parent_name: Secondo genitore Nome
+ second_parent_first_name: Secondo genitore Nome
+ second_parent_last_name: Secondo genitore Cognome
+ second_parent_born_in: Nato Secondo genitore a
+ second_parent_born_at: Nato Secondo genitore il
+ second_parent_citizenship: Secondo genitore Cittadinanza
+ second_parent_address: Secondo genitore Indirizzo
+ second_parent_postal_code: Secondo genitore CAP
+ second_parent_email: Secondo genitore Email
+ second_parent_municipality: Secondo genitore Comune
event/kind:
training: Allenamento
competition: Partita/Gara
diff --git a/db/migrate/20240824101228_add_parents_to_members.rb b/db/migrate/20240824101228_add_parents_to_members.rb
new file mode 100644
index 0000000..3bc9d7f
--- /dev/null
+++ b/db/migrate/20240824101228_add_parents_to_members.rb
@@ -0,0 +1,35 @@
+# frozen_string_literal: true
+
+class AddParentsToMembers < ActiveRecord::Migration[7.2]
+ def change
+ change_table :members, bulk: true do |t|
+ # first parent
+ t.string :first_parent_first_name
+ t.string :first_parent_last_name
+ t.date :first_parent_born_at
+ t.string :first_parent_born_in
+ t.string :first_parent_tax_code
+ t.string :first_parent_citizenship
+ t.string :first_parent_address
+ t.string :first_parent_postal_code
+ t.string :first_parent_municipality
+ t.string :first_parent_province
+ t.string :first_parent_telephone
+ t.string :first_parent_email
+
+ # second parent
+ t.string :second_parent_first_name
+ t.string :second_parent_last_name
+ t.date :second_parent_born_at
+ t.string :second_parent_born_in
+ t.string :second_parent_tax_code
+ t.string :second_parent_citizenship
+ t.string :second_parent_address
+ t.string :second_parent_postal_code
+ t.string :second_parent_municipality
+ t.string :second_parent_province
+ t.string :second_parent_telephone
+ t.string :second_parent_email
+ end
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
index bab2e3b..5754698 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
-ActiveRecord::Schema[7.2].define(version: 2024_08_18_161003) do
+ActiveRecord::Schema[7.2].define(version: 2024_08_24_101228) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
@@ -142,6 +142,30 @@
t.boolean "picture_disclaimer", default: false, null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
+ t.string "first_parent_first_name"
+ t.string "first_parent_last_name"
+ t.date "first_parent_born_at"
+ t.string "first_parent_born_in"
+ t.string "first_parent_tax_code"
+ t.string "first_parent_citizenship"
+ t.string "first_parent_address"
+ t.string "first_parent_postal_code"
+ t.string "first_parent_municipality"
+ t.string "first_parent_province"
+ t.string "first_parent_telephone"
+ t.string "first_parent_email"
+ t.string "second_parent_first_name"
+ t.string "second_parent_last_name"
+ t.date "second_parent_born_at"
+ t.string "second_parent_born_in"
+ t.string "second_parent_tax_code"
+ t.string "second_parent_citizenship"
+ t.string "second_parent_address"
+ t.string "second_parent_postal_code"
+ t.string "second_parent_municipality"
+ t.string "second_parent_province"
+ t.string "second_parent_telephone"
+ t.string "second_parent_email"
t.index ["club_id"], name: "index_members_on_club_id"
end