Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/assets/i18n/en.json5
Original file line number Diff line number Diff line change
Expand Up @@ -7334,7 +7334,7 @@

"collspec.menu.catalogues": "Catalogues",

"collspec.onglet-fichier": "Files",
"collspec.onglet-fichier": "Image",

"collspec.onglet-notice": "Full record",

Expand Down
2 changes: 1 addition & 1 deletion src/assets/i18n/fr.json5
Original file line number Diff line number Diff line change
Expand Up @@ -7428,7 +7428,7 @@

"collspec.donate.aria-label": "Faire un don",

"collspec.onglet-fichier": "Fichiers",
"collspec.onglet-fichier": "Image",

"collspec.cookies.consent.content-notice.description": "Vos données personnelles sont collectées et utilisées aux fins suivantes : <strong>authentification, préférences, consentement et statistiques</strong>.<br>Pour plus d’informations, veuillez consulter la <a href=\"https://vie-privee.umontreal.ca/confidentialite\">politique de protection de la vie privée</a>.",

Expand Down
9 changes: 4 additions & 5 deletions src/themes/collspec/app/header/header.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,18 @@
<div id="header-left"
class="h-100 flex-fill d-flex flex-row flex-nowrap justify-content-start align-items-center gapx-3">
<a class="d-block my-2 my-md-0" href="/" [attr.aria-label]="'home.title' | translate" >
<img id="header-logo" src="/assets/collspec/images/logo-collspec.png" [attr.alt]="'menu.header.image.logo' | translate"/>
<img id="header-logo" src="/assets/collspec/images/logo-collspec1.png" [attr.alt]="'menu.header.image.logo' | translate"/>
</a>
<!--<a class="d-block my-2 my-md-0 title titre-logo" routerLink="/" [attr.aria-label]="'home.title' | translate">
<a class="d-block my-2 my-md-0 title titre-logo" routerLink="/" [attr.aria-label]="'home.title' | translate">
Collections <br>spéciales
</a>-->
</a>
<!-- Menu desktop - visible seulement sur écrans XL et plus -->
<nav class="navbar navbar-expand p-0 align-items-stretch align-self-stretch d-none d-xl-block" id="desktop-navbar" [attr.aria-label]="'nav.main.description' | translate">
<ul class="navbar-nav mr-auto menu-collspec">
<!--<li class="nav-item"><a role="menuitem" class="ds-menu-item" href="/community-list">{{'collspec.menu.catalogues'| translate}}</a></li>-->
<li class="nav-item"><a role="menuitem" class="ds-menu-item" href="/page/a-propos">{{'collspec.menu.a-propos'| translate}}</a></li>
<li class="nav-item"><a role="menuitem" class="ds-menu-item" href="/page/blrcs">{{'collspec.menu.blrcs'| translate}}</a></li>
<li class="nav-item"><a role="menuitem" class="ds-menu-item" href="https://bib.umontreal.ca/nous-joindre/"
target="_blank">{{'collspec.menu.contact'| translate}}</a></li>
<li class="nav-item"><a role="menuitem" class="ds-menu-item" href="https://bib.umontreal.ca/nous-joindre/">{{'collspec.menu.contact'| translate}}</a></li>
</ul>
</nav>
</div>
Expand Down
4 changes: 2 additions & 2 deletions src/themes/collspec/app/header/header.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

#main-site-header {
position: relative;
padding-top: 20px;
padding-bottom: 20px;
padding-top: 10px;
padding-bottom: 10px;
margin: 1.75rem 5rem;
border-radius: 1rem;
background: white;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
<div class="card-group vgr-cards">
<ng-container *ngIf="communitiesRD$ | async as communitiesRD">
<ng-container *ngIf="communitiesRD?.hasSucceeded">
<ng-container *ngIf="displayedSouscommunities.length > 0; else loadingContent">
<ng-container *ngFor="let souscommunitie of displayedSouscommunities">
<ng-container *ngIf="allSouscommunities.length > 0; else loadingContent">
<ng-container *ngFor="let souscommunitie of allSouscommunities">
<div class="card" *ngIf="souscommunitie?.vedette">
<div class="card-img-body">
<img class="card-img" [src]="souscommunitie.vedette" alt="Item {{ souscommunitie.title }}">
Expand All @@ -21,12 +21,6 @@ <h4 class="card-title mt-5 text-start">{{ souscommunitie.title }}</h4>
</div>
</div>
</ng-container>

<!-- Indicateur de chargement pendant le scroll -->
<div *ngIf="isLoadingMore" class="w-100 text-center py-3">
<ds-loading></ds-loading>
</div>

</ng-container>
</ng-container>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { AsyncPipe, isPlatformBrowser } from '@angular/common';
import { AsyncPipe } from '@angular/common';
import { TranslateModule } from '@ngx-translate/core';
import { TopLevelCommunityListComponent as BaseComponent } from '../../../../../app/home-page/top-level-community-list/top-level-community-list.component';
import { ErrorComponent } from '../../../../../app/shared/error/error.component';
import { ThemedLoadingComponent } from '../../../../../app/shared/loading/themed-loading.component';
import { ObjectCollectionComponent } from '../../../../../app/shared/object-collection/object-collection.component';
import { VarDirective } from '../../../../../app/shared/utils/var.directive';
import { AfterViewInit, ChangeDetectorRef, Component, Inject, OnDestroy, OnInit, PLATFORM_ID } from '@angular/core';
import { ChangeDetectorRef, Component, Inject, OnDestroy, OnInit, PLATFORM_ID } from '@angular/core';
import { Subject } from 'rxjs';
import { CommunityDataService } from '../../../../../app/core/data/community-data.service';
import { CollectionDataService } from '../../../../../app/core/data/collection-data.service';
Expand All @@ -24,18 +24,11 @@ import { CommonModule } from '@angular/common';
standalone: true,
imports: [VarDirective, ObjectCollectionComponent, ErrorComponent, ThemedLoadingComponent, AsyncPipe, TranslateModule, RouterModule, CommonModule],
})
export class TopLevelCommunityListComponent extends BaseComponent implements OnInit, AfterViewInit, OnDestroy {
export class TopLevelCommunityListComponent extends BaseComponent implements OnInit, OnDestroy {
collections: any[] = [];
allSouscommunities: any[] = [];
displayedSouscommunities: any[] = [];
souscommunitiesPerPage = 3;
currentPage = 1;
hasMore = false;
isLoadingMore = false;

private isBrowser: boolean;
private unsubscribe$ = new Subject<void>();
private scrollListener!: () => void;

constructor(
private cdsCollspec: CommunityDataService,
Expand All @@ -47,7 +40,6 @@ export class TopLevelCommunityListComponent extends BaseComponent implements OnI
@Inject(PLATFORM_ID) private platformId: object
) {
super(appConfig, cdsCollspec, paginationServiceCollspec);
this.isBrowser = isPlatformBrowser(this.platformId);
}

ngOnInit() {
Expand All @@ -59,32 +51,10 @@ export class TopLevelCommunityListComponent extends BaseComponent implements OnI
});
}

ngAfterViewInit() {
if (this.isBrowser) {
this.setupScrollListener();
}
}

private setupScrollListener() {
this.scrollListener = () => {
if (this.isLoadingMore || !this.hasMore) return;

const scrollY = window.scrollY;
const innerHeight = window.innerHeight;
const scrollHeight = document.documentElement.scrollHeight;

if (scrollY + innerHeight >= scrollHeight - 300) {
this.loadMore();
}
};
document.addEventListener('scroll', this.scrollListener, { passive: true });
}

loadSubcommunities(community: any) {
const link = community?._links?.subcommunities?.href;
if (!link) return;

// Code original qui fonctionnait — collService comme avant
this.collService.findByHref(link).pipe(takeUntil(this.unsubscribe$)).subscribe((res) => {
const links = (res.payload?._links as any)?.page || [];

Expand All @@ -100,36 +70,16 @@ export class TopLevelCommunityListComponent extends BaseComponent implements OnI
const subcommunity = { title, description, id, vedette: null };

this.vedetteService.getImagesColl(id).pipe(takeUntil(this.unsubscribe$)).subscribe((images: Vedette[]) => {
// Toujours pousser — avec ou sans image
subcommunity.vedette = images?.length ? images[0].imageUrl : null;
this.allSouscommunities.push(subcommunity);
this.updateDisplayedSouscommunities();
this.cdr.detectChanges();
});
});
});
});
}

updateDisplayedSouscommunities() {
const totalItems = this.allSouscommunities.length;
const totalDisplayed = this.currentPage * this.souscommunitiesPerPage;
this.displayedSouscommunities = this.allSouscommunities.slice(0, totalDisplayed);
this.hasMore = totalDisplayed < totalItems;
this.isLoadingMore = false;
this.cdr.detectChanges();
}

loadMore() {
if (this.isLoadingMore || !this.hasMore) return;
this.isLoadingMore = true;
this.currentPage++;
this.updateDisplayedSouscommunities();
}

ngOnDestroy() {
if (this.isBrowser && this.scrollListener) {
document.removeEventListener('scroll', this.scrollListener);
}
this.unsubscribe$.next();
this.unsubscribe$.complete();
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,30 +1,66 @@
.nav-tabs {
font-size: 16px;
font-size: 15px;
list-style: none;
display: flex;
display: inline-flex;
flex-wrap: wrap;
padding-left: 0;
padding: 0;
margin-top: 1.2rem;
margin-bottom: 0;
color: #eeecec;
background: #334652;
box-shadow: 0 0.2px 3px #0000007a;
background: transparent;
border: none;
box-shadow: none;
gap: 4px;
width: 100%;
border-bottom: none;

li {
a {
display: block;
padding: 1em 2em;
display: flex;
align-items: center;
padding: 0.5em 1.4em;
outline: none;
text-decoration: none;
opacity: 0.9;
border-radius: 0;
color: white;
color: #334652;
font-weight: 400;
font-size: 0.95rem;
background: transparent;
border: 2px solid #C3CCD5; // Bordure grise sur tous les onglets
border-radius: 8px 8px 0 0 !important;
transition: all 0.2s ease;

&:hover {
border-color: #334652;
color: #334652;
}
}
}

// Onglet actif — bordure orange uniquement
.nav-link.active {
animation: md-tab-ripple 0.2s linear forwards;
background-color: white;
border-bottom: solid 1px #f04e24;
background-color: #ffffff;
color: #334652;
font-weight: 600;
border: 2px solid #266883; // Bordure orange tout autour
border-radius: 8px;

&:hover {
border-color: #266883;
color: #334652;
}
}
}

// Zone de contenu
[ngbnavoutlet] {
background-color: #ffffff;
border: 1.5px solid #d0d0d0;
border-radius: 0 4px 4px 4px;
padding: 1.8rem;
margin-top: 0.5rem;
box-shadow: none;
}

@keyframes md-tab-ripple {
0% { opacity: 0.85; }
100% { opacity: 1; }
}
2 changes: 1 addition & 1 deletion src/themes/collspec/assets/i18n/en.json5
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

"repository.title.prefix": "Special Collections :: ",

"collspec.onglet-fichier": "Files",
"collspec.onglet-fichier": "Image",
"collspec.onglet-notice": "Full record",
"collspec.return": "Back",
"collspec.consulter": "View",
Expand Down
2 changes: 1 addition & 1 deletion src/themes/collspec/assets/i18n/fr.json5
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

// "repository.title.prefix": "DSpace Angular :: ",
"repository.title.prefix": "Collections spéciales :: ",
"collspec.onglet-fichier": "Fichiers",
"collspec.onglet-fichier": "Image",
"collspec.onglet-notice": "Notice complète",
"collspec.return": "Retour",
"collspec.consulter": "Consulter",
Expand Down
4 changes: 2 additions & 2 deletions src/themes/collspec/styles/_global-styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ nav#admin-sidebar a {
------------------------------------------------------- */
#main-site-header {
position: relative;
margin: 20px 5%;
margin: 10px 5%;
border-radius: 12px;
background: white;
z-index: 10 !important;
Expand Down Expand Up @@ -292,7 +292,7 @@ nav#admin-sidebar a {
.menu-collspec {
display: flex;
gap: 2rem;
margin-top: 1.5rem;
margin-top: 1.75rem;
padding: 0;
list-style: none;
}
Expand Down