some fix
This commit is contained in:
parent
29e0ff327f
commit
4d7a2fbdec
@ -17,6 +17,7 @@ class CreateThemeShopForm extends FormModel
|
||||
'slug' => 'required',
|
||||
'type' => 'required',
|
||||
'path_to_archive' => 'required',
|
||||
'dependence' => ''
|
||||
];
|
||||
}
|
||||
}
|
18
app/themes/custom/assets/CustomThemesAssets.php
Normal file
18
app/themes/custom/assets/CustomThemesAssets.php
Normal file
@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace app\themes\custom\assets;
|
||||
|
||||
use kernel\Assets;
|
||||
|
||||
class CustomThemesAssets extends Assets
|
||||
{
|
||||
protected function createCSS(): void
|
||||
{
|
||||
$this->registerCSS(slug: "main", resource: "/css/styles.css");
|
||||
}
|
||||
|
||||
protected function createJS(): void
|
||||
{
|
||||
$this->registerJS(slug: "webpack", resource: "/js/scripts.js");
|
||||
}
|
||||
}
|
28
app/themes/custom/controllers/MainController.php
Normal file
28
app/themes/custom/controllers/MainController.php
Normal file
@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace app\themes\custom\controllers;
|
||||
|
||||
use kernel\Controller;
|
||||
|
||||
class MainController extends Controller
|
||||
{
|
||||
|
||||
protected function init(): void
|
||||
{
|
||||
parent::init();
|
||||
$this->cgView->viewPath = APP_DIR . "/themes/custom/views/main/";
|
||||
$this->cgView->layout = "main.php";
|
||||
$this->cgView->layoutPath = APP_DIR . "/themes/custom/views/layout/";
|
||||
$this->cgView->addVarToLayout("resources", "/resources/themes/custom");
|
||||
}
|
||||
|
||||
public function actionIndex(): void
|
||||
{
|
||||
$this->cgView->render("index.php");
|
||||
}
|
||||
|
||||
public function actionAbout(): void
|
||||
{
|
||||
$this->cgView->render("about.php");
|
||||
}
|
||||
}
|
12
app/themes/custom/manifest.json
Normal file
12
app/themes/custom/manifest.json
Normal file
@ -0,0 +1,12 @@
|
||||
{
|
||||
"name": "Custom",
|
||||
"version": "0.1",
|
||||
"author": "ItGuild",
|
||||
"slug": "custom",
|
||||
"type": "theme",
|
||||
"description": "Custom theme",
|
||||
"preview": "preview.png",
|
||||
"resource": "/resources/themes/custom",
|
||||
"resource_path": "{RESOURCES}/themes/custom",
|
||||
"routs": "routs/custom.php"
|
||||
}
|
12
app/themes/custom/routs/custom.php
Normal file
12
app/themes/custom/routs/custom.php
Normal file
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
use kernel\App;
|
||||
|
||||
|
||||
App::$collector->get('/', [\app\themes\custom\controllers\MainController::class, 'actionIndex']);
|
||||
App::$collector->get('/about', [\app\themes\custom\controllers\MainController::class, 'actionAbout']);
|
||||
//App::$collector->get('/page/{page_number}', [\app\modules\tag\controllers\TagController::class, 'actionIndex']);
|
||||
//App::$collector->get('/create', [\app\modules\tag\controllers\TagController::class, 'actionCreate']);
|
||||
|
||||
|
||||
|
92
app/themes/custom/views/layout/main.php
Normal file
92
app/themes/custom/views/layout/main.php
Normal file
@ -0,0 +1,92 @@
|
||||
<?php
|
||||
/**
|
||||
* @var string $content
|
||||
* @var string $resources
|
||||
* @var string $title
|
||||
* @var \kernel\CgView $view
|
||||
*/
|
||||
$assets = new \app\themes\custom\assets\CustomThemesAssets($resources);
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"/>
|
||||
<?php $assets->getCSSAsSTR(); ?>
|
||||
<meta name="description" content=""/>
|
||||
<meta name="author" content=""/>
|
||||
<title><?= $title ?></title>
|
||||
<?= $view->getMeta() ?>
|
||||
<link rel="icon" type="image/x-icon" href="<?= $resources ?>/assets/favicon.ico"/>
|
||||
<!-- Font Awesome icons (free version)-->
|
||||
<script src="https://use.fontawesome.com/releases/v6.3.0/js/all.js" crossorigin="anonymous"></script>
|
||||
<!-- Google fonts-->
|
||||
<link href="https://fonts.googleapis.com/css?family=Lora:400,700,400italic,700italic" rel="stylesheet"
|
||||
type="text/css"/>
|
||||
<link href="https://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800"
|
||||
rel="stylesheet" type="text/css"/>
|
||||
<!-- Core theme CSS (includes Bootstrap)-->
|
||||
</head>
|
||||
<body>
|
||||
<!-- Navigation-->
|
||||
<nav class="navbar navbar-expand-lg navbar-light" id="mainNav">
|
||||
<div class="container px-4 px-lg-5">
|
||||
<a class="navbar-brand" href="/">Custom theme</a>
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarResponsive"
|
||||
aria-controls="navbarResponsive" aria-expanded="false" aria-label="Toggle navigation">
|
||||
Menu
|
||||
<i class="fas fa-bars"></i>
|
||||
</button>
|
||||
<div class="collapse navbar-collapse" id="navbarResponsive">
|
||||
<ul class="navbar-nav ms-auto py-4 py-lg-0">
|
||||
<li class="nav-item"><a class="nav-link px-lg-3 py-3 py-lg-4" href="/">На главную</a></li>
|
||||
<li class="nav-item"><a class="nav-link px-lg-3 py-3 py-lg-4" href="/about">О нас</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<?= $content ?>
|
||||
|
||||
<!-- Footer-->
|
||||
<footer class="border-top">
|
||||
<div class="container px-4 px-lg-5">
|
||||
<div class="row gx-4 gx-lg-5 justify-content-center">
|
||||
<div class="col-md-10 col-lg-8 col-xl-7">
|
||||
<ul class="list-inline text-center">
|
||||
<li class="list-inline-item">
|
||||
<a href="#!">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fab fa-twitter fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="list-inline-item">
|
||||
<a href="#!">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fab fa-facebook-f fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="list-inline-item">
|
||||
<a href="#!">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fab fa-github fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="small text-center text-muted fst-italic">Copyright © IT Guild Micro Framework</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
<!-- Bootstrap core JS-->
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/js/bootstrap.bundle.min.js"></script>
|
||||
<!-- Core theme JS-->
|
||||
<?php $assets->getJSAsStr(); ?>
|
||||
</body>
|
||||
</html>
|
36
app/themes/custom/views/main/about.php
Normal file
36
app/themes/custom/views/main/about.php
Normal file
@ -0,0 +1,36 @@
|
||||
<?php
|
||||
/**
|
||||
* @var string $resources;
|
||||
* @var \kernel\CgView $view
|
||||
*/
|
||||
|
||||
$view->setTitle("Старт Bootstrap");
|
||||
$view->setMeta([
|
||||
'description' => 'Дефолтная bootstrap тема'
|
||||
]);
|
||||
?>
|
||||
<!-- Page Header-->
|
||||
<header class="masthead" style="background-image: url('<?= $resources ?>/assets/img/about-bg.jpeg')">
|
||||
<div class="container position-relative px-4 px-lg-5">
|
||||
<div class="row gx-4 gx-lg-5 justify-content-center">
|
||||
<div class="col-md-10 col-lg-8 col-xl-7">
|
||||
<div class="page-heading">
|
||||
<h1>About Me</h1>
|
||||
<span class="subheading">This is what I do.</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
<!-- Main Content-->
|
||||
<main class="mb-4">
|
||||
<div class="container px-4 px-lg-5">
|
||||
<div class="row gx-4 gx-lg-5 justify-content-center">
|
||||
<div class="col-md-10 col-lg-8 col-xl-7">
|
||||
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Saepe nostrum ullam eveniet pariatur voluptates odit, fuga atque ea nobis sit soluta odio, adipisci quas excepturi maxime quae totam ducimus consectetur?</p>
|
||||
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Eius praesentium recusandae illo eaque architecto error, repellendus iusto reprehenderit, doloribus, minus sunt. Numquam at quae voluptatum in officia voluptas voluptatibus, minus!</p>
|
||||
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Aut consequuntur magnam, excepturi aliquid ex itaque esse est vero natus quae optio aperiam soluta voluptatibus corporis atque iste neque sit tempora!</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
86
app/themes/custom/views/main/index.php
Normal file
86
app/themes/custom/views/main/index.php
Normal file
@ -0,0 +1,86 @@
|
||||
<?php
|
||||
/**
|
||||
* @var string $resources;
|
||||
* @var \kernel\CgView $view
|
||||
*/
|
||||
|
||||
$view->setTitle("IT Guild Micro Framework");
|
||||
$view->setMeta([
|
||||
'description' => 'Default IT Guild Micro Framework theme'
|
||||
]);
|
||||
?>
|
||||
<!-- Page Header-->
|
||||
<header class="masthead" style="background-image: url('<?= $resources ?>/assets/img/home-bg.jpeg')">
|
||||
<div class="container position-relative px-4 px-lg-5">
|
||||
<div class="row gx-4 gx-lg-5 justify-content-center">
|
||||
<div class="col-md-10 col-lg-8 col-xl-7">
|
||||
<div class="site-heading">
|
||||
<h1>Clean Blog</h1>
|
||||
<span class="subheading">A Blog Theme by IT Guild Micro Framework</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
<!-- Main Content-->
|
||||
<div class="container px-4 px-lg-5">
|
||||
<div class="row gx-4 gx-lg-5 justify-content-center">
|
||||
<div class="col-md-10 col-lg-8 col-xl-7">
|
||||
<!-- Post preview-->
|
||||
<div class="post-preview">
|
||||
<a href="#!">
|
||||
<h2 class="post-title">Man must explore, and this is exploration at its greatest</h2>
|
||||
<h3 class="post-subtitle">Problems look mighty small from 150 miles up</h3>
|
||||
</a>
|
||||
<p class="post-meta">
|
||||
Posted by
|
||||
<a href="#!">Start Bootstrap</a>
|
||||
on September 24, 2023
|
||||
</p>
|
||||
</div>
|
||||
<!-- Divider-->
|
||||
<hr class="my-4" />
|
||||
<!-- Post preview-->
|
||||
<div class="post-preview">
|
||||
<a href="#!"><h2 class="post-title">I believe every human has a finite number of heartbeats. I don't intend to waste any of mine.</h2></a>
|
||||
<p class="post-meta">
|
||||
Posted by
|
||||
<a href="#!">Start Bootstrap</a>
|
||||
on September 18, 2023
|
||||
</p>
|
||||
</div>
|
||||
<!-- Divider-->
|
||||
<hr class="my-4" />
|
||||
<!-- Post preview-->
|
||||
<div class="post-preview">
|
||||
<a href="#!">
|
||||
<h2 class="post-title">Science has not yet mastered prophecy</h2>
|
||||
<h3 class="post-subtitle">We predict too much for the next year and yet far too little for the next ten.</h3>
|
||||
</a>
|
||||
<p class="post-meta">
|
||||
Posted by
|
||||
<a href="#!">Start Bootstrap</a>
|
||||
on August 24, 2023
|
||||
</p>
|
||||
</div>
|
||||
<!-- Divider-->
|
||||
<hr class="my-4" />
|
||||
<!-- Post preview-->
|
||||
<div class="post-preview">
|
||||
<a href="#!">
|
||||
<h2 class="post-title">Failure is not an option</h2>
|
||||
<h3 class="post-subtitle">Many say exploration is part of our destiny, but it’s actually our duty to future generations.</h3>
|
||||
</a>
|
||||
<p class="post-meta">
|
||||
Posted by
|
||||
<a href="#!">Start Bootstrap</a>
|
||||
on July 8, 2023
|
||||
</p>
|
||||
</div>
|
||||
<!-- Divider-->
|
||||
<hr class="my-4" />
|
||||
<!-- Pager-->
|
||||
<div class="d-flex justify-content-end mb-4"><a class="btn btn-primary text-uppercase" href="#!">Older Posts →</a></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
Loading…
x
Reference in New Issue
Block a user