Compare commits

..

No commits in common. '738e8d78355f157a0098f753f17ed535322899ef' and 'ddb5b346f2c0c4f74a4883ee950386f190944f1f' have entirely different histories.

@ -50,7 +50,7 @@ php artisan seeding:prepare
``` ```
- Seeding image for models: [Group, Category, Post, Product, Slider] - Seeding image for models: [Group, Category, Post, Product, Slider]
```bash ```bash
php artisan seeding:image Product digital pa seeding:image Product digital
``` ```
> First parameter is Model, Second is image seeder directory available [bag, clothe, digital, sport, posts, makeup] > First parameter is Model, Second is image seeder directory available [bag, clothe, digital, sport, posts, makeup]
> You can create your directory and put your image into new directory then use image seeder > You can create your directory and put your image into new directory then use image seeder

@ -177,12 +177,7 @@ class ClientController extends Controller
{ {
$tag = Tag::where('slug->' . config('app.locale'), 'like', $slug)->first(); $tag = Tag::where('slug->' . config('app.locale'), 'like', $slug)->first();
$posts = Post::withAnyTags([$tag])->where('status', 1)->paginate(100); return $tag;
$products = Product::withAnyTags([$tag])->where('status', 1)->paginate(100);
$clips = Clip::withAnyTags([$tag])->where('status', 1)->paginate(100);
$title = __('Tag') . ': ' . $tag->name;
$subtitle = '';
return view('client.tag', compact('tag', 'posts', 'products', 'clips', 'title', 'subtitle'));
} }
@ -228,28 +223,7 @@ class ClientController extends Controller
public function search(Request $request) public function search(Request $request)
{ {
$q = trim($request->input('q'));
if (mb_strlen($q) < 3) {
return abort(403, __('Search word is too short'));
}
$q = '%'.$q.'%';
$posts = Post::where('status', 1)->where(function($query) use ($q) {
$query->where('title', 'LIKE', $q)
->orWhere('subtitle', 'LIKE', $q)
->orWhere('body', 'LIKE', $q);
})->paginate(100);
$products = Product::where('status', 1)->where(function($query) use ($q) {
$query->where('name', 'LIKE', $q)
->orWhere('excerpt', 'LIKE', $q)
->orWhere('description', 'LIKE', $q);
})->paginate(100);
$clips = Clip::where('status', 1)->where(function($query) use ($q) {
$query->where('title', 'LIKE', $q)
->orWhere('body', 'LIKE', $q);
})->paginate(100);
$title = __('Search for') . ': ' . $request->input('q');
$subtitle = '';
return view('client.tag', compact('posts', 'products', 'clips', 'title', 'subtitle'));
} }
public function group($slug) public function group($slug)
@ -426,6 +400,10 @@ class ClientController extends Controller
} }
public function compare() public function compare()
{ {
$area = 'compare'; $area = 'compare';
@ -435,7 +413,6 @@ class ClientController extends Controller
$products = Product::whereIn('id', $ids)->where('status', 1)->get(); $products = Product::whereIn('id', $ids)->where('status', 1)->get();
return view('client.default-list', compact('area', 'products', 'title', 'subtitle')); return view('client.default-list', compact('area', 'products', 'title', 'subtitle'));
} }
public function contact() public function contact()
{ {
$area = 'contact-us'; $area = 'contact-us';
@ -443,7 +420,6 @@ class ClientController extends Controller
$subtitle = ''; $subtitle = '';
return view('client.default-list', compact('area', 'title', 'subtitle')); return view('client.default-list', compact('area', 'title', 'subtitle'));
} }
public function sendContact(ContactSubmitRequest $request) public function sendContact(ContactSubmitRequest $request)
{ {
$con = new Contact(); $con = new Contact();

@ -27,7 +27,6 @@ class Clip extends Model
return \Storage::url('cover/optimized-' . $this->cover); return \Storage::url('cover/optimized-' . $this->cover);
} }
public function imgOriginalUrl() public function imgOriginalUrl()
{ {
if ($this->cover == null) { if ($this->cover == null) {
@ -51,13 +50,11 @@ class Clip extends Model
return $this->belongsTo(\App\Models\User::class); return $this->belongsTo(\App\Models\User::class);
} }
public function attachs() public function attachs(){
{
return $this->morphMany(Attachment::class,'attachable'); return $this->morphMany(Attachment::class,'attachable');
} }
public function webUrl() public function webUrl(){
{
return fixUrlLang(route('client.clip',$this->slug)); return fixUrlLang(route('client.clip',$this->slug));
} }
@ -72,8 +69,7 @@ class Clip extends Model
return $this->morphMany(Comment::class, 'commentable')->where('status', 1); return $this->morphMany(Comment::class, 'commentable')->where('status', 1);
} }
public function markup() public function markup(){
{
$app = config('app.name'); $app = config('app.name');
$logo = asset('upload/images/logo.png'); $logo = asset('upload/images/logo.png');
@ -110,8 +106,7 @@ RESULT;
} }
public function tagsList() public function tagsList(){
{
if ($this->tags()->count() == 0){ if ($this->tags()->count() == 0){
return getSetting('keyword'); return getSetting('keyword');
}else{ }else{

@ -106,13 +106,11 @@ class Post extends Model implements HasMedia
return $this->morphMany(Comment::class, 'commentable'); return $this->morphMany(Comment::class, 'commentable');
} }
public function mainGroup() public function mainGroup(){
{
return $this->belongsTo(Group::class,'group_id'); return $this->belongsTo(Group::class,'group_id');
} }
public function attachs() public function attachs(){
{
return $this->morphMany(Attachment::class,'attachable'); return $this->morphMany(Attachment::class,'attachable');
} }
@ -132,14 +130,12 @@ class Post extends Model implements HasMedia
// ]; // ];
// } // }
public function webUrl() public function webUrl(){
{
return fixUrlLang(route('client.post',$this->slug)); return fixUrlLang(route('client.post',$this->slug));
} }
public function markup() public function markup(){
{
$type = 'BlogPosting'; $type = 'BlogPosting';
if (strpos(strtolower(implode(',',$this->groups()->pluck('name')->toArray())),__('article')) !== false){ if (strpos(strtolower(implode(',',$this->groups()->pluck('name')->toArray())),__('article')) !== false){
$type = 'Article'; $type = 'Article';
@ -188,8 +184,7 @@ RESULT;
} }
public function tagsList() public function tagsList(){
{
if ($this->tags()->count() == 0){ if ($this->tags()->count() == 0){
return getSetting('keyword'); return getSetting('keyword');
}else{ }else{

@ -315,7 +315,6 @@ class Product extends Model implements HasMedia
return number_format($price) . ' ' . config('app.currency.symbol'); return number_format($price) . ' ' . config('app.currency.symbol');
} }
public function oldPricePure() public function oldPricePure()
{ {
$price = 0; $price = 0;
@ -331,7 +330,6 @@ class Product extends Model implements HasMedia
return $price; return $price;
} }
public function oldPrice() public function oldPrice()
{ {
$price = 0; $price = 0;
@ -348,8 +346,7 @@ class Product extends Model implements HasMedia
return number_format($price) . ' ' . config('app.currency.symbol'); return number_format($price) . ' ' . config('app.currency.symbol');
} }
public function isFav() public function isFav(){
{
if (!auth('customer')->check()) { if (!auth('customer')->check()) {
return -1; return -1;
} }
@ -360,8 +357,7 @@ class Product extends Model implements HasMedia
} }
} }
public function isAvailable() public function isAvailable(){
{
if ($this->stock_quantity == 0){ if ($this->stock_quantity == 0){
return false; return false;
} }
@ -372,8 +368,7 @@ class Product extends Model implements HasMedia
return true; return true;
} }
public function markup() public function markup(){
{
$currency = config('app.currency.code'); $currency = config('app.currency.code');
@ -432,8 +427,7 @@ RESULT;
} }
public function tagsList() public function tagsList(){
{
if ($this->tags()->count() == 0){ if ($this->tags()->count() == 0){
return getSetting('keyword'); return getSetting('keyword');
}else{ }else{

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 696 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 618 B

@ -1,12 +1,11 @@
document.addEventListener('DOMContentLoaded', function () { document.addEventListener('DOMContentLoaded', function () {
if (document.querySelectorAll('.tab-control a').length > 0) { if (document.querySelectorAll('.tab-control a').length > 0) {
document.querySelectorAll('.tab-control a')?.forEach(function (el) { document.querySelectorAll('.tab-control a')?.forEach(function (el) {
el.addEventListener('click', function () { el.addEventListener('click', function () {
try { try {
document.querySelector('.tab-control a.active').classList.remove('active'); document.querySelector('.tab-control a.active').classList.remove('active');
this.classList.add('active'); this.classList.add('active');
document.querySelector('.tab.active,.tab-content.active').classList.remove('active'); document.querySelector('.tab.active').classList.remove('active');
document.querySelector(this.getAttribute('href')).classList.add('active'); document.querySelector(this.getAttribute('href')).classList.add('active');
} catch { } catch {
} }

@ -274,17 +274,8 @@ export default {
}, },
initMap() { initMap() {
if (!import.meta.env.DEV){
L.Icon.Default.mergeOptions({
iconRetinaUrl: "/assets/vendor/leaflet/marker-icon-2x.png",
iconUrl: "/assets/vendor/leaflet/marker-icon.png",
shadowUrl: "/assets/vendor/leaflet/marker-shadow.png"
});
}
this.map = L.map(this.$refs.mapContainer).setView([35.83266000, 50.99155000], 10); this.map = L.map(this.$refs.mapContainer).setView([35.83266000, 50.99155000], 10);
L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
attribution: '&copy; openstreetmap', attribution: '&copy; openstreetmap',
attributionControl: false, attributionControl: false,

@ -274,16 +274,6 @@ export default {
}, },
initMap() { initMap() {
if (!import.meta.env.DEV){
L.Icon.Default.mergeOptions({
iconRetinaUrl: "/assets/vendor/leaflet/marker-icon-2x.png",
iconUrl: "/assets/vendor/leaflet/marker-icon.png",
shadowUrl: "/assets/vendor/leaflet/marker-shadow.png"
});
}
this.map = L.map(this.$refs.mapContainer).setView([35.83266000, 50.99155000], 10); this.map = L.map(this.$refs.mapContainer).setView([35.83266000, 50.99155000], 10);
L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {

@ -70,14 +70,6 @@ export default {
}, },
methods: { methods: {
initMap() { initMap() {
if (!import.meta.env.DEV){
L.Icon.Default.mergeOptions({
iconRetinaUrl: "/assets/vendor/leaflet/marker-icon-2x.png",
iconUrl: "/assets/vendor/leaflet/marker-icon.png",
shadowUrl: "/assets/vendor/leaflet/marker-shadow.png"
});
}
this.map = L.map(this.$refs.mapContainer).setView([this.lat, this.lng], this.zoom); this.map = L.map(this.$refs.mapContainer).setView([this.lat, this.lng], this.zoom);
L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {

@ -127,38 +127,3 @@ body {
color: var(--xshop-diff2); color: var(--xshop-diff2);
} }
} }
.tag-page{
min-height: 60vh;
.tab-control{
padding-left: 12px;
padding-right: 12px;
}
.tab-control a.active{
background: var(--xshop-primary);
color: var(--xshop-diff);
}
.tab-content{
background: transparent;
}
}
.tab-content {
display: none;
padding: 1rem;
background: var(--karen-tab-bg-color,#ffffff);
&.active {
display: block;
}
}
.x64-img{
width: 64px;
height: 64px;
object-fit: cover;
}

@ -1,101 +0,0 @@
@extends('website.inc.website-layout')
@section('title')
{{$title}} - {{config('app.name')}}
@endsection
@section('content')
@foreach(getParts('default_header') as $part)
@php($p = $part->getBladeWithData())
@include($p['blade'],['data' => $p['data']])
@endforeach
<div class="{{gfx()['container']}} content tag-page">
<div class="tab-control">
<div class="row text-center">
<a class="col-md py-2 active" href="#posts">
{{__("Posts")}} ({{count($posts)}})
</a>
<a class="col-md py-2" href="#products">
{{__("Products")}} ({{count($products)}})
</a>
<a class="col-md py-2" href="#clips">
{{__("Video clips")}} ({{count($clips)}})
</a>
</div>
</div>
<div>
<div class="tab-content active px-0" id="posts">
@if(count($posts) == 0)
<div class="alert alert-info">
{{__("There is nothing to show!")}}
</div>
@else
<ul class="list-group">
@foreach($posts as $post)
<li class="list-group-item">
<img src="{{$post->imgUrl()}}" class="float-start x64-img me-2" alt="">
<h6>
<a href="{{$post->webUrl()}}">
{{$post->title}}
</a>
</h6>
<p class="text-muted">
{{$post->subtitle}}
</p>
</li>
@endforeach
</ul>
@endif
</div>
<div class="tab-content px-0" id="products">
@if(count($products) == 0)
<div class="alert alert-info">
{{__("There is nothing to show!")}}
</div>
@else
<ul class="list-group">
@foreach($products as $product)
<li class="list-group-item">
<img src="{{$product->thumbUrl()}}" class="float-start x64-img me-2" alt="">
<h6>
<a href="{{$product->webUrl()}}">
{{$product->name}}
</a>
</h6>
<p class="text-muted">
{{$product->excerpt}}
</p>
</li>
@endforeach
</ul>
@endif
</div>
<div class="tab-content px-0" id="clips">
@if(count($clips) == 0)
<div class="alert alert-info">
{{__("There is nothing to show!")}}
</div>
@else
<ul class="list-group">
@foreach($clips as $clip)
<li class="list-group-item">
<img src="{{$clip->imgUrl()}}" class="float-start x64-img me-2" alt="">
<h6>
<a href="{{$clip->webUrl()}}">
{{$clip->title}}
</a>
</h6>
<p class="text-muted">
{{Str::limit(strip_tags($clip->body))}}
</p>
</li>
@endforeach
</ul>
@endif
</div>
</div>
</div>
@foreach(getParts('default_footer') as $part)
@php($p = $part->getBladeWithData())
@include($p['blade'],['data' => $p['data']])
@endforeach
@endsection

@ -3,15 +3,6 @@ import L from 'leaflet';
var map,marker ; var map,marker ;
window.addEventListener('load',function () { window.addEventListener('load',function () {
// delete L.icon.default.prototype._getIconUrl ;
if (!import.meta.env.DEV){
L.Icon.Default.mergeOptions({
iconRetinaUrl: "/assets/vendor/leaflet/marker-icon-2x.png",
iconUrl: "/assets/vendor/leaflet/marker-icon.png",
shadowUrl: "/assets/vendor/leaflet/marker-shadow.png"
});
}
if (document.querySelectorAll('#mapContainer').length != 0) {
const lat = parseFloat(document.querySelector('#maplat').value); const lat = parseFloat(document.querySelector('#maplat').value);
const lng = parseFloat(document.querySelector('#maplng').value); const lng = parseFloat(document.querySelector('#maplng').value);
const zoom = parseInt(document.querySelector('#mapzoom').value); const zoom = parseInt(document.querySelector('#mapzoom').value);
@ -29,5 +20,4 @@ window.addEventListener('load',function () {
} }
marker = L.marker({lat: lat, lng: lng}).addTo(map); marker = L.marker({lat: lat, lng: lng}).addTo(map);
}
}); });

@ -2,9 +2,9 @@
<h4> <h4>
{{__("Search")}} {{__("Search")}}
</h4> </h4>
<form action="{{route('client.search')}}" class="side-data"> <form action="">
<div class="input-group mb-3"> <div class="input-group mb-3">
<input type="search" name="q" class="form-control" placeholder="{{__('Search')}}..."> <input type="search" class="form-control" placeholder="{{__('Search')}}...">
<button class="btn btn-outline-secondary" type="submit" id="button-addon2"> <button class="btn btn-outline-secondary" type="submit" id="button-addon2">
<i class="ri-search-2-line"></i> <i class="ri-search-2-line"></i>
</button> </button>

@ -2,9 +2,9 @@
<h4> <h4>
{{__("Search")}} {{__("Search")}}
</h4> </h4>
<form action="{{route('client.search')}}" class="side-data"> <form action="">
<div class="input-group mb-3"> <div class="input-group mb-3">
<input type="search" name="q" class="form-control" placeholder="{{__('Search')}}..."> <input type="search" class="form-control" placeholder="{{__('Search')}}...">
<button class="btn btn-outline-secondary" type="submit" id="button-addon2"> <button class="btn btn-outline-secondary" type="submit" id="button-addon2">
<i class="ri-search-2-line"></i> <i class="ri-search-2-line"></i>
</button> </button>

@ -2,9 +2,9 @@
<h4> <h4>
{{__("Search")}} {{__("Search")}}
</h4> </h4>
<form action="{{route('client.search')}}" class="side-data"> <form action="">
<div class="input-group mb-3"> <div class="input-group mb-3">
<input type="search" name="q" class="form-control" placeholder="{{__('Search')}}..."> <input type="search" class="form-control" placeholder="{{__('Search')}}...">
<button class="btn btn-outline-secondary" type="submit" id="button-addon2"> <button class="btn btn-outline-secondary" type="submit" id="button-addon2">
<i class="ri-search-2-line"></i> <i class="ri-search-2-line"></i>
</button> </button>

@ -160,5 +160,13 @@
background: var(--xshop-primary); background: var(--xshop-primary);
transition: left 0.3s ease, width 0.3s ease; transition: left 0.3s ease, width 0.3s ease;
} }
.tab-content {
display: none;
padding: 1rem;
background: var(--karen-tab-bg-color,#ffffff);
}
.tab-content.active {
display: block;
}
} }

@ -3,9 +3,9 @@
<h4> <h4>
{{__("Search")}} {{__("Search")}}
</h4> </h4>
<form action="{{route('client.search')}}" class="side-data"> <form action="" class="side-data">
<div class="input-group mb-3"> <div class="input-group mb-3">
<input type="search" name="q" class="form-control" placeholder="{{__('Search')}}..."> <input type="search" class="form-control" placeholder="{{__('Search')}}...">
<button class="btn btn-outline-secondary" type="submit" id="button-addon2"> <button class="btn btn-outline-secondary" type="submit" id="button-addon2">
<i class="ri-search-2-line"></i> <i class="ri-search-2-line"></i>
</button> </button>

Loading…
Cancel
Save