diff --git a/app/controllers/admin/administration/locations_controller.rb b/app/controllers/admin/administration/locations_controller.rb index 3cb94a4abdf118a3ae40f3695cd8969dd0d37995..07041d4f40ad3ed0f88b8c8c23ada218452e9dde 100644 --- a/app/controllers/admin/administration/locations_controller.rb +++ b/app/controllers/admin/administration/locations_controller.rb @@ -63,6 +63,6 @@ class Admin::Administration::LocationsController < Admin::Administration::Applic def location_params params.require(:administration_location) - .permit(:name, :address, :zipcode, :city, :country, :url, :phone, school_ids: [], program_ids: []) + .permit(:name, :address, :address_additional, :address_name, :zipcode, :city, :country, :url, :phone, school_ids: [], program_ids: []) end end diff --git a/app/models/administration/location.rb b/app/models/administration/location.rb index 8908cd91886441cd8e8cf3d7ff3f0dca4fe9ca8c..04460d8cdbac506b323b655dd2e49aaa24fb8b46 100644 --- a/app/models/administration/location.rb +++ b/app/models/administration/location.rb @@ -2,21 +2,23 @@ # # Table name: administration_locations # -# id :uuid not null, primary key -# address :string -# city :string -# country :string -# latitude :float -# longitude :float -# name :string -# phone :string -# slug :string -# summary :text -# url :string -# zipcode :string -# created_at :datetime not null -# updated_at :datetime not null -# university_id :uuid not null, indexed +# id :uuid not null, primary key +# address :string +# address_additional :string +# address_name :string +# city :string +# country :string +# latitude :float +# longitude :float +# name :string +# phone :string +# slug :string +# summary :text +# url :string +# zipcode :string +# created_at :datetime not null +# updated_at :datetime not null +# university_id :uuid not null, indexed # # Indexes # diff --git a/app/views/admin/administration/locations/_form.html.erb b/app/views/admin/administration/locations/_form.html.erb index 68eb0c747f26bad2f064b4097e9c1bedc89db082..0f5a27abca369a67315209cd5b4d6e802f9ce579 100644 --- a/app/views/admin/administration/locations/_form.html.erb +++ b/app/views/admin/administration/locations/_form.html.erb @@ -7,7 +7,9 @@ <%= render 'admin/application/summary/form', f: f, about: location %> </div> <div class="col-lg-4"> + <%= f.input :address_name %> <%= f.input :address %> + <%= f.input :address_additional %> <div class="row pure__row--small"> <div class="col-md-4"> <%= f.input :zipcode %> diff --git a/app/views/admin/administration/locations/static.html.erb b/app/views/admin/administration/locations/static.html.erb index 0e75b24c7be59b8288a314e165deb20cb80e95a0..65336fcc13ef9f8d12f6bdf4db4ce7fb5623a036 100644 --- a/app/views/admin/administration/locations/static.html.erb +++ b/app/views/admin/administration/locations/static.html.erb @@ -9,7 +9,9 @@ title: > current_title: @about.to_s %> <% end %> contact_details: +<%= render 'admin/application/static/contact_detail', variable: :address_name, data: @about.address_name, kind: ContactDetails::Base %> <%= render 'admin/application/static/contact_detail', variable: :address, data: @about.address, kind: ContactDetails::Base %> +<%= render 'admin/application/static/contact_detail', variable: :address_additional, data: @about.address_additional, kind: ContactDetails::Base %> <%= render 'admin/application/static/contact_detail', variable: :zipcode, data: @about.zipcode, kind: ContactDetails::Base %> <%= render 'admin/application/static/contact_detail', variable: :city, data: @about.city, kind: ContactDetails::Base %> <%= render 'admin/application/static/contact_detail', variable: :country, data: @about.country, kind: ContactDetails::Country %> diff --git a/app/views/admin/university/organizations/static.html.erb b/app/views/admin/university/organizations/static.html.erb index 58717ff974dcb5549d7297ea2c16460ca42e07eb..fc5c5f245cf4e817188f6de76335f6d8bdba1679 100644 --- a/app/views/admin/university/organizations/static.html.erb +++ b/app/views/admin/university/organizations/static.html.erb @@ -33,11 +33,12 @@ kind: website: > <%= prepare_text_for_static @about.url %> contact_details: +<%= render 'admin/application/static/contact_detail', variable: :address_name, data: @about.address_name, kind: ContactDetails::Base %> <%= render 'admin/application/static/contact_detail', variable: :address, data: @about.address, kind: ContactDetails::Base %> +<%= render 'admin/application/static/contact_detail', variable: :address_additional, data: @about.address_additional, kind: ContactDetails::Base %> <%= render 'admin/application/static/contact_detail', variable: :zipcode, data: @about.zipcode, kind: ContactDetails::Base %> <%= render 'admin/application/static/contact_detail', variable: :city, data: @about.city, kind: ContactDetails::Base %> <%= render 'admin/application/static/contact_detail', variable: :country, data: @about.country, kind: ContactDetails::Country %> -<%= render 'admin/application/static/contact_detail', variable: :address, data: @about.address, kind: ContactDetails::Base %> <%= render 'admin/application/static/contact_detail', variable: :website, data: @about.url, kind: ContactDetails::Website %> <%= render 'admin/application/static/contact_detail', variable: :linkedin, data: @about.linkedin, kind: ContactDetails::Linkedin %> <%= render 'admin/application/static/contact_detail', variable: :twitter, data: @about.twitter, kind: ContactDetails::Twitter %> diff --git a/config/locales/administration/en.yml b/config/locales/administration/en.yml index d2454fdafd213229852a2c617551ce6972b4a8c1..7dc9331ccb4c9767928dc74c9931b2c181e1d3b6 100644 --- a/config/locales/administration/en.yml +++ b/config/locales/administration/en.yml @@ -16,6 +16,8 @@ en: attributes: administration/location: address: Address + address_additional: Additional address + address_name: Address name city: City country: Country name: Name @@ -47,4 +49,13 @@ en: location: description: Management of the various (physical) education and research sites qualiopi: - description: Help in checking the conformity of the training offer with the Qualiopi standard \ No newline at end of file + description: Help in checking the conformity of the training offer with the Qualiopi standard + simple_form: + hints: + administration_location: + address: 'This field is used for geolocation. Ex: 3 rue de la Poste' + address_name: 'This field is not used for geolocation. Ex: Hôtel du Département' + address_additional: 'This field is not used for geolocation. Ex: Bureau 508' + city: 'This field is used for geolocation. Ex: Cenon' + country: 'This field is used for geolocation. Ex: France' + zipcode: 'This field is used for geolocation. Ex: 33150' \ No newline at end of file diff --git a/config/locales/administration/fr.yml b/config/locales/administration/fr.yml index cd2d5d84fea1c3f921846334b082ba96257407da..f9a479b4e632961e9e56f4359dd22d7e7d7f92bc 100644 --- a/config/locales/administration/fr.yml +++ b/config/locales/administration/fr.yml @@ -16,6 +16,8 @@ fr: attributes: administration/location: address: Adresse + address_additional: Complément d'adresse + address_name: Nom de l'adresse city: Ville country: Pays name: Nom @@ -48,3 +50,12 @@ fr: description: Gestion des différents sites (physiques) de formation et de recherche qualiopi: description: Aide à la vérification de la conformité de l'offre de formation avec la norme Qualiopi + simple_form: + hints: + administration_location: + address: 'Ce champ est utilisé pour géolocaliser. Ex: 3 rue de la Poste' + address_name: 'Ce champ est ignoré dans la géolocalisation. Ex: Hôtel du Département' + address_additional: 'Ce champ est ignoré dans la géolocalisation. Ex: Bureau 508' + city: 'Ce champ est utilisé pour géolocaliser. Ex: Cenon' + country: 'Ce champ est utilisé pour géolocaliser. Ex: France' + zipcode: 'Ce champ est utilisé pour géolocaliser. Ex: 33150' \ No newline at end of file diff --git a/db/migrate/20240130111440_add_additional_address_to_administration_location.rb b/db/migrate/20240130111440_add_additional_address_to_administration_location.rb new file mode 100644 index 0000000000000000000000000000000000000000..73cdbe10f70ee3d635b4328dff77bd2d452c5d3b --- /dev/null +++ b/db/migrate/20240130111440_add_additional_address_to_administration_location.rb @@ -0,0 +1,6 @@ +class AddAdditionalAddressToAdministrationLocation < ActiveRecord::Migration[7.1] + def change + add_column :administration_locations, :address_additional, :string + add_column :administration_locations, :address_name, :string + end +end diff --git a/db/schema.rb b/db/schema.rb index abd8aece95f9e7eb6959219640e23a6625d52f70..941f26db705addac4f9a7690c82b955534b9813c 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.1].define(version: 2024_01_29_100647) do +ActiveRecord::Schema[7.1].define(version: 2024_01_30_111440) do # These are extensions that must be enabled in order to support this database enable_extension "pgcrypto" enable_extension "plpgsql" @@ -71,6 +71,8 @@ ActiveRecord::Schema[7.1].define(version: 2024_01_29_100647) do t.datetime "created_at", null: false t.datetime "updated_at", null: false t.string "slug" + t.string "address_additional" + t.string "address_name" t.index ["university_id"], name: "index_administration_locations_on_university_id" end