transmet/templates/pages/news.html

40 lines
1.3 KiB
HTML

{{define "body"}}
<h2 class="news-heading">News</h2>
{{template "flashes" .}}
<div class="news-posts">
{{range $news_post := .news}}
{{template "row-news" dict "post" $news_post "categories" $.categories}}
{{end}}
</div>
{{end}}
<!-- print a news row -->
{{define "row-news"}}
<div class="news-row">
<div class="row">
<div class="col-xs-3">
{{fullCategoryPath .categories .post.Category_id}}
</div>
<div class="col-xs-6">
<strong>{{truncate .post.Title 100}}</strong>
</div>
<div class="col-xs-3">
{{dateFormat .post.Date}}
</div>
</div>
<div class="row">
<div class="col-xs-3">&nbsp;</div>
<div class="col-xs-6">
<a href="{{.post.Url}}">{{truncate .post.Url 100}}</a>
</div>
<div class="col-xs-3"><a href="/edit?id={{.post.Id}}">Edit</a></div>
</div>
<div class="row">
<div class="col-xs-3">&nbsp;</div>
<div class="col-xs-6">{{truncate .post.Notes 500}}</div>
<div class="col-xs-3"><a class="confirm-delete" href="/delete?id={{.post.Id}}">Delete</a></div>
</div>
</div>
{{end}}