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