diff --git a/app/controllers/extranet/academic_years_controller.rb b/app/controllers/extranet/academic_years_controller.rb index ae8af0b8c569df15a51e6a2e3da2f05765b70447..5b7d80d9b3171d4f70d7b38921376e9bd6a0b514 100644 --- a/app/controllers/extranet/academic_years_controller.rb +++ b/app/controllers/extranet/academic_years_controller.rb @@ -4,7 +4,7 @@ class Extranet::AcademicYearsController < Extranet::ApplicationController through_association: :academic_years def index - @academic_years = current_context.about&.academic_years || @academic_years + @academic_years = current_extranet.about&.academic_years || @academic_years breadcrumb end diff --git a/app/controllers/extranet/cohorts_controller.rb b/app/controllers/extranet/cohorts_controller.rb index 7ff9e380dc6637c345005bb0c02fbbc74216791f..e25c966f2436df3c6edb8a413c0087bc736afe38 100644 --- a/app/controllers/extranet/cohorts_controller.rb +++ b/app/controllers/extranet/cohorts_controller.rb @@ -4,7 +4,7 @@ class Extranet::CohortsController < Extranet::ApplicationController through_association: :education_cohorts def index - @cohorts = current_context.about&.cohorts || @cohorts + @cohorts = current_extranet.about&.cohorts || @cohorts breadcrumb end diff --git a/app/controllers/extranet/home_controller.rb b/app/controllers/extranet/home_controller.rb index 6c097138065df7a0d5a018826bf23d7d86f05918..d0b22af8f1c99870030fc6c052c2cdb92205adae 100644 --- a/app/controllers/extranet/home_controller.rb +++ b/app/controllers/extranet/home_controller.rb @@ -1,6 +1,7 @@ class Extranet::HomeController < Extranet::ApplicationController def index redirect_to admin_root_path unless current_extranet - @cohorts = current_university.education_cohorts.ordered.limit(2) + @cohorts = current_extranet.about&.cohorts || current_university.education_cohorts + @cohorts = @cohorts.ordered.limit(5) end end diff --git a/app/controllers/extranet/persons_controller.rb b/app/controllers/extranet/persons_controller.rb index c674dbb34a8bf128ea15ffc8b252c7454f1ba03c..172fc4473cb9dcea27c733b9b95c8d3c81b44b4a 100644 --- a/app/controllers/extranet/persons_controller.rb +++ b/app/controllers/extranet/persons_controller.rb @@ -4,7 +4,7 @@ class Extranet::PersonsController < Extranet::ApplicationController through_association: :people def index - @people = current_context.about&.alumni || @people.alumni + @people = current_extranet.about&.alumni || @people.alumni breadcrumb end diff --git a/app/views/extranet/home/index.html.erb b/app/views/extranet/home/index.html.erb index d2c5b60451a61c62cf6f8a2e14feaaa97584e9cb..3a6a045cbdabf5e569b57de4a9afd5061302f7d7 100644 --- a/app/views/extranet/home/index.html.erb +++ b/app/views/extranet/home/index.html.erb @@ -1,5 +1,14 @@ <% content_for :title, current_context %> -<h2><%= Education::Cohort.model_name.human(count: 2) %></h2> -<p><%= link_to 'Voir toutes les promotions', education_cohorts_path %></p> -<%= render 'extranet/cohorts/list', cohorts: @cohorts %> +<div class="row"> + <div class="col-md-8"> + + </div> + <div class="col-md-4"> + <h2>Promotions actuelles</h2> + <p><%= link_to 'Voir toutes les promotions', education_cohorts_path %></p> + <% @cohorts.each do |cohort| %> + <%= link_to cohort, cohort %><br> + <% end %> + </div> +</div>