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

posts

parent a488b8d7
No related branches found
No related tags found
No related merge requests found
......@@ -2,5 +2,6 @@ class Extranet::HomeController < Extranet::ApplicationController
def index
@cohorts = about&.education_cohorts.ordered.limit(5)
@experiences = about&.university_person_experiences.recent
@posts = current_extranet.posts.published.ordered.limit(3) if current_extranet.feature_posts
end
end
<div class="row">
<div class="col-md-8">
<h2><%= t('extranet.home.recent_experiences') %></h2>
<div class="experiences">
<ul>
<% @experiences.ordered.each do |experience| %>
<li>
<div>
<%= link_to [:alumni, experience.person], class: "stretched-link" do %>
<% if experience.person.best_picture.attached? %>
<%= kamifusen_tag experience.person.best_picture, width: 400, class: 'img-fluid', sizes: {
'(max-width: 576px)': '400px',
'(max-width: 991px)': '200px'
} %>
<% else %>
<%= image_tag 'extranet/avatar.png', width: 400, class: 'img-fluid' %>
<% end %>
<% end %>
</div>
<div>
<section class="mt-5">
<div class="row">
<div class="col-md-8">
<h2><%= t('extranet.home.recent_experiences') %></h2>
<div class="experiences">
<ul>
<% @experiences.ordered.each do |experience| %>
<li>
<div>
<p class="mb-md-0">
<%= experience.person.first_name %> <%= experience.person.last_name %>
<br>
<%= experience.description %>
<%= '—' if experience.description.present? && experience.organization.present? %>
<%= experience.organization %>
</p>
<small><%= l experience.created_at.to_date, format: :long %></small>
<%= link_to [:alumni, experience.person], class: "stretched-link" do %>
<% if experience.person.best_picture.attached? %>
<%= kamifusen_tag experience.person.best_picture, width: 400, class: 'img-fluid', sizes: {
'(max-width: 576px)': '400px',
'(max-width: 991px)': '200px'
} %>
<% else %>
<%= image_tag 'extranet/avatar.png', width: 400, class: 'img-fluid' %>
<% end %>
<% end %>
</div>
<% if experience.organization.present? %>
<% if experience.organization.logo.attached? %>
<%= link_to [:alumni, experience.organization] do %>
<%= kamifusen_tag experience.organization.logo, height: 80, class: 'img-fluid' %>
<% end %>
<div>
<div>
<p class="mb-md-0">
<%= experience.person.first_name %> <%= experience.person.last_name %>
<br>
<%= experience.description %>
<%= '—' if experience.description.present? && experience.organization.present? %>
<%= experience.organization %>
</p>
<small><%= l experience.created_at.to_date, format: :long %></small>
</div>
<% if experience.organization.present? %>
<% if experience.organization.logo.attached? %>
<%= link_to [:alumni, experience.organization] do %>
<%= kamifusen_tag experience.organization.logo, height: 80, class: 'img-fluid' %>
<% end %>
<% end %>
<% end %>
<% end %>
</div>
</div>
</li>
<% end %>
</ul>
</div>
</div>
<div class="col-md-4 mt-5 mt-md-0">
<h2><%= t('extranet.home.recent_cohorts') %></h2>
<ul class="promotions">
<% @cohorts.each do |cohort| %>
<li>
<%= link_to cohort.program.to_short_s, [:alumni, cohort] %>
<b><%= cohort.academic_year %></b>
</li>
<% end %>
</ul>
</div>
</div>
<div class="col-md-4 mt-5 mt-md-0">
<h2><%= t('extranet.home.recent_cohorts') %></h2>
<ul class="promotions">
<% @cohorts.each do |cohort| %>
<li>
<%= link_to cohort.program.to_short_s, [:alumni, cohort] %>
<b><%= cohort.academic_year %></b>
</li>
<% end %>
</ul>
</div>
</div>
\ No newline at end of file
</section>
\ No newline at end of file
<section class="mt-5">
<h2>Chercher dans l'annuaire</h2>
<h2><%= t 'extranet.contacts.search.home' %></h2>
<%= render 'extranet/contacts/search/form' %>
</section>
\ No newline at end of file
<% if @posts.any? %>
<section class="mt-5">
<h2><%= t('extranet.posts.home') %></h2>
<%= render 'extranet/posts/posts/list', posts: @posts %>
</section>
<% end %>
\ No newline at end of file
......@@ -9,6 +9,7 @@
</h1>
<% end %>
<%= render 'extranet/home/features/posts' if current_extranet.feature_posts %>
<%= render 'extranet/home/features/alumni' if current_extranet.feature_alumni %>
<%= render 'extranet/home/features/contacts' if current_extranet.feature_contacts %>
......@@ -9,6 +9,7 @@ en:
logout: Log out
contacts:
search:
home: Search in directory
title: Search
placeholder: Type your search here
submit: Search
......@@ -33,3 +34,5 @@ en:
edit: Edit
title: My personal data
updated: Your personal data has been updated!
posts:
home: Recent posts
\ No newline at end of file
......@@ -9,6 +9,7 @@ fr:
logout: Déconnexion
contacts:
search:
home: Chercher dans l'annuaire
title: Recherche
placeholder: Entrez votre recherche ici
submit: Chercher
......@@ -33,3 +34,5 @@ fr:
edit: Modifier
title: Mes données personnelles
updated: Mise à jour des donnes personnelles effectuée !
posts:
home: Actualités récentes
\ No newline at end of file
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