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 class Extranet::PagesController < Extranet::ApplicationController
skip_before_action :authenticate_user!, :authorize_extranet_access! skip_before_action :authenticate_user!, :authorize_extranet_access!
def termes_of_use def terms
breadcrumb
add_breadcrumb Communication::Extranet.human_attribute_name('terms')
end end
def cookie_policy def cookies_policy
breadcrumb
add_breadcrumb Communication::Extranet.human_attribute_name('cookies_policy')
end end
def privacy_policy 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
end end
...@@ -68,6 +68,10 @@ class Communication::Extranet < ApplicationRecord ...@@ -68,6 +68,10 @@ class Communication::Extranet < ApplicationRecord
about&.university_person_alumni about&.university_person_alumni
end end
def users
university.users.where(person: alumni)
end
def cohorts def cohorts
about&.cohorts about&.cohorts
end end
...@@ -75,11 +79,16 @@ class Communication::Extranet < ApplicationRecord ...@@ -75,11 +79,16 @@ class Communication::Extranet < ApplicationRecord
def years def years
about&.academic_years about&.academic_years
end end
alias academic_years years
def organizations def organizations
about&.alumni_organizations about&.alumni_organizations
end end
def experiences
about&.alumni_experiences
end
def url def url
@url ||= Rails.env.development? ? "http://#{host}:3000" : "https://#{host}" @url ||= Rails.env.development? ? "http://#{host}:3000" : "https://#{host}"
end end
......
...@@ -23,12 +23,11 @@ ...@@ -23,12 +23,11 @@
<span itemprop="name"><%= current_extranet.about.name %></span> <span itemprop="name"><%= current_extranet.about.name %></span>
</div> </div>
<% end %> <% end %>
<p class="my-5"><%= t 'extranet.osuny_html' %></p>
</div> </div>
<nav class="text-md-end col-md-6"> <nav class="text-md-end col-md-6">
<%= link_to t('terms_of_service'), <%= link_to t('terms_of_service'),
terms_of_service_path, terms_path,
target: '_blank', target: '_blank',
rel: 'noreferrer' if current_extranet.has_terms? %> rel: 'noreferrer' if current_extranet.has_terms? %>
<%= link_to t('privacy_policy'), <%= link_to t('privacy_policy'),
...@@ -39,9 +38,12 @@ ...@@ -39,9 +38,12 @@
cookies_policy_path, cookies_policy_path,
target: '_blank', target: '_blank',
rel: 'noreferrer' if current_extranet.has_cookies_policy? %> rel: 'noreferrer' if current_extranet.has_cookies_policy? %>
<%= link_to t('extranet.data'), data_path %>
<%= link_to t('cookies_consent_choice'), <%= link_to t('cookies_consent_choice'),
'', '',
class: 'js-gdpr__cookie_consent__display_again' %> class: 'js-gdpr__cookie_consent__display_again' %>
<%= t 'extranet.osuny_html' %>
</nav> </nav>
</div> </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: ...@@ -6,6 +6,7 @@ en:
edit_personal_data: Edit profile edit_personal_data: Edit profile
updated: Updated updated: Updated
logout: Log out logout: Log out
data: Data
errors: errors:
email_not_allowed: is not authorized to access this extranet. 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. email_not_allowed_with_contact: is not authorized to access this extranet. Contact %{contact} for more information.
...@@ -19,7 +20,7 @@ en: ...@@ -19,7 +20,7 @@ en:
organization: organization:
experiences: Alumni in this organization (%{count}) experiences: Alumni in this organization (%{count})
osuny_html: 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: personal_data:
title: My personal data title: My personal data
updated: Your personal data has been updated! updated: Your personal data has been updated!
...@@ -6,6 +6,7 @@ fr: ...@@ -6,6 +6,7 @@ fr:
edit_personal_data: Modifier mon profil edit_personal_data: Modifier mon profil
updated: Mise à jour effectuée updated: Mise à jour effectuée
logout: Déconnexion logout: Déconnexion
data: Informations
errors: errors:
email_not_allowed: n'est pas autorisé à accéder à cet extranet. 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. email_not_allowed_with_contact: n'est pas autorisé à accéder à cet extranet. Contactez %{contact} pour en savoir plus.
...@@ -20,7 +21,7 @@ fr: ...@@ -20,7 +21,7 @@ fr:
organization: organization:
experiences: Alumni dans cette organisation (%{count}) experiences: Alumni dans cette organisation (%{count})
osuny_html: 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: personal_data:
edit: Modifier edit: Modifier
title: Mes données personnelles title: Mes données personnelles
......
...@@ -15,7 +15,8 @@ scope :account do ...@@ -15,7 +15,8 @@ scope :account do
get 'personal_data' => 'extranet/personal_data#edit', as: :edit_personal_data get 'personal_data' => 'extranet/personal_data#edit', as: :edit_personal_data
patch 'personal_data' => 'extranet/personal_data#update', as: :personal_data patch 'personal_data' => 'extranet/personal_data#update', as: :personal_data
end 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 'privacy-policy' => 'extranet/pages#privacy_policy', as: :privacy_policy
get 'cookies-policy' => 'extranet/pages#cookies_policy', as: :cookies_policy get 'cookies-policy' => 'extranet/pages#cookies_policy', as: :cookies_policy
get 'data' => 'extranet/pages#data', as: :data
root to: 'extranet/home#index' 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