Refactor course finder and resources templates for improved readability and functionality

- Updated course finder form to use HTML helper methods for cleaner syntax.
- Enhanced form structure with better class management and attributes.
- Implemented AJAX pagination for course listings to improve user experience.
- Cleaned up resource template code for consistency and readability.
- Ensured proper indentation and spacing for better maintainability.
- Added missing target="_blank" attribute for external links in resource documents.
This commit is contained in:
2025-08-03 18:01:22 +05:45
parent 5e4cb2767c
commit afc7c61f86
5 changed files with 582 additions and 450 deletions

View File

@@ -1,6 +1,5 @@
@extends('client.raffles.layouts.app')
@section('content')
<div class="about-banner">
</div>
<section class="container py-30 free-resources">
@@ -26,7 +25,8 @@
data-bs-toggle="collapse" data-bs-parent="#accordion-questions"
href="index.php#collapse-question-item-1" aria-expanded="false"
aria-controls="collapse-question-item-1">
<img class="w-40" src="{{asset('raffles/assets/images/icons/one.svg')}}" alt="">
<img class="w-40" src="{{ asset('raffles/assets/images/icons/one.svg') }}"
alt="">
<h5 class="text-16 p-0 m-0">Countries</h5>
</a>
</h4>
@@ -36,12 +36,12 @@
data-bs-parent="#accordion-questions" role="tabpanel"
aria-labelledby="heading-question-1">
@foreach($countries as $country)
<div class="accordion-content text-16 leading-20 text-black bg-white px-10 flex items-center gap-10"
onclick="showTab('tab{{$country->title}}')">
<i class="fa-solid fa-angles-right text-18 text-brand"></i>
<p>{{$country->title}}</p>
</div>
@foreach ($countries as $country)
<div class="accordion-content text-16 leading-20 text-black bg-white px-10 flex items-center gap-10"
onclick="showTab('tab{{ $country->title }}')">
<i class="fa-solid fa-angles-right text-18 text-brand"></i>
<p>{{ $country->title }}</p>
</div>
@endforeach
</div>
@@ -60,7 +60,8 @@
data-bs-toggle="collapse" data-bs-parent="#accordion-questions"
href="index.php#collapse-question-item-2" aria-expanded="false"
aria-controls="collapse-question-item-2">
<img class="w-40" src="{{asset('raffles/assets/images/icons/two.svg')}}" alt="">
<img class="w-40" src="{{ asset('raffles/assets/images/icons/two.svg') }}"
alt="">
<h5 class="text-16 p-0 m-0">Language Test</h5>
</a>
</h4>
@@ -70,12 +71,12 @@
data-bs-parent="#accordion-questions" role="tabpanel"
aria-labelledby="heading-question-2">
@foreach($tests as $test)
<div class="accordion-content text-16 leading-20 text-black bg-white px-10 flex items-center gap-10"
onclick="showTab('tab{{$test->title}}')">
<i class="fa-solid fa-angles-right text-18 text-brand"></i>
<p>{{$test->title}}</p>
</div>
@foreach ($tests as $test)
<div class="accordion-content text-16 leading-20 text-black bg-white px-10 flex items-center gap-10"
onclick="showTab('tab{{ $test->title }}')">
<i class="fa-solid fa-angles-right text-18 text-brand"></i>
<p>{{ $test->title }}</p>
</div>
@endforeach
</div>
@@ -93,7 +94,9 @@
data-bs-toggle="collapse" data-bs-parent="#accordion-questions"
href="index.php#collapse-question-item-3" aria-expanded="false"
aria-controls="collapse-question-item-3">
<img class="w-40" src="{{asset('raffles/assets/images/icons/three.svg')}}" alt="">
<img class="w-40"
src="{{ asset('raffles/assets/images/icons/three.svg') }}"
alt="">
<h5 class="text-16 p-0 m-0">Support Services</h5>
</a>
</h4>
@@ -103,13 +106,13 @@
data-bs-parent="#accordion-questions" role="tabpanel"
aria-labelledby="heading-question-2">
@foreach($services as $service)
<div class="accordion-content text-16 leading-20 text-black bg-white px-10 flex items-center gap-10"
onclick="showTab('tab{{$service->title}}')">
<i class="fa-solid fa-angles-right text-18 text-brand"></i>
<p>{{$service->title}}</p>
@foreach ($services as $service)
<div class="accordion-content text-16 leading-20 text-black bg-white px-10 flex items-center gap-10"
onclick="showTab('tab{{ $service->title }}')">
<i class="fa-solid fa-angles-right text-18 text-brand"></i>
<p>{{ $service->title }}</p>
</div>
</div>
@endforeach
</div>
@@ -127,7 +130,7 @@
<div class="second-row">
<div class="tab-content active lg:w-full lg:text-end bg-center bg-contain bg-no-repeat -mt-20"
style="
background-image: url('{{asset('raffles/assets/images/demo/start-hub-1/shape-Blob.svg')}});
background-image: url('{{ asset('raffles/assets/images/demo/start-hub-1/shape-Blob.svg') }});
">
<div data-custom-animations="true"
@@ -136,8 +139,8 @@
<div class="content-inside">
<div class="w-60percent h-400 mx-auto lqd-imggrp-single relative monkey-img"
data-float="ease-in-out">
<img class="w-full h-full " src="{{asset('raffles/assets/images/general/monkey.png')}}"
alt="">
<img class="w-full h-full "
src="{{ asset('raffles/assets/images/general/monkey.png') }}" alt="">
<div class="absolute top-30 -left-20 flex gap-10 items-center">
<i class="fa-solid fa-arrow-left text-20 text-brand md:hiden"></i>
<i class="fa-solid fa-arrow-up text-20 text-brand md:bloc hidden"></i>
@@ -151,139 +154,141 @@
</div>
</div>
@foreach($countries as $country)
<div class="tab-content " id="tab{{$country->title}}">
<div data-custom-animations="true"
data-ca-options='{"animationTarget": ".content-inside", "ease": "power4.out", "initValues":{"y": "-50px", "opacity":0} , "animations":{"y": "0px", "opacity":1}}'>
@foreach ($countries as $country)
<div class="tab-content " id="tab{{ $country->title }}">
<div data-custom-animations="true"
data-ca-options='{"animationTarget": ".content-inside", "ease": "power4.out", "initValues":{"y": "-50px", "opacity":0} , "animations":{"y": "0px", "opacity":1}}'>
<div class="content-inside">
<div class="content-inside">
<h3 class="text-brand text-30 mb-30">{{$country->title}}</h3>
<h3 class="text-brand text-30 mb-30">{{ $country->title }}</h3>
<table class="">
<table class="">
@php
$countryDocs = $country->documents()->get();
@endphp
@php
$countryDocs = $country->documents()->get();
@endphp
@foreach($countryDocs as $doc)
@foreach ($countryDocs as $doc)
@php
$path = $doc->collection_name . '/' . $doc->file_path;
$full_path = Storage::disk('public')->url($path);
@endphp
@php
$path = $doc->collection_name . '/' . $doc->file_path;
$full_path = Storage::disk('public')->url($path)
@endphp
<tr>
<td class="pl-20 text-brand text-16">{{$loop->index + 1}}</td>
<td class="text-brand text-16">{{$doc->title}}</td>
<td class=" flex items-center justify-end gap-10">
<a href="{{ $full_path }}" class="link-primary fs-15" download>
<button
class="cursor-pointer px-20 py-10 bg-sec rounded-10 text-center text-white text-12 button-hover border-0">View</button>
</a>
<a href="{{ $full_path }}" class="link-primary fs-15" download>
<button
class="cursor-pointer px-20 py-10 bg-green rounded-10 text-center text-white text-12 button-hover border-0">Download</button>
</a>
</td>
</tr>
@endforeach
</table>
<tr>
<td class="pl-20 text-brand text-16">{{ $loop->index + 1 }}</td>
<td class="text-brand text-16">{{ $doc->title }}</td>
<td class=" flex items-center justify-end gap-10">
<a href="{{ $full_path }}" class="link-primary fs-15"
target="_blank">
<button
class="cursor-pointer px-20 py-10 bg-sec rounded-10 text-center text-white text-12 button-hover border-0">View</button>
</a>
<a href="{{ $full_path }}" class="link-primary fs-15"
download>
<button
class="cursor-pointer px-20 py-10 bg-green rounded-10 text-center text-white text-12 button-hover border-0">Download</button>
</a>
</td>
</tr>
@endforeach
</table>
</div>
</div>
</div>
</div>
@endforeach
@foreach($tests as $test)
<div class="tab-content " id="tab{{$test->title}}">
@foreach ($tests as $test)
<div class="tab-content " id="tab{{ $test->title }}">
<div data-custom-animations="true"
data-ca-options='{"animationTarget": ".content-inside", "ease": "power4.out", "initValues":{"y": "-50px", "opacity":0} , "animations":{"y": "0px", "opacity":1}}'>
<div data-custom-animations="true"
data-ca-options='{"animationTarget": ".content-inside", "ease": "power4.out", "initValues":{"y": "-50px", "opacity":0} , "animations":{"y": "0px", "opacity":1}}'>
<div class="content-inside">
<h3 class="text-brand text-30 mb-30">{{$test->title}}</h3>
<div class="content-inside">
<h3 class="text-brand text-30 mb-30">{{ $test->title }}</h3>
<table class="">
<table class="">
@php
$testDocs = $test->documents()->get();
@endphp
@php
$testDocs = $test->documents()->get();
@endphp
@foreach($testDocs as $docs)
@foreach ($testDocs as $docs)
@php
$paths = $docs->collection_name . '/' . $docs->file_path;
$full_paths = Storage::disk('public')->url($paths);
@endphp
@php
$paths = $docs->collection_name . '/' . $docs->file_path;
$full_paths = Storage::disk('public')->url($paths)
@endphp
<tr>
<td class="pl-20 text-brand text-16">{{ $loop->index + 1 }}</td>
<td class="text-brand text-16">{{ $docs->title }}</td>
<td class=" flex items-center gap-10 justify-end">
<a href="{{ $full_paths }}" class="link-primary fs-15 "
target="_blank">
<button
class="cursor-pointer px-20 py-10 bg-sec rounded-10 text-center text-white text-12 button-hover border-0">View</button>
</a>
<a href="{{ $full_paths }}" class="link-primary fs-15"
download>
<button
class="cursor-pointer px-20 py-10 bg-green rounded-10 text-center text-white text-12 button-hover border-0">Download</button>
</a>
</td>
</tr>
@endforeach
<tr>
<td class="pl-20 text-brand text-16">{{$loop->index + 1}}</td>
<td class="text-brand text-16">{{$docs->title}}</td>
<td class=" flex items-center gap-10 justify-end">
<a href="{{ $full_paths }}" class="link-primary fs-15" download>
<button
class="cursor-pointer px-20 py-10 bg-sec rounded-10 text-center text-white text-12 button-hover border-0">View</button>
</a>
<a href="{{ $full_paths }}" class="link-primary fs-15" download>
<button
class="cursor-pointer px-20 py-10 bg-green rounded-10 text-center text-white text-12 button-hover border-0">Download</button>
</a>
</td>
</tr>
@endforeach
</table>
</table>
</div>
</div>
</div>
</div>
@endforeach
@foreach($services as $service)
<div class="tab-content " id="tab{{$service->title}}">
@foreach ($services as $service)
<div class="tab-content " id="tab{{ $service->title }}">
<div data-custom-animations="true"
data-ca-options='{"animationTarget": ".content-inside", "ease": "power4.out", "initValues":{"y": "-50px", "opacity":0} , "animations":{"y": "0px", "opacity":1}}'>
<div data-custom-animations="true"
data-ca-options='{"animationTarget": ".content-inside", "ease": "power4.out", "initValues":{"y": "-50px", "opacity":0} , "animations":{"y": "0px", "opacity":1}}'>
<div class="content-inside">
<h3 class="text-brand text-30 mb-30">{{$service->title}}</h3>
<div class="content-inside">
<h3 class="text-brand text-30 mb-30">{{ $service->title }}</h3>
<table class="">
<table class="">
@php
$serviceDocs = $service->documents()->get();
@endphp
@php
$serviceDocs = $service->documents()->get();
@endphp
@foreach($serviceDocs as $docss)
@foreach ($serviceDocs as $docss)
@php
$pathss = $docss->collection_name . '/' . $docss->file_path;
$full_pathss = Storage::disk('public')->url($pathss);
@endphp
@php
$pathss = $docss->collection_name . '/' . $docss->file_path;
$full_pathss = Storage::disk('public')->url($pathss)
@endphp
<tr>
<td class="pl-20 text-brand text-16">{{$loop->index + 1}}</td>
<td class="text-brand text-16">{{$docss->title}}</td>
<td class=" flex items-center gap-10 justify-end">
<a href="{{ $full_pathss }}" class="link-primary fs-15" download>
<button
class="cursor-pointer px-20 py-10 bg-sec rounded-10 text-center text-white text-12 button-hover border-0">View</button>
</a>
<a href="{{ $full_pathss }}" class="link-primary fs-15" download>
<button
class="cursor-pointer px-20 py-10 bg-green rounded-10 text-center text-white text-12 button-hover border-0">Download</button>
</a>
</td>
</tr>
@endforeach
</table>
<tr>
<td class="pl-20 text-brand text-16">{{ $loop->index + 1 }}</td>
<td class="text-brand text-16">{{ $docss->title }}</td>
<td class=" flex items-center gap-10 justify-end">
<a href="{{ $full_pathss }}" class="link-primary fs-15"
target="_blank">
<button
class="cursor-pointer px-20 py-10 bg-sec rounded-10 text-center text-white text-12 button-hover border-0">View</button>
</a>
<a href="{{ $full_pathss }}" class="link-primary fs-15"
download>
<button
class="cursor-pointer px-20 py-10 bg-green rounded-10 text-center text-white text-12 button-hover border-0">Download</button>
</a>
</td>
</tr>
@endforeach
</table>
</div>
</div>
</div>
</div>
@endforeach
</div>
@@ -299,9 +304,10 @@
<div class="divider"></div>
<ul class="flex-flex-col gap-20 list-none px-0 py-20">
@foreach($countries as $country)
<li class="py-10 border-bottom text-16 text-hover"><a class="text-grey "
href="{{route('country.single', $country->slug)}}">{{$country->title}}</a></li>
@foreach ($countries as $country)
<li class="py-10 border-bottom text-16 text-hover"><a class="text-grey "
href="{{ route('country.single', $country->slug) }}">{{ $country->title }}</a>
</li>
@endforeach
</ul>