Skip to content

Commit

Permalink
server quickfixes (#338)
Browse files Browse the repository at this point in the history
  • Loading branch information
kdmnk authored Oct 21, 2023
1 parent 1edde79 commit a5c9f85
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 20 deletions.
2 changes: 1 addition & 1 deletion app/Http/Controllers/Secretariat/UserController.php
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ public function showTenantUpdate()
*/
public function tenantToApplicant()
{
if (!user()->isTenant() || user()->isCollegist()) {
if (!user()->isTenant() || user()->isCollegist(false)) {
return abort(403);
}
$user = user();
Expand Down
7 changes: 4 additions & 3 deletions app/Policies/UserPolicy.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public function view(User $user, User $target): bool
]);
})) || $target->workshops
->intersect($user->roleWorkshops)
->count()>0;
->count() > 0;
} elseif ($target->hasRole(Role::TENANT)) {
return $user->hasRole([Role::STAFF, Role::STUDENT_COUNCIL => Role::PRESIDENT]);
}
Expand All @@ -130,10 +130,10 @@ public function viewApplication(User $user, User $target): bool

return $target->workshops
->intersect($user->applicationCommitteWorkshops)
->count()>0
->count() > 0
|| $target->workshops
->intersect($user->roleWorkshops)
->count()>0;
->count() > 0;
}

/**
Expand Down Expand Up @@ -163,6 +163,7 @@ public function editApplicationStatus(User $user): bool
Role::SECRETARY,
Role::DIRECTOR,
Role::WORKSHOP_LEADER,
Role::STUDENT_COUNCIL => Role::STUDENT_COUNCIL_LEADERS
]);
}

Expand Down
28 changes: 14 additions & 14 deletions resources/views/auth/application/application.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

<div class="card-title">{{ $user->name }}</div>
<p style="margin-bottom: 5px"><a href="mailto:{{ $user->email }}">{{ $user->email }}</a></p>
<p style="margin-bottom: 5px">{{ $user->personalInformation->phone_number }}</p>
<p style="margin-bottom: 5px">{{ $user->personalInformation?->phone_number }}</p>
<p style="margin-bottom: 5px">
@forelse($user->educationalInformation?->studyLines ?? [] as $studyLine)
@if($studyLine->end == null)
Expand Down Expand Up @@ -67,50 +67,50 @@
<tr>
<th scope="row">@lang('user.place_and_date_of_birth')</th>
<td>
{{ $user->personalInformation->place_of_birth }}
{{ $user->personalInformation->date_of_birth }}
{{ $user->personalInformation?->place_of_birth }}
{{ $user->personalInformation?->date_of_birth }}
</td>
</tr>
<tr>
<th scope="row">@lang('user.mothers_name')</th>
<td>
{{ $user->personalInformation->mothers_name }}
{{ $user->personalInformation?->mothers_name }}
</td>
</tr>
<tr>
<th scope="row">@lang('user.address')</th>
<td>
{{ $user->personalInformation->country }},
{{ $user->personalInformation->county }}
{{ $user->personalInformation?->country }},
{{ $user->personalInformation?->county }}
<br>
{{ $user->personalInformation->zip_code }} {{ $user->personalInformation->city }},
{{ $user->personalInformation->street_and_number }}
{{ $user->personalInformation?->zip_code }} {{ $user->personalInformation?->city }},
{{ $user->personalInformation?->street_and_number }}
</td>
</tr>
@if($user->educationalInformation)
<tr>
<th scope="row">@lang('user.high_school')</th>
<td>
{{ $user->educationalInformation->high_school }}<br>
@if(!$user->educationalInformation->high_school)
{{ $user->educationalInformation?->high_school }}<br>
@if(!$user->educationalInformation?->high_school)
<span style="font-style:italic;color:red">hiányzó adat</span>
@endif
</td>
</tr>
<tr>
<th scope="row">@lang('user.neptun')</th>
<td>
{{ $user->educationalInformation->neptun }}
@if(!$user->educationalInformation->neptun)
{{ $user->educationalInformation?->neptun }}
@if(!$user->educationalInformation?->neptun)
<span style="font-style:italic;color:red">hiányzó adat</span>
@endif
</td>
</tr>
<tr>
<th scope="row">@lang('user.educational-email')</th>
<td>
{{ $user->educationalInformation->email }}
@if(!$user->educationalInformation->email)
{{ $user->educationalInformation?->email }}
@if(!$user->educationalInformation?->email)
<span style="font-style:italic;color:red">hiányzó adat</span>
@endif
</td>
Expand Down
4 changes: 2 additions & 2 deletions resources/views/auth/application/applications.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<p>A jelentkezők aktuális státusza a jelentkezők számára nem nyilvános.</p>
@endcan
@can('finalizeApplicationProcess', \App\Models\User::class)
<p>{{$applicationDeadline->addWeeks(2)->format('Y. m. d.')}} után lehet a lap alján felvenni a kiválasztott jelentkezőket, ezzel véglegesíteni a felvételit.</p>
<p>{{$applicationDeadline->addWeeks(1)->format('Y. m. d.')}} után lehet a lap alján felvenni a kiválasztott jelentkezőket, ezzel véglegesíteni a felvételit.</p>
@endcan
</blockquote>

Expand All @@ -56,7 +56,7 @@
<hr>
<h6>Összesen: <b class="right">{{$applications->count()}} jelentkező</b></h6>
@can('finalizeApplicationProcess', \App\Models\User::class)
@if($applicationDeadline->addWeeks(2) < now())
@if($applicationDeadline->addWeeks(1) < now())
<div class="card" style="margin-top:20px">
<div class="card-content">
<div class="row" style="margin:0">
Expand Down

0 comments on commit a5c9f85

Please sign in to comment.