2015-09-05 16:11:04 +00:00
|
|
|
{% extends 'global/master.tpl' %}
|
|
|
|
|
2015-09-15 20:37:29 +00:00
|
|
|
{% set newsPosts = viewPost and postExists ? [news.getPost(postExists)] : news.getPosts(postsPerPage)[currentPage] %}
|
2015-09-11 23:31:54 +00:00
|
|
|
|
|
|
|
{% set pagination = {'page': currentPage, 'pages': news.getPosts(postsPerPage), 'urlPattern': 'SITE_NEWS_PAGE'} %}
|
|
|
|
|
|
|
|
{% set title %}
|
2015-09-15 20:37:29 +00:00
|
|
|
{% if not (viewPost ? postExists : newsPosts|length) %}Post does not exist!{% elseif viewPost and postExists %}{{ newsPosts[0].title }}{% else %}News{% endif %}
|
2015-09-11 23:31:54 +00:00
|
|
|
{% endset %}
|
|
|
|
|
|
|
|
{% block title %}{{ title }}{% endblock %}
|
|
|
|
|
|
|
|
{% block css %}
|
|
|
|
<style type="text/css">
|
|
|
|
.pagination {
|
|
|
|
float: right;
|
|
|
|
}
|
|
|
|
</style>
|
|
|
|
{% endblock %}
|
2015-09-07 20:53:47 +00:00
|
|
|
|
2015-09-05 16:11:04 +00:00
|
|
|
{% block content %}
|
2015-04-02 13:41:05 +00:00
|
|
|
<div class="content">
|
|
|
|
<div class="content-column news">
|
2015-09-15 20:37:29 +00:00
|
|
|
<div class="head">{{ title }}{% if not (viewPost and postExists) %}<a href="{{ urls.format('SITE_NEWS_RSS') }}" class="fa fa-rss news-rss default"></a>{% endif %}</div>
|
|
|
|
{% if (viewPost ? postExists : newsPosts|length) %}
|
2015-09-11 23:31:54 +00:00
|
|
|
{% for post in newsPosts %}
|
|
|
|
{% include 'elements/newsPost.tpl' %}
|
2015-09-18 21:56:54 +00:00
|
|
|
{% if viewPost and postExists %}
|
|
|
|
{% include 'elements/comments.tpl' %}
|
|
|
|
{% endif %}
|
2015-09-11 23:31:54 +00:00
|
|
|
{% endfor %}
|
2015-09-15 20:37:29 +00:00
|
|
|
{% if not (viewPost and postExists) and news.getPosts(postsPerPage)|length > 1 %}
|
2015-07-31 21:18:14 +00:00
|
|
|
<div>
|
2015-09-11 23:31:54 +00:00
|
|
|
{% include 'elements/pagination.tpl' %}
|
2015-07-31 21:18:14 +00:00
|
|
|
<div class="clear"></div>
|
|
|
|
</div>
|
|
|
|
{% endif %}
|
2015-04-06 19:51:26 +00:00
|
|
|
{% else %}
|
|
|
|
<div style="padding: 20px;">
|
|
|
|
<h1>The requested news post does not exist!</h1>
|
|
|
|
There are a few possible reasons for this;
|
|
|
|
<ul style="margin-left: 30px;">
|
|
|
|
<li>The post may have been deleted due to irrelevancy.</li>
|
|
|
|
<li>The post never existed.</li>
|
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
{% endif %}
|
2015-04-02 13:41:05 +00:00
|
|
|
</div>
|
2015-04-05 17:39:33 +00:00
|
|
|
</div>
|
2015-09-05 16:11:04 +00:00
|
|
|
{% endblock %}
|