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

data

parent bec9e7cd
No related branches found
No related tags found
No related merge requests found
class Extranet::PagesController < Extranet::ApplicationController
skip_before_action :authenticate_user!, :authorize_extranet_access!
def termes_of_use
def terms
breadcrumb
add_breadcrumb Communication::Extranet.human_attribute_name('terms')
end
def cookie_policy
def cookies_policy
breadcrumb
add_breadcrumb Communication::Extranet.human_attribute_name('cookies_policy')
end
def privacy_policy
breadcrumb
add_breadcrumb Communication::Extranet.human_attribute_name('privacy_policy')
end
def data
@metrics = [
{ value: current_extranet.alumni.count, name: University::Person::Alumnus.model_name.human(count: 2) },
{ value: current_extranet.users.count, name: User.model_name.human(count: 2) },
{ value: current_extranet.experiences.count, name: University::Person::Experience.model_name.human(count: 2) },
{ value: current_extranet.academic_years.count, name: Education::AcademicYear.model_name.human(count: 2) },
{ value: current_extranet.cohorts.count, name: Education::Cohort.model_name.human(count: 2) },
{ value: current_extranet.organizations.count, name: University::Organization.model_name.human(count: 2) },
]
breadcrumb
add_breadcrumb t('extranet.data')
end
end
......@@ -68,6 +68,10 @@ class Communication::Extranet < ApplicationRecord
about&.university_person_alumni
end
def users
university.users.where(person: alumni)
end
def cohorts
about&.cohorts
end
......@@ -75,11 +79,16 @@ class Communication::Extranet < ApplicationRecord
def years
about&.academic_years
end
alias academic_years years
def organizations
about&.alumni_organizations
end
def experiences
about&.alumni_experiences
end
def url
@url ||= Rails.env.development? ? "http://#{host}:3000" : "https://#{host}"
end
......
......@@ -23,12 +23,11 @@
<span itemprop="name"><%= current_extranet.about.name %></span>
</div>
<% end %>
<p class="my-5"><%= t 'extranet.osuny_html' %></p>
</div>
<nav class="text-md-end col-md-6">
<%= link_to t('terms_of_service'),
terms_of_service_path,
terms_path,
target: '_blank',
rel: 'noreferrer' if current_extranet.has_terms? %>
<%= link_to t('privacy_policy'),
......@@ -39,9 +38,12 @@
cookies_policy_path,
target: '_blank',
rel: 'noreferrer' if current_extranet.has_cookies_policy? %>
<%= link_to t('extranet.data'), data_path %>
<%= link_to t('cookies_consent_choice'),
'',
class: 'js-gdpr__cookie_consent__display_again' %>
<%= t 'extranet.osuny_html' %>
</nav>
</div>
......
<% content_for :title, t('extranet.data') %>
<% content_for :header do %>
<h1><%= t('extranet.data') %></h1>
<% end %>
<div class="row">
<% @metrics.each do |metric| %>
<div class="col-md-3">
<p class="h1 mb-0"><%= metric[:value] %></p>
<p><%= metric[:name] %></p>
</div>
<% end %>
</div>
\ No newline at end of file
......@@ -6,6 +6,7 @@ en:
edit_personal_data: Edit profile
updated: Updated
logout: Log out
data: Data
errors:
email_not_allowed: is not authorized to access this extranet.
email_not_allowed_with_contact: is not authorized to access this extranet. Contact %{contact} for more information.
......@@ -19,7 +20,7 @@ en:
organization:
experiences: Alumni in this organization (%{count})
osuny_html:
Crafted with <a href="https://www.osuny.org" target="_blank" rel="noreferer">Osuny</a>
<a href="https://www.osuny.org" target="_blank" rel="noreferer">Crafted with ♥ and with Osuny</a>
personal_data:
title: My personal data
updated: Your personal data has been updated!
......@@ -6,6 +6,7 @@ fr:
edit_personal_data: Modifier mon profil
updated: Mise à jour effectuée
logout: Déconnexion
data: Informations
errors:
email_not_allowed: n'est pas autorisé à accéder à cet extranet.
email_not_allowed_with_contact: n'est pas autorisé à accéder à cet extranet. Contactez %{contact} pour en savoir plus.
......@@ -20,7 +21,7 @@ fr:
organization:
experiences: Alumni dans cette organisation (%{count})
osuny_html:
Développé avec <a href="https://www.osuny.org" target="_blank" rel="noreferer">Osuny</a>
<a href="https://www.osuny.org" target="_blank" rel="noreferer">Développé avec ♥ et avec Osuny</a>
personal_data:
edit: Modifier
title: Mes données personnelles
......
......@@ -15,7 +15,8 @@ scope :account do
get 'personal_data' => 'extranet/personal_data#edit', as: :edit_personal_data
patch 'personal_data' => 'extranet/personal_data#update', as: :personal_data
end
get 'terms-of-service' => 'extranet/pages#terms_of_service', as: :terms_of_service
get 'terms' => 'extranet/pages#terms', as: :terms
get 'privacy-policy' => 'extranet/pages#privacy_policy', as: :privacy_policy
get 'cookies-policy' => 'extranet/pages#cookies_policy', as: :cookies_policy
get 'data' => 'extranet/pages#data', as: :data
root to: 'extranet/home#index'
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