Skip to content

Commit

Permalink
filter ribbon when badge type is correct
Browse files Browse the repository at this point in the history
  • Loading branch information
hdaws committed Jan 12, 2025
1 parent 05a9a77 commit 5f91c2a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
10 changes: 8 additions & 2 deletions uber/templates/registration/attendee_data.html
Original file line number Diff line number Diff line change
Expand Up @@ -145,11 +145,17 @@

x-init="$watch('badge_ribbons',
(ribbons) => {
if (Alpine.raw(ribbons).includes({{ c.VOLUNTEER_RIBBON }})) { staffing = true }
console.log(Alpine.raw(ribbons))
if (Alpine.raw(ribbons).includes({{ c.VOLUNTEER_RIBBON }})) { staffing=true }
});
$watch('badge_type',
(btype) => {
if( btype == {{ c.STAFF_BADGE }} || btype == {{ c.CONTRACTOR_BADGE }}){ staffing = true }
console.log(btype);
if( btype == {{ c.STAFF_BADGE }} || btype == {{ c.CONTRACTOR_BADGE }}){
staffing = true;
//This does trigger the above watcher, but that's alright.
badge_ribbons = badge_ribbons.filter( ribbon => ribbon != {{ c.VOLUNTEER_RIBBON }} );
}
})"
>
{{ csrf_token() }}
Expand Down
6 changes: 5 additions & 1 deletion uber/templates/registration/form.html
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,11 @@ <h4>{{ attendee.full_name }} currently owes <strong>{{ (receipt.current_amount_o
$watch('badge_type',
(btype) => {
console.log(btype);
if( btype == {{ c.STAFF_BADGE }} || btype == {{ c.CONTRACTOR_BADGE }}){ staffing = true }
if( btype == {{ c.STAFF_BADGE }} || btype == {{ c.CONTRACTOR_BADGE }}){
staffing = true;
//This does trigger the above watcher, but that's alright.
badge_ribbons = badge_ribbons.filter( ribbon => ribbon != {{ c.VOLUNTEER_RIBBON }} );
}
})"
>
{{ csrf_token() }}
Expand Down

0 comments on commit 5f91c2a

Please sign in to comment.