Skip to content

Commit

Permalink
Merge pull request #6 from uasoft-indonesia/task/v1/update-linky
Browse files Browse the repository at this point in the history
Task/v1/update linky
  • Loading branch information
rizkiheryandi authored Dec 30, 2023
2 parents c3acd08 + 4e6321d commit 38703c5
Show file tree
Hide file tree
Showing 14 changed files with 160 additions and 63 deletions.
1 change: 0 additions & 1 deletion src/Commands/LinkyThemeSetup.php
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand Down
12 changes: 11 additions & 1 deletion src/Controllers/HomeController.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,22 @@

namespace Uasoft\Badaso\Theme\LinkyTheme\Controllers;

use Uasoft\Badaso\Theme\LinkyTheme\Helpers\Configurations;

class HomeController extends Controller
{
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]);
}


Expand Down
24 changes: 24 additions & 0 deletions src/Helpers/Configurations.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php

namespace Uasoft\Badaso\Theme\LinkyTheme\Helpers;

use Uasoft\Badaso\Models\Configuration;

class Configurations
{
public static function index()
{
$configurations = Configuration::where('group', 'linkyTheme')->get();
foreach ($configurations as $key => $config) {
if ($config->key == 'linkyThemeSiteTitle') {
$site_title = $config->value;
}

}

$title = (object)[
"siteTitle" => $site_title
];
return $title;
}
}
Binary file added src/Images/thumbnail-linky/favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 6 additions & 16 deletions src/Seeder/LinkyThemeConfigurationsSeeder.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ public function run()
try {
$settings = [
0 => [
'key' => 'LinkyThemeNavbarTitle',
'display_name' => 'Navigation Bar Title',
'key' => 'linkyThemeSiteTitle',
'display_name' => 'Site Title',
'value' => 'Linky Theme',
'details' => '',
'type' => 'text',
Expand All @@ -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) {
Expand Down
8 changes: 7 additions & 1 deletion src/Seeder/LinkyThemeContentsSeeder.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public function run()
'slug' => 'linky',
'label' => 'Linky',
'value' => '{
"navbarlink": {
"navbarlink": {
"name": "navbarlink",
"label": "Navbar Link",
"type": "group",
Expand Down Expand Up @@ -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"
}
}'
],
Expand Down
49 changes: 48 additions & 1 deletion src/resources/js/app.js
Original file line number Diff line number Diff line change
@@ -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();
27 changes: 0 additions & 27 deletions src/resources/js/index/linky-theme.js

This file was deleted.

2 changes: 1 addition & 1 deletion src/resources/js/pages/configuration/browse.vue
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ export default {
get() {
return [
{
label: 'linky Theme Configuration',
label: 'Linky Theme Configuration',
value: 'linkyTheme'
}
]
Expand Down
63 changes: 53 additions & 10 deletions src/resources/views/components/linky-header.blade.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,54 @@
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Index | Linky Theme</title>
<link href="{{ mix('css/linky-theme.css') }}" rel="stylesheet">
<script src="{{ mix('js/linky-theme.js') }}" defer></script>
<script src="{{ mix('js/index/linky-theme.js') }}" defer></script>
<script src="http://maps.googleapis.com/maps/api/js"></script>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Karla:wght@400;700&display=swap" rel="stylesheet">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link id="favicon" rel="shortcut icon" href="favicon.ico" type="image/x-icon">
<title>@yield('title')</title>
<link href="{{ mix('css/linky-theme.css') }}" rel="stylesheet">
<script src="{{ mix('js/linky-theme.js') }}" defer></script>
<script src="http://maps.googleapis.com/maps/api/js"></script>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Karla:wght@400;700&display=swap" rel="stylesheet">

<style>
.splash {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100vh;
background: black;
z-index: 200;
color: white;
text-align: center;
line-height: 90vh;
}
.splash.display-none {
position: fixed;
opacity: 0;
top: 0;
left: 0;
width: 100%;
height: 100vh;
background: black;
z-index: -10;
color: white;
text-align: center;
line-height: 90vh;
transition: all 0.5s;
}
@keyframes fadeIn {
to {
opacity: 1;
}
}
.fade-in {
opacity: 0;
animation: fadeIn 1s ease-in forwards;
}
</style>
8 changes: 5 additions & 3 deletions src/resources/views/layout/app.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
</head>

<body>
<div class="splash">
<progress class="progress progress-info w-56"></progress>
</div>
<div x-data="loadDataContent()" x-init="loadLandingPage()">
<div class="bg-blue-400 min-h-screen font-karla">
<div class="container mx-auto max-w-[1280px] px-4">
Expand All @@ -14,13 +17,12 @@
</div>

<div class="flex justify-center space-x-2 pb-10">
<span class="text-base text-center text-slate-200">© Copyright 2022 | Linky Theme by
UASOFT | All Rights Reserved | Powered by UASOFT</span>
<span class="text-base text-center text-slate-200" x-html="copyright"></span>
</div>
</div>
</div>


<div x-data="loadDataContent()" x-init="loadDataConfiguration()"></div>
</body>

</html>
3 changes: 3 additions & 0 deletions src/resources/views/pages/landing-page.blade.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
@extends('linky-theme::layout.app')
@section('title')
{{$title}}
@endsection
@section('mainContent')

@include('linky-theme::components.linky-logo')
Expand Down
2 changes: 1 addition & 1 deletion website/docs/content-management/list-link-content.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ sidebar_position: 2

To manage your menu links 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. Seacrh List Link label
4. Input your text and url links content to the links content form
5. Click update configuration when finished editing
Expand Down
2 changes: 1 addition & 1 deletion website/docs/content-management/navbar-content.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 38703c5

Please sign in to comment.