This repository has been archived on 2022-11-26. You can view files and clone it, but cannot push or open issues or pull requests.
IcyNet.eu/views/news/news.pug

56 lines
1.6 KiB
Plaintext
Raw Normal View History

2017-08-29 12:00:36 +00:00
extends ../layout.pug
2017-08-24 10:52:12 +00:00
2018-01-27 11:07:36 +00:00
block append meta
link(rel="alternate", href="/news/atom.xml", title="Icy Network News", type="application/atom+xml")
2017-08-24 10:52:12 +00:00
block title
|Icy Network - News
block body
2018-01-28 19:15:53 +00:00
.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
2017-08-24 10:52:12 +00:00
if news.page.page > 1
2018-01-28 19:15:53 +00:00
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
2017-08-24 10:52:12 +00:00
- var n = 0
while n < news.page.pages
2018-01-28 19:15:53 +00:00
- 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 &nbsp;(current)
2017-08-24 10:52:12 +00:00
- n++
if news.page.pages > news.page.page
2018-01-28 19:15:53 +00:00
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
2017-08-24 10:52:12 +00:00