Skip to content

Commit 4c21476

Browse files
committed
nit
1 parent 6af262a commit 4c21476

4 files changed

Lines changed: 51 additions & 22 deletions

File tree

conferences/index.php

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,30 @@
1818
foreach ((new NewsHandler())->getConferences() as $entry) {
1919
$link = preg_replace('~^(http://php.net/|https://www.php.net/)~', '', $entry["id"]);
2020
$id = parse_url($entry["id"], PHP_URL_FRAGMENT);
21-
$date = date_format(date_create($entry["updated"]), 'd M Y');
22-
$date_w3c = date_format(date_create($entry["updated"]), DATE_W3C);
21+
22+
$nixtimestamp = date_create($entry["updated"]);
23+
if(isset($item["finalTeaserDate"])) {
24+
$nixtimestamp = date_create($entry["finalTeaserDate"]);
25+
}
26+
27+
$date = date_format($nixtimestamp, 'd M Y');
28+
$date_w3c = date_format($nixtimestamp, DATE_W3C);
2329

2430
$content .= '<div class="news__item" itemscope itemtype="https://schema.org/Event">';
31+
$content .= '<div class="news__heading">';
32+
$content .= '<div class="news__title">';
33+
$content .= '<a href="' . $link . '" id="' . $id . '" itemprop="name">' . $entry["title"] . '</a>';
34+
$content .= '</div>';
35+
$content .= '<div class="news__date" itemprop="startDate" content="' . $date_w3c . '">' . $date . '</div>';
36+
$content .= '</div>';
37+
2538
$content .= '<div class="news__content">';
26-
$content .= '<div class="news__date" itemprop="startDate" content="$date_w3c">' . $date . '</div>';
27-
$content .= '<div class="news__title"><a href="' . $link . '" id="' . $id . '" itemprop="name">' . $entry["title"] . '</a></div>';
2839
$content .= '<div class="news__text" itemprop="description">' . $entry["content"] . '</div>';
29-
$content .= '</div>';
3040
$content .= '<div class="news__image">';
3141
$content .= sprintf('<a href="%s"><img src="/images/news/%s" itemprop="image" alt="%s"></a>', $entry["newsImage"]["link"], $entry["newsImage"]["content"], $entry["title"]);
3242
$content .= '</div>';
3343
$content .= '</div>';
44+
$content .= '</div>';
3445
}
3546
$content .= "</div>";
3647

include/layout.inc

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -411,8 +411,13 @@ function print_news($news, $dog, $max = 5, $return = false) {
411411

412412
$published = substr($item["published"], 0, 10);
413413
$nixtimestamp = strtotime($published);
414+
415+
if(isset($item["finalTeaserDate"])) {
416+
$nixtimestamp = strtotime($item["finalTeaserDate"]);
417+
}
418+
414419
$newsdate = date("d M Y", $nixtimestamp);
415-
$newsdate_w3c = date_format(date_create($nixtimestamp), DATE_W3C);
420+
$newsdate_w3c = date(DATE_W3C, $nixtimestamp);
416421

417422
if ($return) {
418423
$retval[] = [
@@ -435,14 +440,16 @@ function print_news($news, $dog, $max = 5, $return = false) {
435440

436441
echo <<<EOT
437442
<div class="news__item" itemscope itemtype="https://schema.org/Event">
438-
<div class="news__content">
439-
<div class="news__date" itemprop="startDate" content="$newsdate_w3c">$newsdate</div>
443+
<div class="news__heading">
440444
<div class="news__title">
441445
<a href="{$permlink}" id="{$id}" rel="bookmark" itemprop="name">{$item["title"]}</a>
442446
</div>
447+
<div class="news__date" itemprop="startDate" content="$newsdate_w3c">$newsdate</div>
448+
</div>
449+
<div class="news__content">
443450
<div class="news__text" itemprop="description">{$item["content"]}</div>
451+
{$imageBlock}
444452
</div>
445-
{$imageBlock}
446453
</div>
447454
EOT;
448455
}

index.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,13 @@
6666
$date_w3c = date_format($date, DATE_W3C);
6767
$content .= <<<NEWSENTRY
6868
<div class="news__item" itemscope itemtype="https://schema.org/Event">
69-
<div class="news__content">
70-
<div class="news__date" itemprop="startDate" content="$date_w3c">$date_human</div>
69+
<div class="news__heading">
7170
<div class="news__title">
7271
<a href="{$link}" id="{$id}" itemprop="name">{$entry["title"]}</a>
7372
</div>
73+
<div class="news__date" itemprop="startDate" content="$date_w3c">$date_human</div>
74+
</div>
75+
<div class="news__content">
7476
<div class="news__text" itemprop="description">{$entry["content"]}</div>
7577
</div>
7678
</div>

styles/theme-base.css

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1422,11 +1422,6 @@ td {
14221422
}
14231423

14241424
.news__item {
1425-
font-family: var(--font-sans);
1426-
display: flex;
1427-
flex-direction: row;
1428-
justify-content: space-between;
1429-
gap: calc(var(--spacing) * 10);
14301425
padding-bottom: calc(calc(var(--spacing) * 10) * calc(1 - var(--tw-space-y-reverse)));
14311426
margin-block-start: calc(calc(var(--spacing) * 10) * var(--tw-space-y-reverse));
14321427
margin-block-end: calc(calc(var(--spacing) * 10) * calc(1 - var(--tw-space-y-reverse)));
@@ -1435,18 +1430,33 @@ td {
14351430
border-style: solid;
14361431
}
14371432

1433+
.news__heading {
1434+
display: flex;
1435+
flex-direction: row;
1436+
justify-content: space-between;
1437+
align-items: flex-end;
1438+
gap: calc(var(--spacing) * 10);
1439+
border-bottom: 1px dotted;
1440+
padding-bottom: calc(var(--spacing) * 3);
1441+
margin-bottom: calc(var(--spacing) * 3);
1442+
}
1443+
14381444
.news__item:last-child {
14391445
border-width: 0;
14401446
}
14411447

14421448
.news__content {
1449+
display: flex;
1450+
flex-direction: row;
1451+
justify-content: space-between;
1452+
gap: calc(var(--spacing) * 10);
14431453
font-size: var(--text-lg);
14441454
line-height: var(--tw-leading, var(--text-lg--line-height));
14451455
color: var(--color-gray-600);
14461456
}
14471457

14481458
.news__date {
1449-
color: var(--color-gray-600);
1459+
color: var(--content-text-color);
14501460
font-size: var(--text-base);
14511461
line-height: var(--tw-leading, var(--text-base--line-height));
14521462
}
@@ -1458,19 +1468,18 @@ td {
14581468
#layout-content .news__title a,
14591469
#layout-content .news__title a:link,
14601470
#layout-content .news__title a:visited {
1461-
color: var(--color-gray-800);
1462-
font-weight: var(--font-weight-bold);
1471+
color: #369;
1472+
font-weight: var(--font-weight-medium);
14631473
text-decoration: none;
14641474
border: 0;
1465-
font-size: var(--text-3xl);
1475+
font-size: var(--text-xl);
14661476
line-height: var(--tw-leading, var(--text-3xl--line-height));
14671477
}
14681478

14691479
.news__text {
1470-
color: var(--color-gray-600);
1480+
color: var(--content-text-color);
14711481
font-size: var(--text-base);
14721482
line-height: calc(var(--spacing) * 6);
1473-
margin-top: calc(var(--spacing) * 5);
14741483
}
14751484

14761485
.news__image {

0 commit comments

Comments
 (0)