Skip to content

Commit 3e91ec8

Browse files
committed
💄 make repo card look nicer
1 parent 03f4460 commit 3e91ec8

File tree

4 files changed

+37
-13
lines changed

4 files changed

+37
-13
lines changed

frontend/src/app/projects-tab/projects-tab.component.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,8 @@
8989

9090
<!-- Paginator and Repositories -->
9191
<mat-card-content>
92-
<mat-paginator #paginator
92+
<mat-paginator
93+
#paginator
9394
[length]="projects.totalElements"
9495
[pageSize]="pageSize"
9596
[pageSizeOptions]="pageSizeOptions"

frontend/src/app/repository/repository.component.css

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
.repository-card {
22
width: 370px;
3-
height: 160px;
3+
height: 170px;
44
margin: 20px;
55
-moz-border-radius: 30px;
66
-webkit-border-radius: 30px;
@@ -14,3 +14,14 @@
1414
.repository-card:hover {
1515
transform: scale(1.1);
1616
}
17+
18+
mat-card-header {
19+
padding-right: 3em;
20+
}
21+
22+
#show-dialog {
23+
bottom: 1.5em;
24+
right: 1.5em;
25+
position: absolute;
26+
background-color: #80c6ff;
27+
}

frontend/src/app/repository/repository.component.html

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,26 @@
11
<mat-card class="repository-card">
22
<mat-card-header>
33
<mat-card-title style="text-align: left">
4-
{{ project.name }}
4+
{{ truncateName() }}
55
</mat-card-title>
66
<mat-card-subtitle style="text-align: left">
77
{{ project.nameSpace }}
88
</mat-card-subtitle>
99
</mat-card-header>
1010
<mat-card-content style="padding-left: 16px">
11-
<p>
12-
{{ truncateDescription() }}
13-
</p>
14-
<p>
15-
<a [href]="project.url" target="_blank">Link zum Repository</a>
16-
</p>
11+
{{ truncateDescription() }}
1712
</mat-card-content>
18-
<mat-card-actions style="bottom: 16%; right: 8%; position: absolute">
19-
<button
20-
mat-raised-button
21-
style="background-color: #80c6ff"
13+
<mat-card-actions>
14+
<a
15+
mat-button
16+
[href]="project.url"
17+
target="_blank"
18+
style="top: 1em; right: 1em; position: absolute"
19+
>
20+
<mat-icon>code</mat-icon>
21+
</a>
22+
<button id="show-dialog"
23+
mat-flat-button
2224
(click)="openDetailsDialog()"
2325
>
2426
Anzeigen

frontend/src/app/repository/repository.component.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,14 @@ export class RepositoryComponent {
3434
return this.project.description.substring(0, 100) + '...';
3535
}
3636
}
37+
38+
truncateName() {
39+
if (this.project.name == '') {
40+
return 'Kein Name Vorhanden'
41+
} else if (this.project.name.length <= 40) {
42+
return this.project.name;
43+
} else {
44+
return this.project.name.substring(0, 40) + '...'
45+
}
46+
}
3747
}

0 commit comments

Comments
 (0)