Skip to content
Snippets Groups Projects
Commit 9f1e83ed authored by pabois's avatar pabois
Browse files

wip alumni

parent 8baf73c5
No related branches found
No related tags found
No related merge requests found
......@@ -19,10 +19,9 @@
class Education::AcademicYear < ApplicationRecord
include WithUniversity
has_many :education_cohorts,
class_name: 'Education::Cohort'
has_many :cohorts,
class_name: 'Education::Cohort'
alias_attribute :education_cohorts, :cohorts
# Dénormalisation des alumni pour le faceted search
has_and_belongs_to_many :university_people,
......
......@@ -2,9 +2,8 @@
<thead>
<tr>
<th><%= Education::AcademicYear.human_attribute_name('year') %></th>
<th><%= Education::AcademicYear.human_attribute_name('cohorts') %></th>
<th><%= Education::AcademicYear.human_attribute_name('alumni') %></th>
<th></th>
<th><%= Education::Cohort.model_name.human(count: 2) %></th>
<th><%= University::Person::Alumnus.model_name.human(count: 2) %></th>
</tr>
</thead>
<tbody>
......@@ -15,12 +14,6 @@
</td>
<td><%= academic_year.cohorts.count %></td>
<td><%= academic_year.people.count %></td>
<td class="text-end">
<div class="btn-group" role="group">
<%= edit_link academic_year %>
<%= destroy_link academic_year %>
</div>
</td>
</tr>
<% end %>
</tbody>
......
<% content_for :title, @academic_year %>
<% if @academic_year.cohorts.any? %>
<h2><%= Education::Cohort.model_name.human(count: 2) %></h2>
<%= render 'admin/education/cohorts/list', cohorts: @academic_year.cohorts.ordered %>
<% end %>
<% if @academic_year.people.any? %>
<h2><%= University::Person::Alumnus.model_name.human(count: 2) %></h2>
<%= render 'admin/university/alumni/list', alumni: @academic_year.people.ordered %>
<% end %>
<% content_for :title, @cohort %>
<div class="row">
<div class="col-md-8">
<div class="card flex-fill w-100">
<div class="card-body">
<h3 class="h5"><%= Education::Cohort.human_attribute_name('program') %></h3>
<p><%= link_to_if can?(:read, @cohort.program), @cohort.program, [:admin, @cohort.program] %></p>
......@@ -15,9 +13,6 @@
</div>
</div>
<h2><%= University::Person::Alumnus.model_name.human(count: 2) %></h2>
<%= render 'admin/university/alumni/list', alumni: @cohort.people.ordered %>
......@@ -20,6 +20,8 @@ en:
one: School
other: Schools
attributes:
education/academic_year:
year: Year
education/cohort:
alumni: Alumni
program: Program
......
......@@ -20,6 +20,8 @@ fr:
one: École
other: Écoles
attributes:
education/academic_year:
year: Année
education/cohort:
alumni: Alumni
program: Formation
......
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