-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: introduce new columns for session ratings
add ratedSessions to controllers update ratedSessions and remove extra vars
- Loading branch information
1 parent
93f9157
commit 7765d38
Showing
5 changed files
with
77 additions
and
26 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
20 changes: 17 additions & 3 deletions
20
app/templates/components/ui-table/cell/events/view/sessions/cell-rating.hbs
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,5 +1,19 @@ | ||
{{ui-rating | ||
rating=(if record.averageRating record.averageRating '0') | ||
{{#if (includes ratedSessions record.id)}} | ||
{{#each record.feedbacks as |feedback|}} | ||
{{#if (eq feedback.user.email authManager.currentUser.email)}} | ||
{{ui-rating | ||
initialRating=feedback.rating | ||
rating=feedback.rating | ||
maxRating=5 | ||
onRate=(pipe-action (action (mut feedback.rating)) (action updateRating feedback.rating feedback)) | ||
clearable=true}} | ||
{{/if}} | ||
{{/each}} | ||
{{else}} | ||
{{ui-rating | ||
initialRating=0 | ||
rating=record.rating | ||
maxRating=5 | ||
onRate=(pipe-action (action (mut record.averageRating)) (action updateRating record record.averageRating)) | ||
onRate=(pipe-action (action (mut record.rating)) (action addRating record.rating record)) | ||
clearable=true}} | ||
{{/if}} |
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