Skip to content

Commit

Permalink
Merge pull request #590 from HZ-HBO-ICT/hotfix/programme
Browse files Browse the repository at this point in the history
Fix programme
  • Loading branch information
TimKardol authored Nov 7, 2024
2 parents f200255 + ddf9a1e commit 6b217bb
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/Models/Presentation.php
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ public function creator(): Attribute
public function remainingCapacity(): Attribute
{
return Attribute::make(
get: fn() => $this->max_participants - $this->participants->count(),
get: fn() => min($this->room->max_participants, $this->max_participants) - $this->participants->count(),
);
}

Expand Down
2 changes: 1 addition & 1 deletion resources/views/components/schedule-block.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class="w-full rounded overflow-hidden bg-{{$colorName}}-400 hover:cursor-pointer
{{$presentation->room->name}}
</span>
<span class="inline-block bg-gray-100 rounded-full px-3 py-1 text-xs font-semibold text-gray-700 mr-2 mb-2">
Participants: {{$presentation->participants->count()}}/{{$presentation->room->max_participants}}
Participants: {{$presentation->participants->count()}}/{{ min($presentation->room->max_participants, $presentation->max_participants) }}
</span>
<span class="inline-block bg-gray-100 rounded-full px-3 py-1 text-xs font-semibold text-gray-700 mr-2 mb-2">
{{ucfirst($presentation->difficulty->level)}}
Expand Down
2 changes: 1 addition & 1 deletion resources/views/programme/show.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ class="text-yellow-500 flex transititext-primary text-primary transition duratio
</h2>
<p>Room: {{$presentation->room->name}}</p>
<p>Time: {{Carbon::parse($presentation->timeslot->start)->format('H:i')}}
- {{(Carbon::parse($presentation->timeslot->start)->addMinutes($presentation->timeslot->duration))->format('H:i')}}</p>
- {{(Carbon::parse($presentation->timeslot->start)->addMinutes($presentation->duration))->format('H:i')}}</p>
</div>
@if(Auth::user())
@can('enroll', $presentation)
Expand Down

0 comments on commit 6b217bb

Please sign in to comment.