1
0

AoC single + prism + better additional css/js handling

This commit is contained in:
2019-11-03 15:33:23 +01:00
parent 65f75c26ef
commit bdda2001e3
27 changed files with 565 additions and 108 deletions

View File

@@ -5,11 +5,6 @@ require_once (__DIR__ . '/../internals/adventofcode.php');
$year = $post['extras']['aoc:year'];
$assocdays = AdventOfCode::listSingleYearAssociative($year);
$prev_year = AdventOfCode::getPrevYear($year);
$next_year = AdventOfCode::getNextYear($year);
?>
<div class="boxedcontent blogcontent_plain">
@@ -26,37 +21,14 @@ $next_year = AdventOfCode::getNextYear($year);
<div class="bc_data">
<?php echo nl2br(Blog::getPostFragment($post)); ?>
<?php echo nl2br(htmlspecialchars(Blog::getPostFragment($post))); ?>
<div class="aoc_calendar_parent">
<div class="aoc_calendar">
<div class="aoc_calendar_header">
<?php
if ($prev_year !== null) echo '<a href="' . AdventOfCode::getURLForYear($prev_year) . '" class="aoc_calendar_header_link aoc_prev" >&lt;</a>';
else echo '<a href="#" class="aoc_calendar_header_link aoc_prev aoc_link_hidden" >&lt;</a>';
echo '<span class="aoc_calendar_header_title">'.$year.'</span>';
if ($next_year !== null) echo '<a href="' . AdventOfCode::getURLForYear($next_year) . '" class="aoc_calendar_header_link aoc_next" >&gt;</a>';
else echo '<a href="" class="aoc_calendar_header_link aoc_next aoc_link_hidden" >&gt;</a>';
?>
</div>
<?php
for ($i=0; $i<5; $i++)
{
echo '<div class="aoc_calendar_row">'."\n";
for ($j=0; $j<5; $j++)
{
$day = $assocdays[$i*5+$j];
if ($day === null) echo '<span class="aoc_calendar_field aoc_disabled">'.($i*5+$j+1).'</span>'."\n";
else echo '<a href="'.$day['url'].'" class="aoc_calendar_field aoc_enabled" >'.($i*5+$j+1).'</a>'."\n";
}
echo '</div>'."\n";
}
?>
</div>
</div>
<?php
global $PARAM_AOCCALENDAR;
$PARAM_AOCCALENDAR = ['year' => $year];
require (__DIR__ . '/../fragments/panel_aoc_calendar.php')
?>
</div>
</div>