forked from DSpace/dspace-angular
-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merged in DSC-983-counters-component-main (pull request DSpace#1318)
DSC-983 counters component main
- Loading branch information
Showing
6 changed files
with
48 additions
and
30 deletions.
There are no files selected for viewing
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
41 changes: 22 additions & 19 deletions
41
src/app/shared/explore/section-component/counters-section/counters-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 |
---|---|---|
@@ -1,27 +1,30 @@ | ||
<div> | ||
<div class="card"> | ||
<div class = "row d-flex justify-content-center"> | ||
<div class="card p-3"> | ||
<div class="d-flex flex-wrap flex-row justify-content-around gap-4"> | ||
<div *ngIf="isLoading$ | async"> | ||
<ds-loading message="{{'loading.default' | translate}}"></ds-loading> | ||
</div> | ||
<div *ngFor="let counter of (counterData$ | async)" | ||
class="px-4 py-1 d-flex flex-column" style="flex: 1 0 100px"> | ||
<div (click)="goToLink(counter.link)" | ||
[ngStyle]="{'cursor': counter.link? 'pointer' : 'inherit'}" | ||
class="col d-flex justify-content-center text-center align-items-center"> | ||
<i [ngClass]="counter.icon"></i> | ||
<ng-container *ngFor="let counter of (counterData$ | async)"> | ||
<ng-container *ngIf="counter.link; else countersSectionContent"> | ||
<a class="text-decoration-none" *ngIf="internalLinkService.isLinkInternal(counter.link)" [routerLink]="internalLinkService.getRelativePath(counter.link)"> | ||
<ng-container *ngTemplateOutlet="countersSectionContent"></ng-container> | ||
</a> | ||
<a class="text-decoration-none" *ngIf="!internalLinkService.isLinkInternal(counter.link)" [href]="counter.link" [target]="'_blank'"> | ||
<ng-container *ngTemplateOutlet="countersSectionContent"></ng-container> | ||
</a> | ||
</ng-container> | ||
<ng-template #countersSectionContent> | ||
<div class="d-flex flex-wrap flex-column justify-content-between align-items-center gapy-1 counters-section"> | ||
<i class="d-block mb-2" [ngClass]="counter.icon"></i> | ||
<div class="counters-label text-center"> | ||
{{ 'explore.counters-section.' + counter.label | translate }} | ||
</div> | ||
<div class="text-center font-weight-bold"> | ||
<b>{{ counter.count }}</b> | ||
</div> | ||
</div> | ||
<div (click)="goToLink(counter.link)" | ||
[ngStyle]="{'cursor': counter.link? 'pointer' : 'inherit'}" | ||
class="col d-flex justify-content-center text-center align-items-center"> | ||
{{'explore.counters-section.' + counter.label | translate}} | ||
</div> | ||
<div (click)="goToLink(counter.link)" | ||
[ngStyle]="{'cursor': counter.link? 'pointer' : 'inherit'}" | ||
class="col d-flex justify-content-center text-center align-items-center"> | ||
<b>{{counter.count}}</b> | ||
</div> | ||
</div> | ||
</ng-template> | ||
</ng-container> | ||
</div> | ||
</div> | ||
</div> |
13 changes: 13 additions & 0 deletions
13
src/app/shared/explore/section-component/counters-section/counters-section.component.scss
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,13 @@ | ||
.counters-section { | ||
min-width: 120px; | ||
max-width: 140px; | ||
color: var(--bs-gray-800); | ||
|
||
&:hover { | ||
color: #{darken($gray-800, 20%)}; | ||
} | ||
} | ||
|
||
.counters-label { | ||
line-height: 1.25; | ||
} |
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