From 578e41192dffce454837dfd6be46bdf38f394c2a Mon Sep 17 00:00:00 2001 From: miftahurrahmi Date: Wed, 26 Oct 2022 14:57:14 +0700 Subject: [PATCH 1/6] add splash screen,update seeder,fix sitetitle and favicon --- src/Controllers/HomeController.php | 17 ++++- src/Helpers/Configurations.php | 24 +++++++ src/Images/thumbnail-linky/favicon.png | Bin 0 -> 969 bytes src/Seeder/LinkyThemeConfigurationsSeeder.php | 22 ++---- src/Seeder/LinkyThemeContentsSeeder.php | 8 ++- src/resources/js/index/linky-theme.js | 64 +++++++++++++----- .../js/pages/configuration/browse.vue | 2 +- .../views/components/linky-header.blade.php | 64 +++++++++++++++--- src/resources/views/layout/app.blade.php | 8 ++- .../views/pages/landing-page.blade.php | 3 + 10 files changed, 163 insertions(+), 49 deletions(-) create mode 100644 src/Helpers/Configurations.php create mode 100644 src/Images/thumbnail-linky/favicon.png diff --git a/src/Controllers/HomeController.php b/src/Controllers/HomeController.php index 29e9b71..6548579 100644 --- a/src/Controllers/HomeController.php +++ b/src/Controllers/HomeController.php @@ -2,12 +2,27 @@ namespace Uasoft\Badaso\Theme\LinkyTheme\Controllers; +use Uasoft\Badaso\Theme\LinkyTheme\Helpers\Configurations; class HomeController extends Controller { + // public function index() + // { + // return view('linky-theme::pages.landing-page'); + // } + + public $prefix = 'badaso.theme.linky-theme'; + public function index() { - return view('linky-theme::pages.landing-page'); + $config = Configurations::index(); + $title = $config->siteTitle; + + $view = 'linky-theme::pages.landing-page'; + if (view()->exists($this->prefix . '.pages.landing-page')) { + $view = $this->prefix . '.pages.landing-page'; + }; + return view($view, ['title' => $title]); } diff --git a/src/Helpers/Configurations.php b/src/Helpers/Configurations.php new file mode 100644 index 0000000..6be8535 --- /dev/null +++ b/src/Helpers/Configurations.php @@ -0,0 +1,24 @@ +get(); + foreach ($configurations as $key => $config) { + if ($config->key == 'linkyThemeSiteTitle') { + $site_title = $config->value; + } + + } + + $title = (object)[ + "siteTitle" => $site_title + ]; + return $title; + } +} diff --git a/src/Images/thumbnail-linky/favicon.png b/src/Images/thumbnail-linky/favicon.png new file mode 100644 index 0000000000000000000000000000000000000000..fe60d4d27099549de715eb27c28de9743b7cff18 GIT binary patch literal 969 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbKJOS+@4BLl<6e(pbstU$g(vPY0F z14ES>14Ba#1H&(%P{RubhEf9thF1v;3|2E37{m+a>$ouF+ z@1u{rk3IA`_R#y-BcG#>Y!BZxK5$ES{|)^EHx>3=k=t`ccIz3}{kNoNtdW|uRHn99 zYWgbanQNqGtP*IMEj4M0?9`P&b3o`Qn1rxVNTA_lNP)Dt9eJR>?;5gpuVat2_FV_M z3LAnTh?K7li zuLJr8$OR%G1B50olbi%&Lqw2Bps}`x?^c5JCDJ4OE zplHDkxJ!hm@06bU!Qid_>);TcS6Q3v7&AY==~H?az2o2Y6t8%fLONpc%zZA>L(f;#An=GT&w5Kc0SoL|t&IE}9En!UZc6Z4+!)Ra)v zL>4nJ@ErkR#;MwT(m+A>5>H=O_GeteOk6TA_g``W3LW!waSV~ToScx5G9@J`B`u|a z+09K;Gt*5>g)wZVNTj8R=qF9CuAVgTW^_Sw?nF<+ty?y2+vvM>^K-`41s6O# z3qwka{E7>ovd%pC?Ag1AFQ2}hJn!M_ zRdP`(kYX@0Ff!6LG|)A)3^6dWGBmI [ - 'key' => 'LinkyThemeNavbarTitle', - 'display_name' => 'Navigation Bar Title', + 'key' => 'linkyThemeSiteTitle', + 'display_name' => 'Site Title', 'value' => 'Linky Theme', 'details' => '', 'type' => 'text', @@ -33,25 +33,15 @@ public function run() 'can_delete' => 0, ], 1 => [ - 'key' => 'LinkyThemeFacebookId', - 'display_name' => 'Facebook ID for comment', - 'value' => '', + 'key' => 'linkyThemeFavicon', + 'display_name' => 'Favicon Theme', + 'value' => 'photos/1/favicon.png', 'details' => '', - 'type' => 'text', + 'type' => 'upload_image', 'order' => 2, 'group' => 'linkyTheme', 'can_delete' => 0, ], - 2 => [ - 'key' => 'LinkyThemeAdsId', - 'display_name' => 'Advertisement column', - 'value' => '', - 'details' => '', - 'type' => 'type_image', - 'order' => 3, - 'group' => 'linkyTheme', - 'can_delete' => 0, - ], ]; foreach ($settings as $key => $value) { diff --git a/src/Seeder/LinkyThemeContentsSeeder.php b/src/Seeder/LinkyThemeContentsSeeder.php index 96fcb13..2f5f1f6 100644 --- a/src/Seeder/LinkyThemeContentsSeeder.php +++ b/src/Seeder/LinkyThemeContentsSeeder.php @@ -25,7 +25,7 @@ public function run() 'slug' => 'linky', 'label' => 'Linky', 'value' => '{ - "navbarlink": { + "navbarlink": { "name": "navbarlink", "label": "Navbar Link", "type": "group", @@ -257,6 +257,12 @@ public function run() } } ] + }, + "copyright": { + "name": "copyright", + "label": "Copyright", + "type": "text", + "data": "© Copyright 2022 | Linky Theme by UASOFT | All Rights Reserved | Powered by UASOFT" } }' ], diff --git a/src/resources/js/index/linky-theme.js b/src/resources/js/index/linky-theme.js index 96fe8e6..fde992d 100644 --- a/src/resources/js/index/linky-theme.js +++ b/src/resources/js/index/linky-theme.js @@ -1,27 +1,57 @@ import Alpine from "alpinejs"; -import { list } from "postcss"; + function loadDataContent(){ - return{ - slug: ["linky"], - navbar:null, - listlink:null, - content:null, - loadLandingPage(){ - fetch( - `/badaso-api/module/content/v1/content/fetch?slug=${this.slug[0]}` - ).then((res) => res.json()) - .then((data)=> { - this.content = data.data.value; - this.navbar = this.content.navbarlink.data; - this.listlink = this.content.listlink.data; - console.log(this.listlink, "tes") - }); + return { + slug: ["linky"], + navbar: null, + listlink: null, + content: "", + configuration: [], + favicon: "", + copyright:"", + loadLandingPage() { + fetch( + `/badaso-api/module/content/v1/content/fetch?slug=${this.slug[0]}` + ) + .then((res) => res.json()) + .then((data) => { + this.content = data.data.value; + this.navbar = this.content.navbarlink.data; + this.listlink = this.content.listlink.data; + this.copyright = this.content.copyright.data; + + }); + }, + loadDataConfiguration() { + fetch(`/badaso-api/v1/configurations/fetch`) + .then((res) => res.json()) + .then((data) => { + this.content = data.data.configuration; + for (let index = 0; index < this.content.length; index++) { + if (this.content[index]["group"] == "linkyTheme") { + this.configuration = this.content[index]["value"]; + if (this.content[index]["key"] == "linkyThemeFavicon") { + this.favicon = this.content[index]["value"]; + } + } + } - }, + let favicon = document.getElementById("favicon"); + favicon.href = this.favicon; + }); + }, }; } +const splash = document.querySelector(".splash"); +document.addEventListener("DOMContentLoaded", (e) => { + setTimeout(() => { + splash.classList.add("display-none"); + }, 2000); +}); + + window.loadDataContent = loadDataContent; window.Alpine = Alpine; Alpine.start(); diff --git a/src/resources/js/pages/configuration/browse.vue b/src/resources/js/pages/configuration/browse.vue index 31be717..861876c 100644 --- a/src/resources/js/pages/configuration/browse.vue +++ b/src/resources/js/pages/configuration/browse.vue @@ -250,7 +250,7 @@ export default { get() { return [ { - label: 'linky Theme Configuration', + label: 'Linky Theme Configuration', value: 'linkyTheme' } ] diff --git a/src/resources/views/components/linky-header.blade.php b/src/resources/views/components/linky-header.blade.php index 80c5570..9f90391 100644 --- a/src/resources/views/components/linky-header.blade.php +++ b/src/resources/views/components/linky-header.blade.php @@ -1,11 +1,55 @@ - - - Index | Linky Theme - - - - - - - + + + + @yield('title') + + + + + + + + + diff --git a/src/resources/views/layout/app.blade.php b/src/resources/views/layout/app.blade.php index f92caec..4f3a574 100644 --- a/src/resources/views/layout/app.blade.php +++ b/src/resources/views/layout/app.blade.php @@ -6,6 +6,9 @@ +
+ +
@@ -14,13 +17,12 @@
- © Copyright 2022 | Linky Theme by - UASOFT | All Rights Reserved | Powered by UASOFT +
- +
diff --git a/src/resources/views/pages/landing-page.blade.php b/src/resources/views/pages/landing-page.blade.php index 7b4cc60..2df70bd 100644 --- a/src/resources/views/pages/landing-page.blade.php +++ b/src/resources/views/pages/landing-page.blade.php @@ -1,4 +1,7 @@ @extends('linky-theme::layout.app') +@section('title') +{{$title}} +@endsection @section('mainContent') @include('linky-theme::components.linky-logo') From 75946cfa246876493a6185678cdb57d3941e4dba Mon Sep 17 00:00:00 2001 From: miftahurrahmi Date: Wed, 26 Oct 2022 16:11:18 +0700 Subject: [PATCH 2/6] update command --- src/Commands/LinkyThemeSetup.php | 1 - src/resources/js/app.js | 49 +++++++++++++++- src/resources/js/index/linky-theme.js | 57 ------------------- .../views/components/linky-header.blade.php | 1 - 4 files changed, 48 insertions(+), 60 deletions(-) delete mode 100644 src/resources/js/index/linky-theme.js diff --git a/src/Commands/LinkyThemeSetup.php b/src/Commands/LinkyThemeSetup.php index cca2666..0a7bed7 100644 --- a/src/Commands/LinkyThemeSetup.php +++ b/src/Commands/LinkyThemeSetup.php @@ -71,7 +71,6 @@ protected function updateWebpackMix() // Badaso Linky Theme mix.js("vendor/badaso/linky-theme/src/resources/js/app.js", "public/js/linky-theme.js") - .js("vendor/badaso/linky-theme/src/resources/js/index/linky-theme.js", "public/js/index/linky-theme.js") .css("vendor/badaso/linky-theme/src/resources/js/assets/css/style.css","public/css/linky-theme.css",{},[ require("tailwindcss")('./tailwind-linky.config.js'), require("autoprefixer"), diff --git a/src/resources/js/app.js b/src/resources/js/app.js index bcae7e2..bb8aea7 100644 --- a/src/resources/js/app.js +++ b/src/resources/js/app.js @@ -1,5 +1,52 @@ import Alpine from "alpinejs"; -window.Alpine = Alpine; +function loadDataContent() { + return { + slug: ["linky"], + navbar: null, + listlink: null, + content: "", + configuration: [], + favicon: "", + copyright: "", + loadLandingPage() { + fetch(`/badaso-api/module/content/v1/content/fetch?slug=${this.slug[0]}`) + .then((res) => res.json()) + .then((data) => { + this.content = data.data.value; + this.navbar = this.content.navbarlink.data; + this.listlink = this.content.listlink.data; + this.copyright = this.content.copyright.data; + }); + }, + loadDataConfiguration() { + fetch(`/badaso-api/v1/configurations/fetch`) + .then((res) => res.json()) + .then((data) => { + this.content = data.data.configuration; + for (let index = 0; index < this.content.length; index++) { + if (this.content[index]["group"] == "linkyTheme") { + this.configuration = this.content[index]["value"]; + if (this.content[index]["key"] == "linkyThemeFavicon") { + this.favicon = this.content[index]["value"]; + } + } + } + + let favicon = document.getElementById("favicon"); + favicon.href = this.favicon; + }); + }, + }; +} +const splash = document.querySelector(".splash"); +document.addEventListener("DOMContentLoaded", (e) => { + setTimeout(() => { + splash.classList.add("display-none"); + }, 2000); +}); + +window.loadDataContent = loadDataContent; +window.Alpine = Alpine; Alpine.start(); diff --git a/src/resources/js/index/linky-theme.js b/src/resources/js/index/linky-theme.js deleted file mode 100644 index fde992d..0000000 --- a/src/resources/js/index/linky-theme.js +++ /dev/null @@ -1,57 +0,0 @@ -import Alpine from "alpinejs"; - - -function loadDataContent(){ - return { - slug: ["linky"], - navbar: null, - listlink: null, - content: "", - configuration: [], - favicon: "", - copyright:"", - loadLandingPage() { - fetch( - `/badaso-api/module/content/v1/content/fetch?slug=${this.slug[0]}` - ) - .then((res) => res.json()) - .then((data) => { - this.content = data.data.value; - this.navbar = this.content.navbarlink.data; - this.listlink = this.content.listlink.data; - this.copyright = this.content.copyright.data; - - }); - }, - loadDataConfiguration() { - fetch(`/badaso-api/v1/configurations/fetch`) - .then((res) => res.json()) - .then((data) => { - this.content = data.data.configuration; - for (let index = 0; index < this.content.length; index++) { - if (this.content[index]["group"] == "linkyTheme") { - this.configuration = this.content[index]["value"]; - if (this.content[index]["key"] == "linkyThemeFavicon") { - this.favicon = this.content[index]["value"]; - } - } - } - - let favicon = document.getElementById("favicon"); - favicon.href = this.favicon; - }); - }, - }; -} - -const splash = document.querySelector(".splash"); -document.addEventListener("DOMContentLoaded", (e) => { - setTimeout(() => { - splash.classList.add("display-none"); - }, 2000); -}); - - -window.loadDataContent = loadDataContent; -window.Alpine = Alpine; -Alpine.start(); diff --git a/src/resources/views/components/linky-header.blade.php b/src/resources/views/components/linky-header.blade.php index 9f90391..8ec919b 100644 --- a/src/resources/views/components/linky-header.blade.php +++ b/src/resources/views/components/linky-header.blade.php @@ -5,7 +5,6 @@ @yield('title') - From 281fe74f503ad68cb0c75b35d17afb8f7ede7c95 Mon Sep 17 00:00:00 2001 From: Rizki Heryandi Date: Mon, 26 Dec 2022 16:13:12 +0700 Subject: [PATCH 3/6] Update list-link-content.md --- website/docs/content-management/list-link-content.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/content-management/list-link-content.md b/website/docs/content-management/list-link-content.md index ca2c1c0..678b11f 100644 --- a/website/docs/content-management/list-link-content.md +++ b/website/docs/content-management/list-link-content.md @@ -5,7 +5,7 @@ sidebar_position: 2 # Manage Links 1. You can open `Content Manager` in your badaso dashboard -2. Select item `Linky` and choise `Fill Content' in Action button +2. Select item `Linky` and choise `Fill Content` in Action button 3. Seacrh List Link label 4. Input your text and url links content to the links content form 5. Click update configuration when finished editing From fc2eab29d708c1306f26085d7ee60e602d53b3c9 Mon Sep 17 00:00:00 2001 From: Rizki Heryandi Date: Mon, 26 Dec 2022 16:13:30 +0700 Subject: [PATCH 4/6] Update navbar-content.md --- website/docs/content-management/navbar-content.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/content-management/navbar-content.md b/website/docs/content-management/navbar-content.md index 7949293..551f7e3 100644 --- a/website/docs/content-management/navbar-content.md +++ b/website/docs/content-management/navbar-content.md @@ -6,7 +6,7 @@ sidebar_position: 1 To manage your menu navbar content view on the linky theme, you can follow the step : 1. You can open `Content Manager` in your badaso dashboard -2. Select item `Linky` and choise `Fill Content' in Action button +2. Select item `Linky` and choise `Fill Content` in Action button 3. Search Navbar Link label 4. In logo column, input your logo brand company 5. In title logo column, input text of your logo brand company From 20b0ec5caa89b49f018e17afb4a9f92079eb75b3 Mon Sep 17 00:00:00 2001 From: Rizki Heryandi Date: Mon, 26 Dec 2022 16:14:04 +0700 Subject: [PATCH 5/6] Update links.md --- .../current/content-management/links.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/i18n/id/docusaurus-plugin-content-docs/current/content-management/links.md b/website/i18n/id/docusaurus-plugin-content-docs/current/content-management/links.md index bde35b9..9903331 100644 --- a/website/i18n/id/docusaurus-plugin-content-docs/current/content-management/links.md +++ b/website/i18n/id/docusaurus-plugin-content-docs/current/content-management/links.md @@ -6,7 +6,7 @@ sidebar_position: 2 Untuk mengatur menu tampilan halaman links di tema linky, kamu bisa mengikuti langkah-langkah berikut : 1. Anda dapat membuka `Pengelola Konten` di dasbor badaso Anda -2. Pilih item `Linky` dan pilih `Isi Konten' di tombol Tindakan +2. Pilih item `Linky` dan pilih `Isi Konten` di tombol Tindakan 3. Cari label List Link 4. Masukkan teks dan konten tautan url Anda ke formulir konten tautan 5. Klik tombol simpan setelah selesai mengedit From 4e6321dfa3de26e1e5667630dc1d8c79cda17cfe Mon Sep 17 00:00:00 2001 From: Rizki Heryandi Date: Sat, 30 Dec 2023 18:43:33 +0700 Subject: [PATCH 6/6] Update HomeController.php --- src/Controllers/HomeController.php | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/Controllers/HomeController.php b/src/Controllers/HomeController.php index 6548579..4186c22 100644 --- a/src/Controllers/HomeController.php +++ b/src/Controllers/HomeController.php @@ -6,11 +6,6 @@ class HomeController extends Controller { - // public function index() - // { - // return view('linky-theme::pages.landing-page'); - // } - public $prefix = 'badaso.theme.linky-theme'; public function index()