59415: messages, subject link on comcol pages and documentation updates

This commit is contained in:
Kristof De Langhe
2019-01-29 17:22:23 +01:00
parent 3fdd32b383
commit 64f301d1dd
5 changed files with 43 additions and 11 deletions

View File

@@ -285,6 +285,14 @@
"title": "Title",
"author": "Author",
"subject": "Subject"
},
"comcol": {
"head": "Browse",
"by": {
"title": "By Title",
"author": "By Author",
"subject": "By Subject"
}
}
},
"admin": {
@@ -382,6 +390,7 @@
"browse_global_by_issue_date": "By Issue Date",
"browse_global_by_author": "By Author",
"browse_global_by_title": "By Title",
"browse_global_by_subject": "By Subject",
"statistics": "Statistics",
"browse_community": "This Community",
"browse_community_by_issue_date": "By Issue Date",

View File

@@ -129,8 +129,10 @@ export class BrowseByMetadataPageComponent implements OnInit {
/**
* Updates the current page with searchOptions
* @param searchOptions Options to narrow down your search:
* { pagination: PaginationComponentOptions,
* sort: SortOptions }
* { metadata: string
* pagination: PaginationComponentOptions,
* sort: SortOptions,
* scope: string }
*/
updatePage(searchOptions) {
this.browseEntries$ = this.browseService.getBrowseEntriesFor(searchOptions.metadata, searchOptions);
@@ -138,14 +140,16 @@ export class BrowseByMetadataPageComponent implements OnInit {
}
/**
* Updates the current page with searchOptions and display items linked to author
* Updates the current page with searchOptions and display items linked to the given value
* @param searchOptions Options to narrow down your search:
* { pagination: PaginationComponentOptions,
* sort: SortOptions }
* @param author The author's name for displaying items
* { metadata: string
* pagination: PaginationComponentOptions,
* sort: SortOptions,
* scope: string }
* @param value The value of the browse-entry to display items for
*/
updatePageWithItems(searchOptions, author: string) {
this.items$ = this.browseService.getBrowseItemsFor(searchOptions.metadata, author, searchOptions);
updatePageWithItems(searchOptions, value: string) {
this.items$ = this.browseService.getBrowseItemsFor(searchOptions.metadata, value, searchOptions);
}
ngOnDestroy(): void {

View File

@@ -84,6 +84,17 @@ export class NavbarComponent extends MenuComponent implements OnInit {
link: '/browse/author'
} as LinkMenuItemModel,
},
{
id: 'browse_global_by_subject',
parentID: 'browse_global',
active: false,
visible: true,
model: {
type: MenuItemType.LINK,
text: 'menu.section.browse_global_by_subject',
link: '/browse/subject'
} as LinkMenuItemModel,
},
/* Statistics */
{

View File

@@ -1,5 +1,6 @@
<h3>Browse</h3>
<h3>{{'browse.comcol.head' | translate}}</h3>
<ul>
<li><a [routerLink]="['/browse/title']" [queryParams]="{scope: id}">By Title</a></li>
<li><a [routerLink]="['/browse/author']" [queryParams]="{scope: id}">By Author</a></li>
<li><a [routerLink]="['/browse/title']" [queryParams]="{scope: id}">{{'browse.comcol.by.title' | translate}}</a></li>
<li><a [routerLink]="['/browse/author']" [queryParams]="{scope: id}">{{'browse.comcol.by.author' | translate}}</a></li>
<li><a [routerLink]="['/browse/subject']" [queryParams]="{scope: id}">{{'browse.comcol.by.subject' | translate}}</a></li>
</ul>

View File

@@ -1,9 +1,16 @@
import { Component, Input } from '@angular/core';
/**
* A component to display the "Browse By" section of a Community or Collection page
* It expects the ID of the Community or Collection as input to be passed on as a scope
*/
@Component({
selector: 'ds-comcol-page-browse-by',
templateUrl: './comcol-page-browse-by.component.html',
})
export class ComcolPageBrowseByComponent {
/**
* The ID of the Community or Collection
*/
@Input() id: string;
}