mirror of https://github.com/4xmen/xshop.git
parent
777a81d6f2
commit
2c090427c5
@ -0,0 +1,32 @@
|
|||||||
|
<section class='AttachmentWithPreview'>
|
||||||
|
<div class="{{gfx()['container']}}">
|
||||||
|
<h1>
|
||||||
|
{{$attachment->title}}
|
||||||
|
</h1>
|
||||||
|
<div class="alert alert-info">
|
||||||
|
{{$attachment->subtitle}}
|
||||||
|
</div>
|
||||||
|
{!! $attachment->body !!}
|
||||||
|
|
||||||
|
@if($attachment->ext == 'mp3')
|
||||||
|
<mp3player
|
||||||
|
asset="{{$attachment->url()}}"></mp3player>
|
||||||
|
@endif
|
||||||
|
@if($attachment->ext == 'mp4')
|
||||||
|
<mp4player
|
||||||
|
asset="{{$attachment->url()}}"></mp4player>
|
||||||
|
@endif
|
||||||
|
|
||||||
|
|
||||||
|
<a href="{{$attachment->tempUrl()}}" class="btn btn-lg btn-outline-primary mt-4 w-100">
|
||||||
|
<i class="ri-download-2-line"></i>
|
||||||
|
|
||||||
|
{{__("Download")}}
|
||||||
|
|
||||||
|
{{formatFileSize($attachment->size)}}
|
||||||
|
|
||||||
|
|
||||||
|
[{{$attachment->ext}}]
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</section>
|
@ -0,0 +1,10 @@
|
|||||||
|
{
|
||||||
|
"name": "AttachmentWithPreview",
|
||||||
|
"version": "1.0",
|
||||||
|
"author": "xStack",
|
||||||
|
"email": "xshop@xstack.ir",
|
||||||
|
"license": "GPL-3.0-or-later",
|
||||||
|
"url": "https:\/\/xstack.ir",
|
||||||
|
"author_url": "https:\/\/4xmen.ir",
|
||||||
|
"packages": []
|
||||||
|
}
|
@ -0,0 +1,21 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Resources\Views\Segments;
|
||||||
|
|
||||||
|
use App\Models\Part;
|
||||||
|
|
||||||
|
class AttachmentWithPreview
|
||||||
|
{
|
||||||
|
public static function onAdd(Part $part = null)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
public static function onRemove(Part $part = null)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
public static function onMount(Part $part = null)
|
||||||
|
{
|
||||||
|
return $part;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,12 @@
|
|||||||
|
.AttachmentWithPreview {
|
||||||
|
padding: 2rem 0;
|
||||||
|
h1{
|
||||||
|
font-weight: 300;
|
||||||
|
font-size: 30px;
|
||||||
|
}
|
||||||
|
|
||||||
|
p{
|
||||||
|
line-height: 2em;
|
||||||
|
text-align: justify;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,31 @@
|
|||||||
|
<section class='DenaAttachList content'>
|
||||||
|
<div class="{{gfx()['container']}}">
|
||||||
|
<h1>
|
||||||
|
{{$title}}
|
||||||
|
</h1>
|
||||||
|
<p class="text-muted">
|
||||||
|
{{getSetting($data->area->name.'_'.$data->part.'_title')}}
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<div id="dena-list">
|
||||||
|
@foreach($attachs as $attach)
|
||||||
|
<div class="dena-item">
|
||||||
|
<span class="dena-tag">
|
||||||
|
{{$attach->ext}}
|
||||||
|
</span>
|
||||||
|
<span class="dena-size">
|
||||||
|
{{formatFileSize($attach->size)}}
|
||||||
|
</span>
|
||||||
|
<h3>
|
||||||
|
<a href="{{$attach->webUrl()}}">
|
||||||
|
{{$attach->title}}
|
||||||
|
</a>
|
||||||
|
</h3>
|
||||||
|
<p class="text-muted">
|
||||||
|
{{$attach->subtitle}}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
@endforeach
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
@ -0,0 +1,10 @@
|
|||||||
|
{
|
||||||
|
"name": "DenaAttachList",
|
||||||
|
"version": "1.0",
|
||||||
|
"author": "xStack",
|
||||||
|
"email": "xshop@xstack.ir",
|
||||||
|
"license": "GPL-3.0-or-later",
|
||||||
|
"url": "https:\/\/xstack.ir",
|
||||||
|
"author_url": "https:\/\/4xmen.ir",
|
||||||
|
"packages": []
|
||||||
|
}
|
@ -0,0 +1,29 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Resources\Views\Segments;
|
||||||
|
|
||||||
|
use App\Models\Part;
|
||||||
|
use App\Models\Setting;
|
||||||
|
|
||||||
|
class DenaAttachList
|
||||||
|
{
|
||||||
|
public static function onAdd(Part $part = null)
|
||||||
|
{
|
||||||
|
$setting = new Setting();
|
||||||
|
$setting->section = 'theme';
|
||||||
|
$setting->key = $part->area->name . '_' . $part->part.'_title';
|
||||||
|
$setting->value = __("Website attachments list").' [ pdf, docx, zip, png, jpg, svg, mp4, rar, mp3 ]';
|
||||||
|
$setting->type = 'text';
|
||||||
|
$setting->size = 6;
|
||||||
|
$setting->title = $part->area->name . ' ' . $part->part;
|
||||||
|
$setting->save();
|
||||||
|
}
|
||||||
|
public static function onRemove(Part $part = null)
|
||||||
|
{
|
||||||
|
Setting::where('key',$part->area->name . '_' . $part->part.'_title')->first()?->delete();
|
||||||
|
}
|
||||||
|
public static function onMount(Part $part = null)
|
||||||
|
{
|
||||||
|
return $part;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,51 @@
|
|||||||
|
.DenaAttachList {
|
||||||
|
padding: 2rem 0;
|
||||||
|
|
||||||
|
h1 {
|
||||||
|
font-weight: 400;
|
||||||
|
font-size: 27px;
|
||||||
|
padding: .5rem 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dena-item {
|
||||||
|
position: relative;
|
||||||
|
border: 1px solid var(--xshop-primary);
|
||||||
|
box-shadow: var(--xshop-shadow);
|
||||||
|
border-radius: var(--xshop-border-radius);
|
||||||
|
padding: 1rem;
|
||||||
|
margin-bottom: .5rem;
|
||||||
|
|
||||||
|
h3{
|
||||||
|
font-size: 23px;
|
||||||
|
font-weight: 400;
|
||||||
|
}
|
||||||
|
|
||||||
|
p{
|
||||||
|
margin-bottom: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.dena-tag {
|
||||||
|
position: absolute;
|
||||||
|
inset-inline-end: 10px;
|
||||||
|
top: 10px;
|
||||||
|
background: var(--xshop-primary);
|
||||||
|
color: var(--xshop-diff);
|
||||||
|
padding: .3rem;
|
||||||
|
width: 65px;
|
||||||
|
text-align: center;
|
||||||
|
border-radius: var(--xshop-border-radius);
|
||||||
|
}
|
||||||
|
.dena-size {
|
||||||
|
position: absolute;
|
||||||
|
inset-inline-end: 10px;
|
||||||
|
bottom: 10px;
|
||||||
|
background: var(--xshop-secondary);
|
||||||
|
color: var(--xshop-diff2);
|
||||||
|
padding: .3rem;
|
||||||
|
width: 120px;
|
||||||
|
text-align: center;
|
||||||
|
border-radius: var(--xshop-border-radius);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue