forked from DSpace/dspace-angular
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
108588: Updated CommunityPageRoutingModule to use custom sections
- Loading branch information
1 parent
430720d
commit e7ee06c
Showing
10 changed files
with
125 additions
and
104 deletions.
There are no files selected for viewing
83 changes: 20 additions & 63 deletions
83
src/app/browse-by/browse-by-metadata-page/browse-by-metadata-page.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,67 +1,24 @@ | ||
<div class="container"> | ||
<ng-container *ngVar="(parent$ | async) as parent"> | ||
<ng-container *ngIf="parent?.payload as parentContext"> | ||
<div class="d-flex flex-row border-bottom mb-4 pb-4"> | ||
|
||
<header class="comcol-header mr-auto"> | ||
<!-- Parent Name --> | ||
<ds-comcol-page-header [name]="dsoNameService.getName(parentContext)"> | ||
</ds-comcol-page-header> | ||
<!-- Collection logo --> | ||
<ds-comcol-page-logo *ngIf="logo$" | ||
[logo]="(logo$ | async)?.payload" | ||
[alternateText]="'Community or Collection Logo'"> | ||
</ds-comcol-page-logo> | ||
<!-- Handle --> | ||
<ds-themed-comcol-page-handle | ||
[content]="parentContext.handle" | ||
[title]="parentContext.type+'.page.handle'" > | ||
</ds-themed-comcol-page-handle> | ||
<!-- Introductory text --> | ||
<ds-comcol-page-content [content]="parentContext.introductoryText" [hasInnerHtml]="true"> | ||
</ds-comcol-page-content> | ||
<!-- News --> | ||
<ds-comcol-page-content [content]="parentContext.sidebarText" [hasInnerHtml]="true" [title]="'community.page.news'"> | ||
</ds-comcol-page-content> | ||
</header> | ||
<ds-dso-edit-menu></ds-dso-edit-menu> | ||
</div> | ||
<!-- Browse-By Links --> | ||
<ds-themed-comcol-page-browse-by [id]="parentContext.id" [contentType]="parentContext.type"></ds-themed-comcol-page-browse-by> | ||
</ng-container></ng-container> | ||
|
||
<section class="comcol-page-browse-section"> | ||
<section class="comcol-page-browse-section"> | ||
<div class="browse-by-metadata w-100"> | ||
<ds-browse-by *ngIf="startsWithOptions" class="col-xs-12 w-100" | ||
title="{{'browse.title' | translate: | ||
{ | ||
collection: dsoNameService.getName((parent$ | async)?.payload), | ||
field: 'browse.metadata.' + browseId | translate, | ||
startsWith: (startsWith)? ('browse.startsWith' | translate: { startsWith: '"' + startsWith + '"' }) : '', | ||
value: (value)? '"' + value + '"': '' | ||
} }}" | ||
parentname="{{dsoNameService.getName((parent$ | async)?.payload)}}" | ||
[objects$]="(items$ !== undefined)? items$ : browseEntries$" | ||
[paginationConfig]="(currentPagination$ |async)" | ||
[sortConfig]="(currentSort$ |async)" | ||
[type]="startsWithType" | ||
[startsWithOptions]="startsWithOptions" | ||
(prev)="goPrev()" | ||
(next)="goNext()"> | ||
</ds-browse-by> | ||
<ds-themed-loading *ngIf="!startsWithOptions" message="{{'loading.browse-by-page' | translate}}"></ds-themed-loading> | ||
</div> | ||
</section> | ||
<ng-container *ngVar="(parent$ | async) as parent"> | ||
<ng-container *ngIf="parent?.payload as parentContext"> | ||
<footer *ngIf="parentContext.copyrightText" class="border-top my-5 pt-4"> | ||
<div > | ||
|
||
<!-- Copyright --> | ||
<ds-comcol-page-content [content]="parentContext.copyrightText" [hasInnerHtml]="true"> | ||
</ds-comcol-page-content> | ||
<ds-browse-by *ngIf="startsWithOptions" class="col-xs-12 w-100" | ||
title="{{'browse.title' | translate: | ||
{ | ||
collection: dsoNameService.getName((parent$ | async)?.payload), | ||
field: 'browse.metadata.' + browseId | translate, | ||
startsWith: (startsWith)? ('browse.startsWith' | translate: { startsWith: '"' + startsWith + '"' }) : '', | ||
value: (value)? '"' + value + '"': '' | ||
} }}" | ||
parentname="{{dsoNameService.getName((parent$ | async)?.payload)}}" | ||
[objects$]="(items$ !== undefined)? items$ : browseEntries$" | ||
[paginationConfig]="(currentPagination$ |async)" | ||
[sortConfig]="(currentSort$ |async)" | ||
[type]="startsWithType" | ||
[startsWithOptions]="startsWithOptions" | ||
(prev)="goPrev()" | ||
(next)="goNext()"> | ||
</ds-browse-by> | ||
<ds-themed-loading *ngIf="!startsWithOptions" message="{{'loading.browse-by-page' | translate}}"></ds-themed-loading> | ||
</div> | ||
</footer> | ||
</ng-container> | ||
</ng-container> | ||
</section> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
.../community-page/sections/community-browse-section/community-browse-section.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<p>community-browse-section works!</p> |
Empty file.
23 changes: 23 additions & 0 deletions
23
...mmunity-page/sections/community-browse-section/community-browse-section.component.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { ComponentFixture, TestBed } from '@angular/core/testing'; | ||
import { CommunityBrowseSectionComponent } from './community-browse-section.component'; | ||
|
||
describe('CommunityBrowseSectionComponent', () => { | ||
let component: CommunityBrowseSectionComponent; | ||
let fixture: ComponentFixture<CommunityBrowseSectionComponent>; | ||
|
||
beforeEach(async () => { | ||
await TestBed.configureTestingModule({ | ||
declarations: [ | ||
CommunityBrowseSectionComponent, | ||
], | ||
}).compileComponents(); | ||
|
||
fixture = TestBed.createComponent(CommunityBrowseSectionComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
9 changes: 9 additions & 0 deletions
9
...pp/community-page/sections/community-browse-section/community-browse-section.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { Component } from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'ds-community-browse-section', | ||
templateUrl: './community-browse-section.component.html', | ||
styleUrls: ['./community-browse-section.component.scss'], | ||
}) | ||
export class CommunityBrowseSectionComponent { | ||
} |
14 changes: 9 additions & 5 deletions
14
src/app/shared/comcol/comcol-page-browse-by/comcol-page-browse-by.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,28 @@ | ||
<h2 class="comcol-browse-label h5">{{'browse.comcol.head' | translate}}</h2> | ||
<nav class="comcol-browse mb-4" aria-label="Browse Community or Collection"> | ||
<nav *ngIf="(allOptions$ | async) as allOptions" class="comcol-browse mb-4" aria-label="Browse Community or Collection"> | ||
<div class="d-none d-sm-block"> | ||
|
||
<div class="list-group list-group-horizontal"> | ||
<a *ngFor="let option of allOptions" | ||
class="list-group-item" | ||
[routerLink]="option.routerLink" | ||
[queryParams]="option.params" | ||
routerLinkActive="active">{{ option.label | translate }}</a> | ||
[class.active]="(currentOption$ | async)?.id === option.id"> | ||
{{ option.label | translate }} | ||
</a> | ||
</div> | ||
</div> | ||
|
||
<div class="d-block d-sm-none"> | ||
<select name="browse-type" | ||
class="form-control" | ||
aria-label="Browse Community or Collection" | ||
(ngModelChange)="onSelectChange($event)" [ngModel]="currentOptionId$ | async"> | ||
(change)="onSelectChange($event)"> | ||
<option *ngFor="let option of allOptions" | ||
[ngValue]="option.id" | ||
[attr.selected]="(currentOptionId$ | async) === option.id ? 'selected' : null">{{ option.label | translate }}</option> | ||
[value]="option.id" | ||
[attr.selected]="(currentOption$ | async)?.id === option.id ? 'selected' : null"> | ||
{{ option.label | translate }} | ||
</option> | ||
</select> | ||
</div> | ||
</nav> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters