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

View File

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

View File

@ -5,6 +5,7 @@ declare(strict_types=1);
namespace App\Handler;
use App\Service\AwardeeManager;
use App\Service\JudgeManager;
use Psr\Container\ContainerInterface;
use Psr\Http\Server\RequestHandlerInterface;
use Zend\Expressive\Helper\UrlHelper;
@ -17,6 +18,7 @@ class AwardeeHandlerFactory
$template = $container->get(TemplateRendererInterface::class);
$awardeeManager = $container->get(AwardeeManager::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'])
]);
$this->menu->addChild(strtoupper("Judges"), [
'uri' => $this->getUriFromRouter('judges')
]);
// $this->menu->addChild(strtoupper("Judges"), [
// 'uri' => $this->getUriFromRouter('judges')
// ]);
$awardeesMenu = $this->menu->addChild(strtoupper("Awardees"), [
$awardeesMenu = $this->menu->addChild(strtoupper("Awards"), [
'uri' => $this->getUriFromRouter('awardees')
]);
$this->populateAwardeesSubmenu($awardeesMenu);

View File

@ -21,7 +21,7 @@ class AwardeeManager
* @param int $year
* @return Awardee[]
*/
public function getJudgesByYear(int $year): ?array
public function getAwardeesByYear(int $year): ?array
{
return $this->entityManager->getRepository(Awardee::class)->findBy([
'year' => $year,
@ -32,7 +32,7 @@ class AwardeeManager
* @param string $slug
* @return Awardee|null
*/
public function getJudgeFromSlug(string $slug): ?Awardee
public function getAwardeeFromSlug(string $slug): ?Awardee
{
/** @var Awardee $awardee */
$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>
</a>
<?php endforeach; ?>
<?php $this->insert('app::judges.inc', ['judges' => $judges, 'year' => $year]) ?>
</section>

View File

@ -5,6 +5,19 @@
<img class="simg2" src="<?= $this->serverurl('/img/home_3.png') ?>">
<article>
<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>
<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>

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">
<a href="<?= $this->serverurl('/') ?>">
Gran Prize
</a>
<img class="granprize-logo" src="<?= $this->serverurl('/img/logo/gran_prize_logo.png') ?>">
</div>
<div class="description">
<a href="<?= $this->serverurl('/') ?>">
<img class="granprize-logo" src="<?= $this->serverurl('/img/logo/gran_prize_logo.png') ?>">
Interdisciplinary<br>
Innovative<br>
Award
</a>
Interdisciplinary<br>
Innovative<br>
Award
</div>
</header>
<nav class="main"><?= $this->navigation() ?></nav>