mirror of https://github.com/4xmen/xshop.git
added index image post theme part
parent
a05298b15c
commit
83daefba26
@ -0,0 +1,36 @@
|
||||
<section class='PostIndexImage'>
|
||||
<div class="{{gfx()['container']}}">
|
||||
<h1>
|
||||
<a href="{{getGroupBySetting($data->area->name.'_'.$data->part.'_group')->webUrl()}}">
|
||||
{{getGroupBySetting($data->area->name.'_'.$data->part.'_group')->name}}
|
||||
</a>
|
||||
</h1>
|
||||
<p class="text-muted">
|
||||
{{getGroupBySetting($data->area->name.'_'.$data->part.'_group')->description}}
|
||||
</p>
|
||||
<div class="row">
|
||||
@foreach( getGroupPostsBySetting($data->area->name.'_'.$data->part.'_group',4) as $post )
|
||||
<div class="col-lg-3 col-md-6">
|
||||
<div class="post-img-index">
|
||||
<img src="{{$post->imgUrl()}}" alt="{{$post->title}}" class="img-fluid">
|
||||
<h3>
|
||||
{{$post->title}}
|
||||
</h3>
|
||||
<p class="text-muted">
|
||||
{{$post->subtitle}}
|
||||
</p>
|
||||
<a href="{{$post->webUrl()}}">
|
||||
{{__("Read more")}}
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@endforeach
|
||||
</div>
|
||||
<div class="py-5 text-center">
|
||||
<a href="{{getGroupBySetting($data->area->name.'_'.$data->part.'_group')->webUrl()}}" class="btn btn-outline-primary">
|
||||
{{getSetting($data->area->name.'_'.$data->part.'_btn')}}
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
@ -0,0 +1,10 @@
|
||||
{
|
||||
"name": "PostIndexImage",
|
||||
"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,43 @@
|
||||
<?php
|
||||
|
||||
namespace Resources\Views\Segments;
|
||||
|
||||
use App\Models\Group;
|
||||
use App\Models\Part;
|
||||
use App\Models\Setting;
|
||||
|
||||
class PostIndexImage
|
||||
{
|
||||
public static function onAdd(Part $part = null)
|
||||
{
|
||||
|
||||
$setting = new Setting();
|
||||
$setting->section = 'theme';
|
||||
$setting->key = $part->area->name . '_' . $part->part.'_group';
|
||||
$setting->value = Group::first()->id;
|
||||
$setting->size = 6;
|
||||
$setting->type = 'GROUP';
|
||||
// $setting->data = json_encode(['xmin' => 2, 'xmax' => 90]);
|
||||
$setting->title = $part->area->name . ' ' . $part->part. ' group';
|
||||
$setting->save();
|
||||
|
||||
$setting = new Setting();
|
||||
$setting->section = 'theme';
|
||||
$setting->key = $part->area->name . '_' . $part->part.'_btn';
|
||||
$setting->value = __("Find more");
|
||||
$setting->size = 6;
|
||||
$setting->type = 'TEXT';
|
||||
// $setting->data = json_encode(['xmin' => 2, 'xmax' => 90]);
|
||||
$setting->title = $part->area->name . ' ' . $part->part. ' button text';
|
||||
$setting->save();
|
||||
}
|
||||
public static function onRemove(Part $part = null)
|
||||
{
|
||||
Setting::where('key',$part->area->name . '_' . $part->part.'_group')->first()?->delete();
|
||||
Setting::where('key',$part->area->name . '_' . $part->part.'_btn')->first()?->delete();
|
||||
}
|
||||
public static function onMount(Part $part = null)
|
||||
{
|
||||
return $part;
|
||||
}
|
||||
}
|
@ -0,0 +1,48 @@
|
||||
.PostIndexImage {
|
||||
// scss
|
||||
h1{
|
||||
font-size: 30px;
|
||||
text-align: center;
|
||||
position: relative;
|
||||
padding: 1rem;
|
||||
&:before{
|
||||
content: ' ';
|
||||
position: absolute;
|
||||
inset-inline-start: 47%;
|
||||
inset-inline-end: 47%;
|
||||
top: 0;
|
||||
height: 4px;
|
||||
background: var(--xshop-primary);
|
||||
}
|
||||
}
|
||||
|
||||
.post-img-index{
|
||||
background: #ffffff33;
|
||||
box-shadow: var(--xshop-shadow);
|
||||
border-radius: var(--xshop-border-radius);
|
||||
padding: 1rem;
|
||||
|
||||
h3{
|
||||
font-size: 22px;
|
||||
padding: 1rem 0;
|
||||
height: 3.5em;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
|
||||
&:before{
|
||||
content: ' ';
|
||||
position: absolute;
|
||||
inset-inline-end: 5%;
|
||||
width: 15%;
|
||||
bottom: 0;
|
||||
height: 2px;
|
||||
background: var(--xshop-primary);
|
||||
}
|
||||
}
|
||||
img{
|
||||
width: 100%;
|
||||
height: 15vh;
|
||||
object-fit: cover;
|
||||
}
|
||||
}
|
||||
}
|
Binary file not shown.
After Width: | Height: | Size: 236 KiB |
Loading…
Reference in New Issue