diff --git a/app/Models/Post.php b/app/Models/Post.php index 3b384e1..1332b66 100644 --- a/app/Models/Post.php +++ b/app/Models/Post.php @@ -74,7 +74,7 @@ class Post extends Model implements HasMedia public function orgUrl() { if ($this->getMedia()->count() > 0) { - return $this->getMedia()[$this->image_index]->getUrl(); + return $this->getMedia()->first()->getUrl(); } else { return asset('assets/upload/logo.svg'); diff --git a/resources/views/segments/posts/NoLinkImage/NoLinkImage.blade.php b/resources/views/segments/posts/NoLinkImage/NoLinkImage.blade.php new file mode 100644 index 0000000..0db10dd --- /dev/null +++ b/resources/views/segments/posts/NoLinkImage/NoLinkImage.blade.php @@ -0,0 +1,21 @@ +
part.'_dark')) dark-mode @endif'> +
+
+ + @foreach( getGroupPostsBySetting($data->area->name.'_'.$data->part.'_group',5) as $post ) +
+ +
+ @endforeach +
+
+
diff --git a/resources/views/segments/posts/NoLinkImage/NoLinkImage.js b/resources/views/segments/posts/NoLinkImage/NoLinkImage.js new file mode 100644 index 0000000..e69de29 diff --git a/resources/views/segments/posts/NoLinkImage/NoLinkImage.json b/resources/views/segments/posts/NoLinkImage/NoLinkImage.json new file mode 100644 index 0000000..a117ae6 --- /dev/null +++ b/resources/views/segments/posts/NoLinkImage/NoLinkImage.json @@ -0,0 +1,10 @@ +{ + "name": "NoLinkImage", + "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": [] +} \ No newline at end of file diff --git a/resources/views/segments/posts/NoLinkImage/NoLinkImage.php b/resources/views/segments/posts/NoLinkImage/NoLinkImage.php new file mode 100644 index 0000000..beb40a0 --- /dev/null +++ b/resources/views/segments/posts/NoLinkImage/NoLinkImage.php @@ -0,0 +1,42 @@ +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.'_dark'; + $setting->value = Group::first()->id; + $setting->size = 6; + $setting->type = 'CHECKBOX'; +// $setting->data = json_encode(['xmin' => 2, 'xmax' => 90]); + $setting->title = $part->area->name . ' ' . $part->part. ' dark mode'; + $setting->save(); + } + public static function onRemove(Part $part = null) + { + + } + public static function onMount(Part $part = null) + { + return $part; + } +} diff --git a/resources/views/segments/posts/NoLinkImage/NoLinkImage.scss b/resources/views/segments/posts/NoLinkImage/NoLinkImage.scss new file mode 100644 index 0000000..e5121c8 --- /dev/null +++ b/resources/views/segments/posts/NoLinkImage/NoLinkImage.scss @@ -0,0 +1,30 @@ +.NoLinkImage { + padding: 1rem 0; + // scss + .no-link-item{ + transition: .4s; + background: #ffffff; + padding: 5px; + border-radius: var(--xshop-border-radius); + h3{ + font-size: 20px; + margin-top: .4rem; + } + p{ + color: gray; + } + img{ + height: 64px; + } + &:hover{ + filter: grayscale(1); + } + } + + &.dark-mode{ + .no-link-item{ + background: #21252b; + color: whitesmoke; + } + } +} diff --git a/resources/views/segments/posts/NoLinkImage/screenshot.png b/resources/views/segments/posts/NoLinkImage/screenshot.png new file mode 100644 index 0000000..01499fe Binary files /dev/null and b/resources/views/segments/posts/NoLinkImage/screenshot.png differ