Skip to content
This repository was archived by the owner on Jan 22, 2026. It is now read-only.

Commit b51e567

Browse files
authored
Merge pull request #566 from Sage-Bionetworks/update-resource-styling
update styling of resource cards
2 parents d5d0332 + f91e142 commit b51e567

File tree

2 files changed

+48
-16
lines changed

2 files changed

+48
-16
lines changed

client/components/resource/resource-page/resource-page.html

Lines changed: 24 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,22 @@
11
<div *ngIf="resource">
22
<mat-card *ngIf="!showResourceEditTemplate; else showResourceEditForm" class="app-resource">
3+
34
<mat-card-header class="app-resource-header">
5+
<div class="app-resource-left-container">
46
<mat-card-title class="app-resource-title">{{ resource.title }}</mat-card-title>
57
<mat-card-subtitle
68
>{{ resource.resourceType }} created by {{ resource.createdBy.name }} on
79
{{ resource.createdAt | dateAndTime }}</mat-card-subtitle
810
>
11+
<mat-card-content class="app-resource-content">
12+
<app-quill-editor
13+
[isReadOnly]="true"
14+
[showActions]="false"
15+
[body]="form.controls['description']"
16+
></app-quill-editor>
17+
</mat-card-content>
18+
</div>
19+
<div class="app-resource-action-section">
920
<div class="app-resource-actions">
1021
<share-button [entity]="resource" [entityType]="entityType"></share-button>
1122
<show-activity-button [root]="resource"></show-activity-button>
@@ -45,25 +56,23 @@
4556
<span class="app-resource-actions-delete-btn-label">Delete {{ resource.resourceType }}</span>
4657
</button>
4758
</mat-menu>
59+
4860
</div>
61+
<div class="app-resource-extra-actions">
62+
<!-- Use enum for State -->
63+
<a *ngIf="resource.resourceType === 'State'" mat-raised-button color="primary" (click)="openInTool(resource)">Open with {{ tool.title }}</a>
64+
<a *ngIf="resource.resourceType !== 'State'" mat-raised-button color="primary" (click)="open(resource)">Open {{ resource.resourceType }}</a>
65+
<a mat-raised-button color="primary" (click)="notificationService.info('Not yet implemented')" [disabled]="true">Discuss</a>
66+
<!-- <a mat-raised-button color="primary" [routerLink]="'/discussion'">Discuss</a> -->
67+
<a mat-raised-button color="primary" (click)="notificationService.info('Not yet implemented')" [disabled]="true">Create Insight</a>
68+
</div>
69+
</div>
70+
4971
</mat-card-header>
5072

51-
<mat-card-content class="app-resource-content">
52-
<app-quill-editor
53-
[isReadOnly]="true"
54-
[showActions]="false"
55-
[body]="form.controls['description']"
56-
></app-quill-editor>
57-
</mat-card-content>
5873

59-
<div class="app-resource-extra-actions">
60-
<!-- Use enum for State -->
61-
<a *ngIf="resource.resourceType === 'State'" mat-raised-button color="primary" (click)="openInTool(resource)">Open with {{ tool.title }}</a>
62-
<a *ngIf="resource.resourceType !== 'State'" mat-raised-button color="primary" (click)="open(resource)">Open {{ resource.resourceType }}</a>
63-
<a mat-raised-button color="primary" (click)="notificationService.info('Not yet implemented')">Discuss</a>
64-
<!-- <a mat-raised-button color="primary" [routerLink]="'/discussion'">Discuss</a> -->
65-
<a mat-raised-button color="primary" (click)="notificationService.info('Not yet implemented')">Create Insight</a>
66-
</div>
74+
75+
6776
</mat-card>
6877

6978
<ng-template #showResourceEditForm>

client/components/resource/resource-page/resource-page.scss

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
display: flex;
77
flex-flow: row nowrap;
88
align-items: flex-start;
9+
justify-content: space-between;
910
}
1011

1112
.app-resource-title {
@@ -16,20 +17,42 @@
1617
.app-resource-content {
1718
padding-top: 8px;
1819
padding-bottom: 8px;
19-
margin: 0 16px;
20+
margin-right: 8px;
2021
}
2122

2223
.app-resource-actions {
2324
display: flex;
2425
flex-flow: row nowrap;
26+
justify-content: flex-end;
27+
padding-bottom: 10px;
2528
}
2629

2730
.app-resource-action-btn {
2831
margin-right: 10px;
2932
}
3033

3134
.mat-card-header-text {
35+
margin: 0px !important;
36+
}
37+
38+
.app-resource-action-section {
39+
display: flex;
40+
flex-flow: column wrap;
41+
}
42+
43+
.app-resource-extra-actions {
3244
display: flex;
3345
flex-flow: column nowrap;
46+
47+
}
48+
49+
.app-resource-extra-actions > a {
50+
margin-bottom: 10px;
51+
}
52+
53+
.app-resource-left-container {
54+
display: flex;
55+
flex-flow: column wrap;
56+
margin: 5px;
3457
flex-grow: 1;
3558
}

0 commit comments

Comments
 (0)