Skip to content

Commit ca5fc82

Browse files
108588: Fix header ordering issues on community & collection pages
1 parent d95f9d0 commit ca5fc82

12 files changed

Lines changed: 57 additions & 30 deletions

File tree

Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,21 @@
1-
<div class="container">
2-
<section class="comcol-page-browse-section">
3-
<div class="browse-by-metadata w-100">
4-
<ds-browse-by *ngIf="startsWithOptions" class="col-xs-12 w-100"
5-
title="{{'browse.title' | translate:
6-
{
7-
field: 'browse.metadata.' + browseId | translate,
8-
startsWith: (startsWith)? ('browse.startsWith' | translate: { startsWith: '&quot;' + startsWith + '&quot;' }) : '',
9-
value: (value)? '&quot;' + value + '&quot;': ''
10-
} }}"
11-
[objects$]="(items$ !== undefined)? items$ : browseEntries$"
12-
[paginationConfig]="(currentPagination$ |async)"
13-
[sortConfig]="(currentSort$ |async)"
14-
[type]="startsWithType"
15-
[startsWithOptions]="startsWithOptions"
16-
(prev)="goPrev()"
17-
(next)="goNext()">
18-
</ds-browse-by>
19-
<ds-themed-loading *ngIf="!startsWithOptions" message="{{'loading.browse-by-page' | translate}}"></ds-themed-loading>
20-
</div>
21-
</section>
22-
</div>
1+
<section class="comcol-page-browse-section">
2+
<div class="browse-by-metadata w-100">
3+
<ds-browse-by *ngIf="startsWithOptions" class="col-xs-12 w-100"
4+
title="{{'browse.title' | translate:{
5+
field: 'browse.metadata.' + browseId | translate,
6+
startsWith: (startsWith)? ('browse.startsWith' | translate: { startsWith: '&quot;' + startsWith + '&quot;' }) : '',
7+
value: (value)? '&quot;' + value + '&quot;': ''
8+
} }}"
9+
[displayTitle]="displayTitle"
10+
[objects$]="(items$ !== undefined)? items$ : browseEntries$"
11+
[paginationConfig]="(currentPagination$ |async)"
12+
[sortConfig]="(currentSort$ |async)"
13+
[type]="startsWithType"
14+
[startsWithOptions]="startsWithOptions"
15+
(prev)="goPrev()"
16+
(next)="goNext()">
17+
</ds-browse-by>
18+
<ds-themed-loading *ngIf="!startsWithOptions"
19+
message="{{'loading.browse-by-page' | translate}}"></ds-themed-loading>
20+
</div>
21+
</section>

src/app/browse-by/browse-by-metadata/browse-by-metadata.component.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,11 @@ export class BrowseByMetadataComponent implements OnInit, OnChanges, OnDestroy {
5252
*/
5353
@Input() scope: string;
5454

55+
/**
56+
* Display the h1 title in the section
57+
*/
58+
@Input() displayTitle = true;
59+
5560
scope$: BehaviorSubject<string> = new BehaviorSubject(undefined);
5661

5762
/**
Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
1-
<ds-browse-by-switcher [browseByType]="browseByType$ | async">
2-
</ds-browse-by-switcher>
1+
<div class="container">
2+
<ds-browse-by-switcher [browseByType]="browseByType$ | async">
3+
</ds-browse-by-switcher>
4+
</div>

src/app/browse-by/browse-by-switcher/browse-by-switcher.component.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ export class BrowseBySwitcherComponent extends AbstractComponentLoaderComponent<
1515

1616
@Input() browseByType: BrowseByDataType;
1717

18+
@Input() displayTitle: boolean;
19+
1820
@Input() scope: string;
1921

2022
protected inputNamesDependentForComponent: (keyof this & string)[] = [
@@ -25,6 +27,7 @@ export class BrowseBySwitcherComponent extends AbstractComponentLoaderComponent<
2527
protected inputNames: (keyof this & string)[] = [
2628
'context',
2729
'browseByType',
30+
'displayTitle',
2831
'scope',
2932
];
3033

src/app/browse-by/browse-by-taxonomy/browse-by-taxonomy.component.html

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
1-
<div class="container">
1+
<section>
2+
<h1 *ngIf="displayTitle">
3+
{{ ('browse.title') | translate:{
4+
field: 'browse.metadata.' + vocabularyName | translate,
5+
startsWith: '',
6+
value: '',
7+
} }}
8+
</h1>
29
<div class="mb-3">
310
<ds-vocabulary-treeview [vocabularyOptions]=vocabularyOptions
411
[multiSelect]="true"
@@ -11,4 +18,4 @@
1118
[queryParams]="queryParams"
1219
[queryParamsHandling]="'merge'">
1320
{{ 'browse.taxonomy.button' | translate }}</a>
14-
</div>
21+
</section>

src/app/browse-by/browse-by-taxonomy/browse-by-taxonomy.component.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,11 @@ export class BrowseByTaxonomyComponent implements OnInit, OnChanges, OnDestroy {
3636
*/
3737
@Input() scope: string;
3838

39+
/**
40+
* Display the h1 title in the section
41+
*/
42+
@Input() displayTitle = true;
43+
3944
scope$: BehaviorSubject<string> = new BehaviorSubject(undefined);
4045

4146
/**

src/app/community-page/sections/sub-com-col-section/sub-collection-list/community-page-sub-collection-list.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<ng-container *ngVar="(subCollectionsRDObs | async) as subCollectionsRD">
22
<div *ngIf="subCollectionsRD?.hasSucceeded && subCollectionsRD?.payload.totalElements > 0" @fadeIn>
3-
<h2>{{'community.sub-collection-list.head' | translate}}</h2>
3+
<h3>{{'community.sub-collection-list.head' | translate}}</h3>
44
<ds-viewable-collection
55
[config]="config"
66
[sortConfig]="sortConfig"

src/app/community-page/sections/sub-com-col-section/sub-community-list/community-page-sub-community-list.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<ng-container *ngVar="(subCommunitiesRDObs | async) as subCommunitiesRD">
22
<div *ngIf="subCommunitiesRD?.hasSucceeded && subCommunitiesRD?.payload.totalElements > 0" @fadeIn>
3-
<h2>{{'community.sub-community-list.head' | translate}}</h2>
3+
<h3>{{'community.sub-community-list.head' | translate}}</h3>
44
<ds-viewable-collection
55
[config]="config"
66
[sortConfig]="sortConfig"

src/app/shared/browse-by/browse-by.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<ng-container *ngVar="(objects$ | async) as objects">
2-
<h3>{{title | translate}}</h3>
2+
<h1 *ngIf="displayTitle">{{title | translate}}</h1>
33
<ng-container *ngComponentOutlet="getStartsWithComponent(); injector: objectInjector;"></ng-container>
44
<div *ngIf="objects?.hasSucceeded && !objects?.isLoading && objects?.payload?.page.length > 0" @fadeIn>
55
<div *ngIf="shouldDisplayResetButton$ |async" class="mb-2 reset">

src/app/shared/browse-by/browse-by.component.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,11 @@ export class BrowseByComponent implements OnInit, OnDestroy {
3838
*/
3939
@Input() title: string;
4040

41+
/**
42+
* Whether the title should be displayed
43+
*/
44+
@Input() displayTitle = true;
45+
4146
/**
4247
* The list of objects to display
4348
*/

0 commit comments

Comments
 (0)