Compare commits
24
Commits
97dac9ddc4
...
v1.0.0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
583580e068 | ||
|
|
5b7da3237f | ||
|
|
2bc0c9e56f | ||
|
|
cebb213830 | ||
|
|
8e29b0513a | ||
|
|
7f549a377a | ||
|
|
f87bccb3ab | ||
|
|
212dbd17c0 | ||
|
|
f462fcc597 | ||
|
|
13d306aec9 | ||
|
|
07613bf1cb | ||
|
|
4e28917b96 | ||
|
|
163df3f4ba | ||
|
|
3320dc47c1 | ||
|
|
4484dc8985 | ||
|
|
1d61ff87e4 | ||
|
|
0cc9a8a893 | ||
|
|
fd8fa7695e | ||
|
|
0581f378a5 | ||
|
|
708af80fa2 | ||
|
|
1f828eb022 | ||
|
|
959a182d16 | ||
|
|
ffe66e522c | ||
|
|
730ce7474e |
No files matched your search
@@ -29,8 +29,8 @@ return [
|
||||
return function(array $errorData) {
|
||||
return HttpFactory::createJsonResponse($errorData + [
|
||||
'api.error' => "Authorization failed",
|
||||
'api.datetime' => (new \DateTime)->format(\DateTime::ATOM),
|
||||
], 401);
|
||||
'api.datetime' => (new \DateTime)->format(\DateTime::ISO8601),
|
||||
], 403);
|
||||
};
|
||||
},
|
||||
|
||||
|
||||
@@ -60,12 +60,11 @@ return [
|
||||
}
|
||||
|
||||
$routing->response = $redirect;
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if ( $securityHandler->isLocked($class, $method) && $container->has(Taxus::class) ) {
|
||||
if ( $securityHandler->isLocked($class, $method) && $container->has(Taxus::class) && $container->has(SecurityHandler::class) ) {
|
||||
if ( $forbidden = $container->get(SecurityHandler::class)->taxus($class, $method, $object->user ?? null) ) {
|
||||
$routing->response = $forbidden;
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<?php
|
||||
|
||||
use Ulmus\Container\AdapterProxy;
|
||||
use Ulmus\ConnectionAdapter;
|
||||
|
||||
use function DI\autowire, DI\create, DI\get, DI\add;
|
||||
|
||||
@@ -9,9 +10,8 @@ return [
|
||||
AdapterProxy::class,
|
||||
]),
|
||||
|
||||
AdapterProxy::class => function (ContainerInterface $c) {
|
||||
AdapterProxy::class => function (Psr\Container\ContainerInterface $c) {
|
||||
return new AdapterProxy(
|
||||
$c->get('lean:adapter.sqlite'),
|
||||
$c->get(ConnectionAdapter::class),
|
||||
);
|
||||
},
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
use function DI\autowire, DI\create, DI\get;
|
||||
use function DI\autowire, DI\create, DI\get, DI\add;
|
||||
|
||||
use League\Route\Strategy\ApplicationStrategy,
|
||||
League\Route\Router;
|
||||
@@ -49,10 +49,10 @@ return [
|
||||
"dump", "errorHandler", SessionMiddleware::class, CronardMiddleware::class, Mcnd\Event\EventMiddleware::class, Mcnd\CLI\CliMiddleware::class,
|
||||
],
|
||||
|
||||
'app.middlewares' => [
|
||||
'app.middlewares' => add([
|
||||
# HeaderAuthenticationMiddleware::class,
|
||||
# PostRequestAuthenticationMiddleware::class,
|
||||
],
|
||||
]),
|
||||
|
||||
Lean\Routing\RouteDefinitionInterface::class => function($c) {
|
||||
return function (ContainerInterface $container) {
|
||||
@@ -68,6 +68,8 @@ return [
|
||||
}
|
||||
}
|
||||
|
||||
$router->addPatternMatcher('email', '[^@ \t\r\n]+@[^@ \t\r\n]+\.[^@ \t\r\n]+');
|
||||
|
||||
$routing = $container->get(Lean\Routing::class);
|
||||
$routing->registerRoute($container, getenv('URL_BASE'));
|
||||
|
||||
|
||||
@@ -2,14 +2,11 @@
|
||||
|
||||
use Taxus\Privilege;
|
||||
|
||||
use function DI\autowire, DI\create, DI\get;
|
||||
use function DI\{ autowire, add, create, get };
|
||||
|
||||
$dir = getenv("META_PATH") . "/definitions";
|
||||
$dir = dirname(__DIR__, 2);
|
||||
|
||||
return array_merge(
|
||||
Lean\Lean::autoloadDefinitionsFromComposerExtra(),
|
||||
|
||||
[
|
||||
return [
|
||||
'%APPKEY%' => [
|
||||
'picea' => [
|
||||
'context' => "%ESCAPED_NAMESPACE%\\View",
|
||||
@@ -18,46 +15,35 @@ return array_merge(
|
||||
],
|
||||
|
||||
'ulmus' => [
|
||||
'entities' => [ '%ESCAPED_NAMESPACE%\\Entity' => getenv("PROJECT_PATH") . '/src/Entity/' ],
|
||||
'entities' => [ '%ESCAPED_NAMESPACE%\\Entity' => implode(DIRECTORY_SEPARATOR, [ $dir, 'src', 'Entity', '' ]) ],
|
||||
],
|
||||
|
||||
'routes' => [
|
||||
'%ESCAPED_NAMESPACE%\\Controller' => getenv("PROJECT_PATH") . '/src/Controller/',
|
||||
'%ESCAPED_NAMESPACE%\\Controller' => implode(DIRECTORY_SEPARATOR, [ $dir, 'src', 'Controller', '' ]),
|
||||
],
|
||||
|
||||
'events' => [
|
||||
'%ESCAPED_NAMESPACE%\\Controller' => implode(DIRECTORY_SEPARATOR, [ getenv("PROJECT_PATH"), 'src', 'Controller', '' ]),
|
||||
'%ESCAPED_NAMESPACE%\\Controller' => implode(DIRECTORY_SEPARATOR, [ $dir, 'src', 'Controller', '' ]),
|
||||
],
|
||||
|
||||
'cronard' => [
|
||||
'%ESCAPED_NAMESPACE%\\Controller' => implode(DIRECTORY_SEPARATOR, [ getenv("PROJECT_PATH"), 'src', 'Controller', '' ]),
|
||||
'%ESCAPED_NAMESPACE%\\Controller' => implode(DIRECTORY_SEPARATOR, [ $dir, 'src', 'Controller', '' ]),
|
||||
],
|
||||
|
||||
'cli' => [
|
||||
'%ESCAPED_NAMESPACE%\\Controller' => implode(DIRECTORY_SEPARATOR, [ getenv("PROJECT_PATH"), 'src', 'Controller', '' ]),
|
||||
'%ESCAPED_NAMESPACE%\\Controller' => implode(DIRECTORY_SEPARATOR, [ $dir, 'src', 'Controller', '' ]),
|
||||
],
|
||||
|
||||
'taxus' => [
|
||||
[ new Privilege("dev", "Is a developper of this application."), "is_dev" ],
|
||||
[ new Privilege("admin", "Can manage mostly everything from this application."), "is_admin" ],
|
||||
[ new Privilege("user", "Is an authenticated user."), "is_user" ],
|
||||
[ new Privilege("anonymous", "Is an anonymous (unauthenticated) user."), "is_anonymous" ],
|
||||
'is_dev' => [ 'dev' => "Can manage almost everything in this application."],
|
||||
'is_admin' => [ 'admin' => "Can manage almost everything in this application."],
|
||||
'is_moderator' => [ 'moderator' => "Can moderate this application."],
|
||||
'is_user' => [ 'user' => "Is an authenticated user."],
|
||||
'is_anonymous' => [ 'anonymous' => "Is an anonymous (unauthenticated) user."],
|
||||
]
|
||||
],
|
||||
|
||||
'app.middlewares' => [],
|
||||
],
|
||||
|
||||
require("$dir/auth.php"),
|
||||
require("$dir/storage.php"),
|
||||
require("$dir/security.php"),
|
||||
require("$dir/env/" . getenv('APP_ENV') . ".php"),
|
||||
[
|
||||
'config' => function () {
|
||||
return array_merge_recursive(
|
||||
Lean\Lean::autoloadConfigFromComposerExtra(),
|
||||
require(getenv("META_PATH")."/config.php")
|
||||
);
|
||||
}
|
||||
]
|
||||
);
|
||||
'app.middlewares' => \DI\add([
|
||||
Ulmus\User\Middleware\RememberMeMiddleware::class,
|
||||
]),
|
||||
];
|
||||
@@ -16,11 +16,4 @@ return [
|
||||
|
||||
return $adapter;
|
||||
},
|
||||
|
||||
AdapterProxy::class => function (ContainerInterface $c) {
|
||||
return new AdapterProxy(
|
||||
$c->get('lean:adapter.sqlite'),
|
||||
$c->get(ConnectionAdapter::class)
|
||||
);
|
||||
},
|
||||
];
|
||||
@@ -23,8 +23,6 @@ new class(dirname(__DIR__)) extends \Lean\Kernel {
|
||||
{
|
||||
$this->errorLogPath = getenv("LOGS_PATH") . DIRECTORY_SEPARATOR. date("Y-m").".log";
|
||||
|
||||
$this->definitionFilePaths = Lean::getDefinitionsPathsFromComposer();
|
||||
|
||||
return parent::initializeEngine();
|
||||
}
|
||||
|
||||
|
||||
@@ -11,21 +11,25 @@ use Notes\Security\Attribute\Security;
|
||||
use %NAMESPACE%\{ Entity, Lib, Form };
|
||||
|
||||
use Mcnd\Event\EventManager;
|
||||
use Ulmus\User\Entity\UserInterface;
|
||||
use Notes\Attribute\Ignore;use Ulmus\User\Entity\UserInterface;
|
||||
|
||||
#[Security(locked: false)]
|
||||
#[Route(method: ['GET', 'POST', ])]
|
||||
trait ControllerTrait {
|
||||
use \Lean\ControllerTrait;
|
||||
|
||||
#[Ignore]
|
||||
public ? UserInterface $user;
|
||||
|
||||
#[Ignore]
|
||||
protected EventManager $eventManager;
|
||||
|
||||
#[Ignore]
|
||||
public function __construct(Picea $picea, Session $session, UserInterface $user, \Notes\Breadcrumb\Breadcrumb $breadcrumb, EventManager $eventManager) {
|
||||
$this->initializeController($picea, $session, $user, $breadcrumb, $eventManager);
|
||||
}
|
||||
|
||||
#[Ignore]
|
||||
public function initializeController(Picea $picea, Session $session, UserInterface $user, \Notes\Breadcrumb\Breadcrumb $breadcrumb, EventManager $eventManager) {
|
||||
$this->picea = $picea;
|
||||
$this->session = $session;
|
||||
|
||||
@@ -38,9 +38,13 @@ class ApplicationStrategy extends Strategy\ApplicationStrategy {
|
||||
|
||||
public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
|
||||
{
|
||||
if (php_sapi_name() !== 'cli' and ! defined('STDIN')) {
|
||||
return $this->throw404($request);
|
||||
}
|
||||
|
||||
return $handler->handle($request);;
|
||||
}
|
||||
|
||||
public function throw404(ServerRequestInterface $request) : ResponseInterface
|
||||
{
|
||||
if ( getenv('DEBUG') && $this->di->has(\Picea\Asset\Asset::class) ) {
|
||||
|
||||
+16
-13
@@ -2,29 +2,38 @@
|
||||
|
||||
namespace Lean;
|
||||
|
||||
use DI\Attribute\Inject;
|
||||
use Lean\Factory\HttpFactory;
|
||||
use Notes\Attribute\Ignore;
|
||||
use Notes\Route\Attribute\Object\Route;
|
||||
use Notes\Security\Attribute\Security;
|
||||
use Picea, Picea\Ui\Method\FormContext;
|
||||
use TheBugs\Email\MailerInterface;
|
||||
use Storage\Session;
|
||||
use Storage\{ Cookie, Session };
|
||||
use League\CommonMark\CommonMarkConverter;
|
||||
|
||||
use Psr\Http\Message\{ ServerRequestInterface, ResponseInterface };
|
||||
|
||||
use function file_get_contents;
|
||||
|
||||
#[Security(locked: true, realm: "Protected Area")]
|
||||
#[Security(locked: false, realm: "Protected Area")]
|
||||
#[Route(method: [ "GET", "POST" ])]
|
||||
trait ControllerTrait {
|
||||
public ? \Notes\Breadcrumb\Breadcrumb $breadcrumb;
|
||||
|
||||
public ? Session $session;
|
||||
#[Inject]
|
||||
public \Notes\Breadcrumb\Breadcrumb $breadcrumb;
|
||||
|
||||
public ? Picea\Picea $picea;
|
||||
#[Inject]
|
||||
public Session $session;
|
||||
|
||||
public ? MailerInterface $mailer;
|
||||
#[Inject]
|
||||
public Cookie $cookie;
|
||||
|
||||
#[Inject]
|
||||
public Picea\Picea $picea;
|
||||
|
||||
#[Inject]
|
||||
public MailerInterface $mailer;
|
||||
|
||||
public array $contextList = [];
|
||||
|
||||
@@ -217,12 +226,6 @@ trait ControllerTrait {
|
||||
#[Ignore]
|
||||
public function isRoute(mixed $name, ServerRequestInterface $request) : bool
|
||||
{
|
||||
foreach((array) $name as $item) {
|
||||
if ( fnmatch($item, $request->getAttribute('lean.route')->name) ) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
return $request->getAttribute('lean.route')->match($name);
|
||||
}
|
||||
}
|
||||
+13
-5
@@ -29,9 +29,7 @@ class Kernel {
|
||||
|
||||
public int $errorReporting = E_ALL & ~E_USER_DEPRECATED & ~E_DEPRECATED & ~E_STRICT & ~E_NOTICE;
|
||||
|
||||
public string $definitionFilePath;
|
||||
|
||||
public array $definitionFilePaths = [];
|
||||
public array $definitionFilePaths;
|
||||
|
||||
public string $errorLogPath;
|
||||
|
||||
@@ -108,6 +106,8 @@ class Kernel {
|
||||
{
|
||||
$containerBuilder = new ContainerBuilder();
|
||||
|
||||
$containerBuilder->useAttributes(true);
|
||||
|
||||
if (getenv("APP_ENV") === "prod") {
|
||||
if (getenv("CACHE_PATH")) {
|
||||
# check if ACPU is there first, $containerBuilder->enableDefinitionCache();
|
||||
@@ -124,14 +124,22 @@ class Kernel {
|
||||
}
|
||||
}
|
||||
|
||||
if ($this->definitionFilePath ?? false) {
|
||||
$containerBuilder->addDefinitions($this->definitionFilePath);
|
||||
foreach(Lean::getDefinitionsPathsFromComposer() as $path) {
|
||||
$containerBuilder->addDefinitions($path);
|
||||
}
|
||||
|
||||
foreach($this->definitionFilePaths ?? [] as $path) {
|
||||
$containerBuilder->addDefinitions($path);
|
||||
}
|
||||
|
||||
$containerBuilder->addDefinitions([
|
||||
'config' => function () {
|
||||
return array_merge_recursive(
|
||||
Lean::autoloadConfigFromComposerExtra(), []
|
||||
);
|
||||
}
|
||||
]);
|
||||
|
||||
$this->container = $containerBuilder->build();
|
||||
|
||||
return $this;
|
||||
|
||||
+27
-26
@@ -1,6 +1,5 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace Lean;
|
||||
|
||||
use Psr\Container\ContainerInterface;
|
||||
@@ -22,13 +21,16 @@ class Lean
|
||||
|
||||
protected function loadApplications() : void
|
||||
{
|
||||
$list = $this->container->get('config')['lean']['autoload'] ?? [];
|
||||
$list = array_filter($this->container->get('config')['lean']['autoload'] ?? []);
|
||||
|
||||
if (! $list ) {
|
||||
throw new \Exception("You must provide at least one application to autoload within your config file ( 'lean' => 'autoload' => [] )");
|
||||
}
|
||||
|
||||
foreach(array_filter($list) as $application) {
|
||||
# Allows 'lean.default' and [ 'lean.default', 100 ] which allows ordering of apps loading.
|
||||
usort($list, fn($e1, $e2) => ( is_array($e1) ? $e1[1] : 0 ) <=> ( is_array($e2) ? $e2[1] : 0 ));
|
||||
|
||||
foreach(array_map(fn($item) => is_array($item) ? $item[0] : $item, $list) as $application) {
|
||||
if ( $this->container->has($application) ) {
|
||||
$this->applications[] = ( new Application($application) )->fromArray($this->container->get($application));
|
||||
}
|
||||
@@ -166,29 +168,23 @@ class Lean
|
||||
$list = [];
|
||||
|
||||
foreach(Composer::readComposerLock()['packages'] as $package) {
|
||||
$order = $package['extra']['lean']['autoload']['order'] ?? 0;
|
||||
|
||||
foreach($package['extra']['lean']['autoload']['definitions'] ?? [] as $autoload) {
|
||||
$list[] = static::pathFromPackage($package, $autoload);
|
||||
$list[] = [ static::pathFromPackage($package, $autoload), $order ];
|
||||
}
|
||||
}
|
||||
|
||||
foreach(Composer::readComposerJson()['extra']['lean']['autoload']['definitions'] ?? [] ?? [] as $autoload) {
|
||||
$list[] = getenv('PROJECT_PATH') . DIRECTORY_SEPARATOR . $autoload;
|
||||
foreach(Composer::readComposerJson()['extra']['lean']['autoload']['definitions'] ?? [] as $autoload) {
|
||||
$order = $package['extra']['lean']['autoload']['order'] ?? 1000;
|
||||
|
||||
$list[] = [ getenv('PROJECT_PATH') . DIRECTORY_SEPARATOR . $autoload, $order ];
|
||||
}
|
||||
|
||||
return $list;
|
||||
}
|
||||
# Allows 'lean.default' and [ 'lean.default', 100 ] which allows ordering of apps loading.
|
||||
usort($list, fn($e1, $e2) => $e1[1] <=> $e2[1]);
|
||||
|
||||
public static function autoloadDefinitionsFromComposerExtra() : array
|
||||
{
|
||||
$list = [];
|
||||
|
||||
foreach(Composer::readComposerLock()['packages'] as $package) {
|
||||
foreach($package['extra']['lean']['autoload']['definitions'] ?? [] as $autoload) {
|
||||
$list = array_replace($list, static::loadFromPackage($package, $autoload));
|
||||
}
|
||||
}
|
||||
|
||||
return $list;
|
||||
return array_column($list, 0);
|
||||
}
|
||||
|
||||
public static function autoloadConfigFromComposerExtra() : array
|
||||
@@ -201,14 +197,22 @@ class Lean
|
||||
}
|
||||
}
|
||||
|
||||
foreach(Composer::readComposerJson()['extra']['lean']['autoload']['config'] ?? [] as $autoload) {
|
||||
$list = array_merge_recursive($list, static::loadFromPackage(null, $autoload));
|
||||
}
|
||||
|
||||
return $list;
|
||||
}
|
||||
|
||||
protected static function pathFromPackage(array $package, array|string $autoload) : string
|
||||
protected static function pathFromPackage(?array $package, array|string $autoload) : string
|
||||
{
|
||||
if ($package === null) {
|
||||
$filepath = getenv('PROJECT_PATH') . DIRECTORY_SEPARATOR . $autoload;
|
||||
}
|
||||
else {
|
||||
$vendor = getenv('VENDOR_DIR') ? getenv('VENDOR_PATH') : dirname(__DIR__, 3);
|
||||
|
||||
$filepath = $vendor . DIRECTORY_SEPARATOR . $package['name'] . DIRECTORY_SEPARATOR . $autoload;
|
||||
}
|
||||
|
||||
if (! file_exists($filepath)) {
|
||||
throw new \InvalidArgumentException("Given definition filepath do not exists '$filepath'");
|
||||
@@ -217,7 +221,7 @@ class Lean
|
||||
return $filepath;
|
||||
}
|
||||
|
||||
protected static function loadFromPackage(array $package, array|string $autoload) : false|array
|
||||
protected static function loadFromPackage(? array $package, array|string $autoload) : false|array
|
||||
{
|
||||
$list = [];
|
||||
|
||||
@@ -230,12 +234,9 @@ class Lean
|
||||
|
||||
return require($file);
|
||||
}
|
||||
else {
|
||||
|
||||
$func = implode('::', array_merge([ key($autoload) ], $autoload));
|
||||
|
||||
return call_user_func($func);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
+41
-2
@@ -5,6 +5,7 @@ namespace Lean;
|
||||
use League\Route\RouteGroup,
|
||||
League\Route\Router;
|
||||
|
||||
use Notes\Route\Attribute\Method\Route;
|
||||
use Psr\Http\Message\ServerRequestInterface,
|
||||
Psr\Http\Message\ResponseInterface,
|
||||
Psr\Container\ContainerInterface;
|
||||
@@ -17,6 +18,8 @@ class Routing {
|
||||
|
||||
public ResponseInterface $response;
|
||||
|
||||
public array $overriddenRoutes = [];
|
||||
|
||||
public function __construct(
|
||||
public Router $router,
|
||||
public RouteFetcher $fetcher,
|
||||
@@ -25,12 +28,12 @@ class Routing {
|
||||
|
||||
public function registerRoute(ContainerInterface $container, string $urlBase) {
|
||||
$this->router->group(rtrim($urlBase, "/"), function (RouteGroup $route) use ($container) {
|
||||
foreach($this->fetcher->compile() as $attribute) {
|
||||
foreach($this->fetchRoutesAttributes() as $attribute) {
|
||||
$this->eventManager->execute(Event\RoutingCompileRoutes::class, $this, $attribute);
|
||||
|
||||
# Mapping every URLs from attributes in searched folders (Api, Controller, etc...)
|
||||
foreach((array) $attribute->method as $method) {
|
||||
$route->map(strtoupper($method), $attribute->getRoute(), function (ServerRequestInterface $request, array $arguments) use (
|
||||
$route->map(strtoupper($method), $attribute->getRegistrableRoute(), function (ServerRequestInterface $request, array $arguments) use (
|
||||
$container, $route, $attribute
|
||||
) : ResponseInterface {
|
||||
$class = $attribute->class;
|
||||
@@ -47,4 +50,40 @@ class Routing {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public function fetchRoutesAttributes() : iterable
|
||||
{
|
||||
static $list = [];
|
||||
|
||||
if ($list) {
|
||||
return $list;
|
||||
}
|
||||
|
||||
foreach($this->fetcher->compile() as $routeAttribute) {
|
||||
# Routes with differents methods can have the same name
|
||||
$key = sprintf('{%s}~{%s}', $routeAttribute->name, $this->serializeMethods((array) $routeAttribute->method));
|
||||
|
||||
if ( isset($list[$key]) ) {
|
||||
$this->overriddenRoutes[$key] = $list[$key];
|
||||
}
|
||||
|
||||
$list[$key] = $routeAttribute;
|
||||
}
|
||||
|
||||
return $list;
|
||||
}
|
||||
|
||||
public function findOverriddenRoute(Route $route) : false|iterable
|
||||
{
|
||||
return array_filter($this->overriddenRoutes, fn($e) => $route->name === $e->name);
|
||||
}
|
||||
|
||||
protected function serializeMethods(array $methods) : string
|
||||
{
|
||||
$methods = array_map('strtolower', $methods);
|
||||
|
||||
sort($methods);
|
||||
|
||||
return implode(':', $methods);
|
||||
}
|
||||
}
|
||||
@@ -1 +1 @@
|
||||
<svg id="e7dedc5b-fca6-4313-b5a0-e6297481e8ae" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="1022.7" height="785.81" viewBox="0 0 1022.7 785.81"><defs><linearGradient id="af83dc26-9572-4816-b7a1-1af4f72ff554" x1="678.2" y1="821.79" x2="678.2" y2="493.4" gradientTransform="translate(-20.24 29.65) rotate(-2.31)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="gray" stop-opacity="0.25"/><stop offset="0.54" stop-color="gray" stop-opacity="0.12"/><stop offset="1" stop-color="gray" stop-opacity="0.1"/></linearGradient></defs><title>bug fixing</title><ellipse cx="468.63" cy="660.88" rx="425" ry="33" fill="#6c63ff" opacity="0.1"/><g opacity="0.1"><path d="M933.7,529.93c-2.54-7.71-12.84-11.26-23-7.92a24.76,24.76,0,0,0-4.23,1.83c-.65-.18-1.32-.34-2-.46a22.42,22.42,0,0,0,.63-6.79A24.6,24.6,0,0,0,916,495.12a24.63,24.63,0,0,0,10.86-21.47,23.76,23.76,0,0,0,8.23-9.32c4.9-9.7,2.87-20.6-4.54-24.35s-17.4,1.08-22.3,10.78a23.69,23.69,0,0,0-2.63,12.15,24.63,24.63,0,0,0-10.86,21.47,24.63,24.63,0,0,0-10.86,21.47A24.64,24.64,0,0,0,873,527.33a23.76,23.76,0,0,0-8.23,9.32,25.46,25.46,0,0,0-2.08,5.74,21.18,21.18,0,0,0-4.44-4.73,25.38,25.38,0,0,0-1-4.5c-3.34-10.17-12.3-16.37-20-13.83s-11.26,12.83-7.92,23a23.07,23.07,0,0,0,7.56,11.08,25.38,25.38,0,0,0,1,4.5c1.94,5.9,5.77,10.46,10.15,12.75a23.23,23.23,0,0,0-.83,3.9,25.29,25.29,0,0,0-7.54,14.91,25.27,25.27,0,0,0-7.54,14.92,24.63,24.63,0,0,0-5,6.81c-4.91,9.7-2.88,20.61,4.53,24.35s17.4-1.07,22.31-10.78a24.62,24.62,0,0,0,2.5-8.09,25.29,25.29,0,0,0,7.54-14.91,25.27,25.27,0,0,0,7.54-14.92A25.21,25.21,0,0,0,879,571.94,25.21,25.21,0,0,0,886.56,557a24.11,24.11,0,0,0,3.39-4,23.46,23.46,0,0,0,12.27-.77,24.76,24.76,0,0,0,4.23-1.83,23.2,23.2,0,0,0,13.42-.48C930,546.61,936.23,537.65,933.7,529.93Z" transform="translate(-88.65 -57.09)" fill="#3f3d56"/><g opacity="0.1"><path d="M915.77,499.53a21.5,21.5,0,0,1-3.44,2.75,23,23,0,0,1-1.11,8.43,26.18,26.18,0,0,0,2.1-3.43A24.64,24.64,0,0,0,915.77,499.53Z" transform="translate(-88.65 -57.09)"/><path d="M926.63,478.06a21.5,21.5,0,0,1-3.44,2.75,23,23,0,0,1-1.11,8.43,25.65,25.65,0,0,0,2.1-3.44A24.85,24.85,0,0,0,926.63,478.06Z" transform="translate(-88.65 -57.09)"/><path d="M902,470.07a21.91,21.91,0,0,1,.17-4.41,24.93,24.93,0,0,0-4.78,6.57,25.63,25.63,0,0,0-1.52,3.73A22.75,22.75,0,0,1,902,470.07Z" transform="translate(-88.65 -57.09)"/><path d="M833.07,600a23.59,23.59,0,0,1,2.95-3.38,22.92,22.92,0,0,1,.87-4,25.09,25.09,0,0,0-2.29,3.71A25.59,25.59,0,0,0,833.07,600Z" transform="translate(-88.65 -57.09)"/><path d="M840.61,585.1a23.59,23.59,0,0,1,2.95-3.38,23,23,0,0,1,.83-3.9l0,0a25.68,25.68,0,0,0-2.2,3.59A26.76,26.76,0,0,0,840.61,585.1Z" transform="translate(-88.65 -57.09)"/><path d="M904.9,521a20.82,20.82,0,0,1-3.43,2.74,22.45,22.45,0,0,1-.63,6.79,18.75,18.75,0,0,1,2,.46,24.76,24.76,0,0,1,4.23-1.83c10.18-3.34,20.47.21,23,7.92a11.68,11.68,0,0,1,.32,6c3.35-3.94,4.74-8.74,3.3-13.14-2.54-7.71-12.84-11.26-23-7.92a24.76,24.76,0,0,0-4.23,1.83c-.65-.18-1.32-.34-2-.46C904.65,522.59,904.79,521.8,904.9,521Z" transform="translate(-88.65 -57.09)"/><path d="M829.35,607.49a25.09,25.09,0,0,0-2.29,3.71,26.56,26.56,0,0,0-1.54,3.74,24.48,24.48,0,0,1,3-3.4A22.92,22.92,0,0,1,829.35,607.49Z" transform="translate(-88.65 -57.09)"/><path d="M891.09,491.54a22,22,0,0,1,.17-4.41,24.93,24.93,0,0,0-4.78,6.57,25.63,25.63,0,0,0-1.52,3.73A22.75,22.75,0,0,1,891.09,491.54Z" transform="translate(-88.65 -57.09)"/><path d="M875.4,579.1a24.29,24.29,0,0,1-1,4.38,26.67,26.67,0,0,0,2.09-3.44,25.49,25.49,0,0,0,1.63-4A24.23,24.23,0,0,1,875.4,579.1Z" transform="translate(-88.65 -57.09)"/><path d="M860.32,608.92a24.15,24.15,0,0,1-1,4.38,25.65,25.65,0,0,0,2.1-3.44,26.47,26.47,0,0,0,1.63-4A23.57,23.57,0,0,1,860.32,608.92Z" transform="translate(-88.65 -57.09)"/><path d="M867.86,594a24.11,24.11,0,0,1-1,4.38A26.67,26.67,0,0,0,869,595a25.49,25.49,0,0,0,1.63-4A24.23,24.23,0,0,1,867.86,594Z" transform="translate(-88.65 -57.09)"/><path d="M882.94,564.19a24,24,0,0,1-1,4.37,25.89,25.89,0,0,0,2.09-3.43,25.48,25.48,0,0,0,1.64-4.07A23.22,23.22,0,0,1,882.94,564.19Z" transform="translate(-88.65 -57.09)"/><path d="M833.57,526.48c7.72-2.53,16.68,3.66,20,13.83a25.68,25.68,0,0,1,1,4.51,21.18,21.18,0,0,1,4.44,4.73,25.53,25.53,0,0,1,2.08-5.75c.35-.68.73-1.33,1.12-2a21.07,21.07,0,0,0-4-4.18,25.38,25.38,0,0,0-1-4.5c-3.34-10.17-12.3-16.37-20-13.83-4.4,1.44-7.44,5.41-8.62,10.43A11.69,11.69,0,0,1,833.57,526.48Z" transform="translate(-88.65 -57.09)"/><path d="M869.37,534.48a21.85,21.85,0,0,1,.18-4.4,24.73,24.73,0,0,0-4.79,6.57,25.07,25.07,0,0,0-1.52,3.72A23,23,0,0,1,869.37,534.48Z" transform="translate(-88.65 -57.09)"/><path d="M880.23,513a21.85,21.85,0,0,1,.18-4.4,24.52,24.52,0,0,0-4.79,6.56,25.63,25.63,0,0,0-1.52,3.73A22.75,22.75,0,0,1,880.23,513Z" transform="translate(-88.65 -57.09)"/><path d="M852.78,623.83a24.25,24.25,0,0,1-1,4.39,25.73,25.73,0,0,0,3.73-7.49A23.57,23.57,0,0,1,852.78,623.83Z" transform="translate(-88.65 -57.09)"/></g><path d="M948.52,430.71a23.68,23Line truncated
|
||||
<svg id="e7dedc5b-fca6-4313-b5a0-e6297481e8ae" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="1022.7" height="785.81" viewBox="0 0 1022.7 785.81"><defs><linearGradient id="af83dc26-9572-4816-b7a1-1af4f72ff554" x1="678.2" y1="821.79" x2="678.2" y2="493.4" gradientTransform="translate(-20.24 29.65) rotate(-2.31)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="gray" stop-opacity="0.25"/><stop offset="0.54" stop-color="gray" stop-opacity="0.12"/><stop offset="1" stop-color="gray" stop-opacity="0.1"/></linearGradient></defs><title>bug fixing</title><ellipse cx="468.63" cy="660.88" rx="425" ry="33" fill="#6c63ff" opacity="0.1"/><g opacity="0.1"><path d="M933.7,529.93c-2.54-7.71-12.84-11.26-23-7.92a24.76,24.76,0,0,0-4.23,1.83c-.65-.18-1.32-.34-2-.46a22.42,22.42,0,0,0,.63-6.79A24.6,24.6,0,0,0,916,495.12a24.63,24.63,0,0,0,10.86-21.47,23.76,23.76,0,0,0,8.23-9.32c4.9-9.7,2.87-20.6-4.54-24.35s-17.4,1.08-22.3,10.78a23.69,23.69,0,0,0-2.63,12.15,24.63,24.63,0,0,0-10.86,21.47,24.63,24.63,0,0,0-10.86,21.47A24.64,24.64,0,0,0,873,527.33a23.76,23.76,0,0,0-8.23,9.32,25.46,25.46,0,0,0-2.08,5.74,21.18,21.18,0,0,0-4.44-4.73,25.38,25.38,0,0,0-1-4.5c-3.34-10.17-12.3-16.37-20-13.83s-11.26,12.83-7.92,23a23.07,23.07,0,0,0,7.56,11.08,25.38,25.38,0,0,0,1,4.5c1.94,5.9,5.77,10.46,10.15,12.75a23.23,23.23,0,0,0-.83,3.9,25.29,25.29,0,0,0-7.54,14.91,25.27,25.27,0,0,0-7.54,14.92,24.63,24.63,0,0,0-5,6.81c-4.91,9.7-2.88,20.61,4.53,24.35s17.4-1.07,22.31-10.78a24.62,24.62,0,0,0,2.5-8.09,25.29,25.29,0,0,0,7.54-14.91,25.27,25.27,0,0,0,7.54-14.92A25.21,25.21,0,0,0,879,571.94,25.21,25.21,0,0,0,886.56,557a24.11,24.11,0,0,0,3.39-4,23.46,23.46,0,0,0,12.27-.77,24.76,24.76,0,0,0,4.23-1.83,23.2,23.2,0,0,0,13.42-.48C930,546.61,936.23,537.65,933.7,529.93Z" transform="translate(-88.65 -57.09)" fill="#3f3d56"/><g opacity="0.1"><path d="M915.77,499.53a21.5,21.5,0,0,1-3.44,2.75,23,23,0,0,1-1.11,8.43,26.18,26.18,0,0,0,2.1-3.43A24.64,24.64,0,0,0,915.77,499.53Z" transform="translate(-88.65 -57.09)"/><path d="M926.63,478.06a21.5,21.5,0,0,1-3.44,2.75,23,23,0,0,1-1.11,8.43,25.65,25.65,0,0,0,2.1-3.44A24.85,24.85,0,0,0,926.63,478.06Z" transform="translate(-88.65 -57.09)"/><path d="M902,470.07a21.91,21.91,0,0,1,.17-4.41,24.93,24.93,0,0,0-4.78,6.57,25.63,25.63,0,0,0-1.52,3.73A22.75,22.75,0,0,1,902,470.07Z" transform="translate(-88.65 -57.09)"/><path d="M833.07,600a23.59,23.59,0,0,1,2.95-3.38,22.92,22.92,0,0,1,.87-4,25.09,25.09,0,0,0-2.29,3.71A25.59,25.59,0,0,0,833.07,600Z" transform="translate(-88.65 -57.09)"/><path d="M840.61,585.1a23.59,23.59,0,0,1,2.95-3.38,23,23,0,0,1,.83-3.9l0,0a25.68,25.68,0,0,0-2.2,3.59A26.76,26.76,0,0,0,840.61,585.1Z" transform="translate(-88.65 -57.09)"/><path d="M904.9,521a20.82,20.82,0,0,1-3.43,2.74,22.45,22.45,0,0,1-.63,6.79,18.75,18.75,0,0,1,2,.46,24.76,24.76,0,0,1,4.23-1.83c10.18-3.34,20.47.21,23,7.92a11.68,11.68,0,0,1,.32,6c3.35-3.94,4.74-8.74,3.3-13.14-2.54-7.71-12.84-11.26-23-7.92a24.76,24.76,0,0,0-4.23,1.83c-.65-.18-1.32-.34-2-.46C904.65,522.59,904.79,521.8,904.9,521Z" transform="translate(-88.65 -57.09)"/><path d="M829.35,607.49a25.09,25.09,0,0,0-2.29,3.71,26.56,26.56,0,0,0-1.54,3.74,24.48,24.48,0,0,1,3-3.4A22.92,22.92,0,0,1,829.35,607.49Z" transform="translate(-88.65 -57.09)"/><path d="M891.09,491.54a22,22,0,0,1,.17-4.41,24.93,24.93,0,0,0-4.78,6.57,25.63,25.63,0,0,0-1.52,3.73A22.75,22.75,0,0,1,891.09,491.54Z" transform="translate(-88.65 -57.09)"/><path d="M875.4,579.1a24.29,24.29,0,0,1-1,4.38,26.67,26.67,0,0,0,2.09-3.44,25.49,25.49,0,0,0,1.63-4A24.23,24.23,0,0,1,875.4,579.1Z" transform="translate(-88.65 -57.09)"/><path d="M860.32,608.92a24.15,24.15,0,0,1-1,4.38,25.65,25.65,0,0,0,2.1-3.44,26.47,26.47,0,0,0,1.63-4A23.57,23.57,0,0,1,860.32,608.92Z" transform="translate(-88.65 -57.09)"/><path d="M867.86,594a24.11,24.11,0,0,1-1,4.38A26.67,26.67,0,0,0,869,595a25.49,25.49,0,0,0,1.63-4A24.23,24.23,0,0,1,867.86,594Z" transform="translate(-88.65 -57.09)"/><path d="M882.94,564.19a24,24,0,0,1-1,4.37,25.89,25.89,0,0,0,2.09-3.43,25.48,25.48,0,0,0,1.64-4.07A23.22,23.22,0,0,1,882.94,564.19Z" transform="translate(-88.65 -57.09)"/><path d="M833.57,526.48c7.72-2.53,16.68,3.66,20,13.83a25.68,25.68,0,0,1,1,4.51,21.18,21.18,0,0,1,4.44,4.73,25.53,25.53,0,0,1,2.08-5.75c.35-.68.73-1.33,1.12-2a21.07,21.07,0,0,0-4-4.18,25.38,25.38,0,0,0-1-4.5c-3.34-10.17-12.3-16.37-20-13.83-4.4,1.44-7.44,5.41-8.62,10.43A11.69,11.69,0,0,1,833.57,526.48Z" transform="translate(-88.65 -57.09)"/><path d="M869.37,534.48a21.85,21.85,0,0,1,.18-4.4,24.73,24.73,0,0,0-4.79,6.57,25.07,25.07,0,0,0-1.52,3.72A23,23,0,0,1,869.37,534.48Z" transform="translate(-88.65 -57.09)"/><path d="M880.23,513a21.85,21.85,0,0,1,.18-4.4,24.52,24.52,0,0,0-4.79,6.56,25.63,25.63,0,0,0-1.52,3.73A22.75,22.75,0,0,1,880.23,513Z" transform="translate(-88.65 -57.09)"/><path d="M852.78,623.83a24.25,24.25,0,0,1-1,4.39,25.73,25.73,0,0,0,3.73-7.49A23.57,23.57,0,0,1,852.78,623.83Z" transform="translate(-88.65 -57.09)"/></g><path d="M948.52,430.71a23.68,23Line truncated
|
||||
|
Before Width: | Height: | Size: 39 KiB After Width: | Height: | Size: 32 KiB |
@@ -1,28 +1,33 @@
|
||||
<ol class="breadcrumb ">
|
||||
<li class="breadcrumb-item"><a href="{% url '' %}"><i class="fas fa-fw fa-tachometer-alt"></i> Tableau de bord</a></li>
|
||||
{% if isset($this->breadcrumb) %}
|
||||
{% php $routeTree = $this->breadcrumb->getRouteTree($this->session->get('lean.route')) %}
|
||||
|
||||
{% foreach $this->breadcrumb ?? [] as $crumb %}
|
||||
<li class="breadcrumb-item {{ ( $crumb['active'] ?? false ) ? 'active' : '' }}">
|
||||
{% if ! ($crumb['active'] ?? false) %}
|
||||
{? $last = $crumb ?}
|
||||
{% if count($routeTree) %}
|
||||
<ol class="breadcrumb mb-4 px-3 py-2">
|
||||
{% foreach $routeTree as $index => $crumb %}
|
||||
<li class="breadcrumb-item {% if $crumb->current %}active{% endif %}">
|
||||
{% if ! $crumb->current %}
|
||||
{% php $last = $crumb %}
|
||||
|
||||
<a href="{% url $crumb['url'] %}">
|
||||
{% if $crumb['icon'] ?? false %}
|
||||
<i class="fa fa-{{ $crumb['icon'] }}"></i>
|
||||
<a href="{% route $crumb->routeAnnotation->name %}">
|
||||
{% if $crumb->icon ?? false %}
|
||||
<i class="fa fa-{{ $crumb->icon }}"></i>
|
||||
{% endif %}
|
||||
|
||||
{{ $crumb['title'] }}
|
||||
<span>{{ lang($crumb->lang, get_defined_vars()) }}</span>
|
||||
</a>
|
||||
{% else %}
|
||||
{% if $crumb['icon'] ?? false %}
|
||||
<i class="fa fa-{{ $crumb['icon'] }}"></i>
|
||||
{% if $crumb->icon ?? false %}
|
||||
<i class="fa fa-{{ $crumb->icon }}"></i>
|
||||
{% endif %}
|
||||
<span>{{ $crumb['title'] }}</span>
|
||||
|
||||
<span>{{ lang($crumb->lang, get_defined_vars()) }}</span>
|
||||
{% endif %}
|
||||
</li>
|
||||
{% endforeach %}
|
||||
|
||||
{% if $last ?? false %}
|
||||
<li class="breadcrumb-last-item ml-auto"><a href="{{ url( $last['url']) }}"><i class="fas fa-chevron-circle-left"></i> Retour</a></li>
|
||||
{# if $last ?? false %}
|
||||
<li class="breadcrumb-last-item ml-auto"><a href="{{ ( $last['route'] ?? false ) ? $last['route'] : url($last['url']) }}"><i class="fas fa-chevron-circle-left"></i> Retour</a></li>
|
||||
{% endif #}
|
||||
</ol>
|
||||
{% endif %}
|
||||
</ol>
|
||||
{% endif %}
|
||||
@@ -31,15 +31,17 @@
|
||||
{% foreach range(0, 5) as $week %}
|
||||
<div class="week">
|
||||
{% foreach range(0, 6) as $day %}
|
||||
{% php $dayType = in_array($day, [0, 6]) ? 'week-end' : 'week-day' %}
|
||||
|
||||
{% if ( $week * 6 + $day >= $index ) && ( $currentDay < $dayCount ) %}
|
||||
{% php $currentDay++; %}
|
||||
|
||||
{% slot "day.content", new \DateTime("$year-$month-$currentDay"), date("$year-$month-$currentDay") === date('Y-n-j') %}
|
||||
<div class="day-box {{ $today ? 'today' : '' }}">{{ $date->format('d') }}</div>
|
||||
<div class="day-box {{ $today ? 'today' : '' }} {{ $dayType }}">{{ $date->format('d') }}</div>
|
||||
{% endslot %}
|
||||
{% else %}
|
||||
{% slot "day.empty", $day, $month, $year %}
|
||||
<div class="day-box"></div>
|
||||
<div class="day-box {{ $dayType }}"></div>
|
||||
{% endslot %}
|
||||
{% endif %}
|
||||
{% endforeach %}
|
||||
|
||||
@@ -6,9 +6,11 @@
|
||||
|
||||
<li class="page-item {{ $page === 1 ? 'active' : '' }}"><a class="page-link" href="{% url.parameters $url, [ 'page' => 1 ] + get() %}">1</a></li>
|
||||
|
||||
{% if $pageCount > 1%}
|
||||
{% foreach range(2, $pageCount < $maxPage ? $pageCount : $maxPage) as $pageIndex %}
|
||||
<li class="page-item {{ $page === $pageIndex ? 'active' : '' }}"><a class="page-link" href="{% url.parameters $url, [ 'page' => $pageIndex ] + get() %}">{{ $pageIndex }}</a></li>
|
||||
{% endforeach %}
|
||||
{% endif %}
|
||||
|
||||
<li class="page-item {{ $page === $pageCount ? 'disabled' : '' }}"><a class="page-link" href="{% url.parameters $url, [ 'page' => $page + 1 ] + get() %}">{% lang "lean.widget.pagination.next" %}</a></li>
|
||||
</ul>
|
||||
|
||||
Reference in new issue
Block a user