Skip to content

Commit

Permalink
src/app: Minor adjustment to CGSpace accessRights component
Browse files Browse the repository at this point in the history
To keep the heading size consistent we need to mimic the style and
structure of the metadata-field-wrapper component. Part of this was
to remove unneccessary duplication of some simple-view classes.
  • Loading branch information
alanorth committed Dec 16, 2023
1 parent 78bfbf1 commit 8f1b9cc
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
Original file line number Diff line number Diff line change
@@ -1,22 +1,20 @@
<div class="item-page-field" *ngIf="item?.allMetadata(fields).length">
<ds-metadata-field-wrapper>
<div class="simple-view-element">
<h5 class="simple-view-element-header">{{ label | translate }}</h5>
<div class="simple-view-element-body">
<!-- Iterate over metadata values and send them to the correct template -->
<ng-container *ngFor="let mdValue of item?.allMetadata(fields)">
<ng-container *ngIf="mdValue.value == 'Open Access'"
[ngTemplateOutlet]="openAccess"
[ngTemplateOutletContext]="{value: mdValue.value}">
</ng-container>
<ng-container *ngIf="mdValue.value == 'Limited Access'"
[ngTemplateOutlet]="limitedAccess"
[ngTemplateOutletContext]="{value: mdValue.value}">
</ng-container>
<div class="simple-view-element">
<h2 class="simple-view-element-header">{{ label | translate }}</h2>
<div class="simple-view-element-body">
<!-- Iterate over metadata values and send them to the correct template -->
<ng-container *ngFor="let mdValue of item?.allMetadata(fields)">
<ng-container *ngIf="mdValue.value == 'Open Access'"
[ngTemplateOutlet]="openAccess"
[ngTemplateOutletContext]="{value: mdValue.value}">
</ng-container>
</div>
<ng-container *ngIf="mdValue.value == 'Limited Access'"
[ngTemplateOutlet]="limitedAccess"
[ngTemplateOutletContext]="{value: mdValue.value}">
</ng-container>
</ng-container>
</div>
</ds-metadata-field-wrapper>
</div>
</div>

<!-- Images CCO-1.0 from Wikipedia.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import { ItemPageFieldComponent } from '../item-page-field.component';

@Component({
selector: 'ds-item-page-accessRights-field',
// Mimic style from metadata-field-wrapper component since we can't use it here
styleUrls: ['../../../../../shared/metadata-field-wrapper/metadata-field-wrapper.component.scss'],
templateUrl: './item-page-accessRights-field.component.html'
})
/**
Expand Down

0 comments on commit 8f1b9cc

Please sign in to comment.