55693: Tabset

This commit is contained in:
Kristof De Langhe
2018-09-26 11:45:10 +02:00
parent 315b6a9690
commit 3dc09062d0
4 changed files with 20 additions and 29 deletions

View File

@@ -18,6 +18,10 @@
"head": "Item Mapper - Map Items from Other Collections", "head": "Item Mapper - Map Items from Other Collections",
"collection": "Collection: \"<b>{{name}}</b>\"", "collection": "Collection: \"<b>{{name}}</b>\"",
"description": "This is the item mapper tool that allows collection administrators to map items from other collections into this collection. You can search for items from other collections and map them, or browse the list of currently mapped items.", "description": "This is the item mapper tool that allows collection administrators to map items from other collections into this collection. You can search for items from other collections and map them, or browse the list of currently mapped items.",
"tabs": {
"browse": "Browse",
"map": "Map"
},
"return": "Return" "return": "Return"
} }
}, },

View File

@@ -14,30 +14,23 @@
</ds-search-form> </ds-search-form>
</div> </div>
</div> </div>
<ul class="nav nav-tabs mb-2">
<li class="nav-item">
<span class="tab nav-link" id="tab-browse-content" (click)="activeTab = 0" [ngClass]="(activeTab == 0)?'active':''">Browse</span>
</li>
<li class="nav-item">
<span class="tab nav-link" id="tab-map-content" (click)="activeTab = 1" [ngClass]="(activeTab == 1)?'active':''">Map</span>
</li>
</ul>
<div class="tab-content"> <ngb-tabset>
<!-- Browse Tab --> <ngb-tab title="{{'collection.item-mapper.tabs.browse' | translate}}">
<div *ngIf="activeTab == 0" id="tab-browse"> <ng-template ngbTabContent>
<ds-viewable-collection <ds-viewable-collection
[config]="(searchOptions$ | async)?.pagination" [config]="(searchOptions$ | async)?.pagination"
[sortConfig]="(searchOptions$ | async)?.sort" [sortConfig]="(searchOptions$ | async)?.sort"
[objects]="collectionItemsRD$ | async"> [objects]="collectionItemsRD$ | async">
</ds-viewable-collection> </ds-viewable-collection>
</div> </ng-template>
</ngb-tab>
<!-- Map Tab --> <ngb-tab title="{{'collection.item-mapper.tabs.map' | translate}}">
<div *ngIf="activeTab == 1" id="tab-map"> <ng-template ngbTabContent>
<ds-item-select [itemsRD$]="mappingItemsRD$" [paginationOptions]="(searchOptions$ | async)?.pagination"></ds-item-select> <ds-item-select [itemsRD$]="mappingItemsRD$" [paginationOptions]="(searchOptions$ | async)?.pagination"></ds-item-select>
</div> </ng-template>
</div> </ngb-tab>
</ngb-tabset>
<button [routerLink]="['/collections/', (collectionRD$ | async)?.payload?.id]" class="btn btn-outline-secondary">{{'collection.item-mapper.return' | translate}}</button> <button [routerLink]="['/collections/', (collectionRD$ | async)?.payload?.id]" class="btn btn-outline-secondary">{{'collection.item-mapper.return' | translate}}</button>
</div> </div>

View File

@@ -1,5 +1 @@
@import '../../../styles/variables.scss'; @import '../../../styles/variables.scss';
.tab:hover {
cursor: pointer;
}

View File

@@ -32,8 +32,6 @@ export class CollectionItemMapperComponent implements OnInit {
collectionItemsRD$: Observable<RemoteData<PaginatedList<DSpaceObject>>>; collectionItemsRD$: Observable<RemoteData<PaginatedList<DSpaceObject>>>;
mappingItemsRD$: Observable<RemoteData<PaginatedList<DSpaceObject>>>; mappingItemsRD$: Observable<RemoteData<PaginatedList<DSpaceObject>>>;
activeTab = 0;
constructor(private collectionDataService: CollectionDataService, constructor(private collectionDataService: CollectionDataService,
private route: ActivatedRoute, private route: ActivatedRoute,
private router: Router, private router: Router,