Skip to content
Snippets Groups Projects
Commit fac5b55b authored by Lukas Mauß's avatar Lukas Mauß
Browse files

Display search bar only if comments exist

parent ab81060e
Branches
Tags
1 merge request!257Improve comment-list view + 2 bug fixes
This commit is part of merge request !257. Comments created here will be created in the context of that merge request.
<div fxLayout="row" id="search-container"> <div fxLayout="row" id="search-container" *ngIf="comments.length > 0">
  • comments.length > 2 seems more reasonable to me. A search is a good option for 3 or more comments.

  • Author Maintainer

    Okay. Filter and sort just like that (whole search bar)?

  • If no search is offered, the filter and sort icons should remain in place, otherwise the insertion of the search icon and the search field will result in disturbing movement.

  • Author Maintainer

    But who wants to sort/filter one or two comments?

  • Oha, now I understand your question. Of course, show everything when there are 3 or more comments.

  • Please register or sign in to reply
<mat-label fxLayoutAlign="center center"> <mat-label fxLayoutAlign="center center">
<mat-icon class="search-icon">search</mat-icon> <mat-icon class="search-icon">search</mat-icon>
</mat-label> </mat-label>
...@@ -72,6 +72,13 @@ ...@@ -72,6 +72,13 @@
</mat-menu> </mat-menu>
</div> </div>
<div fxLayout="row" fxLayoutAlign="center" *ngIf="comments.length < 1">
<button mat-fab class="fab-extended" (click)="openCreateDialog()">
{{'comment-list.add-comment' | translate}}
<mat-icon class="add">add</mat-icon>
</button>
</div>
<div *ngIf="!isLoading"> <div *ngIf="!isLoading">
<app-comment *ngFor="let current of hideCommentsList ? filteredComments : comments" [comment]="current" [parseVote]="getVote(current)"></app-comment> <app-comment *ngFor="let current of hideCommentsList ? filteredComments : comments" [comment]="current" [parseVote]="getVote(current)"></app-comment>
</div> </div>
......
...@@ -65,7 +65,7 @@ input { ...@@ -65,7 +65,7 @@ input {
} }
.no-comments { .no-comments {
margin-top: 30%; margin-top: 10%;
} }
h4 { h4 {
...@@ -115,3 +115,21 @@ h4 { ...@@ -115,3 +115,21 @@ h4 {
color: var(--on-surface); color: var(--on-surface);
opacity: 1; opacity: 1;
} }
.fab-extended {
width: 50%;
min-width: 270px;
height: 40px;
border-radius: 32px;
margin: 10% 0 10% 0;
font-size: large;
background-color: var(--primary);
color: var(--on-primary);
}
.add {
transform: scale(1.4);
padding-right: 5px;
padding-left: 5px;
color: var(--on-primary);
}
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment