Skip to content

Commit b03f299

Browse files
Merge pull request #3756 from ita-social-projects/Bugfix/6837-No-star-ratings-are-displayed-on-the-event-card
Bugfix/6837 Events rate button enabled and rating is shown
2 parents d9979dd + e9d3607 commit b03f299

4 files changed

Lines changed: 35 additions & 19 deletions

File tree

src/app/greencity/modules/events/components/event-details/event-details.component.html

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -81,16 +81,17 @@
8181
></div>
8282
</div>
8383
<div class="event-participants">
84+
<div class="event-stars" *ngIf="!event.isRelevant">
85+
<app-rating-display [rate]="event.eventRate" [maxRating]="max"></app-rating-display>
86+
</div>
87+
88+
<span class="event-participants-count">({{ attendees.length }})</span>&nbsp;
89+
8490
<div *ngIf="attendeesAvatars.length" class="event-participants-avatars">
8591
<div *ngFor="let avatar of attendeesAvatars" class="event-participants-avatar">
86-
<img [src]="avatar" alt="" />
92+
<img [src]="avatar" alt="avatar" />
8793
</div>
8894
</div>
89-
<div class="event-participants-count-container">
90-
<span class="event-participants-count">{{ attendees.length }}</span
91-
>&nbsp;
92-
<span>{{ 'homepage.events.people-joined' | translate }}</span>
93-
</div>
9495
</div>
9596
</div>
9697

src/app/greencity/modules/events/components/event-details/event-details.component.scss

Lines changed: 26 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -246,8 +246,9 @@
246246
}
247247

248248
.event-participants {
249-
display: inline-flex;
250-
gap: 13px;
249+
display: flex;
250+
align-items: center;
251+
gap: 4px;
251252

252253
.event-participants-avatars {
253254
padding: 3px 0;
@@ -273,14 +274,9 @@
273274
}
274275
}
275276

276-
.event-participants-count-container {
277+
.event-participants-count {
277278
font-size: 16px;
278-
font-weight: 400;
279-
line-height: 26px;
280-
281-
.event-participants-count {
282-
font-weight: 500;
283-
}
279+
font-weight: 500;
284280
}
285281
}
286282
}
@@ -510,6 +506,27 @@
510506
gap: 24px;
511507
}
512508

509+
.event-stars {
510+
display: flex;
511+
justify-content: space-between;
512+
align-items: center;
513+
514+
.star {
515+
display: inline-block;
516+
width: 25px;
517+
height: 25px;
518+
transition: all 0.3s;
519+
}
520+
521+
.fill {
522+
background: url('/assets/events-icons/star-filled.svg') no-repeat center;
523+
}
524+
525+
.empty {
526+
background: url('/assets/events-icons/star-empthy.svg') no-repeat center;
527+
}
528+
}
529+
513530
.like-wr {
514531
margin-left: 20px;
515532
display: flex;

src/app/greencity/modules/events/components/event-details/event-details.component.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@ import { EventAttender, EventDto, EventForm, PlaceOnline } from '../../models/ev
2929
import { EventStoreService } from '../../services/event-store.service';
3030
import { MatSnackBarService } from '@global-service/mat-snack-bar/mat-snack-bar.service';
3131

32-
33-
3432
@Component({
3533
selector: 'app-event-details',
3634
templateUrl: './event-details.component.html',
@@ -63,7 +61,7 @@ export class EventDetailsComponent implements OnInit, OnDestroy {
6361
isUpdating: boolean;
6462
currentDate = new Date();
6563
isPreview = false;
66-
max = 5;
64+
max = 3;
6765
rate: number;
6866
likesType = {
6967
like: 'assets/img/comments/like.png',

src/app/greencity/shared/components/events-list-item/events-list-item.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
'primary-global-button': btnName.join === nameBtn
7474
}"
7575
(click)="buttonAction(nameBtn)"
76-
[disabled]="nameBtn === btnName.requestSent || isDateExpired(event.dates)"
76+
[disabled]="nameBtn === btnName.requestSent || (nameBtn === btnName.join && isDateExpired(event.dates))"
7777
>
7878
{{ nameBtn | translate }}
7979
</button>

0 commit comments

Comments
 (0)