Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugs bugs bugs 2 #7

Draft
wants to merge 7 commits into
base: master
Choose a base branch
from
2 changes: 1 addition & 1 deletion app/Http/Controllers/HomeController.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public function __construct(
*/
public function index(): View
{
$categories = $this->categoryService->getHomepageListQuery()->get();
$categories = $this->categoryService->getHomepageListQuery()->get()->reverse();
$news = $this->newsService->getNewsListQuery()->limit(3)->get();

return \view('home.intro', \compact('categories', 'news'));
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Requests/Api/Order/CreateOrderRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public function rules(?string $orderType = null): array
];

$typeSpecificRules = [
'students' => 'required|integer|min:1',
'students' => 'required|integer|min:0',
'age' => 'required|string|max:30',
'adults' => 'required|integer|min:1',
];
Expand Down
13 changes: 8 additions & 5 deletions app/Http/Requests/Student/UpdateStudentRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ public function rules(?Term $term = null): array
$term = $this->route()->student->term;
$rules = parent::rules($term);

unset($rules['forename']);
unset($rules['surname']);
// unset($rules['forename']);
// unset($rules['surname']);
unset($rules['terms_conditions']);

return $rules;
Expand All @@ -31,9 +31,12 @@ public function getData(bool $addTerm = false): array
{
$data = parent::getData($addTerm);

unset($data['term_id']);
unset($data['forename']);
unset($data['surname']);
if ($data['term_id'] === null) {
unset($data['term_id']);
}

// unset($data['forename']);
// unset($data['surname']);

return $data;
}
Expand Down
6 changes: 6 additions & 0 deletions resources/views/admin/terms/list.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@
data: "flag",
render: CzechitasApp.datatables.getRenderer('flag', $(".flag_change_template")),
},
{
targets: 3,
render: function (data, type, row, meta) {
return data+5;
}
},
{
targets: 4,
data: "id",
Expand Down
2 changes: 1 addition & 1 deletion resources/views/admin/users/show.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
</tr>
<tr>
<td>@lang('users.form.role'):</td>
<td>{{ trans('users.role.'.$user->role) }}</td>
<td>{{ trans('users.role.master') }}</td>
</tr>
<tr>
<td>@lang('users.form.created_at'):</td>
Expand Down
8 changes: 4 additions & 4 deletions resources/views/layouts/__top_navigation.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
</a>
@endif
@endif
@if (Auth::user() == null || Auth::user()->isRoleParent())
{{-- @if (Auth::user() == null || Auth::user()->isRoleParent()) --}}
<div class="nav-item dropdown">
<a class="nav-link dropdown-toggle {{ Route::is('static.parents') ? 'active' : null }}" href="{{ route('static.parents') }}" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
@lang('app.menu.parents')
Expand All @@ -29,8 +29,8 @@
<a class="dropdown-item" href="{{ route('students.create') }}">@lang('app.menu.application')</a>
</div>
</div>
@endif
@if (Auth::user() == null)
{{-- @endif --}}
{{-- @if (Auth::user() == null) --}}
<div class="nav-item dropdown">
<a class="nav-link dropdown-toggle{{ Route::is(['static.teachers', 'orders.create']) ? ' active' : null }}" href="{{ route('static.teachers') }}" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
@lang('app.menu.teachers')
Expand All @@ -40,7 +40,7 @@
<a class="dropdown-item {{ Route::is('orders.create') ? 'active' : null }}" href="{{ route('orders.create') }}">@lang('app.menu.teachers_order')</a>
</div>
</div>
@endif
{{-- @endif --}}
<a class="nav-item nav-link {{ Route::is('static.contact') ? 'active' : null }}" href="{{ route('static.contact') }}">
@lang('app.menu.contact')
</a>
Expand Down
2 changes: 1 addition & 1 deletion resources/views/students/create.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@
<tr class="configurable" data-part="select_payment">
<td>@lang('students.form.payment'):</td>
<td>
@foreach (\CzechitasApp\Models\Enums\StudentPaymentType::getAvailableValues() as $paymentType)
@foreach (['transfer', 'cash'] as $paymentType)
<span class="custom-control custom-radio{{ $errors->has('payment') ? ' is-invalid' : '' }}">
<input type="radio" id="payment_{{ $paymentType }}" name="payment" value="{{ $paymentType }}" class="custom-control-input" {{ oldChecked('payment', $paymentType) }} required>
<label class="custom-control-label" for="payment_{{ $paymentType }}">@lang('students.payments.'.$paymentType)<small class="text-muted"> - @lang("students.payments.{$paymentType}_desc")</small></label>
Expand Down