- Added createStream methods and fixed multiple errors views

This commit is contained in:
Dave M. 2025-12-20 12:44:13 -05:00
parent 74a56bd72f
commit fdca37a79d
9 changed files with 17 additions and 19 deletions

View File

@ -34,7 +34,7 @@ class NotFoundDecorator implements NotFoundDecoratorInterface
return $this->throw404($request);
}
return $handler->handle($request);;
return $handler->handle($request);
}
public function throw404(ServerRequestInterface $request) : ResponseInterface

View File

@ -5,7 +5,9 @@ namespace Lean\Factory;
use Laminas\Diactoros\Response\{EmptyResponse, HtmlResponse, JsonResponse, RedirectResponse, TextResponse};
use Lean\Response\{ DownloadResponse, ImageResponse, FileDownloadResponse, PdfResponse };
use Laminas\Diactoros\Response;
use Laminas\Diactoros\StreamFactory;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\StreamInterface;
class HttpFactory implements HttpFactoryInterface
{
@ -58,4 +60,9 @@ class HttpFactory implements HttpFactoryInterface
{
return new FileDownloadResponse($path, $code, $headers);
}
public static function createStream(string $content): StreamInterface
{
return new StreamFactory()->createStream($content);
}
}

View File

@ -6,6 +6,7 @@ use Laminas\Diactoros\Response\{EmptyResponse, HtmlResponse, JsonResponse, Redir
use Lean\Response\{ DownloadResponse, ImageResponse, FileDownloadResponse, PdfResponse };
use Laminas\Diactoros\Response;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\StreamInterface;
interface HttpFactoryInterface
{
@ -19,4 +20,6 @@ interface HttpFactoryInterface
public static function createDownloadableResponse(string $data, string $filename, int $code = 200, array $headers = []) : ResponseInterface;
public static function createImageResponse(string $data, int $code = 200, array $headers = []) : ResponseInterface;
public static function createFileDownloadResponse(string $path, int $code = 200, array $headers = []) : ResponseInterface;
public static function createStream(string $content) : StreamInterface;
}

View File

@ -22,5 +22,5 @@
{% section "head.css" %}
.title {font-size:2rem}
.subtitle {font-size:1.25rem; padding-top: 1rem;}
.content {padding-top:1rem}
.content {background: #f7f7f7;padding: 7px;color: #8c3c3c;max-height:300px;overflow-y:auto}
{% endsection %}

View File

@ -18,9 +18,3 @@
{% view "lean/picto/undraw_lost" %}
</div>
{% endsection %}
{% section "head.css" %}
.title {font-size:2rem}
.subtitle {font-size:1.25rem; padding-top: 1rem;}
.content {padding-top:1rem}
{% endsection %}

View File

@ -17,10 +17,4 @@
<div class="picto-login">
{% view "lean/picto/undraw_error" %}
</div>
{% endsection %}
{% section "head.css" %}
.title {font-size:2rem}
.subtitle {font-size:1.25rem; padding-top: 1rem;}
.content {background: #f7f7f7;padding: 7px;color: #8c3c3c;max-height:300px;overflow-y:auto}
{% endsection %}
{% endsection %}

View File

@ -10,14 +10,14 @@
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bulma/0.7.1/css/bulma.min.css">
<style>
body {background:#272822}
body {background:#272822;min-height:100vh;}
#main-content {min-height: 100vh;width: 100vw;align-items:center;justify-content: center;}
#wrapper-content {max-width:960px; max-height:65vh;flex-direction:row-reverse; margin:0 10vw}
#wrapper-content .content-right {background:#efefef;padding:5vh 2vw;align-items:center;display:flex;justify-content:center; width:100%;border-radius:6px 0 0 6px}
#wrapper-content .content-left {background:#ffffff;padding:5vh 2vw;border-radius:0 6px 6px 0;display:flex;align-items:center;justify-content: center}
.form-user-login {width:80%;}
.picto-login svg {max-width:100%;}
.picto-login svg {max-width:100%;width:100%;max-height:33vh}
{% section "head.css" %}{% endsection %}
</style>

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 32 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB