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

cohorts in path

parent 49d6554c
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, program_ids: [])
.permit(:university_id, :name, :address, :zipcode, :city, :country, :phone, :logo, :logo_delete, program_ids: [])
end
end
......@@ -37,6 +37,7 @@ class Education::School < ApplicationRecord
as: :about,
dependent: :nullify
has_one_attached_deletable :logo
validates :name, :address, :city, :zipcode, :country, presence: true
......
......@@ -21,6 +21,11 @@
</div>
</div>
<%= f.input :country, input_html: { class: 'form-select' } %>
<%= f.input :logo,
as: :single_deletable_file,
input_html: { accept: '.jpg,.jpeg,.png,.svg' },
preview: 200,
direct_upload: true %>
</div>
</div>
</div>
......
<%
edit ||= false
%>
<% if person&.experiences.any? %>
<div class="experiences mt-4">
<ul class="list-unstyled">
<div class="experiences mt-4">
<ul class="list-unstyled">
<% if person&.experiences.any? %>
<% @person.experiences.ordered.each do |experience| %>
<%= render 'extranet/experiences/experience', experience: experience, edit: edit %>
<% end %>
</ul>
</div>
<% end %>
\ No newline at end of file
<% end %>
<% person&.cohorts.each do |cohort| %>
<li class="experiences__experience py-4 border-top">
<div class="row">
<div class="col-md-6">
<p class="mb-0">
<b><%= cohort.program %></b><br>
<%= cohort.program.diploma %><br>
<%= cohort.year %>
</p>
</div>
<div class="col-md-6 text-end">
<% if cohort.school.logo.attached? %>
<%= kamifusen_tag cohort.school.logo, width: 100, class: 'img-fluid experience__organization__logo' %>
<% else %>
<p class="text-end"><%= cohort.school %></p>
<% end %>
</div>
</div>
</li>
<% end %>
</ul>
</div>
\ No newline at end of file
<dl>
<% person.cohorts.each do |cohort| %>
<dt><%= cohort.program %></dt>
<dd><%= link_to cohort.academic_year, cohort %></dd>
<% end %>
<% [:phone_mobile, :phone_personal, :phone_professional].each do |attribute_name| %>
<% next if person.public_send(attribute_name).blank? %>
<dt><%= University::Person.human_attribute_name(attribute_name) %> :</dt>
......
......@@ -9,10 +9,8 @@
</div>
</div>
</div>
<% if @person.experiences.any? %>
<p class="mb-4"><%= t('extranet.experiences.title') %></p>
<%= render 'extranet/experiences/list', person: @person %>
<% end %>
<p class="mb-4"><%= t('extranet.experiences.title') %></p>
<%= render 'extranet/experiences/list', person: @person %>
</div>
<div class="offset-md-1 col-md-3 order-1 order-md-2">
<%= kamifusen_tag @person.best_picture, width: 400, class: 'img-fluid person__portrait' if @person.best_picture.attached? %>
......
......@@ -12,7 +12,7 @@ en:
email_not_allowed_with_contact: is not authorized to access this extranet. Contact %{contact} for more information.
experiences:
new: Add experience
title: Professional path
title: Path
home:
recent_cohorts: Recent cohorts
recent_experiences: Recent experiences
......
......@@ -13,7 +13,7 @@ fr:
experiences:
new: Ajouter une expérience
search_organization: Rechercher par nom ou SIREN
title: Parcours professionnel
title: Parcours
home:
recent_cohorts: Promotions récentes
recent_experiences: Mouvements récents
......
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