Skip to content

Commit 840f981

Browse files
committed
fix: info and achievement section
1 parent a540691 commit 840f981

File tree

5 files changed

+21
-37
lines changed

5 files changed

+21
-37
lines changed

app/Http/Requests/UpdateAchievementRequest.php

+1-8
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,6 @@
66

77
class UpdateAchievementRequest extends FormRequest
88
{
9-
/**
10-
* Determine if the user is authorized to make this request.
11-
*/
12-
public function authorize(): bool
13-
{
14-
return auth()->user() !== null;
15-
}
169

1710
/**
1811
* Get the validation rules that apply to the request.
@@ -24,7 +17,7 @@ public function rules(): array
2417
return [
2518
'user' => 'required',
2619
'total_user' => 'required',
27-
'image' => '|nullable|required',
20+
'image' => 'nullable',
2821
];
2922
}
3023
}

resources/views/backend/info/editInfo.blade.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
<x-backend.form.select-input id="section" label="Section" name="section"
1818
placeholder="Choose Section..." onchange="getSectionTitle(this)">
1919
{{-- <option selected disabled>Choose Section...</option> --}}
20-
<option value="1" {{ $info->section_id === 1 ? 'selected' : '' }}>Section 1</option>
21-
<option value="2" {{ $info->section_id === 2 ? 'selected' : '' }}>Section 2</option>
20+
<option value="1" @selected($info->section_id == 1)>Section 1</option>
21+
<option value="2" @selected($info->section_id == 2)>Section 2</option>
2222
</x-backend.form.select-input>
2323
</div>
2424
<div class="col-md-6">

resources/views/components/frontend/achievements.blade.php

+10-14
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,16 @@
55
<div class="col-sm-6 col-md-4 col-xl-3 mb-1 px-2 align-items-center justify-content-center">
66
<div class="px-1 bg-primary rounded">
77
<div class="card rounded">
8-
<div class="row" style="height: 8rem;">
9-
<div class="col-6 ps-2 pe-0" style="height: 100%">
10-
<img loading="lazy" class="rounded-start ps-1" style="width:100%;height:100%;"
11-
src="{{ useImage($item->image) }}" alt="">
12-
</div>
13-
<div class="col-6 ps-0 pe-2 flex items-center justify-center">
14-
<div>
15-
<p
16-
class="m-0 fw-medium mt-2 text-center text-primary whitespace-nowrap text-ellipsis">
17-
{{ $item->title }}</p>
18-
<h2 class="counter-up m-0 text-primary text-center"
19-
style="font-size: 32px; font-weight: 700;">
20-
{{ $item->count }}</h2>
21-
</div>
8+
<div class="grid grid-cols-5 gap-3" style="height: 8rem;">
9+
<img loading="lazy" class="rounded-l-sm col-span-2 object-cover" style="width:100%; height:100%;"
10+
src="{{ useImage($item->image) }}" alt="">
11+
<div class="col-span-3 flex flex-col w-full items-center justify-center pr-3">
12+
<div
13+
class="fw-medium text-center text-primary whitespace-nowrap text-ellipsis overflow-hidden w-full">
14+
{{ $item->title }}</div>
15+
<h2 class="counter-up m-0 text-primary text-center"
16+
style="font-size: 32px; font-weight: 700;">
17+
{{ $item->count }}</h2>
2218
</div>
2319
</div>
2420
</div>
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
<div class="d-flex flex-column align-items-center mx-4 my-2">
2-
<img loading="lazy" class="rounded" style="max-width: 100px;" src="{{ useImage($info->image_url) }}" alt="info-image{{ $info->id }}" loading="lazy">
3-
<p class="mt-3 mb-2" style="text-align: justify;max-width:260px;">
1+
<div class="d-flex flex-column align-items-center w-full">
2+
<img loading="lazy" class="rounded object-cover w-[120px] h-[90px]" src="{{ useImage($info->image_url) }}" alt="info-image{{ $info->id }}" loading="lazy">
3+
<div class="mt-3 mb-2">
44
{!! $info->description !!}
5-
</p>
5+
</div>
66
</div>

resources/views/components/frontend/info-section.blade.php

+4-9
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,9 @@
22
$title = $attributes->get('title');
33
@endphp
44
<section class="mt-5 mb-2 px-5 py-2">
5-
<div>
6-
<h2 {{ $attributes->merge(['class' => 'text-uppercase text-center mb-5']) }}
7-
style="font-size: 28px; font-weight: 800;">{!! $title !!}</h2>
8-
<div class="d-flex align-items-center justify-content-center" style="flex-wrap: wrap;">
9-
{!! $slot !!}
10-
</div>
11-
</div>
12-
<div>
13-
5+
<h2 {{ $attributes->merge(['class' => 'text-uppercase text-center mb-5']) }}
6+
style="font-size: 28px; font-weight: 800;">{!! $title !!}</h2>
7+
<div class="grid gap-4 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 items-center justify-center">
8+
{!! $slot !!}
149
</div>
1510
</section>

0 commit comments

Comments
 (0)