Skip to content

Commit

Permalink
Merge pull request #311 from HZ-HBO-ICT/development
Browse files Browse the repository at this point in the history
Development
  • Loading branch information
TimKardol authored Oct 14, 2023
2 parents 7ad0be4 + d169d6c commit 9d0057d
Show file tree
Hide file tree
Showing 15 changed files with 173 additions and 74 deletions.
2 changes: 1 addition & 1 deletion app/Http/Controllers/ScheduleController.php
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ private function schedulePresentations(): int
foreach ($presentations as $presentation) {
$timeslots = Timeslot::where('duration', $presentation->type == 'lecture' ? 30 : 90)
->get();
$rooms = (new RoomController())->getRoomsWithClosestCapacity(12);
$rooms = Room::getWithClosestCapacity($presentation->max_participants);

$availableCombination = $rooms->crossJoin($timeslots)
->first(function ($room_timeslot) {
Expand Down
18 changes: 1 addition & 17 deletions app/Http/Controllers/TimeslotController.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,28 +34,12 @@ public function store(Request $request): RedirectResponse
'ending' => 'required|date_format:H:i|after:starting',
];

if ($request->all()['breakStart'])
$rules['breakStart'] = 'date_format:H:i|after:starting|before:ending';

if ($request->all()['breakEnd'])
$rules['breakEnd'] = 'date_format:H:i|after:breakStart|before:ending';

$validatedData = $request->validate($rules);

$starting = $validatedData['starting'];
$ending = $validatedData['ending'];
$breakStart = key_exists('breakStart', $validatedData) ? $validatedData['breakStart'] : '12:30';
$breakEnd = key_exists('breakEnd', $validatedData) ? $validatedData['breakEnd'] : '13:00';

if($breakEnd < $breakStart)
{
return redirect(route('moderator.schedule.timeslots.create'))
->withInput()
->withErrors(['breakEnd' => 'The ending time of the break cannot be before the starting time']);
}

$this->generate($starting, $breakStart);
$this->generate($breakEnd, $ending);
$this->generate($starting, $ending);

if (Room::all()->count() == 0) {
return redirect(route('rooms.index'));
Expand Down
13 changes: 13 additions & 0 deletions app/Models/Room.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,17 @@ public function presentations(): HasMany
{
return $this->hasMany(Presentation::class);
}

/**
* List with the rooms with the closest capacity to the maximum participants passed
* @param $maxCapacity
* @return mixed
*/
public static function getWithClosestCapacity($maxCapacity)
{
return Room::select('*')
->selectRaw('CAST(max_participants AS SIGNED) AS signed_capacity')
->orderByRaw('ABS(signed_capacity - ?)', [$maxCapacity])
->get();
}
}
5 changes: 3 additions & 2 deletions app/View/Components/ContentModeratorBlock.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,13 @@ class ContentModeratorBlock extends Component
public function __construct(
public string $label,
public string $count,
public string $routeName,
public string $route,
public string $icon,
public string $roleColour,
public string $param = ''
)
{
$this->routeName = $routeName;

}

/**
Expand Down
3 changes: 2 additions & 1 deletion database/factories/PresentationFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ public function definition(): array
'description' => $this->faker->paragraph,
'max_participants' => $this->faker->numberBetween(1, 50),
'type' => $this->faker->boolean ? 'lecture' : 'workshop',
'file_path' => $path
'file_path' => $path,
'difficulty_id' => $this->faker->numberBetween(1, 3),
];
}
}
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions resources/views/components/company-dashboard-section.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
&& Auth::user()->currentTeam->allPresentations->count() < 2)
<div class="px-6 pt-5">
<div
class="py-5 px-4 rounded-lg overflow-hidden relative bg-amber-100 dark:bg-amber-900 shadow-md dark:shadow-md">
<div class="p-3 rounded-md absolute bg-orange-500">
class="py-5 px-4 rounded-lg overflow-hidden relative bg-crew-100 dark:bg-crew-800 shadow-md dark:shadow-md">
<div class="p-3 rounded-md absolute bg-crew-500">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"
stroke-width="1.5" stroke="white"
aria-hidden="true" class="w-6 h-6">
Expand All @@ -19,13 +19,13 @@ class="py-5 px-4 rounded-lg overflow-hidden relative bg-amber-100 dark:bg-amber-
company can have two presentations. Currently, you have
requested {{Auth::user()->currentTeam->allPresentations->count()}} presentations.
<a href="{{route('teams.show', Auth::user()->currentTeam)}}"
class="text-purple-500">
class="text-partner-500">
Invite speakers to host a presentation
</a>
@if(!Auth::user()->speaker)
or
<a href="{{route('speakers.request.presentation')}}"
class="text-purple-500">
class="text-partner-500">
host one yourself
</a>
@endif
Expand Down Expand Up @@ -102,7 +102,7 @@ class="text-sm">by {{$presentation->mainSpeaker()->user->name}} {{$cospeakersStr
</div>
@endforeach
@else
<p class="text-purple-600 font-medium text-md dark:text-purple-500">
<p class="text-partner-600 font-medium text-md dark:text-partner-500">
Your company has not requested any presentations yet
</p>
@endif
Expand Down
6 changes: 3 additions & 3 deletions resources/views/components/content-moderator-block.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<div class="p-3 rounded-md absolute bg-{{ $roleColour }}-500">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="white" aria-hidden="true" class="w-6 h-6">
<path stroke-linecap="round" stroke-linejoin="round" d="{{ $icon }}" />
</svg>
</svg>
</div>
<p class="ml-16 font-medium text-sm text-gray-500 dark:text-gray-100 overflow-hidden text-ellipsis whitespace-nowrap">
{{ $label }}
Expand All @@ -20,8 +20,8 @@
</p>
<div class="py-4 px-4 bottom-0 inset-x-0 absolute bg-gray-50 dark:bg-gray-700 border-t dark:border-t-gray-600">
<div class="text-base font-semibold text-{{ $roleColour }}-500 hover:text-{{ $roleColour }}-400 dark:text-{{ $roleColour }}-500 dark:hover:text-{{ $roleColour }}-300">
<a href="{{ $routeName }}">View all</a>
<a href="{{ empty($param) ? route($route) : route($route, $param) }}">View all</a>
</div>
</div>
</dd>
</div>
</div>
26 changes: 15 additions & 11 deletions resources/views/components/content-moderator-dashboard.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,31 +13,31 @@
<x-content-moderator-block
:label="'Companies'"
:count="Team::where('is_approved', 0)->count()"
:routeName="route('moderator.requests', 'teams')"
:route="'moderator.companies.index'"
:icon="'M2.25 21h19.5m-18-18v18m10.5-18v18m6-13.5V21M6.75 6.75h.75m-.75 3h.75m-.75 3h.75m3-6h.75m-.75 3h.75m-.75 3h.75M6.75 21v-3.375c0-.621.504-1.125 1.125-1.125h2.25c.621 0 1.125.504 1.125 1.125V21M3 3h12m-.75 4.5H21m-3.75 3.75h.008v.008h-.008v-.008zm0 3h.008v.008h-.008v-.008zm0 3h.008v.008h-.008v-.008z'"
:roleColour="'crew'"/>
<x-content-moderator-block
:label="'Booths'"
:count="Booth::where('is_approved', 0)->count()"
:routeName="route('moderator.requests', 'booths')"
:route="'moderator.booths.index'"
:icon="'M13.5 21v-7.5a.75.75 0 01.75-.75h3a.75.75 0 01.75.75V21m-4.5 0H2.36m11.14 0H18m0 0h3.64m-1.39 0V9.349m-16.5 11.65V9.35m0 0a3.001 3.001 0 003.75-.615A2.993 2.993 0 009.75 9.75c.896 0 1.7-.393 2.25-1.016a2.993 2.993 0 002.25 1.016c.896 0 1.7-.393 2.25-1.016a3.001 3.001 0 003.75.614m-16.5 0a3.004 3.004 0 01-.621-4.72L4.318 3.44A1.5 1.5 0 015.378 3h13.243a1.5 1.5 0 011.06.44l1.19 1.189a3 3 0 01-.621 4.72m-13.5 8.65h3.75a.75.75 0 00.75-.75V13.5a.75.75 0 00-.75-.75H6.75a.75.75 0 00-.75.75v3.75c0 .415.336.75.75.75z'"
:roleColour="'crew'"/>
<x-content-moderator-block
:label="'Sponsorships'"
:count="Team::where('is_sponsor_approved', 0)->count()"
:routeName="route('moderator.requests', 'sponsorships')"
:route="'moderator.sponsors.index'"
:icon="'M21 11.25v8.25a1.5 1.5 0 01-1.5 1.5H5.25a1.5 1.5 0 01-1.5-1.5v-8.25M12 4.875A2.625 2.625 0 109.375 7.5H12m0-2.625V7.5m0-2.625A2.625 2.625 0 1114.625 7.5H12m0 0V21m-8.625-9.75h18c.621 0 1.125-.504 1.125-1.125v-1.5c0-.621-.504-1.125-1.125-1.125h-18c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125z'"
:roleColour="'crew'"/>
<x-content-moderator-block
:label="'Presentations'"
:count="$numberOfPresentationRequests"
:routeName="route('moderator.requests', 'presentations')"
:route="'moderator.presentations.index'"
:icon="'M3.75 3v11.25A2.25 2.25 0 006 16.5h2.25M3.75 3h-1.5m1.5 0h16.5m0 0h1.5m-1.5 0v11.25A2.25 2.25 0 0118 16.5h-2.25m-7.5 0h7.5m-7.5 0l-1 3m8.5-3l1 3m0 0l.5 1.5m-.5-1.5h-9.5m0 0l-.5 1.5M9 11.25v1.5M12 9v3.75m3-6v6'"
:roleColour="'crew'"/>
<x-content-moderator-block
:label="'Schedule presentations'"
:count="$numberOfUnscheduledPresentations"
:routeName="route('moderator.presentations-for-scheduling')"
:route="'moderator.presentations-for-scheduling'"
:icon="'M6.75 3v2.25M17.25 3v2.25M3 18.75V7.5a2.25 2.25 0 012.25-2.25h13.5A2.25 2.25 0 0121 7.5v11.25m-18 0A2.25 2.25 0 005.25 21h13.5A2.25 2.25 0 0021 18.75m-18 0v-7.5A2.25 2.25 0 015.25 9h13.5A2.25 2.25 0 0121 11.25v7.5'"
:roleColour="'crew'"/>
</dl>
Expand All @@ -53,37 +53,41 @@
:label="'Participants'"
:count="User::role('participant')->get()->count()"
:icon="'M18 18.72a9.094 9.094 0 003.741-.479 3 3 0 00-4.682-2.72m.94 3.198l.001.031c0 .225-.012.447-.037.666A11.944 11.944 0 0112 21c-2.17 0-4.207-.576-5.963-1.584A6.062 6.062 0 016 18.719m12 0a5.971 5.971 0 00-.941-3.197m0 0A5.995 5.995 0 0012 12.75a5.995 5.995 0 00-5.058 2.772m0 0a3 3 0 00-4.681 2.72 8.986 8.986 0 003.74.477m.94-3.197a5.971 5.971 0 00-.94 3.197M15 6.75a3 3 0 11-6 0 3 3 0 016 0zm6 3a2.25 2.25 0 11-4.5 0 2.25 2.25 0 014.5 0zm-13.5 0a2.25 2.25 0 11-4.5 0 2.25 2.25 0 014.5 0z'"
:routeName="route('moderator.list', 'participants')"
:route="'moderator.list'"
:param="'participant'"
:roleColour="'crew'"/>
<x-content-moderator-block
:label="'Speakers'"
:count="User::role('speaker')->get()->count()"
:icon="'M3.75 3v11.25A2.25 2.25 0 006 16.5h2.25M3.75 3h-1.5m1.5 0h16.5m0 0h1.5m-1.5 0v11.25A2.25 2.25 0 0118 16.5h-2.25m-7.5 0h7.5m-7.5 0l-1 3m8.5-3l1 3m0 0l.5 1.5m-.5-1.5h-9.5m0 0l-.5 1.5m.75-9l3-3 2.148 2.148A12.061 12.061 0 0116.5 7.605'"
:routeName="route('moderator.list', 'speakers')"
:route="'moderator.list'"
:param="'speakers'"
:roleColour="'crew'"/>
<x-content-moderator-block
:label="'All users'"
:count="User::all()->count()"
:icon="'M15 19.128a9.38 9.38 0 002.625.372 9.337 9.337 0 004.121-.952 4.125 4.125 0 00-7.533-2.493M15 19.128v-.003c0-1.113-.285-2.16-.786-3.07M15 19.128v.106A12.318 12.318 0 018.624 21c-2.331 0-4.512-.645-6.374-1.766l-.001-.109a6.375 6.375 0 0111.964-3.07M12 6.375a3.375 3.375 0 11-6.75 0 3.375 3.375 0 016.75 0zm8.25 2.25a2.625 2.625 0 11-5.25 0 2.625 2.625 0 015.25 0z'"
:routeName="route('moderator.list', 'users')"
:route="'moderator.list'"
:param="'users'"
:roleColour="'crew'"/>
<x-content-moderator-block
:label="'Booths'"
:count="Booth::where('is_approved', 1)->count()"
:icon="'M13.5 21v-7.5a.75.75 0 01.75-.75h3a.75.75 0 01.75.75V21m-4.5 0H2.36m11.14 0H18m0 0h3.64m-1.39 0V9.349m-16.5 11.65V9.35m0 0a3.001 3.001 0 003.75-.615A2.993 2.993 0 009.75 9.75c.896 0 1.7-.393 2.25-1.016a2.993 2.993 0 002.25 1.016c.896 0 1.7-.393 2.25-1.016a3.001 3.001 0 003.75.614m-16.5 0a3.004 3.004 0 01-.621-4.72L4.318 3.44A1.5 1.5 0 015.378 3h13.243a1.5 1.5 0 011.06.44l1.19 1.189a3 3 0 01-.621 4.72m-13.5 8.65h3.75a.75.75 0 00.75-.75V13.5a.75.75 0 00-.75-.75H6.75a.75.75 0 00-.75.75v3.75c0 .415.336.75.75.75z'"
:routeName="route('moderator.list', 'booths')"
:route="'moderator.booths.index'"
:param="'booths'"
:roleColour="'crew'"/>
<x-content-moderator-block
:label="'Presentations'"
:count="$numberOfScheduledPresentations"
:icon="'M3.75 3v11.25A2.25 2.25 0 006 16.5h2.25M3.75 3h-1.5m1.5 0h16.5m0 0h1.5m-1.5 0v11.25A2.25 2.25 0 0118 16.5h-2.25m-7.5 0h7.5m-7.5 0l-1 3m8.5-3l1 3m0 0l.5 1.5m-.5-1.5h-9.5m0 0l-.5 1.5m.75-9l3-3 2.148 2.148A12.061 12.061 0 0116.5 7.605'"
:routeName="route('moderator.list', 'presentations')"
:route="'moderator.presentations.index'"
:roleColour="'crew'"/>
<x-content-moderator-block
:label="'Companies'"
:count="Team::where('is_approved', 1)->count()"
:icon="'M3.75 21h16.5M4.5 3h15M5.25 3v18m13.5-18v18M9 6.75h1.5m-1.5 3h1.5m-1.5 3h1.5m3-6H15m-1.5 3H15m-1.5 3H15M9 21v-3.375c0-.621.504-1.125 1.125-1.125h3.75c.621 0 1.125.504 1.125 1.125V21'"
:routeName="route('moderator.list', 'teams')"
:route="'moderator.companies.index'"
:roleColour="'crew'"/>
</dl>
</div>
Expand Down
16 changes: 7 additions & 9 deletions resources/views/livewire/booth-request.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,18 @@
</x-slot>

<x-slot name="description">
Signing up for our company market will after confirmation grant a standard 8m2 (sponsor package size may
differ) sized area where we will present you with a round standing table. Electricity is available. You can
bring your own banner to place in the area. Floorplans with location will be provided no later than two
weeks before the start of the conference. We will expand making more room but you can see an impression from
last years floorplan
<LINK>

Signing up for our company market will, after confirmation, grant a standard 8m2 booth.
Choosing the gold sponsor package gives you a 12m2 booth.
The standard and gold package booth both include a standing table and electricity.
It is possible to bring your own banner to place at your booth.
Floorplans for the location of your booth will be provided no later than two weeks before the conference.
</x-slot>

<x-slot name="form">
<div class="col-span-6">
<div class="max-w-xl text-sm text-gray-600 dark:text-gray-400">
Any additional supplies or preferences you need to fill the area please let us know so we can try to
think with you and accommodate you as best as we can.
If there are any additional materials or specific preferences you require for your booth,
please inform us. We'll do our best to understand your needs and accommodate them.
</div>
</div>

Expand Down
11 changes: 7 additions & 4 deletions resources/views/livewire/sponsorship-request.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,19 @@
</x-slot>

<x-slot name="description">
If you decide to become a sponsor of the conference, there are different tiers that you can choose of with
different privileges. Check out <a class="text-purple-600 dark:text-purple-500 underline" href="/files/sponsor-packages.pdf">this
link</a>
If you choose to sponsor the conference, there are various tiers available,
each offering distinct benefits.
Check out
<a class="text-purple-600 dark:text-purple-500 underline" href="/files/sponsor-packages.pdf">
this link
</a>
for more detailed information.
</x-slot>

<x-slot name="form">
<div class="col-span-6">
<div class="max-w-xl text-sm text-gray-600 dark:text-gray-400">
If you want to be a sponsor, choose a tier and we will be soon in touch with you to discuss further.
If you're interested in sponsoring, please select a tier and we'll reach out to you for further discussions.
</div>
</div>

Expand Down
Loading

0 comments on commit 9d0057d

Please sign in to comment.