diff --git a/app/assets/stylesheets/extranet/layout/_nav.sass b/app/assets/stylesheets/extranet/layout/_nav.sass index 9e706d3f1c5780e670e2cef79f551968caf95bdc..bfe58ba9c021174e2a18a3fee42cca2cf1f6ac94 100644 --- a/app/assets/stylesheets/extranet/layout/_nav.sass +++ b/app/assets/stylesheets/extranet/layout/_nav.sass @@ -22,6 +22,8 @@ background: transparent border: 0 padding: 0 + .dropdown-item + padding-left: var(--bs-navbar-nav-link-padding-x) .navbar-toggler border: 0 font-size: px2rem(14) diff --git a/app/controllers/extranet/academic_years_controller.rb b/app/controllers/extranet/alumni/academic_years_controller.rb similarity index 83% rename from app/controllers/extranet/academic_years_controller.rb rename to app/controllers/extranet/alumni/academic_years_controller.rb index 27e47ab9872c88be80ae82cb71bbdd90457d1578..1cd5a4c89b029af876cbf739da14004798a5fa10 100644 --- a/app/controllers/extranet/academic_years_controller.rb +++ b/app/controllers/extranet/alumni/academic_years_controller.rb @@ -1,4 +1,4 @@ -class Extranet::AcademicYearsController < Extranet::ApplicationController +class Extranet::Alumni::AcademicYearsController < Extranet::Alumni::ApplicationController def index @academic_years = about&.education_academic_years .ordered @@ -19,7 +19,7 @@ class Extranet::AcademicYearsController < Extranet::ApplicationController def breadcrumb super - add_breadcrumb Education::AcademicYear.model_name.human(count: 2), education_academic_years_path + add_breadcrumb Education::AcademicYear.model_name.human(count: 2), alumni_education_academic_years_path add_breadcrumb @academic_year if @academic_year end end diff --git a/app/controllers/extranet/alumni/application_controller.rb b/app/controllers/extranet/alumni/application_controller.rb new file mode 100644 index 0000000000000000000000000000000000000000..340b7599ce67f1e09ffb53c69c9603dd746e18ce --- /dev/null +++ b/app/controllers/extranet/alumni/application_controller.rb @@ -0,0 +1,9 @@ +class Extranet::Alumni::ApplicationController < Extranet::ApplicationController + + protected + + def breadcrumb + super + add_breadcrumb University::Person::Alumnus.model_name.human(count: 2) + end +end \ No newline at end of file diff --git a/app/controllers/extranet/cohorts_controller.rb b/app/controllers/extranet/alumni/cohorts_controller.rb similarity index 83% rename from app/controllers/extranet/cohorts_controller.rb rename to app/controllers/extranet/alumni/cohorts_controller.rb index f4174abc4abdcc75507744a2f336edc753680ae7..d87e5e803e90a8743a0b6c3b2b4ef7c9f5dd718d 100644 --- a/app/controllers/extranet/cohorts_controller.rb +++ b/app/controllers/extranet/alumni/cohorts_controller.rb @@ -1,4 +1,4 @@ -class Extranet::CohortsController < Extranet::ApplicationController +class Extranet::Alumni::CohortsController < Extranet::Alumni::ApplicationController def index @facets = Education::Cohort::Facets.new params[:facets], { model: about.education_cohorts, @@ -21,7 +21,7 @@ class Extranet::CohortsController < Extranet::ApplicationController def breadcrumb super - add_breadcrumb Education::Cohort.model_name.human(count: 2), education_cohorts_path + add_breadcrumb Education::Cohort.model_name.human(count: 2), alumni_education_cohorts_path add_breadcrumb @cohort if @cohort end end diff --git a/app/controllers/extranet/organizations_controller.rb b/app/controllers/extranet/alumni/organizations_controller.rb similarity index 86% rename from app/controllers/extranet/organizations_controller.rb rename to app/controllers/extranet/alumni/organizations_controller.rb index d974426c2d2fa70e1035860a8666921def301fbe..2d75beb4ba2fc320e5012540cdada5a70a43d1d0 100644 --- a/app/controllers/extranet/organizations_controller.rb +++ b/app/controllers/extranet/alumni/organizations_controller.rb @@ -1,4 +1,4 @@ -class Extranet::OrganizationsController < Extranet::ApplicationController +class Extranet::Alumni::OrganizationsController < Extranet::Alumni::ApplicationController def index @facets = University::Organization::Facets.new params[:facets], { model: about&.university_person_alumni_organizations, @@ -28,7 +28,7 @@ class Extranet::OrganizationsController < Extranet::ApplicationController def breadcrumb super - add_breadcrumb University::Organization.model_name.human(count: 2), university_organizations_path + add_breadcrumb University::Organization.model_name.human(count: 2), alumni_university_organizations_path add_breadcrumb @organization if @organization end end diff --git a/app/controllers/extranet/persons_controller.rb b/app/controllers/extranet/alumni/persons_controller.rb similarity index 76% rename from app/controllers/extranet/persons_controller.rb rename to app/controllers/extranet/alumni/persons_controller.rb index 4ab759241764783d6ce4115c3f6914903e6eb014..1270b6d1b6b93634b8c2d4490db70e51056abf2b 100644 --- a/app/controllers/extranet/persons_controller.rb +++ b/app/controllers/extranet/alumni/persons_controller.rb @@ -1,4 +1,4 @@ -class Extranet::PersonsController < Extranet::ApplicationController +class Extranet::Alumni::PersonsController < Extranet::Alumni::ApplicationController def index @facets = University::Person::Alumnus::Facets.new params[:facets], { model: about&.university_person_alumni.for_language_id(current_university.default_language_id), @@ -21,7 +21,7 @@ class Extranet::PersonsController < Extranet::ApplicationController def breadcrumb super - add_breadcrumb University::Person::Alumnus.model_name.human(count: 2), university_persons_path + add_breadcrumb University::Person.model_name.human(count: 2), alumni_university_persons_path add_breadcrumb @person if @person end end diff --git a/app/controllers/extranet/contacts/application_controller.rb b/app/controllers/extranet/contacts/application_controller.rb new file mode 100644 index 0000000000000000000000000000000000000000..b9e8ad4120f98555471d3b25bc83d47f725cc86b --- /dev/null +++ b/app/controllers/extranet/contacts/application_controller.rb @@ -0,0 +1,9 @@ +class Extranet::Contacts::ApplicationController < Extranet::ApplicationController + + protected + + def breadcrumb + super + add_breadcrumb Communication::Extranet.human_attribute_name(:feature_contacts) + end +end \ No newline at end of file diff --git a/app/controllers/extranet/contacts/organizations_controller.rb b/app/controllers/extranet/contacts/organizations_controller.rb new file mode 100644 index 0000000000000000000000000000000000000000..f2cbefc1a568633f17e571d9a225690f1f348857 --- /dev/null +++ b/app/controllers/extranet/contacts/organizations_controller.rb @@ -0,0 +1,23 @@ +class Extranet::Contacts::OrganizationsController < Extranet::Contacts::ApplicationController + def index + @organizations = current_extranet.connected_organizations + .ordered + .page(params[:page]) + .per(60) + @count = @organizations.total_count + breadcrumb + end + + def show + @organization = current_extranet.connected_organizations.find(params[:id]) + breadcrumb + end + + protected + + def breadcrumb + super + add_breadcrumb University::Organization.model_name.human(count: 2), contacts_university_organizations_path + add_breadcrumb @organization if @organization + end +end diff --git a/app/controllers/extranet/contacts/persons_controller.rb b/app/controllers/extranet/contacts/persons_controller.rb new file mode 100644 index 0000000000000000000000000000000000000000..6ef8e86c3ade4f8339fc7b488138b6bad8e64d74 --- /dev/null +++ b/app/controllers/extranet/contacts/persons_controller.rb @@ -0,0 +1,23 @@ +class Extranet::Contacts::PersonsController < Extranet::Contacts::ApplicationController + def index + @people = current_extranet.connected_persons + .ordered + .page(params[:page]) + .per(60) + @count = @people.total_count + breadcrumb + end + + def show + @person = current_extranet.connected_persons.find(params[:id]) + breadcrumb + end + + protected + + def breadcrumb + super + add_breadcrumb University::Person.model_name.human(count: 2), contacts_university_persons_path + add_breadcrumb @person if @person + end +end diff --git a/app/models/communication/extranet/with_connections.rb b/app/models/communication/extranet/with_connections.rb index 4a584f05fcf25be212cc5096dcb741a0ae2271e1..67841e9235ab6d571a83acd50aa0c5dbb50ac225 100644 --- a/app/models/communication/extranet/with_connections.rb +++ b/app/models/communication/extranet/with_connections.rb @@ -16,4 +16,15 @@ module Communication::Extranet::WithConnections def disconnect(object) connections.where(university: university, object: object).destroy_all end + + def connected_organizations + ids = connections.where(object_type: 'University::Organization').pluck(:object_id) + University::Organization.where(id: ids) + end + + def connected_persons + ids = connections.where(object_type: 'University::Person').pluck(:object_id) + University::Person.where(id: ids) + end + end \ No newline at end of file diff --git a/app/views/extranet/account/show.html.erb b/app/views/extranet/account/show.html.erb index 22d39597de667085c00524a1a61f3e8b1bc11d45..cb79fe1a16b9feb55f4dd90dce2838bcd618d681 100644 --- a/app/views/extranet/account/show.html.erb +++ b/app/views/extranet/account/show.html.erb @@ -2,14 +2,16 @@ <div class="row"> <div class="col-md-9"> - <div class="biography mb-5"> - <p><%= @person&.biography %></p> - </div> + <% unless @person.biography.blank? %> + <div class="biography mb-5"> + <%= sanitize @person.biography %> + </div> + <% end %> <p><%= t('extranet.experiences.title') %></p> <%= link_to University::Person::Experience.human_attribute_name('new'), new_experience_path, class: 'btn btn-sm btn-primary mt-md-n5 float-md-end' %> - <%= render 'extranet/persons/path', person: @person, edit: true %> + <%= render 'extranet/alumni/persons/path', person: @person, edit: true %> </div> <div class="col-md-3"> <%= kamifusen_tag @person.best_picture, width: 400, class: 'img-fluid person__portrait' if @person&.best_picture&.attached? %> @@ -17,6 +19,6 @@ <%= link_to t('extranet.account.edit'), edit_account_path, class: 'btn btn-primary mb-2' %> <%= link_to t('extranet.account.edit_personal_data'), edit_personal_data_path, class: 'btn btn-primary mb-2' %> </div> - <%= render 'extranet/persons/details', person: @person unless @person.nil? %> + <%= render 'extranet/alumni/persons/details', person: @person unless @person.nil? %> </div> </div> diff --git a/app/views/extranet/academic_years/index.html.erb b/app/views/extranet/alumni/academic_years/index.html.erb similarity index 92% rename from app/views/extranet/academic_years/index.html.erb rename to app/views/extranet/alumni/academic_years/index.html.erb index f3913b723e3bc07648d1d03bbe533ac61b28c2e5..f0ea9e2094ba22de5339f8729c21bc32f7a0db94 100644 --- a/app/views/extranet/academic_years/index.html.erb +++ b/app/views/extranet/alumni/academic_years/index.html.erb @@ -13,7 +13,7 @@ <li class="row"> <div class="col-md-6"> <b> - <%= link_to year, year, class: 'stretched-link' %> + <%= link_to year, [:alumni, year], class: 'stretched-link' %> </b> </div> <div class="col-md-3 col-6"> diff --git a/app/views/extranet/academic_years/show.html.erb b/app/views/extranet/alumni/academic_years/show.html.erb similarity index 81% rename from app/views/extranet/academic_years/show.html.erb rename to app/views/extranet/alumni/academic_years/show.html.erb index 4f9a6b708e533f2e23197e8a4bb22dedd2bd52c7..37172bd0d229bed9a929ccb9ecb50f4e6cec637f 100644 --- a/app/views/extranet/academic_years/show.html.erb +++ b/app/views/extranet/alumni/academic_years/show.html.erb @@ -12,7 +12,7 @@ </h2> </div> <div class="col-lg-8"> - <%= render 'extranet/cohorts/list', cohorts: @cohorts %> + <%= render 'extranet/alumni/cohorts/list', cohorts: @cohorts %> </div> </div> @@ -21,4 +21,4 @@ <%= University::Person::Alumnus.model_name.human(count: @alumni.count).downcase %> </h2> -<%= render 'extranet/persons/list', people: @alumni %> +<%= render 'extranet/alumni/persons/list', people: @alumni %> diff --git a/app/views/extranet/cohorts/_index_cards.html.erb b/app/views/extranet/alumni/cohorts/_index_cards.html.erb similarity index 92% rename from app/views/extranet/cohorts/_index_cards.html.erb rename to app/views/extranet/alumni/cohorts/_index_cards.html.erb index 9128658501682aa86d0d19804ff340f28e4b2fe9..59559a849840e1ea28302d31b343b03bba353f18 100644 --- a/app/views/extranet/cohorts/_index_cards.html.erb +++ b/app/views/extranet/alumni/cohorts/_index_cards.html.erb @@ -4,7 +4,7 @@ <div class="col-md-4 col-xl-3"> <article class="card mb-5"> <div class="card-body"> - <h2 class="mb-0"><%= link_to cohort.academic_year.year, cohort, class: 'stretched-link' %></h2> + <h2 class="mb-0"><%= link_to cohort.academic_year.year, [:alumni, cohort], class: 'stretched-link' %></h2> <p class="small mb-0"> <%= cohort.people.count %> <%= University::Person::Alumnus.model_name.human(count: cohort.people.count).downcase %> diff --git a/app/views/extranet/cohorts/_index_facets.html.erb b/app/views/extranet/alumni/cohorts/_index_facets.html.erb similarity index 70% rename from app/views/extranet/cohorts/_index_facets.html.erb rename to app/views/extranet/alumni/cohorts/_index_facets.html.erb index 642682d7c9dd4da7bd37f028ef481230577299a0..5807aa4bb3eafa3be9105396ae622836a07381f0 100644 --- a/app/views/extranet/cohorts/_index_facets.html.erb +++ b/app/views/extranet/alumni/cohorts/_index_facets.html.erb @@ -3,6 +3,6 @@ <%= render 'faceted_search/facets', facets: @facets %> </div> <div class="col-md-8 offset-md-1"> - <%= render 'extranet/cohorts/list', cohorts: @cohorts %> + <%= render 'extranet/alumni/cohorts/list', cohorts: @cohorts %> </div> </div> diff --git a/app/views/extranet/cohorts/_list.html.erb b/app/views/extranet/alumni/cohorts/_list.html.erb similarity index 85% rename from app/views/extranet/cohorts/_list.html.erb rename to app/views/extranet/alumni/cohorts/_list.html.erb index 88c165fd8902fc8a4b0b8ba42e7289e7fc7bcce4..cb43093683153cab383d233e511e1f66c05d5c37 100644 --- a/app/views/extranet/cohorts/_list.html.erb +++ b/app/views/extranet/alumni/cohorts/_list.html.erb @@ -3,7 +3,7 @@ <% cohorts_paged.each do |cohort| %> <li> <h2> - <%= link_to cohort.program, cohort, class: 'stretched-link' %> + <%= link_to cohort.program, [:alumni, cohort], class: 'stretched-link' %> <%#= link_to cohort, cohort, class: 'stretched-link' %> </h2> <p> diff --git a/app/views/extranet/cohorts/index.html.erb b/app/views/extranet/alumni/cohorts/index.html.erb similarity index 100% rename from app/views/extranet/cohorts/index.html.erb rename to app/views/extranet/alumni/cohorts/index.html.erb diff --git a/app/views/extranet/cohorts/show.html.erb b/app/views/extranet/alumni/cohorts/show.html.erb similarity index 80% rename from app/views/extranet/cohorts/show.html.erb rename to app/views/extranet/alumni/cohorts/show.html.erb index 594c9713096f28fd9f6fd7e5ee45e61b2798b749..d30a374fc73e663ed27a94a30f04d6b964962d3f 100644 --- a/app/views/extranet/cohorts/show.html.erb +++ b/app/views/extranet/alumni/cohorts/show.html.erb @@ -9,4 +9,4 @@ <%= @cohort.program %> </p> -<%= render 'extranet/persons/list', people: @cohort.people %> +<%= render 'extranet/alumni/persons/list', people: @cohort.people %> diff --git a/app/views/extranet/organizations/_list.erb b/app/views/extranet/alumni/organizations/_list.erb similarity index 75% rename from app/views/extranet/organizations/_list.erb rename to app/views/extranet/alumni/organizations/_list.erb index 2dc160a7fa2e289a738410d690501b1be08c12d0..b51afe6ae377d654766665835fe3633a7aede2a8 100644 --- a/app/views/extranet/organizations/_list.erb +++ b/app/views/extranet/alumni/organizations/_list.erb @@ -1,6 +1,6 @@ <% @organizations.each do |organization| %> <div class="organization"> - <p class="mb-0"><%= link_to organization, organization %></p> + <p class="mb-0"><%= link_to organization, [:alumni, organization] %></p> <% if organization.url %> <p class="mb-0 mt-n1"><small><%= link_to organization.url, organization.url %></small></p> <% end %> diff --git a/app/views/extranet/organizations/index.html.erb b/app/views/extranet/alumni/organizations/index.html.erb similarity index 89% rename from app/views/extranet/organizations/index.html.erb rename to app/views/extranet/alumni/organizations/index.html.erb index 540c86027b1c9d044ce33a4f27f59327a0a71b77..d965b07354e4eec49e4f21a4d8fe5b0cced23d00 100644 --- a/app/views/extranet/organizations/index.html.erb +++ b/app/views/extranet/alumni/organizations/index.html.erb @@ -10,7 +10,7 @@ </div> <div class="offset-lg-1 col-lg-8"> <div class="organizations"> - <%= render "extranet/organizations/list" %> + <%= render "extranet/alumni/organizations/list" %> </div> <%= paginate @organizations, theme: 'bootstrap-5', window: 2 %> </div> diff --git a/app/views/extranet/organizations/search.json.jbuilder b/app/views/extranet/alumni/organizations/search.json.jbuilder similarity index 100% rename from app/views/extranet/organizations/search.json.jbuilder rename to app/views/extranet/alumni/organizations/search.json.jbuilder diff --git a/app/views/extranet/organizations/show.html.erb b/app/views/extranet/alumni/organizations/show.html.erb similarity index 97% rename from app/views/extranet/organizations/show.html.erb rename to app/views/extranet/alumni/organizations/show.html.erb index 8b960857dd9650d64e668cc3d9ba888ca0f4cc2b..e90c709e23750461314018036a4b24c018ade7d3 100644 --- a/app/views/extranet/organizations/show.html.erb +++ b/app/views/extranet/alumni/organizations/show.html.erb @@ -27,7 +27,7 @@ <div class="border-top"> <div class="row pt-4"> <div class="col-md-6"> - <p><b><%= link_to experience.person.name, experience.person, class: "stretched-link" %></b></p> + <p><b><%= link_to experience.person.name, [:alumni, experience.person], class: "stretched-link" %></b></p> </div> <div class="col-md-6"> <p class="text-end"> diff --git a/app/views/extranet/persons/_details.html.erb b/app/views/extranet/alumni/persons/_details.html.erb similarity index 100% rename from app/views/extranet/persons/_details.html.erb rename to app/views/extranet/alumni/persons/_details.html.erb diff --git a/app/views/extranet/persons/_list.html.erb b/app/views/extranet/alumni/persons/_list.html.erb similarity index 76% rename from app/views/extranet/persons/_list.html.erb rename to app/views/extranet/alumni/persons/_list.html.erb index 709e4aeed24d02c7029feda17403c75921791d92..d181ddc677f978f4d9b07fc92d3c4fd41a3d9907 100644 --- a/app/views/extranet/persons/_list.html.erb +++ b/app/views/extranet/alumni/persons/_list.html.erb @@ -2,7 +2,7 @@ <div class="row"> <% people_paged.each do |person| %> <div class="col-md-2"> - <%= render 'extranet/persons/person', person: person %> + <%= render 'extranet/alumni/persons/person', person: person %> </div> <% end %> </div> diff --git a/app/views/extranet/persons/_path.html.erb b/app/views/extranet/alumni/persons/_path.html.erb similarity index 95% rename from app/views/extranet/persons/_path.html.erb rename to app/views/extranet/alumni/persons/_path.html.erb index 9b2b583074a8ae7d994b3776aeb1b8a649ee61e7..4572ea2b20a4cbf92e2ea566c4204e678c18d22a 100644 --- a/app/views/extranet/persons/_path.html.erb +++ b/app/views/extranet/alumni/persons/_path.html.erb @@ -13,7 +13,7 @@ edit ||= false <div class="row"> <div class="col-md-6"> <p class="mb-0"> - <%= link_to cohort do %> + <%= link_to [:alumni, cohort] do %> <b><%= cohort.program %></b><br> <%= cohort.program.diploma %><br> <%= cohort.year %> diff --git a/app/views/extranet/persons/_person.html.erb b/app/views/extranet/alumni/persons/_person.html.erb similarity index 89% rename from app/views/extranet/persons/_person.html.erb rename to app/views/extranet/alumni/persons/_person.html.erb index c77c919cbad300fb80d9d64205a3e5bde5d40e91..21b681748a3f85d69e8b2d3952e9e0f1e8b2a0b6 100644 --- a/app/views/extranet/persons/_person.html.erb +++ b/app/views/extranet/alumni/persons/_person.html.erb @@ -12,7 +12,7 @@ <% end %> </div> <div class="col-9 col-md-12"> - <%= link_to person, class: 'stretched-link' do %> + <%= link_to [:alumni, person], class: 'stretched-link' do %> <%= person.first_name %> <%= person.last_name %> <% end %> </div> diff --git a/app/views/extranet/persons/index.html.erb b/app/views/extranet/alumni/persons/index.html.erb similarity index 66% rename from app/views/extranet/persons/index.html.erb rename to app/views/extranet/alumni/persons/index.html.erb index 8265919832f8e6dc457ff57e4ce7395216238633..ea22d1b37692867920714161856c9dd62699494e 100644 --- a/app/views/extranet/persons/index.html.erb +++ b/app/views/extranet/alumni/persons/index.html.erb @@ -1,7 +1,7 @@ -<% content_for :title, University::Person::Alumnus.model_name.human(count: 2) %> +<% content_for :title, University::Person.model_name.human(count: 2) %> <% content_for :header_right do %> <%= @count %> - <%= University::Person::Alumnus.model_name.human(count: @count).downcase %> + <%= University::Person.model_name.human(count: @count).downcase %> <% end %> <div class="row"> @@ -12,7 +12,7 @@ <div class="row"> <% @people.each do |person| %> <div class="col-xxl-3 col-md-4 col-sm-6"> - <%= render 'extranet/persons/person', person: person %> + <%= render 'extranet/alumni/persons/person', person: person %> </div> <% end %> </div> diff --git a/app/views/extranet/persons/show.html.erb b/app/views/extranet/alumni/persons/show.html.erb similarity index 59% rename from app/views/extranet/persons/show.html.erb rename to app/views/extranet/alumni/persons/show.html.erb index df53287140ec6e1fec0cb38f8dbe525ce7ba864f..6079d71e13004f41c86705e6603db3862af383d2 100644 --- a/app/views/extranet/persons/show.html.erb +++ b/app/views/extranet/alumni/persons/show.html.erb @@ -4,16 +4,18 @@ <div class="col-md-8 order-2 order-md-1"> <div class="row"> <div class="col-md-9"> - <div class="biography mb-5"> - <%= sanitize @person&.biography %> - </div> + <% unless @person.biography.blank? %> + <div class="biography mb-5"> + <%= sanitize @person&.biography %> + </div> + <% end %> </div> </div> <p class="mb-4"><%= t('extranet.experiences.title') %></p> - <%= render 'extranet/persons/path', person: @person %> + <%= render 'extranet/alumni/persons/path', person: @person %> </div> <div class="offset-md-1 col-md-3 order-1 order-md-2"> <%= kamifusen_tag @person.best_picture, width: 400, class: 'img-fluid person__portrait' if @person.best_picture.attached? %> - <%= render 'extranet/persons/details', person: @person %> + <%= render 'extranet/alumni/persons/details', person: @person %> </div> </div> diff --git a/app/views/extranet/application/_head.html.erb b/app/views/extranet/application/_head.html.erb index 4609cab2b9793793b613f0ef125b97eb0952d880..8ae368ff3c95f76af201c0d748060ae4767df3ad 100644 --- a/app/views/extranet/application/_head.html.erb +++ b/app/views/extranet/application/_head.html.erb @@ -4,7 +4,7 @@ <%= csrf_meta_tags %> <%= csp_meta_tag %> <%= stylesheet_link_tag 'extranet', media: 'all' %> -<link rel="stylesheet" href="<%= extranet_style_path(format: :css) %>" media="all"> +<link rel="stylesheet" href="<%= style_path(format: :css) %>" media="all"> <%= javascript_include_tag 'extranet' %> <% if current_extranet.favicon.attached? %> <%= favicon_link_tag url_for(current_extranet.favicon.variant(:thumb)) %> diff --git a/app/views/extranet/contacts/organizations/_list.erb b/app/views/extranet/contacts/organizations/_list.erb new file mode 100644 index 0000000000000000000000000000000000000000..6c8592c603523cb2154b4be103863c8dd8f9a368 --- /dev/null +++ b/app/views/extranet/contacts/organizations/_list.erb @@ -0,0 +1,12 @@ +<div class="row"> +<% @organizations.each do |organization| %> + <div class="col-md-3"> + <div class="card"> + <%= kamifusen_tag organization.logo, width: 400, class: 'img-fluid p-5' if organization.logo.attached? %> + <div class="card-body text-center"> + <%= link_to organization, [:contacts, organization], class: 'stretched-link' %> + </div> + </div> + </div> +<% end %> +</div> diff --git a/app/views/extranet/contacts/organizations/index.html.erb b/app/views/extranet/contacts/organizations/index.html.erb new file mode 100644 index 0000000000000000000000000000000000000000..7ee41fb11311eb2ee1dd4a6279a0686326d889e9 --- /dev/null +++ b/app/views/extranet/contacts/organizations/index.html.erb @@ -0,0 +1,8 @@ +<% content_for :title, University::Organization.model_name.human(count: 2) %> +<% content_for :header_right do %> + <%= @count %> + <%= University::Organization.model_name.human(count: @count).downcase %> +<% end %> + +<%= render "extranet/contacts/organizations/list" %> +<%= paginate @organizations, theme: 'bootstrap-5', window: 2 %> \ No newline at end of file diff --git a/app/views/extranet/contacts/organizations/show.html.erb b/app/views/extranet/contacts/organizations/show.html.erb new file mode 100644 index 0000000000000000000000000000000000000000..054d501404c5eb21bf09efb40928362a74e1802a --- /dev/null +++ b/app/views/extranet/contacts/organizations/show.html.erb @@ -0,0 +1,35 @@ +<% content_for :title, @organization %> + +<div class="row"> + <div class="col-md-8 order-2 order-md-1"> + <div class="row"> + <div class="col-md-9"> + <div class="biography mb-5"> + <%= sanitize @organization.text %> + </div> + </div> + </div> + </div> + <div class="offset-md-1 col-md-3 order-1 order-md-2"> + <%= kamifusen_tag @organization.logo, width: 400, class: 'img-fluid organization__logo' if @organization.logo.attached? %> + + <dl> + <dt><%= University::Organization.human_attribute_name(:kind) %></dt> + <dd><%= @organization.kind_i18n %></dd> + <% if @organization.phone.present? %> + <dt><%= University::Organization.human_attribute_name(:phone) %></dt> + <dd><a href="tel:<%= @organization.phone %>" target="_blank" rel="noreferrer"><%= @organization.phone %></a></dd> + <% end %> + <% if @organization.email.present? %> + <dt><%= University::Organization.human_attribute_name(:email) %></dt> + <dd><a href="mailto:<%= @organization.email %>" target="_blank" rel="noreferrer"><%= @organization.email %></a></dd> + <% end %> + <% if @organization.url.present? %> + <dt><%= University::Organization.human_attribute_name(:url) %></dt> + <dd> + <%= link_to @organization.url, @organization.url %> + </dd> + <% end %> + </dl> + </div> +</div> diff --git a/app/views/extranet/contacts/persons/_details.html.erb b/app/views/extranet/contacts/persons/_details.html.erb new file mode 100644 index 0000000000000000000000000000000000000000..3347918fa54e1df45d9156bde66a7e6b92079bed --- /dev/null +++ b/app/views/extranet/contacts/persons/_details.html.erb @@ -0,0 +1,52 @@ +<dl> + <% [:phone_mobile, :phone_personal, :phone_professional].each do |attribute_name| %> + <% next if person.public_send(attribute_name).blank? %> + <dt><%= University::Person.human_attribute_name(attribute_name) %> :</dt> + <dd> + <a href="tel:<%= person.public_send(attribute_name) %>" target="_blank" rel="noreferrer"> + <%= person.public_send(attribute_name) %> + </a> + </dd> + <% end %> + <% if person.email.present? %> + <dt><%= University::Person.human_attribute_name(:email) %></dt> + <dd> + <a href="mailto:<%= person.email %>" target="_blank" rel="noreferrer"> + <%= person.email %> + </a> + </dd> + <% end %> + <% if person.full_street_address.present? %> + <dt><%= University::Person.human_attribute_name("address") %></dt> + <dd> + <%= person.address %> + <% if person.address.present? && (person.city.present? || person.zipcode.present?) %><br><% end %> + <%= person.zipcode %> + <%= person.city %> + </dd> + <% end %> + <% if person.url.present? %> + <dt><%= University::Person.human_attribute_name(:url) %></dt> + <dd> + <a href="<%= social_website_to_url person.url %>" target="_blank" rel="noreferrer"> + <%= social_website_to_s person.url %> + </a> + </dd> + <% end %> + <% if person.linkedin.present? %> + <dt><%= University::Person.human_attribute_name(:linkedin) %></dt> + <dd> + <a href="<%= social_linkedin_to_url person.linkedin %>" target="_blank" rel="noreferrer"> + <%= social_linkedin_to_s person.linkedin %> + </a> + </dd> + <% end %> + <% if person.twitter.present? %> + <dt><%= University::Person.human_attribute_name(:twitter) %></dt> + <dd> + <a href="<%= social_twitter_to_url person.twitter %>" target="_blank" rel="noreferrer"> + <%= social_twitter_to_s person.twitter %> + </a> + </dd> + <% end %> +</dl> \ No newline at end of file diff --git a/app/views/extranet/contacts/persons/_list.html.erb b/app/views/extranet/contacts/persons/_list.html.erb new file mode 100644 index 0000000000000000000000000000000000000000..d181ddc677f978f4d9b07fc92d3c4fd41a3d9907 --- /dev/null +++ b/app/views/extranet/contacts/persons/_list.html.erb @@ -0,0 +1,9 @@ +<% people_paged = people.ordered.page(params[:page]).per(60) %> +<div class="row"> + <% people_paged.each do |person| %> + <div class="col-md-2"> + <%= render 'extranet/alumni/persons/person', person: person %> + </div> + <% end %> +</div> +<%= paginate people_paged, theme: 'bootstrap-5' %> diff --git a/app/views/extranet/contacts/persons/_path.html.erb b/app/views/extranet/contacts/persons/_path.html.erb new file mode 100644 index 0000000000000000000000000000000000000000..4572ea2b20a4cbf92e2ea566c4204e678c18d22a --- /dev/null +++ b/app/views/extranet/contacts/persons/_path.html.erb @@ -0,0 +1,34 @@ +<% +edit ||= false +%> +<div class="experiences mt-4"> + <ul class="list-unstyled"> + <% if person&.experiences&.any? %> + <% @person.experiences.ordered.each do |experience| %> + <%= render 'extranet/experiences/experience', experience: experience, edit: edit %> + <% end %> + <% end %> + <% person&.cohorts&.each do |cohort| %> + <li class="experiences__experience py-4 border-top"> + <div class="row"> + <div class="col-md-6"> + <p class="mb-0"> + <%= link_to [:alumni, cohort] do %> + <b><%= cohort.program %></b><br> + <%= cohort.program.diploma %><br> + <%= cohort.year %> + <% end %> + </p> + </div> + <div class="col-md-6 text-end"> + <% if cohort.school.logo.attached? %> + <%= kamifusen_tag cohort.school.logo, width: 100, class: 'img-fluid experience__organization__logo' %> + <% else %> + <p class="text-end"><%= cohort.school %></p> + <% end %> + </div> + </div> + </li> + <% end %> + </ul> +</div> diff --git a/app/views/extranet/contacts/persons/_person.html.erb b/app/views/extranet/contacts/persons/_person.html.erb new file mode 100644 index 0000000000000000000000000000000000000000..5800edb499099a5d98c9e39ff58292059ff3e99f --- /dev/null +++ b/app/views/extranet/contacts/persons/_person.html.erb @@ -0,0 +1,19 @@ +<article class="person mb-4"> + <div class="row gx-3"> + <div class="col-3 col-md-12 mb-md-2"> + <% if person.best_picture.attached? %> + <%= kamifusen_tag 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 %> + </div> + <div class="col-9 col-md-12"> + <%= link_to [:contacts, person], class: 'stretched-link' do %> + <%= person.first_name %> <%= person.last_name %> + <% end %> + </div> +</article> diff --git a/app/views/extranet/contacts/persons/index.html.erb b/app/views/extranet/contacts/persons/index.html.erb new file mode 100644 index 0000000000000000000000000000000000000000..36bd5fac0e3fa6bb82d950b024f82b408af9e722 --- /dev/null +++ b/app/views/extranet/contacts/persons/index.html.erb @@ -0,0 +1,14 @@ +<% content_for :title, University::Person.model_name.human(count: 2) %> +<% content_for :header_right do %> + <%= @count %> + <%= University::Person.model_name.human(count: @count).downcase %> +<% end %> + +<div class="row"> + <% @people.each do |person| %> + <div class="col-xxl-2 col-md-3 col-sm-6"> + <%= render 'extranet/contacts/persons/person', person: person %> + </div> + <% end %> +</div> +<%= paginate @people, theme: 'bootstrap-5', window: 2 %> diff --git a/app/views/extranet/contacts/persons/show.html.erb b/app/views/extranet/contacts/persons/show.html.erb new file mode 100644 index 0000000000000000000000000000000000000000..ba4019e9def3c9116e335c4ed9183f2cdac0d246 --- /dev/null +++ b/app/views/extranet/contacts/persons/show.html.erb @@ -0,0 +1,19 @@ +<% content_for :title, @person %> + +<div class="row"> + <div class="col-md-8 order-2 order-md-1"> + <div class="row"> + <div class="col-md-9"> + <% unless @person.biography.blank? %> + <div class="biography mb-5"> + <%= sanitize @person&.biography %> + </div> + <% end %> + </div> + </div> + </div> + <div class="offset-md-1 col-md-3 order-1 order-md-2"> + <%= kamifusen_tag @person.best_picture, width: 400, class: 'img-fluid person__portrait' if @person.best_picture.attached? %> + <%= render 'extranet/alumni/persons/details', person: @person %> + </div> +</div> diff --git a/app/views/extranet/experiences/_experience.html.erb b/app/views/extranet/experiences/_experience.html.erb index 3052ede2aaf7d300d7da2f531ccdb635f8a7973b..e5f211fc62bc64248d3ebdb99f8faf04068b3f5c 100644 --- a/app/views/extranet/experiences/_experience.html.erb +++ b/app/views/extranet/experiences/_experience.html.erb @@ -15,11 +15,11 @@ edit ||= false </div> <div class="col-md-6 text-end"> <% if experience.organization.present? %> - <%= link_to experience.organization do %> + <%= link_to [:alumni, experience.organization] do %> <% if experience.organization.logo.attached? %> <%= kamifusen_tag experience.organization.logo, width: 100, class: 'img-fluid experience__organization__logo' %> <% else %> - <p class="text-end><%= link_to experience.organization, experience.organization %></p> + <p class="text-end><%= link_to experience.organization, [:alumni, experience.organization] %></p> <% end %> <% end %> <div> diff --git a/app/views/extranet/experiences/_form.html.erb b/app/views/extranet/experiences/_form.html.erb index 96d09eece642aecd845668577659a0bd3b148e1e..5ff1f5470817ac3386fa70c3f46a06fa23f9ce9e 100644 --- a/app/views/extranet/experiences/_form.html.erb +++ b/app/views/extranet/experiences/_form.html.erb @@ -26,7 +26,7 @@ <%= f.input :organization_name, label: University::Organization.model_name.human, as: :autocomplete, - url: search_university_organizations_path, + url: alumni_search_university_organizations_path, placeholder: t("extranet.experiences.search_organization"), input_html: { data: { diff --git a/app/views/extranet/home/features/_alumni.html.erb b/app/views/extranet/home/features/_alumni.html.erb new file mode 100644 index 0000000000000000000000000000000000000000..ad51815a96763dfea249f76ef846e87747267afb --- /dev/null +++ b/app/views/extranet/home/features/_alumni.html.erb @@ -0,0 +1,55 @@ +<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> + <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 %> + </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> \ No newline at end of file diff --git a/app/views/extranet/home/features/_contacts.html.erb b/app/views/extranet/home/features/_contacts.html.erb new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/app/views/extranet/home/index.html.erb b/app/views/extranet/home/index.html.erb index b821aa90de4ff2f9e76fbf0855a20f5ac336c806..c57895292735df58e906a61800c54d6f77ef676d 100644 --- a/app/views/extranet/home/index.html.erb +++ b/app/views/extranet/home/index.html.erb @@ -6,70 +6,16 @@ <% else %> <%# TODO i18n %> Bienvenue sur l’extranet <%= current_context %>. - Retrouvez les <%= link_to University::Person::Alumnus.model_name.human(count: 2).downcase, university_persons_path %>, + Retrouvez les <%= link_to University::Person::Alumnus.model_name.human(count: 2).downcase, alumni_university_persons_path %>, <% if current_extranet.should_show_years? %> - recherchez par <%= link_to Education::AcademicYear.model_name.human(count: 2).downcase, education_academic_years_path %>, + recherchez par <%= link_to Education::AcademicYear.model_name.human(count: 2).downcase, alumni_education_academic_years_path %>, <% end %> - explorez les <%= link_to Education::Cohort.model_name.human(count: 2).downcase, education_cohorts_path %>, - découvrez les <%= link_to University::Organization.model_name.human(count: 2).downcase, university_organizations_path %>. + explorez les <%= link_to Education::Cohort.model_name.human(count: 2).downcase, alumni_education_cohorts_path %>, + découvrez les <%= link_to University::Organization.model_name.human(count: 2).downcase, alumni_university_organizations_path %>. <% end %> </h1> <% 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 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> - <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 experience.organization do %> - <%= kamifusen_tag experience.organization.logo, height: 80, class: 'img-fluid' %> - <% end %> - <% end %> - <% end %> - </div> - </li> - <% end %> - </ul> - </div> - </div> +<%= render 'extranet/home/features/alumni' if current_extranet.feature_alumni %> +<%= render 'extranet/home/features/contacts' if current_extranet.feature_contacts %> - - <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, cohort %> - <b><%= cohort.academic_year %></b> - </li> - <% end %> - </ul> - </div> -</div> diff --git a/config/extranet_navigation.rb b/config/extranet_navigation.rb index 2a505cb1d75da292af45324c85bd5fc484d5e1eb..ee28c27705c3f6919885d848ac683107d8630d2c 100644 --- a/config/extranet_navigation.rb +++ b/config/extranet_navigation.rb @@ -4,17 +4,29 @@ SimpleNavigation::Configuration.run do |navigation| navigation.highlight_on_subpath = true navigation.selected_class = 'active' navigation.items do |primary| - primary.item :person, - University::Person::Alumnus.model_name.human(count: 2), - university_persons_path - primary.item :years, - Education::AcademicYear.model_name.human(count: 2), - education_academic_years_path if current_extranet.should_show_years? - primary.item :cohorts, - Education::Cohort.model_name.human(count: 2), - education_cohorts_path - primary.item :organizations, - University::Organization.model_name.human(count: 2), - university_organizations_path + primary.item :contacts, + Communication::Extranet.human_attribute_name(:feature_contacts) do |secondary| + secondary.item :person, + University::Person.model_name.human(count: 2), + contacts_university_persons_path + secondary.item :organizations, + University::Organization.model_name.human(count: 2), + contacts_university_organizations_path + end if current_extranet.feature_contacts? + primary.item :alumni, + University::Person::Alumnus.model_name.human(count: 2) do |secondary| + secondary.item :person, + University::Person.model_name.human(count: 2), + alumni_university_persons_path + secondary.item :years, + Education::AcademicYear.model_name.human(count: 2), + alumni_education_academic_years_path if current_extranet.should_show_years? + secondary.item :cohorts, + Education::Cohort.model_name.human(count: 2), + alumni_education_cohorts_path + secondary.item :organizations, + University::Organization.model_name.human(count: 2), + alumni_university_organizations_path + end if current_extranet.feature_alumni? end end \ No newline at end of file diff --git a/config/routes.rb b/config/routes.rb index 4677d21232310cf3b10e6587ef340602c5d4b9df..cc81e0d31ff58eefaaca592ada11568e94fd4a37 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -36,7 +36,9 @@ Rails.application.routes.draw do get '/media/:signed_id/:filename_with_transformations' => 'media#show', as: :medium draw 'api' - draw 'extranet' draw 'server' - # Root is in extranet + scope module: 'extranet' do + draw 'extranet' + end + root to: 'extranet/home#index' end diff --git a/config/routes/extranet.rb b/config/routes/extranet.rb index f7a659b44716a575dad287448387960f47bb9663..afa8bb3e77f0aa3763afe8ccb0009e373ce77664 100644 --- a/config/routes/extranet.rb +++ b/config/routes/extranet.rb @@ -1,23 +1,31 @@ -get 'cohorts' => 'extranet/cohorts#index', as: :education_cohorts -get 'cohorts/:id' => 'extranet/cohorts#show', as: :education_cohort -get 'organizations' => 'extranet/organizations#index', as: :university_organizations -get 'organizations/search' => 'extranet/organizations#search', as: :search_university_organizations, defaults: { format: 'json' } -get 'organizations/:id' => 'extranet/organizations#show', as: :university_organization -get 'persons' => 'extranet/persons#index', as: :university_persons -get 'persons/:id' => 'extranet/persons#show', as: :university_person -get 'years' => 'extranet/academic_years#index', as: :education_academic_years -get 'years/:id' => 'extranet/academic_years#show', as: :education_academic_year -get 'account' => 'extranet/account#show', as: :account -get 'account/edit' => 'extranet/account#edit', as: :edit_account -patch 'account' => 'extranet/account#update' +# Full :as names are useful for the resolution of links like [:alumni, cohort] +namespace :contacts do + get 'organizations' => 'organizations#index', as: :university_organizations + get 'organizations/:id' => 'organizations#show', as: :university_organization + get 'persons' => 'persons#index', as: :university_persons + get 'persons/:id' => 'persons#show', as: :university_person +end +namespace :alumni do + get 'cohorts' => 'cohorts#index', as: :education_cohorts + get 'cohorts/:id' => 'cohorts#show', as: :education_cohort + get 'organizations' => 'organizations#index', as: :university_organizations + get 'organizations/search' => 'organizations#search', as: :search_university_organizations, defaults: { format: 'json' } + get 'organizations/:id' => 'organizations#show', as: :university_organization + get 'persons' => 'persons#index', as: :university_persons + get 'persons/:id' => 'persons#show', as: :university_person + get 'years' => 'academic_years#index', as: :education_academic_years + get 'years/:id' => 'academic_years#show', as: :education_academic_year +end +get 'account' => 'account#show', as: :account +get 'account/edit' => 'account#edit', as: :edit_account +patch 'account' => 'account#update' scope :account do - resources :experiences, controller: 'extranet/experiences', except: [:index, :show] - get 'personal_data' => 'extranet/personal_data#edit', as: :edit_personal_data - patch 'personal_data' => 'extranet/personal_data#update', as: :personal_data + resources :experiences, controller: 'experiences', except: [:index, :show] + get 'personal_data' => 'personal_data#edit', as: :edit_personal_data + patch 'personal_data' => 'personal_data#update', as: :personal_data end -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 -get 'extranet' => 'extranet/style#index', as: :extranet_style, constraints: { format: 'css' } -root to: 'extranet/home#index' +get 'terms' => 'pages#terms', as: :terms +get 'privacy-policy' => 'pages#privacy_policy', as: :privacy_policy +get 'cookies-policy' => 'pages#cookies_policy', as: :cookies_policy +get 'data' => 'pages#data', as: :data +get 'style' => 'style#index', as: :style, constraints: { format: 'css' } diff --git a/test/controllers/extranet/academic_years_controller_test.rb b/test/controllers/extranet/academic_years_controller_test.rb deleted file mode 100644 index f4b820116447d53bb1a019315143d3bc0b6cb0e6..0000000000000000000000000000000000000000 --- a/test/controllers/extranet/academic_years_controller_test.rb +++ /dev/null @@ -1,15 +0,0 @@ -require "test_helper" - -class Extranet::AcademicYearsControllerTest < ActionDispatch::IntegrationTest - include ExtranetSetup - - def test_index - get education_academic_years_path - assert_response(:success) - end - - def test_show - get education_academic_year_path(education_academic_years(:twenty_two)) - assert_response(:success) - end -end diff --git a/test/controllers/extranet/alumni/academic_years_controller_test.rb b/test/controllers/extranet/alumni/academic_years_controller_test.rb new file mode 100644 index 0000000000000000000000000000000000000000..218be5b5e3c858259daab15da07795b9d96f8582 --- /dev/null +++ b/test/controllers/extranet/alumni/academic_years_controller_test.rb @@ -0,0 +1,15 @@ +require "test_helper" + +class Extranet::Alumni::AcademicYearsControllerTest < ActionDispatch::IntegrationTest + include ExtranetSetup + + def test_index + get alumni_education_academic_years_path + assert_response(:success) + end + + def test_show + get alumni_education_academic_year_path(education_academic_years(:twenty_two)) + assert_response(:success) + end +end diff --git a/test/controllers/extranet/alumni/cohorts_controller_test.rb b/test/controllers/extranet/alumni/cohorts_controller_test.rb new file mode 100644 index 0000000000000000000000000000000000000000..be957ebc37e0a1a930d9da8a3db5330e608a15ed --- /dev/null +++ b/test/controllers/extranet/alumni/cohorts_controller_test.rb @@ -0,0 +1,15 @@ +require "test_helper" + +class Extranet::Alumni::CohortsControllerTest < ActionDispatch::IntegrationTest + include ExtranetSetup + + def test_index + get alumni_education_cohorts_path + assert_response(:success) + end + + def test_show + get alumni_education_cohort_path(education_cohorts(:default_cohort)) + assert_response(:success) + end +end diff --git a/test/controllers/extranet/organizations_controller_test.rb b/test/controllers/extranet/alumni/organizations_controller_test.rb similarity index 53% rename from test/controllers/extranet/organizations_controller_test.rb rename to test/controllers/extranet/alumni/organizations_controller_test.rb index 5e3edacefa33e6b2a66bae06b287bad50dad458b..4ae389477eb5ff650133f317dd1ecdf7f4be5030 100644 --- a/test/controllers/extranet/organizations_controller_test.rb +++ b/test/controllers/extranet/alumni/organizations_controller_test.rb @@ -1,15 +1,15 @@ require "test_helper" -class Extranet::OrganizationsControllerTest < ActionDispatch::IntegrationTest +class Extranet::Alumni::OrganizationsControllerTest < ActionDispatch::IntegrationTest include ExtranetSetup def test_index - get university_organizations_path + get alumni_university_organizations_path assert_response(:success) end def test_search - get search_university_organizations_path(term: "Organisation de test") + get alumni_search_university_organizations_path(term: "Organisation de test") assert_response(:success) results = JSON.parse(response.body) assert_equal(1, results.size) @@ -17,7 +17,7 @@ class Extranet::OrganizationsControllerTest < ActionDispatch::IntegrationTest end def test_show - get university_organization_path(university_organizations(:default_organization)) + get alumni_university_organization_path(university_organizations(:default_organization)) assert_response(:success) end end diff --git a/test/controllers/extranet/alumni/persons_controller_test.rb b/test/controllers/extranet/alumni/persons_controller_test.rb new file mode 100644 index 0000000000000000000000000000000000000000..d8fd71dd72bc10cfa8554d6716581ead53619d81 --- /dev/null +++ b/test/controllers/extranet/alumni/persons_controller_test.rb @@ -0,0 +1,15 @@ +require "test_helper" + +class Extranet::Alumni::PersonsControllerTest < ActionDispatch::IntegrationTest + include ExtranetSetup + + def test_index + get alumni_university_persons_path + assert_response(:success) + end + + def test_show + get alumni_university_person_path(university_people(:alumnus)) + assert_response(:success) + end +end diff --git a/test/controllers/extranet/cohorts_controller_test.rb b/test/controllers/extranet/cohorts_controller_test.rb deleted file mode 100644 index f925d1782d23748fa6b6020908755153d2a9ae4e..0000000000000000000000000000000000000000 --- a/test/controllers/extranet/cohorts_controller_test.rb +++ /dev/null @@ -1,15 +0,0 @@ -require "test_helper" - -class Extranet::CohortsControllerTest < ActionDispatch::IntegrationTest - include ExtranetSetup - - def test_index - get education_cohorts_path - assert_response(:success) - end - - def test_show - get education_cohort_path(education_cohorts(:default_cohort)) - assert_response(:success) - end -end diff --git a/test/controllers/extranet/persons_controller_test.rb b/test/controllers/extranet/persons_controller_test.rb deleted file mode 100644 index 1b4d10523048015f6f3f1f3d6abcdcf8f7c227d4..0000000000000000000000000000000000000000 --- a/test/controllers/extranet/persons_controller_test.rb +++ /dev/null @@ -1,15 +0,0 @@ -require "test_helper" - -class Extranet::PersonsControllerTest < ActionDispatch::IntegrationTest - include ExtranetSetup - - def test_index - get university_persons_path - assert_response(:success) - end - - def test_show - get university_person_path(university_people(:alumnus)) - assert_response(:success) - end -end