56 lines
1.6 KiB
Plaintext
56 lines
1.6 KiB
Plaintext
extends ../layout.pug
|
|
|
|
block append meta
|
|
link(rel="alternate", href="/news/atom.xml", title="Icy Network News", type="application/atom+xml")
|
|
|
|
block title
|
|
|Icy Network - News
|
|
|
|
block body
|
|
.container.mt-4
|
|
nav(aria-label="breadcrumb")
|
|
ol.breadcrumb
|
|
li.breadcrumb-item
|
|
a(href="/") Home
|
|
li.breadcrumb-item.active(aria-current="page") News
|
|
|
|
if user && user.privilege && user.privilege > 0
|
|
a.btn.btn-light.float-right(href="/news/compose") New Article
|
|
h1.pb-3.mb-4.border-bottom Icy Network News
|
|
if news.error
|
|
span.error There are no articles to show.
|
|
else
|
|
if news.page
|
|
nav(aria-label="pagination")
|
|
ul.pagination
|
|
if news.page.page > 1
|
|
li.page-item
|
|
a.page-link(href="/news/?page=" + (news.page.page - 1)) Previous
|
|
else
|
|
li.page-item.disabled
|
|
a.page-link(href="#" tabindex="-1") Previous
|
|
- var n = 0
|
|
while n < news.page.pages
|
|
- var current = n + 1 == news.page.page
|
|
li.page-item(class=(current ? 'active' : ''))
|
|
a.page-link(href="/news/?page=" + (n + 1))= n + 1
|
|
if current
|
|
span.sr-only (current)
|
|
- n++
|
|
if news.page.pages > news.page.page
|
|
li.page-item
|
|
a.page-link(href="/news/?page=" + (news.page.page + 1)) Next
|
|
else
|
|
li.page-item.disabled
|
|
a.page-link(href="#" tabindex="-1") Next
|
|
each val in news.articles
|
|
.news-article
|
|
h2.news-title
|
|
a(href="/news/" + val.id + "-" + val.slug)= val.title
|
|
p.news-meta Published by
|
|
span #{val.author.display_name}
|
|
|at #{new Date(val.created_at)}
|
|
.content!= val.content
|
|
hr
|
|
|