Skip to content
Snippets Groups Projects
Commit 567cbd26 authored by Arnaud Levy's avatar Arnaud Levy
Browse files

Add url to school

parent a5247102
No related branches found
No related tags found
No related merge requests found
......@@ -60,6 +60,6 @@ class Admin::Education::SchoolsController < Admin::Education::ApplicationControl
def school_params
params.require(:education_school)
.permit(:university_id, :name, :address, :zipcode, :city, :country, :phone, :logo, :logo_delete, program_ids: [])
.permit(:university_id, :name, :address, :zipcode, :city, :country, :url, :phone, :logo, :logo_delete, program_ids: [])
end
end
......@@ -10,6 +10,7 @@
# longitude :float
# name :string
# phone :string
# url :string
# zipcode :string
# created_at :datetime not null
# updated_at :datetime not null
......
......@@ -17,6 +17,7 @@
</div>
</div>
<%= f.input :country, input_html: { class: 'form-select' } %>
<%= f.input :url %>
<%= f.input :logo,
as: :single_deletable_file,
input_html: { accept: '.jpg,.jpeg,.png,.svg' },
......
......@@ -10,8 +10,14 @@
<%= @school.zipcode %> <%= @school.city %><br>
<%= @school.country %>
</p>
<%= osuny_label Education::School.human_attribute_name('phone') %>
<p><%= @school.phone %></p>
<% if @school.phone.present? %>
<%= osuny_label Education::School.human_attribute_name('phone') %>
<p><%= @school.phone %></p>
<% end %>
<% if @school.url.present? %>
<%= osuny_label Education::School.human_attribute_name('url') %>
<p><%= link_to @school.url, @school.url, target: :_blank %></p>
<% end %>
<% end %>
</div>
......
<% hide_logo ||= false %>
<%
hide_logo ||= false
about = current_extranet.about
%>
<footer class="pt-5">
<div class="container">
......@@ -9,14 +12,17 @@
<% end %>
<div class="row justify-space-between">
<div class="col-md-6">
<% if current_extranet.about.is_a?(Education::School) %>
<% if about.is_a?(Education::School) %>
<address itemscope itemtype="https://schema.org/CollegeOrUniversity">
<span itemprop="name"><%= current_extranet.about.name %></span>
<span itemprop="name"><%= about.name %></span>
<div itemprop="address" itemscope itemtype="https://schema.org/PostalAddress">
<span itemprop="streetAddress"><%= current_extranet.about.address %></span><br>
<span itemprop="postalCode"><%= current_extranet.about.zipcode %></span>
<span itemprop="addressLocality"><%= current_extranet.about.city %></span><br>
<span itemprop="streetAddress"><%= about.address %></span><br>
<span itemprop="postalCode"><%= about.zipcode %></span>
<span itemprop="addressLocality"><%= about.city %></span><br>
</div>
<% if about.url.present? %>
<a href="<%= social_website_to_url about.url %>" target="_blank" property="url"><%= social_website_to_s about.url %></a>
<% end %>
</address>
<% elsif current_extranet.about.is_a?(Education::Program) %>
<div itemscope itemtype="https://schema.org/EducationalOccupationalCredential">
......
......@@ -79,6 +79,7 @@ en:
phone: Phone
programs: Programs provided
roles: Team Members
url: Website
websites: Linked websites
zipcode: Zipcode
admin:
......
......@@ -82,6 +82,7 @@ fr:
phone: Téléphone
programs: Formations dispensées
roles: Membres de l'équipe
url: Site Web
websites: Sites Web associés
zipcode: Code postal
university/person/teacher:
......
class AddUrlToEducationSchool < ActiveRecord::Migration[7.0]
def change
add_column :education_schools, :url, :string
end
end
......@@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema[7.0].define(version: 2023_03_17_160229) do
ActiveRecord::Schema[7.0].define(version: 2023_03_20_125138) do
# These are extensions that must be enabled in order to support this database
enable_extension "pgcrypto"
enable_extension "plpgsql"
......@@ -658,6 +658,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_03_17_160229) do
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.string "phone"
t.string "url"
t.index ["university_id"], name: "index_education_schools_on_university_id"
end
......
......@@ -10,6 +10,7 @@
# longitude :float
# name :string
# phone :string
# url :string
# zipcode :string
# created_at :datetime not null
# updated_at :datetime not null
......@@ -29,4 +30,4 @@ default_school:
zipcode: 33080
city: Bordeaux
country: FR
university: default_university
\ No newline at end of file
university: default_university
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment