-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from uasoft-indonesia/task/layout
layout homepage and detail
- Loading branch information
Showing
52 changed files
with
1,778 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
vendor | ||
node_modules | ||
.DS_Store | ||
composer.lock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
image: node:15.12-alpine3.13 | ||
|
||
stages: | ||
- test | ||
- deploy | ||
|
||
test: | ||
stage: test | ||
script: | ||
- cd website | ||
- yarn install | ||
- yarn build | ||
rules: | ||
- if: $CI_COMMIT_REF_NAME != $CI_DEFAULT_BRANCH | ||
|
||
pages: | ||
stage: deploy | ||
script: | ||
- cd website | ||
- yarn install | ||
- yarn build | ||
- mv ./build ../public | ||
artifacts: | ||
paths: | ||
- public | ||
rules: | ||
- if: $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
{ | ||
"version": "1.0.0", | ||
"name": "badaso/comfree-theme", | ||
"description": "Official free theme for commerce module system on badaso", | ||
"keywords": [ | ||
"laravel", | ||
"admin", | ||
"panel", | ||
"dashboard", | ||
"pwa", | ||
"generator", | ||
"blog", | ||
"badaso", | ||
"news" | ||
], | ||
"license": "proprietary", | ||
"homepage": "https://badaso.uatech.co.id/", | ||
"support": { | ||
"issues": "https://github.com/uasoft-indonesia/badaso-comfree-theme/issues", | ||
"discussion": "https://github.com/uasoft-indonesia/badaso-comfree-theme/discussions", | ||
"source": "https://github.com/uasoft-indonesia/badaso-comfree-theme" | ||
}, | ||
"type": "library", | ||
"require": { | ||
"badaso/core": "^2.9", | ||
"badaso/content-module": "^2.1.1", | ||
"badaso/commerce-module": "dev-main" | ||
|
||
}, | ||
"authors": [ | ||
{ | ||
"name": "UASOFT", | ||
"email": "hello@uatech.co.id" | ||
} | ||
], | ||
"minimum-stability": "alpha", | ||
"autoload": { | ||
"psr-4": { | ||
"Uasoft\\Badaso\\Theme\\ComfreeTheme\\": "src/" | ||
} | ||
}, | ||
"extra": { | ||
"laravel": { | ||
"providers": [ | ||
"Uasoft\\Badaso\\Theme\\ComfreeTheme\\Providers\\ComfreeThemeServiceProvider" | ||
] | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?php | ||
|
||
namespace Uasoft\Badaso\Theme\ComfreeTheme; | ||
|
||
class ComfreeTheme | ||
{ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,145 @@ | ||
<?php | ||
|
||
namespace Uasoft\Badaso\Theme\ComfreeTheme\Commands; | ||
|
||
use Illuminate\Console\Command; | ||
use Illuminate\Support\Facades\Artisan; | ||
use Illuminate\Support\Str; | ||
|
||
class ComfreeThemeSetup extends Command | ||
{ | ||
protected $file; | ||
/** | ||
* The console command name. | ||
* | ||
* @var string | ||
*/ | ||
protected $name = 'badaso-comfree-theme:setup'; | ||
|
||
/** | ||
* The console command description. | ||
* | ||
* @var string | ||
*/ | ||
protected $description = 'Setup Badaso Comfree Theme'; | ||
|
||
/** | ||
* Create a new command instance. | ||
* | ||
* @return void | ||
*/ | ||
public function __construct() | ||
{ | ||
$this->file = app('files'); | ||
parent::__construct(); | ||
} | ||
|
||
/** | ||
* Execute the console command. | ||
* | ||
* @return mixed | ||
*/ | ||
public function handle() | ||
{ | ||
$this->updatePackageJson(); | ||
$this->publishConfig(); | ||
$this->addingBadasoEnv(); | ||
$this->updateWebpackMix(); | ||
} | ||
|
||
protected function publishConfig() | ||
{ | ||
Artisan::call('vendor:publish', ['--tag' => 'BadasoComfreeTheme']); | ||
|
||
$this->info('Badaso comfree theme provider published'); | ||
} | ||
|
||
protected function checkExist($file, $search) | ||
{ | ||
return $this->file->exists($file) && !Str::contains($this->file->get($file), $search); | ||
} | ||
|
||
protected function updateWebpackMix() | ||
{ | ||
$mix_file = base_path('webpack.mix.js'); | ||
$search = 'Badaso Comfree Theme'; | ||
|
||
if ($this->checkExist($mix_file, $search)) { | ||
$data = | ||
<<<'EOT' | ||
// Badaso Comfree Theme | ||
mix.js("vendor/badaso/comfree-theme/src/resources/js/app.js", "public/js/comfree-theme.js") | ||
.css("vendor/badaso/comfree-theme/src/resources/app/assets/css/style.css","public/css/comfree-theme.css",{},[ | ||
require("tailwindcss")('./tailwind-comfree.config.js'), | ||
require("autoprefixer"), | ||
] | ||
) | ||
EOT; | ||
|
||
$this->file->append($mix_file, $data); | ||
} | ||
|
||
$this->info('webpack.mix.js updated'); | ||
} | ||
|
||
protected function envListUpload() | ||
{ | ||
return [ | ||
'COMFREE_THEME_PREFIX' => 'comfree', | ||
]; | ||
} | ||
|
||
protected function addingBadasoEnv() | ||
{ | ||
try { | ||
$env_path = base_path('.env'); | ||
|
||
$env_file = file_get_contents($env_path); | ||
$arr_env_file = explode("\n", $env_file); | ||
|
||
$env_will_adding = $this->envListUpload(); | ||
|
||
$new_env_adding = []; | ||
foreach ($env_will_adding as $key_add_env => $val_add_env) { | ||
$status_adding = true; | ||
foreach ($arr_env_file as $key_env_file => $val_env_file) { | ||
$val_env_file = trim($val_env_file); | ||
if (substr($val_env_file, 0, 1) != '#' && $val_env_file != '' && strstr($val_env_file, $key_add_env)) { | ||
$status_adding = false; | ||
break; | ||
} | ||
} | ||
if ($status_adding) { | ||
$new_env_adding[] = "{$key_add_env}={$val_add_env}"; | ||
} | ||
} | ||
|
||
foreach ($new_env_adding as $index_env_add => $val_env_add) { | ||
$arr_env_file[] = $val_env_add; | ||
} | ||
|
||
$env_file = join("\n", $arr_env_file); | ||
file_put_contents($env_path, $env_file); | ||
|
||
$this->info('Adding badaso env'); | ||
} catch (\Exception $e) { | ||
$this->error('Failed adding badaso env '.$e->getMessage()); | ||
} | ||
} | ||
|
||
protected function updatePackageJson() | ||
{ | ||
$package_json = file_get_contents(base_path('package.json')); | ||
$decoded_json = json_decode($package_json, true); | ||
|
||
$decoded_json['dependencies']['daisyui'] = '^4.6.0'; | ||
$decoded_json['dependencies']['alpinejs'] = '^3.13.5'; | ||
$decoded_json['dependencies']['tailwindcss'] = '^3.4.1'; | ||
$decoded_json['dependencies']['@tailwindcss/aspect-ratio'] = '^0.4.2'; | ||
$encoded_json = json_encode($decoded_json, JSON_PRETTY_PRINT); | ||
file_put_contents(base_path('package.json'), $encoded_json); | ||
|
||
$this->info('package.json updated'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?php | ||
|
||
return [ | ||
'comfree_theme_prefix' => env('COMFREE_THEME_PREFIX'), | ||
|
||
/** | ||
* Overriding controllers. | ||
*/ | ||
'controllers' => [], | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?php | ||
|
||
namespace Uasoft\Badaso\Theme\ComfreeTheme\Controllers; | ||
|
||
use Illuminate\Foundation\Auth\Access\AuthorizesRequests; | ||
use Illuminate\Foundation\Bus\DispatchesJobs; | ||
use Illuminate\Foundation\Validation\ValidatesRequests; | ||
use Illuminate\Routing\Controller as BaseController; | ||
|
||
class Controller extends BaseController | ||
{ | ||
use AuthorizesRequests; | ||
use DispatchesJobs; | ||
use ValidatesRequests; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?php | ||
|
||
namespace Uasoft\Badaso\Theme\ComfreeTheme\Controllers; | ||
|
||
use Exception; | ||
use Illuminate\Http\Request; | ||
|
||
use Uasoft\Badaso\Theme\ComfreeTheme\Helpers\Configurations; | ||
|
||
class DetailController extends Controller | ||
{ | ||
public function index() | ||
{ | ||
return view('comfree-theme::pages.detail-page'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?php | ||
|
||
namespace Uasoft\Badaso\Theme\ComfreeTheme\Controllers; | ||
|
||
use Exception; | ||
use Illuminate\Http\Request; | ||
|
||
use Uasoft\Badaso\Theme\ComfreeTheme\Helpers\Configurations; | ||
|
||
class HomeController extends Controller | ||
{ | ||
public function index(){ | ||
|
||
|
||
return view('comfree-theme::pages.landing-page'); | ||
} | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
|
||
namespace Uasoft\Badaso\Theme\ComfreeTheme\Facades; | ||
|
||
use Illuminate\Support\Facades\Facade; | ||
|
||
class ComfreeTheme extends Facade | ||
{ | ||
/** | ||
* Get the registered name of the component. | ||
* | ||
* @return string | ||
*/ | ||
protected static function getFacadeAccessor() | ||
{ | ||
return 'badaso-comfree-theme'; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?php | ||
|
||
namespace Uasoft\Badaso\Theme\ComfreeTheme\Helpers; | ||
|
||
class CaseConvert | ||
{ | ||
public static function slugToCapitalize($string) | ||
{ | ||
$modified_string = str_replace('-', ' ', $string); | ||
|
||
return ucwords($modified_string); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?php | ||
|
||
namespace Uasoft\Badaso\Theme\ComfreeTheme\Helpers; | ||
|
||
use Uasoft\Badaso\Models\Configuration; | ||
|
||
class Configurations | ||
{ | ||
public static function index() | ||
{ | ||
$configurations = Configuration::where('group', 'comfreeTheme')->get(); | ||
foreach ($configurations as $key => $config) { | ||
if ($config->key == 'comfreeThemeSiteTitle') { | ||
$site_title = $config->value; | ||
} | ||
} | ||
|
||
$title = (object)[ | ||
"siteTitle" => $site_title | ||
]; | ||
return $title; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?php | ||
|
||
namespace Uasoft\Badaso\Theme\ComfreeTheme\Helpers; | ||
|
||
class Route | ||
{ | ||
public static function getController($key) | ||
{ | ||
// get config 'controllers' from config/badaso-comfree-theme.php | ||
$controllers = config('badaso-comfree-theme.controllers'); | ||
|
||
// if the key is not found, return $key | ||
if (!isset($controllers[$key])) { | ||
return 'Uasoft\\Badaso\\Theme\\ComfreeTheme\\Controllers\\'.$key; | ||
} | ||
|
||
// return the value of the key | ||
return $controllers[$key]; | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.