diff --git a/app/assets/config/manifest.js b/app/assets/config/manifest.js index 33b86bd606c23d65feaa51d4806485fa74459f73..4aa11843668581fcf726642ee320d12236367eac 100644 --- a/app/assets/config/manifest.js +++ b/app/assets/config/manifest.js @@ -1,4 +1,5 @@ //= link_tree ../images +//= link_tree ../fonts //= link_directory ../stylesheets .css //= link_directory ../javascripts .js //= link vue.js diff --git a/app/assets/fonts/Basier-Square/basiersquare-bold.woff b/app/assets/fonts/Basier-Square/basiersquare-bold.woff new file mode 100644 index 0000000000000000000000000000000000000000..4d192b38cb67448c8e1e9e1decbb0c1c1ce344f8 Binary files /dev/null and b/app/assets/fonts/Basier-Square/basiersquare-bold.woff differ diff --git a/app/assets/fonts/Basier-Square/basiersquare-bold.woff2 b/app/assets/fonts/Basier-Square/basiersquare-bold.woff2 new file mode 100644 index 0000000000000000000000000000000000000000..c0d1fc3d9abfaef6374ad4d73b8276842cdac63e Binary files /dev/null and b/app/assets/fonts/Basier-Square/basiersquare-bold.woff2 differ diff --git a/app/assets/fonts/Basier-Square/basiersquare-regular.woff b/app/assets/fonts/Basier-Square/basiersquare-regular.woff new file mode 100644 index 0000000000000000000000000000000000000000..fd64c52466dddb0b64327362c6e3358b21d04434 Binary files /dev/null and b/app/assets/fonts/Basier-Square/basiersquare-regular.woff differ diff --git a/app/assets/fonts/Basier-Square/basiersquare-regular.woff2 b/app/assets/fonts/Basier-Square/basiersquare-regular.woff2 new file mode 100644 index 0000000000000000000000000000000000000000..98233594f49dfd3e9e6b38caf329b6972e7861d7 Binary files /dev/null and b/app/assets/fonts/Basier-Square/basiersquare-regular.woff2 differ diff --git a/app/assets/stylesheets/application/layout.sass b/app/assets/stylesheets/application/layout.sass index cd015c4d187b46d793493288a6565b52805ad526..3858c3f7d518c648dde9e9035171ed5b9b06aed8 100644 --- a/app/assets/stylesheets/application/layout.sass +++ b/app/assets/stylesheets/application/layout.sass @@ -3,26 +3,10 @@ &-danger color: #82322F -.extranet - .navbar - margin-bottom: 100px - .navbar-brand - img - max-width: 100px - header - border-bottom: 1px solid - border-top: 1px solid - min-height: 160px - h1, p - padding-top: 3rem - footer - margin-top: 100px - .logo - width: 100px - .breadcrumb font-size: 14px padding-bottom: 50px + .card background: black border: none diff --git a/app/assets/stylesheets/extranet.sass b/app/assets/stylesheets/extranet.sass new file mode 100644 index 0000000000000000000000000000000000000000..3a08f1af68e965ca9100b29bf83936c2bc5b8a0e --- /dev/null +++ b/app/assets/stylesheets/extranet.sass @@ -0,0 +1,16 @@ +@import 'extranet/_default/abstracts/*' + +// IJBA Theme +@import 'extranet/themes/IJBA/variables' + +// Vendors +@import 'bootstrap' +@import 'simple_form_password_with_hints' +@import 'simple_form_bs5_file_input' +@import 'gdpr/cookie_consent' + +// Default +@import 'extranet/_default/base/*' +@import 'extranet/_default/layouts/*' +@import 'extranet/_default/components/*' +@import 'extranet/_default/pages/*' diff --git a/app/assets/stylesheets/extranet/_default/abstracts/_functions.sass b/app/assets/stylesheets/extranet/_default/abstracts/_functions.sass new file mode 100644 index 0000000000000000000000000000000000000000..dfad930d62f5dea9a4275ca321f9d0f6b3beb6c6 --- /dev/null +++ b/app/assets/stylesheets/extranet/_default/abstracts/_functions.sass @@ -0,0 +1,7 @@ +@function px2rem($size) + $remSize: $size / 16 + @return #{$remSize}rem + +@function pxr2rem($size) + $remSize: $size / 16 / 2 + @return #{$remSize}rem diff --git a/app/assets/stylesheets/extranet/_default/abstracts/_mixins.sass b/app/assets/stylesheets/extranet/_default/abstracts/_mixins.sass new file mode 100644 index 0000000000000000000000000000000000000000..68836830f57d46f8cfe27b3dbd525e547a5cb69d --- /dev/null +++ b/app/assets/stylesheets/extranet/_default/abstracts/_mixins.sass @@ -0,0 +1,15 @@ +@mixin pseudo-top-border($pseudo: before) + position: relative + &::#{$pseudo} + border-top: 1px solid $primary + content: '' + left: $grid-gutter-width * .5 + position: absolute + right: $grid-gutter-width * .5 + top: 0 + +@mixin pseudo-bottom-border($pseudo: after) + @include pseudo-top-border($pseudo) + &::#{$pseudo} + bottom: 0 + top: auto \ No newline at end of file diff --git a/app/assets/stylesheets/extranet/_default/abstracts/_variables.sass b/app/assets/stylesheets/extranet/_default/abstracts/_variables.sass new file mode 100644 index 0000000000000000000000000000000000000000..b5631c0fae2f20e5f32b054569928bb25aff733b --- /dev/null +++ b/app/assets/stylesheets/extranet/_default/abstracts/_variables.sass @@ -0,0 +1,43 @@ +// Colors +$primary: black + +// Fonts +$font-family-sans-serif: "Basier Square", sans-serif +$font-size-root: 1rem +$font-size-base: 1.125rem + +$h1-font-size: px2rem(40) +$h2-font-size: px2rem(18) +$h3-font-size: px2rem(20) +$headings-font-weight: 700 +$headings-margin-bottom: px2rem(24) +$small-font-size: px2rem(14) + +// Links +$link-color: $primary +$link-decoration: none + +// Buttons +$border-radius: 0 +$border-radius-sm: 0 +$border-radius-lg: 0 +$btn-padding-y-sm: 2px +$btn-padding-x-sm: 7px +$btn-active-bg-tint-amount: 80% + +$btn-facet-background: rgba(0, 0, 0, 0.1) +$btn-facet-background-active: rgba(0, 0, 0, 0.3) +$btn-facet-color: $primary + +// Breadcrumb +$breadcrumb-font-size: px2rem(14) +$breadcrumb-active-color: black +$breadcrumb-divider-color: black +$breadcrumb-margin-bottom: 45px + +// List +$list-border-color: rgba(0, 0, 0, 0.3) + +// Pagination +$pagination-border-width: 0 +$pagination-font-size: $small-font-size diff --git a/app/assets/stylesheets/extranet/_default/base/_fonts.sass b/app/assets/stylesheets/extranet/_default/base/_fonts.sass new file mode 100644 index 0000000000000000000000000000000000000000..1ae9991f29db0e9c8d3afa131687a3f471b456a9 --- /dev/null +++ b/app/assets/stylesheets/extranet/_default/base/_fonts.sass @@ -0,0 +1,14 @@ +@font-face + font-display: swap + font-family: 'Basier Square' + font-style: normal + font-weight: 400 + src: asset-url("Basier-Square/basiersquare-regular.woff2") format("woff2"), url("Basier-Square/basiersquare-regular.woff") format("woff") + +@font-face + font-display: swap + font-family: 'Basier Square' + font-style: normal + font-weight: 700 + src: asset-url("Basier-Square/basiersquare-bold.woff2") format("woff2"), url("Basier-Square/basiersquare-bold.woff") format("woff") + diff --git a/app/assets/stylesheets/extranet/_default/base/_typography.sass b/app/assets/stylesheets/extranet/_default/base/_typography.sass new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/app/assets/stylesheets/extranet/_default/components/_breadcrumb.sass b/app/assets/stylesheets/extranet/_default/components/_breadcrumb.sass new file mode 100644 index 0000000000000000000000000000000000000000..23391a0c8943e73eb29847249e016c0d0c4f81fb --- /dev/null +++ b/app/assets/stylesheets/extranet/_default/components/_breadcrumb.sass @@ -0,0 +1,2 @@ +.breadcrumb + margin-bottom: $breadcrumb-margin-bottom !important \ No newline at end of file diff --git a/app/assets/stylesheets/extranet/_default/components/_facets.sass b/app/assets/stylesheets/extranet/_default/components/_facets.sass new file mode 100644 index 0000000000000000000000000000000000000000..3c6150635a5ce5320ecb8fac3d8c3a6999126da2 --- /dev/null +++ b/app/assets/stylesheets/extranet/_default/components/_facets.sass @@ -0,0 +1,48 @@ +.facets + h2 + margin-bottom: 1em + .facet + .btn-sm + background: $btn-facet-background + border: 0 + color: $btn-facet-color + min-width: px2rem(52) + padding: 2px 7px + .btn-check:checked + .btn-sm + background: $btn-facet-background-active + &--years + .form-check + display: inline-block + padding: 0 + vertical-align: middle + .form-check-input[type="checkbox"] + border-color: $primary + border-radius: 0 + height: 0.65em + margin-top: 0.5em + width: 0.65em + +.faceted__facets + > li + margin-bottom: px2rem(40) + b + display: block + margin-bottom: px2rem(10) +.faceted__facet + &__text + display: flex + &__list + display: flex + flex-wrap: wrap + &__value + @extend .btn-sm + background: $btn-facet-background + border: 0 + color: $btn-facet-color + display: inline-block + margin-bottom: 10px + margin-right: 10px + min-width: px2rem(52) + padding: 2px 7px + &--selected + background: $btn-facet-background-active diff --git a/app/assets/stylesheets/extranet/_default/components/_list.sass b/app/assets/stylesheets/extranet/_default/components/_list.sass new file mode 100644 index 0000000000000000000000000000000000000000..819cdddea6347c29d342a820ce29cbd947febbf9 --- /dev/null +++ b/app/assets/stylesheets/extranet/_default/components/_list.sass @@ -0,0 +1,16 @@ +.list + list-style: none + padding-left: 0 + li + align-items: baseline + border-bottom: 1px solid $list-border-color + display: flex + justify-content: space-between + padding-bottom: px2rem(25) + padding-top: px2rem(25) + position: relative + &:first-of-type + border-top: 1px solid $list-border-color + h2, p + margin-bottom: 0 + \ No newline at end of file diff --git a/app/assets/stylesheets/extranet/_default/components/_pagination.sass b/app/assets/stylesheets/extranet/_default/components/_pagination.sass new file mode 100644 index 0000000000000000000000000000000000000000..cd6998fdb7e487d53ee567e219cb7b6f804d7087 --- /dev/null +++ b/app/assets/stylesheets/extranet/_default/components/_pagination.sass @@ -0,0 +1,3 @@ +.pagination + font-size: $pagination-font-size + justify-content: end diff --git a/app/assets/stylesheets/extranet/_default/layouts/_footer.sass b/app/assets/stylesheets/extranet/_default/layouts/_footer.sass new file mode 100644 index 0000000000000000000000000000000000000000..44a3714b377f596bd2003c73b49172ff063464f4 --- /dev/null +++ b/app/assets/stylesheets/extranet/_default/layouts/_footer.sass @@ -0,0 +1,14 @@ +footer + font-size: $small-font-size + margin-top: 100px + padding-bottom: 100px + .footer-logo + border-bottom: 1px solid $primary + img + height: auto + width: 100px + nav + a + display: block + line-height: px2rem(26) + text-decoration: underline diff --git a/app/assets/stylesheets/extranet/_default/layouts/_header.sass b/app/assets/stylesheets/extranet/_default/layouts/_header.sass new file mode 100644 index 0000000000000000000000000000000000000000..67bc99556e0b81d2b26f040619d8a06f6179fb29 --- /dev/null +++ b/app/assets/stylesheets/extranet/_default/layouts/_header.sass @@ -0,0 +1,16 @@ +.navbar + margin-bottom: 100px + .navbar-brand + img + max-width: 100px + +header + align-items: center + border-bottom: 1px solid + border-top: 1px solid + display: flex + justify-content: space-between + min-height: 160px + h1, p + margin: 0 + padding: 0 diff --git a/app/assets/stylesheets/extranet/_default/pages/_default.sass b/app/assets/stylesheets/extranet/_default/pages/_default.sass new file mode 100644 index 0000000000000000000000000000000000000000..8a8ca85754ea6988c796fd47af16879aab5e57d3 --- /dev/null +++ b/app/assets/stylesheets/extranet/_default/pages/_default.sass @@ -0,0 +1,18 @@ +.action-show + .top + align-items: stretch + header + align-items: center + display: flex + height: 100% + h1 + margin: 0 + padding: 0 + dl + line-height: px2rem(26) + dt + font-size: $small-font-size + dd + margin-bottom: px2rem(26) + .biography + padding-right: percentage(3/9) \ No newline at end of file diff --git a/app/assets/stylesheets/extranet/_default/pages/_home.sass b/app/assets/stylesheets/extranet/_default/pages/_home.sass new file mode 100644 index 0000000000000000000000000000000000000000..447bf5620182a955fe3bd851a371b399ec228c55 --- /dev/null +++ b/app/assets/stylesheets/extranet/_default/pages/_home.sass @@ -0,0 +1,32 @@ +.home-index + .experiences + margin-top: px2rem(80) + ul + padding-left: 0 + li + @include make-row + display: flex + position: relative + > div + @include make-col-ready + &:nth-child(1) + width: percentage(2/9) + &:nth-child(2) + @include pseudo-bottom-border + @include pseudo-top-border + display: flex + justify-content: space-between + padding-bottom: px2rem(16) + padding-top: px2rem(12) + width: percentage(7/9) + display: flex + justify-content: space-between + > div + align-self: stretch + display: flex + flex-direction: column + justify-content: space-between + a + align-self: center + img + max-height: 80px \ No newline at end of file diff --git a/app/assets/stylesheets/extranet/_default/pages/_organizations.sass b/app/assets/stylesheets/extranet/_default/pages/_organizations.sass new file mode 100644 index 0000000000000000000000000000000000000000..55f18781bd9d9043578b667c27670e676ba8aec0 --- /dev/null +++ b/app/assets/stylesheets/extranet/_default/pages/_organizations.sass @@ -0,0 +1,47 @@ +.organization + @include pseudo-top-border + align-items: center + min-height: 80px + &:last-child + @include pseudo-bottom-border + &::after + bottom: 0 + top: auto + > div + @include make-col-ready + &:nth-child(1) + width: percentage(3/8) + &:nth-child(2) + width: percentage(2/8) + &:nth-child(3) + align-self: center + padding-bottom: 0 + padding-top: 0 + text-align: right + width: percentage(3/8) + p + margin-bottom: 0 + img + max-height: 80px + +.organizations-show + .experiences + margin-top: px2rem(80) + ul + padding-left: 0 + li + @include make-row + display: flex + > div + @include make-col-ready + &:nth-child(1) + width: percentage(2/9) + &:nth-child(2) + @include pseudo-bottom-border + @include pseudo-top-border + display: flex + justify-content: space-between + padding-top: px2rem(20) + text-align: right + width: percentage(7/9) + diff --git a/app/assets/stylesheets/extranet/_default/pages/_person.sass b/app/assets/stylesheets/extranet/_default/pages/_person.sass new file mode 100644 index 0000000000000000000000000000000000000000..19194649dc172bbfb17655496be0af1645f57704 --- /dev/null +++ b/app/assets/stylesheets/extranet/_default/pages/_person.sass @@ -0,0 +1,35 @@ +.persons-show + .top + h1 + font-weight: normal + + .experiences + margin-top: px2rem(80) + ul + padding-left: 0 + li + @include make-row + @include pseudo-top-border + display: flex + padding: px2rem(16) 0 + position: relative + p + margin-bottom: px2rem(8) + > div + @include make-col-ready + padding-bottom: px2rem(10) + padding-top: px2rem(10) + &:nth-child(1) + width: percentage(4/9) + &:nth-child(2) + width: percentage(2/9) + &:nth-child(3) + align-self: center + padding-bottom: 0 + padding-top: 0 + text-align: right + width: percentage(3/9) + &:last-child + @include pseudo-bottom-border + img + max-height: 80px \ No newline at end of file diff --git a/app/assets/stylesheets/extranet/themes/IJBA/_variables.sass b/app/assets/stylesheets/extranet/themes/IJBA/_variables.sass new file mode 100644 index 0000000000000000000000000000000000000000..71b7e5289b6b7ddebe1187850cf33c36f0a12a60 --- /dev/null +++ b/app/assets/stylesheets/extranet/themes/IJBA/_variables.sass @@ -0,0 +1,5 @@ +$ijba-red: #E40130 + +$nav-tabs-link-active-color: $ijba-red + +$breadcrumb-active-color: $ijba-red diff --git a/app/assets/stylesheets/extranet/themes/IJBA/ijba.sass b/app/assets/stylesheets/extranet/themes/IJBA/ijba.sass new file mode 100644 index 0000000000000000000000000000000000000000..13396b00fb1dd7ddf4ae91101d0e87d41088aa23 --- /dev/null +++ b/app/assets/stylesheets/extranet/themes/IJBA/ijba.sass @@ -0,0 +1,17 @@ +// TODO : Add one compiled CSS per theme ? + +// @import 'extranet/abstracts/*' + +// // IJBA Theme +// @import 'variables' + +// // Vendors +// @import 'bootstrap' +// @import 'simple_form_password_with_hints' +// @import 'simple_form_bs5_file_input' +// @import 'gdpr/cookie_consent' + +// // Default +// @import 'extranet/_default/base/*' +// @import 'extranet/_default/layouts/*' +// @import 'extranet/_default/components/*' diff --git a/app/controllers/admin/communication/website/posts_controller.rb b/app/controllers/admin/communication/website/posts_controller.rb index 1bd2a9f5929e36dc3efdde6e00a2ceaab1464172..f8c2cad42663fc419dcda29e3d5e2acd0982a646 100644 --- a/app/controllers/admin/communication/website/posts_controller.rb +++ b/app/controllers/admin/communication/website/posts_controller.rb @@ -12,6 +12,10 @@ class Admin::Communication::Website::PostsController < Admin::Communication::Web def index @posts = apply_scopes(@posts).ordered.page params[:page] + @authors = apply_scopes(@website.authors.accessible_by(current_ability)) + .ordered + .page(params[:page]) + @root_categories = @website.categories.root.ordered breadcrumb end diff --git a/app/controllers/extranet/academic_years_controller.rb b/app/controllers/extranet/academic_years_controller.rb index 5b7d80d9b3171d4f70d7b38921376e9bd6a0b514..822020505aefc4632416f284104aaa56e217ff34 100644 --- a/app/controllers/extranet/academic_years_controller.rb +++ b/app/controllers/extranet/academic_years_controller.rb @@ -4,7 +4,11 @@ class Extranet::AcademicYearsController < Extranet::ApplicationController through_association: :academic_years def index - @academic_years = current_extranet.about&.academic_years || @academic_years + @academic_years = about&.academic_years + .ordered + .page(params[:page]) + .per(20) + @count = @academic_years.total_count breadcrumb end diff --git a/app/controllers/extranet/application_controller.rb b/app/controllers/extranet/application_controller.rb index ba0116397edf6125094bc8b0790ee968157c22a9..493ed64fbfd2e0b77ccbebd1dc7c5aae2c8085be 100644 --- a/app/controllers/extranet/application_controller.rb +++ b/app/controllers/extranet/application_controller.rb @@ -4,4 +4,8 @@ class Extranet::ApplicationController < ApplicationController def breadcrumb add_breadcrumb t('home'), root_path end + + def about + current_extranet.about || current_university + end end diff --git a/app/controllers/extranet/cohorts_controller.rb b/app/controllers/extranet/cohorts_controller.rb index e25c966f2436df3c6edb8a413c0087bc736afe38..62ee6a5603936fffa448914a12e76101c50a75b5 100644 --- a/app/controllers/extranet/cohorts_controller.rb +++ b/app/controllers/extranet/cohorts_controller.rb @@ -4,7 +4,15 @@ class Extranet::CohortsController < Extranet::ApplicationController through_association: :education_cohorts def index - @cohorts = current_extranet.about&.cohorts || @cohorts + @facets = Education::Cohort::Facets.new params[:facets], { + model: about.cohorts, + about: about + } + @cohorts = @facets.results + .ordered + .page(params[:page]) + .per(60) + @count = @cohorts.total_count breadcrumb end diff --git a/app/controllers/extranet/home_controller.rb b/app/controllers/extranet/home_controller.rb index 6f189dd8b0cff76d40b497875cd8ea06c1b091ed..41f0e8a1988fa589601f394d52f3ec9c05179938 100644 --- a/app/controllers/extranet/home_controller.rb +++ b/app/controllers/extranet/home_controller.rb @@ -1,8 +1,7 @@ class Extranet::HomeController < Extranet::ApplicationController def index return redirect_to admin_root_path unless current_extranet - @about = current_extranet.about || current_university - @cohorts = @about&.cohorts.ordered.limit(5) - @experiences = @about&.experiences.ordered.limit(10) + @cohorts = about&.cohorts.ordered.limit(5) + @experiences = about&.experiences.ordered.limit(10) end end diff --git a/app/controllers/extranet/organizations_controller.rb b/app/controllers/extranet/organizations_controller.rb index ee06ab51e823f369a0a2571ea27bb2839b246edb..1fd325c4a67c4d6d12118a0e6668d6cf48c36a3c 100644 --- a/app/controllers/extranet/organizations_controller.rb +++ b/app/controllers/extranet/organizations_controller.rb @@ -4,7 +4,7 @@ class Extranet::OrganizationsController < Extranet::ApplicationController through_association: :organizations def index - @organizations = current_extranet.about&.alumni_organizations || @organizations + @organizations = about&.alumni_organizations @organizations = @organizations.ordered.page(params[:page]) @count = @organizations.total_count breadcrumb diff --git a/app/controllers/extranet/persons_controller.rb b/app/controllers/extranet/persons_controller.rb index e3975a7a7afe0f01c3a25506c8d5b567a25fc03c..866a2e30cdf38d4a1f0a0bca1c9e1ccd371f8fd3 100644 --- a/app/controllers/extranet/persons_controller.rb +++ b/app/controllers/extranet/persons_controller.rb @@ -4,9 +4,8 @@ class Extranet::PersonsController < Extranet::ApplicationController through_association: :people def index - alumni = current_extranet.about&.alumni || @people.alumni @facets = University::Person::Alumnus::Facets.new params[:facets], { - model: alumni, + model: about&.alumni, about: current_extranet.about } @people = @facets.results diff --git a/app/models/education/academic_year.rb b/app/models/education/academic_year.rb index ac89369971fb7286c5a8a2b490707b66089b7be3..1002b03ca63e9d986888824cad6626c982ea0971 100644 --- a/app/models/education/academic_year.rb +++ b/app/models/education/academic_year.rb @@ -19,7 +19,10 @@ class Education::AcademicYear < ApplicationRecord include WithUniversity - has_many :cohorts, class_name: 'Education::Cohort' + has_many :education_cohorts, + class_name: 'Education::Cohort' + has_many :cohorts, + class_name: 'Education::Cohort' # Dénormalisation des alumni pour le faceted search has_and_belongs_to_many :university_people, diff --git a/app/models/education/cohort.rb b/app/models/education/cohort.rb index 1d1aceba419850f4b9c61d07382aa26a753eba3c..b513e77a815caf8378d5b7c9ddd59dd5331441d8 100644 --- a/app/models/education/cohort.rb +++ b/app/models/education/cohort.rb @@ -24,14 +24,23 @@ # class Education::Cohort < ApplicationRecord include WithUniversity - belongs_to :program, class_name: 'Education::Program' - belongs_to :academic_year, class_name: 'Education::AcademicYear' + + belongs_to :program, + class_name: 'Education::Program' + alias_attribute :education_program, :program + + belongs_to :academic_year, + class_name: 'Education::AcademicYear' + alias_attribute :education_academic_year, :academic_year + has_and_belongs_to_many :people, class_name: 'University::Person', foreign_key: 'education_cohort_id', association_foreign_key: 'university_person_id' - scope :ordered, -> { includes(:academic_year).order('education_academic_years.year DESC') } + scope :ordered, -> { + includes(:academic_year).order('education_academic_years.year DESC') + } def to_s "#{program} #{academic_year} #{name}" diff --git a/app/models/education/cohort/facets.rb b/app/models/education/cohort/facets.rb new file mode 100644 index 0000000000000000000000000000000000000000..90298cd6d325d86a5160d48eda8b10a82a21256b --- /dev/null +++ b/app/models/education/cohort/facets.rb @@ -0,0 +1,18 @@ +class Education::Cohort::Facets < FacetedSearch::Facets + def initialize(params, options) + super params + + @model = options[:model] + @about = options[:about] + + filter_with_list :academic_years, { + source: @about.academic_years.ordered, + title: Education::AcademicYear.model_name.human(count: 2) + } + + filter_with_checkboxes :programs, { + source: @about.programs.ordered, + title: Education::Program.model_name.human(count: 2) + } unless @about.is_a? Education::Program + end +end diff --git a/app/models/education/program.rb b/app/models/education/program.rb index 7ae3b751c4b5a2fa1bbec8f4ea91c47baf3547a1..66348c20bd9ce683ebc67ea3bc96806afa2e7130 100644 --- a/app/models/education/program.rb +++ b/app/models/education/program.rb @@ -115,6 +115,8 @@ class Education::Program < ApplicationRecord has_many :cohorts, class_name: 'Education::Cohort' + has_many :education_cohorts, + class_name: 'Education::Cohort' has_many :alumni, through: :cohorts, @@ -125,7 +127,7 @@ class Education::Program < ApplicationRecord class_name: 'University::Person::Experience', through: :alumni, source: :experiences - alias_attribute :experiences, :alumni_experiences + alias_attribute :experiences, :alumni_experiences has_many :alumni_organizations, -> { distinct }, @@ -133,16 +135,22 @@ class Education::Program < ApplicationRecord through: :alumni_experiences, source: :organization - has_many :academic_years, - through: :cohorts + has_many :education_academic_years, + -> { distinct }, + class_name: 'Education::AcademicYear', + through: :cohorts, + source: :academic_year + alias_attribute :academic_years, :education_academic_years - # Dénormalisation des alumni pour le faceted search - has_and_belongs_to_many :university_people, - class_name: 'University::Person', - foreign_key: 'education_program_id', - association_foreign_key: 'university_person_id' + # Dénormalisation des alumni pour le faceted search + has_and_belongs_to_many :university_people, + class_name: 'University::Person', + foreign_key: 'education_program_id', + association_foreign_key: 'university_person_id' - accepts_nested_attributes_for :university_person_involvements, reject_if: :all_blank, allow_destroy: true + accepts_nested_attributes_for :university_person_involvements, + reject_if: :all_blank, + allow_destroy: true enum level: { not_applicable: 0, diff --git a/app/models/education/school.rb b/app/models/education/school.rb index f46defd6f85a8486e6134f7b434bf133584395a9..8bf4ed5acf52044b14baa50cf68d20bb29d72948 100644 --- a/app/models/education/school.rb +++ b/app/models/education/school.rb @@ -38,7 +38,9 @@ class Education::School < ApplicationRecord join_table: 'education_programs_schools', foreign_key: 'education_school_id', association_foreign_key: 'education_program_id' + belongs_to :university + has_many :websites, class_name: 'Communication::Website', as: :about, @@ -66,27 +68,29 @@ class Education::School < ApplicationRecord through: :published_programs, source: :university_people_through_role_involvements - has_many :alumni, - -> { distinct }, + has_many :alumni, -> { distinct }, through: :programs - has_many :alumni_experiences, - -> { distinct }, + has_many :alumni_experiences, -> { distinct }, class_name: 'University::Person::Experience', through: :alumni, source: :experiences - alias_attribute :experiences, :alumni_experiences + alias_attribute :experiences, :alumni_experiences - has_many :alumni_organizations, - -> { distinct }, + has_many :alumni_organizations, -> { distinct }, class_name: 'University::Organization', through: :alumni_experiences, source: :organization - has_many :academic_years, - -> { distinct }, - through: :programs - has_many :cohorts, - -> { distinct }, + + has_many :education_academic_years, -> { distinct }, + class_name: 'Education::AcademicYear', through: :programs + alias_attribute :academic_years, :education_academic_years + + has_many :education_cohorts, -> { distinct }, + class_name: 'Education::Cohort', + through: :programs, + source: :cohorts + alias_attribute :cohorts, :education_cohorts validates :name, :address, :city, :zipcode, :country, presence: true diff --git a/app/models/university/person/alumnus/facets.rb b/app/models/university/person/alumnus/facets.rb index cd98815f4885f7ebaea5ab3608f4cb379c0080a3..174244a8738b74ab0ef9afe3e1decb1c40a6b08b 100644 --- a/app/models/university/person/alumnus/facets.rb +++ b/app/models/university/person/alumnus/facets.rb @@ -15,7 +15,7 @@ class University::Person::Alumnus::Facets < FacetedSearch::Facets habtm: true } - filter_with_list :diploma_programs, { + filter_with_checkboxes :diploma_programs, { source: @about.programs.ordered, title: Education::Program.model_name.human(count: 2), habtm: true diff --git a/app/models/university/person/alumnus/import.rb b/app/models/university/person/alumnus/import.rb index 6da4f7198ebb804489d97287313c3f89bc247bba..54d973d228117a591047d8b12038ca669e17e261 100644 --- a/app/models/university/person/alumnus/import.rb +++ b/app/models/university/person/alumnus/import.rb @@ -34,11 +34,17 @@ class University::Person::Alumnus::Import < ApplicationRecord if Rails.env.development? # substitute local data for testing substitutes = { - 'c6b78fac-0a5f-4c44-ad22-4ee68ed382bb' => '23279cab-8bc1-4c75-bcd8-1fccaa03ad55', # DUT MMI - 'ae3e067a-63b4-4c3f-ba9c-468ade0e4182' => '863b8c9c-1ed1-4af7-b92c-7264dfb6b4da', # MASTER IJBA - 'f4d4a92f-8b8f-4778-a127-9293684666be' => '8dfaee2a-c876-4b1c-8e4e-8380d720c71f', # DU_BILINGUE - '6df53074-195c-4299-8b49-bbc9d7cad41a' => 'be3cb0b2-7f66-4c5f-b8d7-6a39a0480c46', # DU_JRI - '0d81d3a2-a12c-4326-a395-fd0df4a3ea4f' => '56a50383-3ef7-43f6-8e98-daf279e86802' # DUT_JOURNALISME + # 'c6b78fac-0a5f-4c44-ad22-4ee68ed382bb' => '23279cab-8bc1-4c75-bcd8-1fccaa03ad55', # DUT MMI + # 'ae3e067a-63b4-4c3f-ba9c-468ade0e4182' => '863b8c9c-1ed1-4af7-b92c-7264dfb6b4da', # MASTER IJBA + # 'f4d4a92f-8b8f-4778-a127-9293684666be' => '8dfaee2a-c876-4b1c-8e4e-8380d720c71f', # DU_BILINGUE + # '6df53074-195c-4299-8b49-bbc9d7cad41a' => 'be3cb0b2-7f66-4c5f-b8d7-6a39a0480c46', # DU_JRI + # '0d81d3a2-a12c-4326-a395-fd0df4a3ea4f' => '56a50383-3ef7-43f6-8e98-daf279e86802' # DUT_JOURNALISME + + 'c6b78fac-0a5f-4c44-ad22-4ee68ed382bb' => '02e6f703-d15b-4841-ac95-3c47d88e21b5', # DUT MMI + 'ae3e067a-63b4-4c3f-ba9c-468ade0e4182' => '8fdfafb7-11fd-456c-9f47-7fd76dddb373', # MASTER IJBA + 'f4d4a92f-8b8f-4778-a127-9293684666be' => 'fab9b86c-8872-4df5-9a97-0e30b104a837', # DU_BILINGUE + '6df53074-195c-4299-8b49-bbc9d7cad41a' => 'cb1a26b9-fe5c-4ad1-9715-71cec4642910', # DU_JRI + '0d81d3a2-a12c-4326-a395-fd0df4a3ea4f' => '91c44fd2-f0a4-4189-a3f5-311322b7b472' # DUT_JOURNALISME } program_id = substitutes[program_id] if substitutes.has_key? program_id end diff --git a/app/views/admin/application/_filters.html.erb b/app/views/admin/application/_filters.html.erb index bb28a2cdfb7408bd76a4b92af1db1f8c0751c3f7..562c3b78ca4f8a0e866daa678ef20a4c009cb8b8 100644 --- a/app/views/admin/application/_filters.html.erb +++ b/app/views/admin/application/_filters.html.erb @@ -6,7 +6,7 @@ filters.each { |filter| should_be_open = true if params.has_key?(filter[:scope_n <% if collapsable %> <div class="text-end mt-n5"> - <a class="btn btn-light btn-sm" + <a class="btn btn-outline-secondary btn-sm" data-bs-toggle="collapse" href="#collapseFilters" role="button" diff --git a/app/views/admin/communication/extranets/index.html.erb b/app/views/admin/communication/extranets/index.html.erb index 8b7e80ea0077db9743a5ac80076001f3639073a0..c0af0e6dab7d5aef15035bb07073dcbea050716e 100644 --- a/app/views/admin/communication/extranets/index.html.erb +++ b/app/views/admin/communication/extranets/index.html.erb @@ -10,14 +10,13 @@ <th><%= Communication::Extranet.human_attribute_name('about_type') %></th> <th><%= Communication::Extranet.human_attribute_name('about') %></th> <th></th> - <th></th> </tr> </thead> <tbody> <% @extranets.each do |extranet| %> <tr> <td><%= link_to extranet, [:admin, extranet] %></td> - <td><%= link_to extranet.url, extranet.url, target: :_blank %></td> + <td><%= link_to extranet.url, extranet.url, target: :_blank unless extranet.url.blank? %></td> <td><%= I18n.t("activerecord.attributes.communication/extranet.about_#{extranet.about_type}") %></td> <td><%= link_to extranet.about, [:admin, extranet.about] if extranet.about %></td> <td class="text-end"> diff --git a/app/views/admin/communication/website/categories/_treebranch.html.erb b/app/views/admin/communication/website/categories/_treebranch.html.erb index 04fcbc2b2392c4d3f2b893f0975ce92362cff8a4..c8c9bcd3a736a80bdef143518fde4bd3d6efc081 100644 --- a/app/views/admin/communication/website/categories/_treebranch.html.erb +++ b/app/views/admin/communication/website/categories/_treebranch.html.erb @@ -1,6 +1,6 @@ <% categories.each do |category| %> <li class="treeview__element js-treeview-element <%= 'treeview__element--empty' unless category.has_children? %>" data-id="<%= category.id %>" data-parent="<%= category.parent_id %>"> - <div class="d-flex align-items-center treeview__label border-bottom p-1"> + <div class="d-flex align-items-center treeview__label border-bottom py-1"> <%= link_to children_admin_communication_website_category_path(website_id: category.website.id, id: category.id), class: 'js-treeview-openzone d-inline-block p-2 ps-0', style: 'width: 22px', remote: true do %> <span class="open_btn"> diff --git a/app/views/admin/communication/website/menus/_list.html.erb b/app/views/admin/communication/website/menus/_list.html.erb index fa74e0adcaaa6ee23f39596c991f15b634cd81b6..ed9f453b643d1cbb0abab554020825022e6ab5d0 100644 --- a/app/views/admin/communication/website/menus/_list.html.erb +++ b/app/views/admin/communication/website/menus/_list.html.erb @@ -2,6 +2,7 @@ <thead> <tr> <th><%= Communication::Website::Menu.human_attribute_name('title') %></th> + <th><%= Communication::Website::Menu.human_attribute_name('items') %></th> <th></th> </tr> </thead> @@ -9,6 +10,7 @@ <% menus.each do |menu| %> <tr> <td><%= link_to menu, admin_communication_website_menu_path(website_id: menu.website.id, id: menu.id) %></td> + <td><%= menu.items.count %></td> <td class="text-end"> <div class="btn-group" role="group"> <%= link_to t('edit'), diff --git a/app/views/admin/communication/website/pages/index.html.erb b/app/views/admin/communication/website/pages/index.html.erb index 1821044eaafcd7de7b63e4aaddf195313391345c..0f387e4fa4032ecc15f4562608504774d7247e17 100644 --- a/app/views/admin/communication/website/pages/index.html.erb +++ b/app/views/admin/communication/website/pages/index.html.erb @@ -1,4 +1,4 @@ -<% content_for :title, "#{Communication::Website::Page.model_name.human(count: 2)} (#{@website.pages.count})" %> +<% content_for :title, "#{t('admin.communication.website.pages.structure')} (#{@website.pages.count})" %> <%= render 'admin/communication/websites/sidebar' do %> <div class="card"> diff --git a/app/views/admin/communication/website/posts/index.html.erb b/app/views/admin/communication/website/posts/index.html.erb index 1e44db031f798099cee8a100c890f0d3128bc632..5688ab1246448d9cb21c061ef28b70d5c14869bb 100644 --- a/app/views/admin/communication/website/posts/index.html.erb +++ b/app/views/admin/communication/website/posts/index.html.erb @@ -15,22 +15,51 @@ <div data-batch-selectable-role="actions-container"> <div class="d-flex align-items-center"> <div class="col-auto me-3"> - Modifier la sélection + <%= t('batch_selectable.title') %> </div> <div class="col-auto me-3"> <select name="published" class="form-select"> - <option value="false">Non publiée</option> - <option value="true">Publiée</option> + <option value="false"><%= t('communication.website.posts.unpublished') %></option> + <option value="true"><%= t('communication.website.posts.published') %></option> </select> </div> <div class="col-auto me-3"> - <input type="submit" value="Enregistrer" class="btn btn-primary"> + <%= submit_tag t("save"), class: "btn btn-primary" %> </div> </div> </div> </div> <% end %> </div> + <div class="row"> + <div class="col-md-6"> + <div class="card"> + <div class="card-header"> + <div class="float-end"> + <%= create_link Communication::Website::Category %> + </div> + <h2 class="card-title"> + <%= Communication::Website::Category.model_name.human(count: 2) %> + </h2> + </div> + <div class="card-body"> + <ul class="list-unstyled treeview treeview--sortable js-treeview js-treeview-sortable js-treeview-sortable-container" + data-id="" + data-sort-url="<%= reorder_admin_communication_website_categories_path %>"> + <%= render 'admin/communication/website/categories/treebranch', categories: @root_categories %> + </ul> + </div> + </div> + </div> + <div class="col-md-6"> + <div class="card"> + <div class="card-header"> + <h2 class="card-title"><%= t('communication.authors', count: 2) %></h2> + </div> + <%= render 'admin/communication/website/authors/list', authors: @authors %> + </div> + </div> + </div> <% end %> diff --git a/app/views/admin/communication/websites/_sidebar.html.erb b/app/views/admin/communication/websites/_sidebar.html.erb index 130b9144f3e67f3a9cf8cd17a4d1e808d3e9c2c2..2c69f37e5f1d21a5e4043b16f4e0569bdcba8b5c 100644 --- a/app/views/admin/communication/websites/_sidebar.html.erb +++ b/app/views/admin/communication/websites/_sidebar.html.erb @@ -7,31 +7,25 @@ { title: Communication::Website.model_name.human, path: admin_communication_website_path(id: @website), + icon: 'fas fa-home', ability: can?(:read, @website) }, { title: t('admin.communication.website.pages.structure'), path: admin_communication_website_pages_path(website_id: @website), + icon: 'fas fa-sitemap', ability: can?(:read, Communication::Website::Page) }, { title: Communication::Website::Post.model_name.human(count: 2), path: admin_communication_website_posts_path(website_id: @website), + icon: 'fas fa-newspaper', ability: can?(:read, Communication::Website::Post) }, - { - title: " - #{Communication::Website::Category.model_name.human(count: 2)}", - path: admin_communication_website_categories_path(website_id: @website), - ability: can?(:read, Communication::Website::Category) - }, - { - title: " - #{t('communication.authors', count: 2)}", - path: admin_communication_website_authors_path(website_id: @website), - ability: can?(:read, University::Person) - }, { title: Communication::Website::Menu.model_name.human(count: 2), path: admin_communication_website_menus_path(website_id: @website), + icon: 'fas fa-bars', ability: can?(:read, Communication::Website::Category) } ].each do |object| @@ -40,6 +34,9 @@ %> <a class="list-group-item list-group-item-action<%= ' active' if active %>" href="<%= object[:path] %>"> <%= object[:title].html_safe %> + <span class="float-end"> + <i class="<%= object[:icon] %>"></i> + </span> </a> <% end %> </div> diff --git a/app/views/admin/communication/websites/index.html.erb b/app/views/admin/communication/websites/index.html.erb index 40daabbc068fe1e165e6360df023274d82f0a74d..612fd9ba2c070b94aeb5289c25545b6ce12176a8 100644 --- a/app/views/admin/communication/websites/index.html.erb +++ b/app/views/admin/communication/websites/index.html.erb @@ -16,7 +16,7 @@ <% @websites.each do |website| %> <tr> <td><%= link_to website, [:admin, website] %></td> - <td><%= link_to website.url, website.url, target: :_blank %></td> + <td><%= link_to website.url, website.url, target: :_blank unless website.url.blank? %></td> <td><%= I18n.t("activerecord.attributes.communication/website.about_#{website.about_type}") %></td> <td><%= link_to_if can?(:read, website.about), website.about, [:admin, website.about] if website.about %></td> <td class="text-end"> diff --git a/app/views/admin/communication/websites/show/_posts.html.erb b/app/views/admin/communication/websites/show/_posts.html.erb index f71aff248cdb98576f92617b3e4fa8dd7237a9a7..34483c9bdac5e240926c39c651468bb5f4fd9098 100644 --- a/app/views/admin/communication/websites/show/_posts.html.erb +++ b/app/views/admin/communication/websites/show/_posts.html.erb @@ -18,5 +18,5 @@ <% end %> </h2> </div> - <%= render 'admin/communication/website/posts/list', posts: @website.posts.recent %> + <%= render 'admin/communication/website/posts/list', posts: @website.posts.recent, hide_author: true, hide_category: true %> </div> diff --git a/app/views/extranet/academic_years/_list.html.erb b/app/views/extranet/academic_years/_list.html.erb deleted file mode 100644 index 914824d3074b9949d01422d3175d6382bd44fc87..0000000000000000000000000000000000000000 --- a/app/views/extranet/academic_years/_list.html.erb +++ /dev/null @@ -1,26 +0,0 @@ -<% academic_years_paged = academic_years.ordered.page(params[:page]).per(60) %> -<div class="row"> - <% academic_years_paged.each do |year| %> - <% - cohorts = year.cohorts_in_context(current_context.about) - alumni = year.alumni_in_context(current_context.about) - %> - <div class="col-md-3"> - <article class="card mb-4"> - <div class="card-body"> - <h2 class="mb-5"> - <%= link_to year, year, class: 'stretched-link' %> - </h2> - <p class="text-end mb-0"> - <%= cohorts.count %> - <%= Education::Cohort.model_name.human(count: cohorts.count).downcase %> - <br> - <%= alumni.count %> - <%= University::Person::Alumnus.model_name.human(count: alumni.count).downcase %> - </p> - </div> - </article> - </div> - <% end %> -</div> -<%= paginate academic_years_paged, theme: 'bootstrap-5' %> diff --git a/app/views/extranet/academic_years/index.html.erb b/app/views/extranet/academic_years/index.html.erb index b524bf9aa66c944c29e02c51287994406e9f26ba..858a4e0603105528334bd4842e689ff3ba4e9be4 100644 --- a/app/views/extranet/academic_years/index.html.erb +++ b/app/views/extranet/academic_years/index.html.erb @@ -4,4 +4,26 @@ <h1><%= Education::AcademicYear.model_name.human(count: 2) %></h1> </header> -<%= render 'extranet/academic_years/list', academic_years: @academic_years %> +<% @academic_years.each do |year| %> + <% + cohorts = year.cohorts_in_context(current_context.about) + alumni = year.alumni_in_context(current_context.about) + %> + <div class="row"> + <div class="col-md-6"> + <b> + <%= link_to year, year, class: 'stretched-link' %> + </b> + </div> + <div class="col-md-3"> + <%= cohorts.count %> + <%= Education::Cohort.model_name.human(count: cohorts.count).downcase %> + </div> + <div class="col-md-3 text-end"> + <%= alumni.count %> + <%= University::Person::Alumnus.model_name.human(count: alumni.count).downcase %> + </div> + </div> + <hr> +<% end %> +<%= paginate @academic_years, theme: 'bootstrap-5' %> diff --git a/app/views/extranet/academic_years/show.html.erb b/app/views/extranet/academic_years/show.html.erb index ffc0c7668f54420022456829f7c12779787b9ca4..b12b6aab4fb107a6eae017fa8d37c80f38750c4a 100644 --- a/app/views/extranet/academic_years/show.html.erb +++ b/app/views/extranet/academic_years/show.html.erb @@ -4,14 +4,21 @@ <h1><%= @academic_year %></h1> </header> -<h2 class="mb-4"> - <%= @cohorts.count %> - <%= Education::Cohort.model_name.human(count: @cohorts.count).downcase %> -</h2> -<%= render 'extranet/cohorts/list', cohorts: @cohorts %> +<div class="row"> + <div class="col-lg-4"> + <h2 class="mb-4"> + <%= @cohorts.count %> + <%= Education::Cohort.model_name.human(count: @cohorts.count).downcase %> + </h2> + </div> + <div class="col-lg-8"> + <%= render 'extranet/cohorts/list', cohorts: @cohorts %> + </div> +</div> <h2 class="mt-5 mb-4"> <%= @alumni.count %> <%= University::Person::Alumnus.model_name.human(count: @alumni.count).downcase %> </h2> + <%= render 'extranet/persons/list', people: @alumni %> diff --git a/app/views/extranet/application/_footer.html.erb b/app/views/extranet/application/_footer.html.erb index 309bb5e8b5f38c341ef30f3c17caec72efa0082b..888af3a3b8310d61ceab66feaa1ef48107ef812e 100644 --- a/app/views/extranet/application/_footer.html.erb +++ b/app/views/extranet/application/_footer.html.erb @@ -1,27 +1,35 @@ <footer class="pt-5"> - <div class="container text-center"> - <div class="mb-5"> + <div class="container"> + <div class="footer-logo pb-5 mb-5 text-center"> <%= 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 class="row justify-space-between"> + <address class="col-md-6" itemscope itemtype="https://schema.org/CollegeOrUniversity"> + <span itemprop="name">Institut de Journalisme Bordeaux Aquitaine</span> + <div itemprop="address" itemscope itemtype="https://schema.org/PostalAddress"> + <span itemprop="streetAddress">1 rue Jacques Ellul</span><br> + <span itemprop="postalCode">33000</span><span itemprop="addressLocality">Bordeaux</span><br> + </div> + </address> + + <nav class="text-end col-md-6"> + <%= link_to t('terms_of_service'), + t('terms_of_service_url'), + target: '_blank', + rel: 'noreferrer' %> + <%= link_to t('privacy_policy'), + t('privacy_policy_url'), + target: '_blank', + rel: 'noreferrer' %> + <%= link_to t('cookies_policy'), + t('cookies_policy_url'), + target: '_blank', + rel: 'noreferrer' %> + <%= link_to t('cookies_consent_choice'), + '', + class: 'js-gdpr__cookie_consent__display_again' %> + </nav> + </div> + </div> </footer> diff --git a/app/views/extranet/cohorts/_list.html.erb b/app/views/extranet/cohorts/_list.html.erb index a1bf831d807b48b7d48471aafa52f22ac2443de5..cb96e5141fe19693a848091fd423f403aadfc4f0 100644 --- a/app/views/extranet/cohorts/_list.html.erb +++ b/app/views/extranet/cohorts/_list.html.erb @@ -1,19 +1,17 @@ <% cohorts_paged = cohorts.ordered.page(params[:page]).per(60) %> -<div class="row"> +<ul class="list"> <% cohorts_paged.each do |cohort| %> - <div class="col-md-6"> - <article class="card mb-4"> - <div class="card-body"> - <h2 class="mb-5"> - <%= link_to cohort, cohort, class: 'stretched-link' %> - </h2> - <p class="text-end mb-0"> - <%= cohort.people.count %> - <%= University::Person::Alumnus.model_name.human(count: cohort.people.count).downcase %> - </p> - </div> - </article> - </div> + <li> + <h2> + <%= link_to cohort.program, cohort, class: 'stretched-link' %> + <%#= link_to cohort, cohort, class: 'stretched-link' %> + </h2> + <p> + <%= cohort.academic_year.year %> + <%#= cohort.people.count %> + <%#= University::Person::Alumnus.model_name.human(count: cohort.people.count).downcase %> + </p> + </li> <% end %> -</div> +</ul> <%= paginate cohorts_paged, theme: 'bootstrap-5' %> diff --git a/app/views/extranet/cohorts/index.html.erb b/app/views/extranet/cohorts/index.html.erb index bf32bf86b3ee261df48e4ae5ec4655aba0d197b0..5cc630029fd4b47af9cb84d846dddbd13d48287e 100644 --- a/app/views/extranet/cohorts/index.html.erb +++ b/app/views/extranet/cohorts/index.html.erb @@ -2,6 +2,17 @@ <header class="mb-5"> <h1><%= Education::Cohort.model_name.human(count: 2) %></h1> + <p> + <%= @count %> + <%= Education::Cohort.model_name.human(count: @count).downcase %> + </p> </header> -<%= render 'extranet/cohorts/list', cohorts: @cohorts %> +<div class="row"> + <div class="col-md-3"> + <%= render 'faceted_search/facets', facets: @facets %> + </div> + <div class="col-md-8 offset-md-1"> + <%= render 'extranet/cohorts/list', cohorts: @cohorts %> + </div> +</div> diff --git a/app/views/extranet/cohorts/show.html.erb b/app/views/extranet/cohorts/show.html.erb index 69da25296c024df6bac2a231ff2aa154941c349f..3ef3148fabc6ce51948804c54d334fa233a43ff7 100644 --- a/app/views/extranet/cohorts/show.html.erb +++ b/app/views/extranet/cohorts/show.html.erb @@ -1,17 +1,11 @@ <% content_for :title, @cohort %> <header class="mb-5"> - <div class="row"> - <div class="col-md-8"> - <h1><%= @cohort %></h1> - </div> - <div class="col-md-4 text-end"> - <p> - <%= @cohort.people.count %> - <%= University::Person::Alumnus.model_name.human(count: @cohort.people.count).downcase %> - </p> - </div> - </div> + <h1><%= @cohort %></h1> + <p> + <%= @cohort.people.count %> + <%= University::Person::Alumnus.model_name.human(count: @cohort.people.count).downcase %> + </p> </header> <%= render 'extranet/persons/list', people: @cohort.people %> diff --git a/app/views/extranet/home/index.html.erb b/app/views/extranet/home/index.html.erb index aa3714a7af09b02bc46eaa44c985e84362a29448..1e31979398dd4f7a324ddf8d211f85bbd557a112 100644 --- a/app/views/extranet/home/index.html.erb +++ b/app/views/extranet/home/index.html.erb @@ -3,16 +3,43 @@ <div class="row"> <div class="col-md-8"> <h2>Mouvements récents</h2> - <% @experiences.each do |experience| %> - <article> - <%= link_to experience.person, experience.person %> - <%= experience.description %> - <%= experience.from_year %> - <%= experience.to_year %> - <%= link_to experience.organization, experience.organization %> - </article> - <% end %> + <div class="experiences"> + <ul> + <% @experiences.ordered.each do |experience| %> + <li class="mb-3"> + <div> + <%= link_to experience.person, class: "stretched-link" do %> + <% if experience.person.picture.attached? %> + <%= kamifusen_tag experience.person.picture, width: 200, class: 'img-fluid' %> + <% else %> + <%= image_tag 'extranet/avatar.png', width: 200, class: 'img-fluid' %> + <% end %> + <% end %> + </div> + <div> + <div> + <p class="mb-0"> + <%= experience.person.first_name %> <b><%= experience.person.last_name %></b> + <br> + <%= experience.description %> — <%= experience.organization %> + </p> + <small><%= experience.created_at %></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> + + <div class="col-md-4"> <h2>Promotions actuelles</h2> <p><%= link_to 'Voir toutes les promotions', education_cohorts_path %></p> @@ -20,4 +47,4 @@ <%= link_to cohort, cohort %><br> <% end %> </div> -</div> +</div> \ No newline at end of file diff --git a/app/views/extranet/layouts/application.html.erb b/app/views/extranet/layouts/application.html.erb index 74bf7b45c19e463fb5e223fc27223bc4536c7a61..9415ecf20b80fbb782dee51b3b0ca25d654eebac 100644 --- a/app/views/extranet/layouts/application.html.erb +++ b/app/views/extranet/layouts/application.html.erb @@ -6,7 +6,7 @@ <title><%= yield :title %></title> <%= csrf_meta_tags %> <%= csp_meta_tag %> - <%= stylesheet_link_tag 'application', media: 'all' %> + <%= stylesheet_link_tag 'extranet', media: 'all' %> <%= javascript_include_tag 'application' %> <%= favicon_link_tag 'favicon.png' %> </head> diff --git a/app/views/extranet/organizations/_list.erb b/app/views/extranet/organizations/_list.erb new file mode 100644 index 0000000000000000000000000000000000000000..d86a6511f710c76114b68d53ec1f57d3e28be9e2 --- /dev/null +++ b/app/views/extranet/organizations/_list.erb @@ -0,0 +1,19 @@ +<% @organizations.each do |organization| %> + <div class="organization row"> + <div> + <p><%= link_to organization, organization %></p> + </div> + <div> + <% if organization.url %> + <p><small><%= link_to organization.url, organization.url %></small></p> + <% end %> + </div> + <% if organization.logo.attached? %> + <div> + <%= link_to organization do %> + <%= kamifusen_tag organization.logo, height: 80, class: 'img-fluid' %> + <% end %> + </div> + <% end %> + </div> +<% end %> diff --git a/app/views/extranet/organizations/index.html.erb b/app/views/extranet/organizations/index.html.erb index b1229875b7627de2122e7d4ec855f4e31c3bd2b2..abd0c2878a919c3577035200a057b9754a4090a6 100644 --- a/app/views/extranet/organizations/index.html.erb +++ b/app/views/extranet/organizations/index.html.erb @@ -8,20 +8,13 @@ </p> </header> -<table class="<%= table_classes %>"> - <thead> - <tr> - <th><%= University::Organization.human_attribute_name('name') %></th> - <th><%= University::Organization.human_attribute_name('kind') %></th> - </tr> - </thead> - <tbody> - <% @organizations.each do |organization| %> - <tr> - <td><%= link_to organization, organization %></td> - <td><%= organization.kind %></td> - </tr> - <% end %> - </tbody> -</table> -<%= paginate @organizations, theme: 'bootstrap-5' %> + +<div class="row"> + <div class="col-md-3"> + <%#= render 'faceted_search/facets', facets: @facets %> + </div> + <div class="offset-lg-1 col-lg-8"> + <%= render "extranet/organizations/list" %> + <%= paginate @organizations, theme: 'bootstrap-5' %> + </div> +</div> diff --git a/app/views/extranet/organizations/show.html.erb b/app/views/extranet/organizations/show.html.erb index b2137522e47431d90ad31d42c1ebb9889c3a9023..8c6b85122c70d559f532135eb2b39165bf84eb02 100644 --- a/app/views/extranet/organizations/show.html.erb +++ b/app/views/extranet/organizations/show.html.erb @@ -1,16 +1,72 @@ <% content_for :title, @organization %> +<div class="row mb-5 top"> + <div class="col-md-9"> + <header> + <h1><%= @organization %></h1> + <% if @organization.url %> + <p><small><%= link_to @organization.url, @organization.url %></small></p> + <% end %> + </header> + </div> + <div class="col-md-3"> + <% if @organization.logo.attached? %> + <%= kamifusen_tag @organization.logo, width: 400, class: 'img-fluid' %> + <% else %> + <%= image_tag 'extranet/avatar.png', width: 400, class: 'img-fluid' %> + <% end %> + </div> +</div> -<header class="mb-5"> - <h1><%= @organization %></h1> -</header> -<ul> - <% @organization.experiences.ordered.each do |experience| %> - <li> - <%= link_to experience.person, experience.person %> - <%= experience.description %> - <%= experience.from_year %> - <%= experience.to_year %> - </li> - <% end %> -</ul> +<div class="row"> + <div class="col-md-9"> + <div class="biography"> + <p><%= @organization.text %></p> + </div> + <div class="experiences"> + <p class="mb-4">Alumni dans cette organisation (<%= @organization.experiences.count %>)</p> + <ul> + <% @organization.experiences.ordered.each do |experience| %> + <li class="mb-3"> + <div> + <%= link_to experience.person, class: "stretched-link" do %> + <% if experience.person.picture.attached? %> + <%= kamifusen_tag experience.person.picture, width: 200, class: 'img-fluid' %> + <% else %> + <%= image_tag 'extranet/avatar.png', width: 200, class: 'img-fluid' %> + <% end %> + <% end %> + </div> + <div> + <p><b><%= experience.person.name %></b></p> + <p> + <%= experience.description %><br> + <%= experience.from_year %> - <%= experience.to_year %> + </p> + </div> + </li> + <% end %> + </ul> + </div> + </div> + <div class="col-md-3"> + <dl> + <dt><%= University::Organization.human_attribute_name(:kind) %></dt> + <dd><%= @organization.kind %></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> \ No newline at end of file diff --git a/app/views/extranet/persons/_person.html.erb b/app/views/extranet/persons/_person.html.erb index f8151bdac4973a6d5355874e2e713a73ded36928..2d68495c55c49cd14b0b17525400567e0cd6d358 100644 --- a/app/views/extranet/persons/_person.html.erb +++ b/app/views/extranet/persons/_person.html.erb @@ -1,8 +1,8 @@ <article class="mb-4 position-relative"> <% if person.picture.attached? %> - <%= kamifusen_tag person.picture, width: 400, class: 'img-fluid' %> + <%= kamifusen_tag person.picture, width: 400, class: 'img-fluid mb-2' %> <% else %> - <%= image_tag 'extranet/avatar.png', width: 400, class: 'img-fluid' %> + <%= image_tag 'extranet/avatar.png', width: 400, class: 'img-fluid mb-2' %> <% end %> <%= link_to person, class: 'stretched-link' do %> <%= person.first_name %> diff --git a/app/views/extranet/persons/index.html.erb b/app/views/extranet/persons/index.html.erb index 11b59fcc05a3b300839db66b7ab245544a15c998..0fa3459638104672652500765ceb39aa5ced0e9a 100644 --- a/app/views/extranet/persons/index.html.erb +++ b/app/views/extranet/persons/index.html.erb @@ -1,21 +1,14 @@ <% content_for :title, University::Person::Alumnus.model_name.human(count: 2) %> - <header class="mb-5"> - <div class="row"> - <div class="col-md-9"> - <h1><%= University::Person::Alumnus.model_name.human(count: 2) %></h1> - </div> - <div class="col-md-3 text-end"> - <p> - <%= @count %> - <%= University::Person::Alumnus.model_name.human(count: @count).downcase %> - </p> - </div> - </div> + <h1><%= University::Person::Alumnus.model_name.human(count: 2) %></h1> + <p> + <%= @count %> + <%= University::Person::Alumnus.model_name.human(count: @count).downcase %> + </p> </header> <div class="row"> - <div class="col-lg-3"> + <div class="col-md-3"> <%= render 'faceted_search/facets', facets: @facets %> </div> <div class="offset-lg-1 col-lg-8"> @@ -27,6 +20,5 @@ <% end %> </div> <%= paginate @people, theme: 'bootstrap-5' %> - </div> </div> diff --git a/app/views/extranet/persons/show.html.erb b/app/views/extranet/persons/show.html.erb index 5af73ffd2762e3029580e51063771d66c06cbbb9..d459c90517113fc74ab9349abc7ad96017974d0a 100644 --- a/app/views/extranet/persons/show.html.erb +++ b/app/views/extranet/persons/show.html.erb @@ -1,9 +1,9 @@ <% content_for :title, @person %> -<div class="row mb-5"> +<div class="row mb-5 top"> <div class="col-md-9"> - <header style="height: 100%"> - <h1><%= @person %></h1> + <header> + <h1><%= @person.first_name %> <b><%= @person.last_name %></b></h1> </header> </div> <div class="col-md-3"> @@ -16,20 +16,44 @@ </div> <div class="row"> - <div class="col-md-6"> - <p><%= @person.biography %></p> - <ul> - <% @person.experiences.ordered.each do |experience| %> - <li> - <%= experience.description %> - <%= experience.from_year %> - <%= experience.to_year %> - <%= link_to experience.organization, experience.organization %> - </li> + <div class="col-md-9"> + <div class="biography"> + <p><%= @person.biography %></p> + </div> + <% if @person.experiences %> + <div class="experiences"> + <p class="mb-4">Parcours professionel</p> + <ul> + <% @person.experiences.ordered.each do |experience| %> + <li> + <div> + <p><b><%= experience.description %></b></p> + <p class="mb-0"><%= experience.from_year %> - <%= experience.to_year %></p> + </div> + <div> + <% if experience.organization.present? %> + <p><%= link_to experience.organization, experience.organization %></p> + <% if experience.organization.url %> + <p class="mb-0"><small><%= link_to experience.organization.url, experience.organization.url %></small></p> + <% end %> + <% end %> + </div> + <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> <% end %> - </ul> </div> - <div class="offset-md-3 col-md-3"> + <div class="col-md-3"> <dl> <% @person.cohorts.each do |cohort| %> <dt><%= cohort.program %></dt> @@ -70,3 +94,4 @@ </dl> </div> </div> + diff --git a/config/locales/communication/en.yml b/config/locales/communication/en.yml index f016a7e5a170ef9d7e69d110f0fbd3ab6558abf0..22b74a1f11458031f17f16d7a46bd3f5a2175128 100644 --- a/config/locales/communication/en.yml +++ b/config/locales/communication/en.yml @@ -80,6 +80,7 @@ en: communication/website/menu: identifier: Identifier title: Title + items: Items communication/website/menu/item: about: Target children: Children items @@ -112,7 +113,7 @@ en: featured_image: Featured image featured_image_alt: Alt text pinned: Pinned - published: Published + published: Published? published_at: Publication date slug: Slug text: Text @@ -302,6 +303,9 @@ en: title: Educational team posts: new_curation: New curation + published: Published + successful_batch_update: Posts have been updated succesfully + unpublished: Unpublished see_all: See the full list (%{number} elements) enums: communication: diff --git a/config/locales/communication/fr.yml b/config/locales/communication/fr.yml index b600e2889c4190d3a1102f5208cf276f3fed8c03..0fce32c9e07ef3652c8a2a1f5ccccd8ae127f402 100644 --- a/config/locales/communication/fr.yml +++ b/config/locales/communication/fr.yml @@ -80,6 +80,7 @@ fr: communication/website/menu: identifier: Identifiant title: Titre + items: Éléments communication/website/menu/item: about: Cible children: Sous-éléments @@ -112,7 +113,7 @@ fr: featured_image: Image à la une featured_image_alt: Texte alternatif pinned: Mis en avant - published: Publié + published: Publié ? published_at: Date de publication slug: Slug text: Texte @@ -304,7 +305,9 @@ fr: title: Équipe pédagogique posts: new_curation: Nouvelle curation + published: Publiée successful_batch_update: Les actualités ont bien été mises à jour + unpublished: Non publiée see_all: Voir la liste complète (%{number} éléments) enums: communication: diff --git a/config/locales/en.yml b/config/locales/en.yml index b21b0fffb0afd6b821c5acf0dba9158479ff94c0..aeaae6cf586c5b579138ff01856c8448b6fc191c 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -56,6 +56,8 @@ en: not_locked_html: '<i>%{model}</i> was not locked.' successfully_unlocked_html: "<i>%{model}</i> was successfully unlocked." will_be_published_html: "<i>%{model}</i> will soon be published." + batch_selectable: + title: Edit the selection content: Content cookies_consent_choice: Cookies consent choice cookies_policy: Cookies policy diff --git a/config/locales/fr.yml b/config/locales/fr.yml index ea0f16c3250c8fc0d35b85606660cef7390c54c2..98572ab5182adbebcfee951ea6724522753a471a 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -56,6 +56,8 @@ fr: not_locked_html: "<i>%{model}</i> n'était pas verrouillé(e)." successfully_unlocked_html: "<i>%{model}</i> a bien été déverrouillé(e)." will_be_published_html: "<i>%{model}</i> va bientôt être publié(e)." + batch_selectable: + title: Modifier la sélection content: Contenu cookies_consent_choice: Choix en matière de cookies cookies_policy: Politique de cookies diff --git a/db/schema.rb b/db/schema.rb index ea5716f23f3fec32251d4bdaeb38cd419a1188cc..f5a8ea0a6798ca4cb2d4de9dd7a2a509c4170244 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -503,23 +503,6 @@ ActiveRecord::Schema.define(version: 2022_04_28_171541) do t.index ["university_id"], name: "index_education_schools_on_university_id" end - create_table "external_organizations", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| - t.string "title" - t.text "description" - t.string "address" - t.string "zipcode" - t.string "city" - t.string "country" - t.string "website" - t.string "phone" - t.string "mail" - t.boolean "active" - t.string "sirene" - t.integer "kind" - t.datetime "created_at", precision: 6, null: false - t.datetime "updated_at", precision: 6, null: false - end - create_table "languages", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| t.string "name" t.string "iso_code" @@ -709,8 +692,8 @@ ActiveRecord::Schema.define(version: 2022_04_28_171541) do t.string "linkedin" t.boolean "is_alumnus", default: false t.text "description_short" - t.string "name" t.boolean "is_author" + t.string "name" t.index ["university_id"], name: "index_university_people_on_university_id" t.index ["user_id"], name: "index_university_people_on_user_id" end diff --git a/docs/extranet/readme.md b/docs/extranet/readme.md new file mode 100644 index 0000000000000000000000000000000000000000..1b6ee19a04935e2d58295e4c7fa14ed1f562fc9f --- /dev/null +++ b/docs/extranet/readme.md @@ -0,0 +1,4 @@ +# Osuny Extranet + +## Alumni +