feat: add legacy PDF generation support and invoice discount fields

This commit is contained in:
I-Fun
2026-04-07 07:49:35 +07:00
parent 737ba24293
commit 0e6726b0a6
13 changed files with 710 additions and 45 deletions

View File

@@ -405,18 +405,45 @@
@if(!empty($publicShowcase))
<div class="platform-section" style="margin-top:40px;">
<div class="platform-title" style="justify-content:center;">Content Showcase</div>
@php $isCarousel = count($publicShowcase) >= 3; @endphp
@php
$isCarousel = count($publicShowcase) >= 3;
$renderShowcase = $isCarousel ? array_merge($publicShowcase, $publicShowcase) : $publicShowcase;
@endphp
@if($isCarousel)
<div class="carousel-wrapper" x-data="{
scrollPrev() { $refs.slider.scrollBy({left: -234, behavior: 'smooth'}); },
scrollNext() { $refs.slider.scrollBy({left: 234, behavior: 'smooth'}); }
scrollTimeout: null,
scrollPrev() {
const slider = this.$refs.slider;
const el = slider.lastElementChild;
const dist = el.offsetWidth + 14;
slider.insertBefore(el, slider.firstElementChild);
slider.scrollLeft += dist;
void slider.offsetWidth;
slider.scrollBy({left: -dist, behavior: 'smooth'});
},
scrollNext() {
const slider = this.$refs.slider;
const el = slider.firstElementChild;
const dist = el.offsetWidth + 14;
slider.scrollBy({left: dist, behavior: 'smooth'});
if (this.scrollTimeout) clearTimeout(this.scrollTimeout);
this.scrollTimeout = setTimeout(() => {
while (slider.scrollLeft >= slider.firstElementChild.offsetWidth + 10) {
const first = slider.firstElementChild;
const moveDist = first.offsetWidth + 14;
slider.appendChild(first);
slider.scrollLeft -= moveDist;
}
}, 400);
}
}">
<button type="button" class="carousel-btn prev" @click="scrollPrev()">&#10094;</button>
<div class="carousel-track" x-ref="slider">
<div class="carousel-track" x-ref="slider" style="overflow-anchor: none;">
@else
<div class="cards">
@endif
@foreach($publicShowcase as $item)
@foreach($renderShowcase as $item)
@php
$isUrl = ($item['file_id'] === 'url');
$file = !$isUrl ? \App\Models\MediaFile::find($item['file_id']) : null;