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

enhancements

parent 9d46296f
No related branches found
No related tags found
No related merge requests found
.navbar
margin-bottom: 100px
.navbar-brand
img
max-width: 100px
footer
margin-top: 100px
.alert .alert
padding: .95rem padding: .95rem
...@@ -13,12 +5,21 @@ footer ...@@ -13,12 +5,21 @@ footer
color: #82322F color: #82322F
.extranet .extranet
.navbar
margin-bottom: 100px
.navbar-brand
img
max-width: 100px
header header
border-bottom: 1px solid border-bottom: 1px solid
border-top: 1px solid border-top: 1px solid
min-height: 160px min-height: 160px
h1, p h1, p
padding-top: 3rem padding-top: 3rem
footer
margin-top: 100px
.logo
width: 100px
.breadcrumb .breadcrumb
font-size: 14px font-size: 14px
......
class HomeController < ApplicationController class Extranet::HomeController < Extranet::ApplicationController
def index def index
redirect_to admin_root_path unless current_extranet redirect_to admin_root_path unless current_extranet
@cohorts = current_university.education_cohorts.ordered.limit(2)
end end
end end
...@@ -11,4 +11,35 @@ module ApplicationHelper ...@@ -11,4 +11,35 @@ module ApplicationHelper
classes classes
end end
def social_website_to_url(string)
string = "https://#{string}" unless string.start_with?('http')
string.gsub('http://', 'https://')
end
def social_website_to_s(string)
string.gsub('http://', '')
.gsub('https://', '')
end
def social_linkedin_to_url(string)
string.gsub('http://', 'https://')
end
def social_linkedin_to_s(string)
string.gsub('http://', 'https://')
.gsub('https://www.linkedin.com/in/', '')
end
def social_twitter_to_url(string)
string = "https://twitter.com/#{string}" unless 'twitter.com'.in? string
string = "https://#{string}" unless string.start_with?('http')
string.gsub('http://', 'https://')
end
def social_twitter_to_s(string)
string.gsub('http://', 'https://')
.gsub('twitter.com', 'https://twitter.com')
.gsub('https://www.twitter.com/', 'https://twitter.com/')
.gsub('https://twitter.com/', '')
end
end end
<footer class="pt-5">
<div class="container text-center">
<div class="mb-5">
<%= render 'logo' %>
</div>
<nav class="nav justify-content-center">
<%= link_to t('terms_of_service'),
t('terms_of_service_url'),
class: 'nav-link',
target: '_blank',
rel: 'noreferrer' %>
<%= link_to t('privacy_policy'),
t('privacy_policy_url'),
class: 'nav-link',
target: '_blank',
rel: 'noreferrer' %>
<%= link_to t('cookies_policy'),
t('cookies_policy_url'),
class: 'nav-link',
target: '_blank',
rel: 'noreferrer' %>
<%= link_to t('cookies_consent_choice'),
'',
class: 'nav-link js-gdpr__cookie_consent__display_again' %>
</nav>
</div>
</footer>
<% if current_context.logo.attached? %>
<%= image_tag current_context.logo, width: 200, alt: current_context.to_s, class: 'logo' %>
<% else %>
<%= current_context %>
<% end %>
<nav class="navbar navbar-light">
<div class="container">
<a class="navbar-brand" href="/">
<%= render 'logo' %>
</a>
<%= render_navigation %>
</div>
</nav>
<% 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 %>
...@@ -11,12 +11,12 @@ ...@@ -11,12 +11,12 @@
<%= favicon_link_tag 'favicon.png' %> <%= favicon_link_tag 'favicon.png' %>
</head> </head>
<body class="extranet <%= body_classes %>"> <body class="extranet <%= body_classes %>">
<%= render 'nav' %> <%= render 'extranet/application/nav' %>
<main class="container"> <main class="container">
<%= render_breadcrumbs builder: Appstack::BreadcrumbsOnRailsBuilder %> <%= render_breadcrumbs builder: Appstack::BreadcrumbsOnRailsBuilder if breadcrumbs.any? %>
<%= yield %> <%= yield %>
</main> </main>
<%= render 'footer' %> <%= render 'extranet/application/footer' %>
<%= render 'gdpr/cookie_consent' %> <%= render 'gdpr/cookie_consent' %>
<%= render 'bugsnag' %> <%= render 'bugsnag' %>
</body> </body>
......
...@@ -35,17 +35,25 @@ ...@@ -35,17 +35,25 @@
<% end %> <% end %>
<% if @person.url %> <% if @person.url %>
<dt><%= University::Person.human_attribute_name(:url) %></dt> <dt><%= University::Person.human_attribute_name(:url) %></dt>
<dd><a href="<%= @person.url %>" target="_blank" rel="noreferrer"><%= @person.url %></a></dd> <dd>
<a href="<%= social_website_to_url @person.url %>" target="_blank" rel="noreferrer">
<%= social_website_to_s @person.url %>
</a>
</dd>
<% end %> <% end %>
<% if @person.linkedin %> <% if @person.linkedin %>
<dt><%= University::Person.human_attribute_name(:linkedin) %></dt> <dt><%= University::Person.human_attribute_name(:linkedin) %></dt>
<dd><a href="<%= @person.linkedin %>" target="_blank" rel="noreferrer"><%= @person.linkedin %></a></dd> <dd>
<a href="<%= social_linkedin_to_url @person.linkedin %>" target="_blank" rel="noreferrer">
<%= social_linkedin_to_s @person.linkedin %>
</a>
</dd>
<% end %> <% end %>
<% if @person.twitter %> <% if @person.twitter %>
<dt><%= University::Person.human_attribute_name(:twitter) %></dt> <dt><%= University::Person.human_attribute_name(:twitter) %></dt>
<dd> <dd>
<a href="<%= @person.twitter %>" target="_blank" rel="noreferrer"> <a href="<%= social_twitter_to_url @person.twitter %>" target="_blank" rel="noreferrer">
<%= @person.twitter.gsub('https://twitter.com/', '') %> <%= social_twitter_to_s @person.twitter %>
</a> </a>
</dd> </dd>
<% end %> <% end %>
......
<% content_for :title, current_context %>
...@@ -29,10 +29,9 @@ Rails.application.routes.draw do ...@@ -29,10 +29,9 @@ Rails.application.routes.draw do
root to: 'dashboard#index' root to: 'dashboard#index'
end end
draw 'extranet'
draw 'api'
get '/media/:signed_id/:filename_with_transformations' => 'media#show', as: :medium get '/media/:signed_id/:filename_with_transformations' => 'media#show', as: :medium
root to: 'home#index' draw 'api'
draw 'extranet'
# Root is in extranet
end end
...@@ -6,3 +6,4 @@ get 'persons' => 'extranet/persons#index', as: :university_persons ...@@ -6,3 +6,4 @@ get 'persons' => 'extranet/persons#index', as: :university_persons
get 'persons/:id' => 'extranet/persons#show', as: :university_person get 'persons/:id' => 'extranet/persons#show', as: :university_person
get 'years' => 'extranet/academic_years#index', as: :education_academic_years get 'years' => 'extranet/academic_years#index', as: :education_academic_years
get 'years/:id' => 'extranet/academic_years#show', as: :education_academic_year get 'years/:id' => 'extranet/academic_years#show', as: :education_academic_year
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