* judges menu removed

* awardees reactored into awards, judges are now included on a per year basis
* lots of minor style adjustments to follow the design guideline
This commit is contained in:
Dávid Danyi 2018-05-08 18:10:38 +02:00
parent 4aeaae2520
commit b93616ab34
18 changed files with 121 additions and 45 deletions

View File

@ -43,8 +43,8 @@ return function (Application $app, MiddlewareFactory $factory, ContainerInterfac
'the-prize.article' 'the-prize.article'
); );
$app->get('/judges', App\Handler\JudgesHandler::class, 'judges'); // $app->get('/judges', App\Handler\JudgesHandler::class, 'judges');
$app->get('/awardees', App\Handler\AwardeeRedirectHandler::class, 'awardees'); $app->get('/awards', App\Handler\AwardeeRedirectHandler::class, 'awardees');
$app->get('/awardees/{year:\d+}', App\Handler\AwardeeHandler::class, 'awardees-by-year'); $app->get('/awards/{year:\d+}', App\Handler\AwardeeHandler::class, 'awardees-by-year');
$app->get('/awardee/{slug}', App\Handler\ProfileHandler::class, 'awardee'); $app->get('/awardee/{slug}', App\Handler\ProfileHandler::class, 'awardee');
}; };

Binary file not shown.

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 394 KiB

After

Width:  |  Height:  |  Size: 342 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 57 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 57 KiB

After

Width:  |  Height:  |  Size: 9.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 57 KiB

After

Width:  |  Height:  |  Size: 9.4 KiB

View File

@ -2,12 +2,11 @@ html,
body { body {
height: 100%; height: 100%;
color: #003b70; color: #003b70;
--header-size: 22pt;
} }
h1 { h1 {
font-family: 'PT Serif', serif; font-family: 'PT Serif', serif;
font-size: var(--header-size); font-size: 22pt;
} }
a:link, a:link,
@ -49,6 +48,7 @@ section.home {
display: grid; display: grid;
grid-column-gap: 20px; grid-column-gap: 20px;
grid-row-gap: 20px; grid-row-gap: 20px;
align-self: start;
} }
section.article { section.article {
@ -80,14 +80,15 @@ footer.main-footer {
footer .footer-lead { footer .footer-lead {
display: inline-block; display: inline-block;
width: 200px; width: 200px;
font-weight: 700;
} }
footer .sigma-logo { footer .sigma-logo {
vertical-align: -10px; vertical-align: middle;
} }
footer .ericsson-logo { footer .ericsson-logo {
vertical-align: -4px; vertical-align: middle;
margin-left: 50px; margin-left: 50px;
} }
@ -110,7 +111,8 @@ footer .ericsson-logo {
grid-template-areas: grid-template-areas:
"bigimg bigimg" "bigimg bigimg"
"article article" "article article"
"smallimg1 smallimg2"; "smallimg1 smallimg2"
"download download";
} }
section.home > img { section.home > img {
@ -190,14 +192,12 @@ footer .ericsson-logo {
} }
footer .sigma-logo { footer .sigma-logo {
vertical-align: -6px;
width: 78px; width: 78px;
} }
footer .ericsson-logo { footer .ericsson-logo {
width: 82px; width: 82px;
margin-left: 10px; margin-left: 10px;
vertical-align: -1px;
} }
section.profile { section.profile {
@ -236,7 +236,8 @@ footer .ericsson-logo {
grid-template-areas: grid-template-areas:
"bigimg bigimg" "bigimg bigimg"
"smallimg1 smallimg2" "smallimg1 smallimg2"
"article article"; "article article"
"download download";
} }
section.article { section.article {
@ -282,7 +283,7 @@ footer .ericsson-logo {
} }
section.awardee { section.awardee {
grid-template-columns: 180px 380px; grid-template-columns: 180px 360px;
} }
section.awardees > .awardee > img.profile, section.awardees > .awardee > img.profile,
@ -293,7 +294,7 @@ footer .ericsson-logo {
} }
section.profile { section.profile {
grid-template-columns: 580px; grid-template-columns: 560px;
grid-template-rows: auto auto; grid-template-rows: auto auto;
grid-template-areas: grid-template-areas:
"profile" "profile"
@ -317,12 +318,13 @@ footer .ericsson-logo {
} }
section.home { section.home {
grid-template-columns: 560px 280px; /*grid-template-columns: 580px 280px;*/
grid-template-columns: 430px 130px 280px;
grid-template-rows: 175px 175px auto; grid-template-rows: 175px 175px auto;
grid-template-areas: grid-template-areas:
"bigimg smallimg1" "bigimg bigimg smallimg1"
"bigimg smallimg2" "bigimg bigimg smallimg2"
"article article"; "article download download";
} }
section.article { section.article {
@ -355,7 +357,7 @@ footer .ericsson-logo {
} }
section.awardee { section.awardee {
grid-template-columns: 180px 380px; grid-template-columns: 180px 360px;
} }
section.awardees > .awardee > img.profile, section.awardees > .awardee > img.profile,
@ -366,7 +368,7 @@ footer .ericsson-logo {
} }
section.profile { section.profile {
grid-template-columns: 580px 380px; grid-template-columns: 560px 380px;
grid-template-rows: auto; grid-template-rows: auto;
grid-template-areas: grid-template-areas:
"profile sidebar" "profile sidebar"
@ -398,6 +400,23 @@ section.home > article {
grid-area: article; grid-area: article;
} }
section.home > section.download {
grid-area: download;
}
section.download a.download {
display: block;
margin-bottom: 3px;
overflow: hidden;
}
section.download a.download > img{
float: left;
width: 31px;
height: 30px;
margin-right: 5px;
}
/* the prize (article) */ /* the prize (article) */
section.article > article { section.article > article {
grid-area: article; grid-area: article;
@ -416,6 +435,12 @@ section.judges {
grid-area: content; grid-area: content;
} }
section.judges > h1 {
clear: both;
padding-top: 40px;
margin-bottom: 20px;
}
section.judge > img.profile { section.judge > img.profile {
float: left; float: left;
width: 80px; width: 80px;
@ -450,6 +475,8 @@ section.profile {
display: grid; display: grid;
grid-column-gap: 20px; grid-column-gap: 20px;
grid-row-gap: 20px; grid-row-gap: 20px;
border-left: 1px solid #003b70;
padding-left: 20px;
} }
section.profile > aside.sidebar > img { section.profile > aside.sidebar > img {
@ -479,7 +506,7 @@ section.awardee {
.awardee .year { .awardee .year {
grid-area: year; grid-area: year;
font-family: 'Raleway', sans-serif; font-family: 'PT Serif', serif;
font-size: 32pt; font-size: 32pt;
align-self: end; align-self: end;
} }
@ -496,6 +523,13 @@ section.awardee {
grid-area: content; grid-area: content;
} }
a.awardee > .description {
border-left: 1px solid #003b70;
padding-left: 10px;
font-family: 'Raleway', sans-serif;
font-style: italic;
}
/* common parts */ /* common parts */
header.main { header.main {
@ -539,7 +573,7 @@ nav > ul > li {
padding-left: 5px; padding-left: 5px;
font-weight: 700; font-weight: 700;
font-size: 16pt; font-size: 16pt;
line-height: 18pt; line-height: 24pt;
} }
nav > ul > li.current { nav > ul > li.current {

View File

@ -5,6 +5,7 @@ declare(strict_types=1);
namespace App\Handler; namespace App\Handler;
use App\Service\AwardeeManager; use App\Service\AwardeeManager;
use App\Service\JudgeManager;
use Psr\Http\Message\ResponseInterface; use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface; use Psr\Http\Message\ServerRequestInterface;
use Psr\Http\Server\RequestHandlerInterface; use Psr\Http\Server\RequestHandlerInterface;
@ -24,32 +25,39 @@ class AwardeeHandler implements RequestHandlerInterface
/** @var UrlHelper */ /** @var UrlHelper */
private $urlHelper; private $urlHelper;
/** @var JudgeManager */
private $judgeManager;
public function __construct( public function __construct(
TemplateRendererInterface $template, TemplateRendererInterface $template,
AwardeeManager $awardeeManager, AwardeeManager $awardeeManager,
UrlHelper $urlHelper UrlHelper $urlHelper,
JudgeManager $judgeManager
) )
{ {
$this->template = $template; $this->template = $template;
$this->awardeeManager = $awardeeManager; $this->awardeeManager = $awardeeManager;
$this->urlHelper = $urlHelper; $this->urlHelper = $urlHelper;
$this->judgeManager = $judgeManager;
} }
public function handle(ServerRequestInterface $request): ResponseInterface public function handle(ServerRequestInterface $request): ResponseInterface
{ {
$year = $request->getAttribute('year'); $year = $request->getAttribute('year');
$awardees = $this->awardeeManager->getJudgesByYear((int)$year); $awardees = $this->awardeeManager->getAwardeesByYear((int)$year);
$judges = $this->judgeManager->getJudgesByYear((int)$year);
if (count($awardees) === 1) { // if (count($awardees) === 1) {
$url = $this->urlHelper->generate('awardee', [ // $url = $this->urlHelper->generate('awardee', [
'slug' => $awardees[0]->getSlug(), // 'slug' => $awardees[0]->getSlug(),
]); // ]);
return new RedirectResponse($url); // return new RedirectResponse($url);
} // }
return new HtmlResponse($this->template->render("app::awardees", [ return new HtmlResponse($this->template->render("app::awardees", [
'year' => $year, 'year' => $year,
'awardees' => $awardees, 'awardees' => $awardees,
'judges' => $judges,
])); ]));
} }
} }

View File

@ -5,6 +5,7 @@ declare(strict_types=1);
namespace App\Handler; namespace App\Handler;
use App\Service\AwardeeManager; use App\Service\AwardeeManager;
use App\Service\JudgeManager;
use Psr\Container\ContainerInterface; use Psr\Container\ContainerInterface;
use Psr\Http\Server\RequestHandlerInterface; use Psr\Http\Server\RequestHandlerInterface;
use Zend\Expressive\Helper\UrlHelper; use Zend\Expressive\Helper\UrlHelper;
@ -17,6 +18,7 @@ class AwardeeHandlerFactory
$template = $container->get(TemplateRendererInterface::class); $template = $container->get(TemplateRendererInterface::class);
$awardeeManager = $container->get(AwardeeManager::class); $awardeeManager = $container->get(AwardeeManager::class);
$urlHelper = $container->get(UrlHelper::class); $urlHelper = $container->get(UrlHelper::class);
return new AwardeeHandler($template, $awardeeManager, $urlHelper); $judgeManager = $container->get(JudgeManager::class);
return new AwardeeHandler($template, $awardeeManager, $urlHelper, $judgeManager);
} }
} }

View File

@ -84,11 +84,11 @@ class NavigationExtension implements ExtensionInterface
'uri' => $this->getUriFromRouter('the-prize.article', ['article' => 'gran-prize-award-events']) 'uri' => $this->getUriFromRouter('the-prize.article', ['article' => 'gran-prize-award-events'])
]); ]);
$this->menu->addChild(strtoupper("Judges"), [ // $this->menu->addChild(strtoupper("Judges"), [
'uri' => $this->getUriFromRouter('judges') // 'uri' => $this->getUriFromRouter('judges')
]); // ]);
$awardeesMenu = $this->menu->addChild(strtoupper("Awardees"), [ $awardeesMenu = $this->menu->addChild(strtoupper("Awards"), [
'uri' => $this->getUriFromRouter('awardees') 'uri' => $this->getUriFromRouter('awardees')
]); ]);
$this->populateAwardeesSubmenu($awardeesMenu); $this->populateAwardeesSubmenu($awardeesMenu);

View File

@ -21,7 +21,7 @@ class AwardeeManager
* @param int $year * @param int $year
* @return Awardee[] * @return Awardee[]
*/ */
public function getJudgesByYear(int $year): ?array public function getAwardeesByYear(int $year): ?array
{ {
return $this->entityManager->getRepository(Awardee::class)->findBy([ return $this->entityManager->getRepository(Awardee::class)->findBy([
'year' => $year, 'year' => $year,
@ -32,7 +32,7 @@ class AwardeeManager
* @param string $slug * @param string $slug
* @return Awardee|null * @return Awardee|null
*/ */
public function getJudgeFromSlug(string $slug): ?Awardee public function getAwardeeFromSlug(string $slug): ?Awardee
{ {
/** @var Awardee $awardee */ /** @var Awardee $awardee */
$awardee = $this->entityManager->getRepository(Awardee::class)->findOneBy([ $awardee = $this->entityManager->getRepository(Awardee::class)->findOneBy([

View File

@ -118,4 +118,14 @@ class JudgeManager
] ]
]; ];
} }
}
/**
* @param int $year
* @return array
* @todo implement real filter by year
*/
public function getJudgesByYear(int $year)
{
return $this->getJudges();
}
}

View File

@ -8,4 +8,6 @@
<div class="description"><?= $this->batch($awardee->getText(), 'excerpt|mdtohtml') ?></div> <div class="description"><?= $this->batch($awardee->getText(), 'excerpt|mdtohtml') ?></div>
</a> </a>
<?php endforeach; ?> <?php endforeach; ?>
<?php $this->insert('app::judges.inc', ['judges' => $judges, 'year' => $year]) ?>
</section> </section>

View File

@ -5,6 +5,19 @@
<img class="simg2" src="<?= $this->serverurl('/img/home_3.png') ?>"> <img class="simg2" src="<?= $this->serverurl('/img/home_3.png') ?>">
<article> <article>
<h1>The Gran Prize</h1> <h1>The Gran Prize</h1>
<p>is an annual prize awarded for outstandingly innovative solutions in response to the most pressing issues of our planet, in the field of environmental protection, sustainable development, design, medicine, health preservation and development and education.</p> <p>is an annual prize awarded for outstandingly innovative solutions in response to the most pressing issues of
our planet, in the field of environmental protection, sustainable development, design, medicine, health
preservation and development and education.</p>
</article> </article>
<section class="download">
<h1>2018 call for entry</h1>
<p>
<a class="download" href="<?= $this->serverurl('/downloads/granprize_entry_2018.pdf') ?>"><img
src="<?= $this->serverurl('/img/icon/downloadx2.png') ?>">Gran Prize Innovative Interdisciplinary
Award Call for Entry 2018</a>
<a class="download" href="<?= $this->serverurl('/downloads/granprize_kiiras_2018.pdf') ?>"><img
src="<?= $this->serverurl('/img/icon/downloadx2.png') ?>">Gran Prize Interdiszciplináris Innovatív
Díj Pályázati kiírás 2018</a>
</p>
</section>
</section> </section>

View File

@ -0,0 +1,10 @@
<section class="judges">
<h1><?=$year?> judges</h1>
<?php foreach ($judges as $judge): ?>
<section class="judge">
<img class="profile" src="<?= $this->serverurl(sprintf('/img/judges/%s.jpg', $judge['image'])) ?>">
<span class="title"><?= $judge['name']?></span><br>
<span class="description"><?= $judge['desc']?></span>
</section>
<?php endforeach; ?>
</section>

View File

@ -17,16 +17,13 @@
<div class="title"> <div class="title">
<a href="<?= $this->serverurl('/') ?>"> <a href="<?= $this->serverurl('/') ?>">
Gran Prize Gran Prize
</a> </a>
<img class="granprize-logo" src="<?= $this->serverurl('/img/logo/gran_prize_logo.png') ?>">
</div> </div>
<div class="description"> <div class="description">
<a href="<?= $this->serverurl('/') ?>"> Interdisciplinary<br>
<img class="granprize-logo" src="<?= $this->serverurl('/img/logo/gran_prize_logo.png') ?>"> Innovative<br>
Interdisciplinary<br> Award
Innovative<br>
Award
</a>
</div> </div>
</header> </header>
<nav class="main"><?= $this->navigation() ?></nav> <nav class="main"><?= $this->navigation() ?></nav>