@Title{Blog}@
@CSS{
	<?= file_get_contents("css/blog.css") ?>
}@
@ButtonsLeft{
	<?php if ($page>1){?>
		<button onclick="window.location.href='/blog/page/<?=$page-1?>'" title="Previous Page">
			<img src="/images/previous.svg" alt="Previous" />
		</button>
	<?php }?>
}@
@ButtonsRight{
	<?php if (Session::GetLoggedInUser()->HasAccess("gallery/manage")){?>
		<button onclick="window.location.href='/blog/manage'" title="Manage">
			<img src="/images/library.svg" alt="Library" />
		</button><br/>
	<?php }
	if ($page<$maxPages) { ?>
		<button onclick="window.location.href='/blog/page/<?=$page+1?>'" title="Next Page">
			<img src="/images/next.svg" alt="Next" />
		</button>
	<?php } ?>
}@
@Body{
	<?php foreach ($posts as $post){ ?>
		<h2><a href="/blog/view/<?=$post->PostUrl?>"><?=$post->PostTitle?></a></h2>
		<?=PostFormatter::FormatToHTML(PostFormatter::CloseOpenTag($post->GetPostPreview()))?>
		<small>Posted on <?=date("l \\t\h\\e jS \of F Y",strtotime($post->PostTimestamp))?></small>
		<p><a href="/blog/view/<?=$post->PostUrl?>">Read more...</a></p>
	<?php } ?>
}@