Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds sponsors and popular projects to the homepage #202

Open
wants to merge 2 commits into
base: staging
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions bootstrap/scss/_custom-styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -333,3 +333,40 @@ article {
.repository-card {
border-bottom: 1px solid rgba(0,0,0,.125) ;
}

.homepage-listing {
.card {
margin-bottom: 1.5rem;
}

.card-title, .card-text {
margin-bottom: 1rem;
}

.listing-icon {
font-size: 1.5rem;
}

.card-footer {
p {
color: rgba(0,0,0,.7);
font-weight: bold;
}
}

.sponsor-item {
margin: 1rem 0;

img {
max-height: 2.5rem;
}
}

.project-item {
margin: 1rem 0;

img {
max-height: 2.5rem;
}
}
}
27 changes: 0 additions & 27 deletions config/autoload/commercial-vendors.global.php

This file was deleted.

123 changes: 123 additions & 0 deletions config/autoload/home-page-content.global.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
<?php

declare(strict_types=1);

// phpcs:disable Generic.Files.LineLength.TooLong

return [
'commercial-vendors' => [
[
'name' => 'Roave',
'logo' => '/images/vendors/roave.png',
'url' => 'https://roave.com',
'text' => 'Roave is a full-service web development firm, offering consulting, training, software development, and more.',
],
[
'name' => 'Zend by Perforce',
'logo' => '/images/vendors/zend.png',
'url' => 'https://www.zend.com/products/laminas-enterprise-support',
'text' => 'Zend is "The PHP Company", and offers training, services, and production support for Laminas and other PHP applications.',
],
[
'name' => 'Apidemia',
'logo' => '/images/vendors/apidemia.png',
'url' => 'https://www.apidemia.com',
'text' => 'Apidemia is a web development company, offering software development and consulting. Since 2005, we have focused on the PHP ecosystem, and our tools of trade have been Zend Framework 1, 2, and 3, and then Laminas and Mezzio. We created DotKernel, a collection of PSR-7 Middleware applications built on top of the Mezzio microframework and Laminas components.',
],
],
'projects-using-components' => [
[
'name' => 'Magento',
'logo' => '/images/projects/magento.png',
],
[
'name' => 'Owncloud',
'logo' => '/images/projects/owncloud.png',
],
[
'name' => 'Drupal',
'logo' => '/images/projects/drupal.png',
],
[
'name' => 'Laravel',
'logo' => '/images/projects/laravel.png',
],
[
'name' => 'CodeIgniter',
'logo' => '/images/projects/codeigniter.png',
],
[
'name' => 'Shopware',
'logo' => '/images/projects/shopware.png',
],
[
'name' => 'CakePHP',
'logo' => '/images/projects/cakephp.png',
],
[
'name' => 'Spiral Framework',
'logo' => '/images/projects/spiral-framework.png',
],
[
'name' => 'Slim Framework',
'logo' => '/images/projects/slim-framework.png',
],
[
'name' => 'Silverstripe',
'logo' => '/images/projects/silverstripe.png',
],
[
'name' => 'Joomla',
'logo' => '/images/projects/joomla.png',
],
[
'name' => 'Kirby CMS',
'logo' => '/images/projects/kirby-cms.png',
],
[
'name' => 'Wallabag',
'logo' => '/images/projects/wallabag.png',
],
[
'name' => 'Flarum',
'logo' => '/images/projects/flarum.png',
],
],
'sponsors' => [
[
'name' => 'Check24',
'logo' => '/images/sponsors/check24.png',
'url' => 'https://www.check24.de/',
],
[
'name' => 'diasyst',
'logo' => '/images/sponsors/diasyst.png',
'url' => 'https://www.diasyst.com/',
],
[
'name' => 'Webador',
'logo' => '/images/sponsors/webador.png',
'url' => 'https://www.webador.co.uk/',
],
[
'name' => 'Mehrkanal',
'logo' => '/images/sponsors/mehrkanal.png',
'url' => 'https://www.mehrkanal.com/',
],
[
'name' => 'Apidemia',
'logo' => '/images/vendors/apidemia.png',
'url' => 'https://www.apidemia.com',
],
[
'name' => 'Switch Systems',
'logo' => '/images/sponsors/switch-systems.png',
'url' => 'https://switchsystems.co.uk/',
],
[
'name' => 'Travello',
'logo' => '/images/sponsors/travello.png',
'url' => 'https://travelloapp.com/',
],
],
];
Binary file added public/images/projects/cakephp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/projects/codeigniter.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/projects/drupal.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/projects/flarum.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/projects/joomla.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/projects/kirby-cms.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/projects/laravel.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/projects/magento.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/projects/owncloud.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/projects/shopware.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/projects/silverstripe.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/projects/slim-framework.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/projects/spiral-framework.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/projects/wallabag.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/sponsors/check24.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/sponsors/diasyst.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/sponsors/mehrkanal.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/sponsors/switch-systems.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/sponsors/travello.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/sponsors/webador.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 11 additions & 8 deletions src/App/Handler/HomePageHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,23 @@

class HomePageHandler implements RequestHandlerInterface
{
private array $vendors;
private TemplateRendererInterface $renderer;

public function __construct(array $vendors, TemplateRendererInterface $renderer)
{
$this->vendors = $vendors;
$this->renderer = $renderer;
public function __construct(
private array $vendors,
private array $sponsors,
private array $projects,
private TemplateRendererInterface $renderer
) {
}

public function handle(ServerRequestInterface $request): ResponseInterface
{
return new HtmlResponse($this->renderer->render(
'app::home-page',
['commercialVendors' => $this->vendors],
[
'commercialVendors' => $this->vendors,
'sponsors' => $this->sponsors,
'projects' => $this->projects,
],
));
}
}
8 changes: 7 additions & 1 deletion src/App/Handler/HomePageHandlerFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,15 @@ public function __invoke(ContainerInterface $container): HomePageHandler
$commercialVendors = $container->get('config')['commercial-vendors'] ?? [];
assert(is_array($commercialVendors));

$projects = $container->get('config')['projects-using-components'] ?? [];
assert(is_array($projects));

$sponsors = $container->get('config')['sponsors'] ?? [];
assert(is_array($sponsors));

$renderer = $container->get(TemplateRendererInterface::class);
assert($renderer instanceof TemplateRendererInterface);

return new HomePageHandler($commercialVendors, $renderer);
return new HomePageHandler($commercialVendors, $sponsors, $projects, $renderer);
}
}
63 changes: 59 additions & 4 deletions templates/app/home-page.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ declare(strict_types=1);
/**
* @var League\Plates\Template\Template $this
* @var list<array{name: string, logo: string, url: string, text: string}> $commercialVendors
* @var list<array{name: string, logo: string, url: string, text: string}> $sponsors
* @var list<array{name: string, url: string}> $projects
*/

$this->layout('layout::default', ['title' => 'Home']);
Expand Down Expand Up @@ -101,7 +103,7 @@ $this->layout('layout::default', ['title' => 'Home']);
</div>

<div class="container mb-4">
<div class="card text-white text-center support-banner">
<div class="card text-white text-center support-banner shadow">
<div class="card-body">
<h1 class="card-title">Donate</h1>
<p class="card-text">Support Laminas Developers Directly</p>
Expand All @@ -113,8 +115,59 @@ $this->layout('layout::default', ['title' => 'Home']);
</div>
</div>

<div class="container">
<div class="card text-center">
<div class="container homepage-listing">
<div class="card sponsors text-center shadow ">
<div class="card-body">
<h4>Our Sponsors</h4>
<p>
The projects of Laminas are free, open source software made possible by many sponsors.
</p>

<div class="container">
<div class="row align-items-center justify-content-center">
<?php foreach ($sponsors as $sponsor): ?>
<div class="sponsor-item col-12 col-sm-6 col-md-4 col-lg-4">
<a href="<?= $sponsor['url'] ?>" target="_blank">
<img class="img-fluid" src="<?= $this->escapeHtmlAttr($sponsor['logo']) ?>" alt="<?= $this->escapeHtmlAttr($sponsor['name']) ?>">
</a>
</div>
<?php endforeach ?>
</div>
</div>

<div class="mt-4 mb-4">
<a href="<?= $this->url('app.support') ?>" class="btn btn-secondary text-white">
<i class="bi-heart-fill"></i>
And more...
</a>
</div>
</div>

<div class="card-footer align-items-center">
<p class="mt-3">Thank you so much!</p>
</div>
</div>

<div class="card projects text-center shadow">
<div class="card-body">
<h4 class="card-title">Popular Projects Which Use Components of Laminas</h4>

<div class="container">
<div class="row align-items-center justify-content-center">
<?php foreach ($projects as $project): ?>
<div class="project-item col-12 col-sm-6 col-md-4 col-lg-2">
<img class="img-fluid" src="<?= $this->escapeHtmlAttr($project['logo']) ?>" alt="<?= $this->escapeHtmlAttr($project['name']) ?>">
</div>
<?php endforeach ?>
</div>
<p class="card-text project">...</p>
</div>

<i class="bi bi-arrow-through-heart-fill listing-icon"></i>
</div>
</div>

<div class="card commercial-vendors text-center shadow">
<div class="card-body">
<h4 class="card-title">Commercial Vendors</h4>
<p class="card-text">
Expand All @@ -125,7 +178,9 @@ $this->layout('layout::default', ['title' => 'Home']);
<div class="row align-items-center justify-content-center">
<?php foreach ($commercialVendors as $commercialVendor): ?>
<div class="col-12 col-sm-6 col-md-4 col-lg-2">
<img class="img-fluid" src="<?= $this->escapeHtmlAttr($commercialVendor['logo']) ?>" alt="<?= $this->escapeHtmlAttr($commercialVendor['name']) ?>">
<a href="<?= $commercialVendor['url'] ?>" target="_blank">
<img class="img-fluid" src="<?= $this->escapeHtmlAttr($commercialVendor['logo']) ?>" alt="<?= $this->escapeHtmlAttr($commercialVendor['name']) ?>">
</a>
</div>
<?php endforeach ?>
</div>
Expand Down