feat: ✨ implement CRUD stickies

This commit is contained in:
Corentin Huet 2026-03-05 10:35:06 +01:00
parent f52db3b50b
commit edd9028336
5 changed files with 67 additions and 1 deletions

View file

@ -277,7 +277,7 @@ class StaticPageController extends Controller
$paritySection = $sectionModels->where('section', PageSectionEnum::hire_parity)->first();
$findSection = $sectionModels->where('section', PageSectionEnum::hire_find)->first();
$carouselSectionParity = Carousel::query()->where('section_id', PageSectionEnum::hire_parity)->where('published', true)->get();
$navLinks = Sticky::query()->where('type', StaticPageType::we_hire)->get();
$navLinks = Sticky::query()->where('type', StaticPageType::we_hire)->get();
return view('fo.pages.hire', \compact(
'staticPageModel',

View file

@ -47,4 +47,45 @@
filter: invert(1);
}
}
.we-hire-navigation {
@include media-breakpoint-up(md) {
position: fixed;
z-index: 10;
bottom: 4rem;
left: 4rem;
max-width: 15rem;
&-wrapper {
height: 0;
opacity: 0;
transform: translateY(25%);
transition: .3s;
visibility: hidden;
&.show {
height: auto;
opacity: 1;
transform: translateY(0);
visibility: visible;
}
}
}
.col-md-12 {
@include media-breakpoint-up(md) {
width: fit-content;
}
.badge {
width: .5rem;
height: .5rem;
@include media-breakpoint-up(md) {
width: 1rem;
height: 1rem;
}
}
}
}
}

View file

@ -21,5 +21,9 @@ import "./base/sticky";
// PAGES
import "./pages/unveil";
<<<<<<< HEAD
import "./pages/site";
=======
import "./pages/we-hire";
>>>>>>> ed349bc (feat: :sparkles: implement CRUD stickies)

View file

@ -0,0 +1,17 @@
document.addEventListener("DOMContentLoaded", function () {
const weHire = document.querySelector("section.we-hire");
if (weHire === null) {
return;
}
const button = document.querySelector(".we-hire-navigation .btn") as HTMLButtonElement;
const navWrapper = document.querySelectorAll(".we-hire-navigation-wrapper ");
button.addEventListener("click", () => {
navWrapper.forEach((element: Element) => {
element.classList.toggle("show");
});
document.querySelectorAll(".we-hire-navigation .btn svg").forEach(icon => {
icon.classList.toggle("d-none");
});
});
});

View file

@ -53,7 +53,11 @@
</fieldset>
</div>
{{-- ANCHOR --}}
<<<<<<< HEAD
@can('create', \App\Models\Sticky::class)
=======
@can('view', \App\Models\Sticky::class)
>>>>>>> ed349bc (feat: :sparkles: implement CRUD stickies)
<div class="col-12 col-md-6 mb-3">
<fieldset class="h-100 border p-3">
<legend>{{ Str::ucfirst(__('validation.custom.anchor')) }}</legend>