2015-07-21 14:10:57 +00:00
|
|
|
{{define "body"}}
|
|
|
|
<h2 class="news-heading">News</h2>
|
|
|
|
{{template "flashes" .}}
|
2015-09-24 04:12:57 +00:00
|
|
|
<div class="row">
|
|
|
|
<div class="col-xs-2">
|
|
|
|
<a class="btn btn-lg btn-primary btn-block" href="{{template "launch-add" .}}">Add to transmet</a>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="col-xs-6">
|
2015-12-25 17:07:03 +00:00
|
|
|
Drag this bookmarklet to bookmark bar and click anywhere to add a link
|
2015-09-24 04:12:57 +00:00
|
|
|
</div>
|
|
|
|
<div class="col-xs-4"></div>
|
|
|
|
<div class="col-xs-12"> </div>
|
|
|
|
</div>
|
2015-08-23 18:04:14 +00:00
|
|
|
<div class="news-posts">
|
2015-07-21 14:10:57 +00:00
|
|
|
{{range $news_post := .news}}
|
2015-11-20 04:00:33 +00:00
|
|
|
{{template "row-news" dict "post" $news_post "categories" $.categories "csrfField" $.csrfField}}
|
2015-07-21 14:10:57 +00:00
|
|
|
{{end}}
|
2015-08-23 18:04:14 +00:00
|
|
|
</div>
|
2015-07-21 14:10:57 +00:00
|
|
|
|
|
|
|
{{end}}
|
|
|
|
|
|
|
|
<!-- print a news row -->
|
|
|
|
{{define "row-news"}}
|
2015-08-23 18:04:14 +00:00
|
|
|
<div class="news-row">
|
|
|
|
<div class="row">
|
2015-09-30 14:33:06 +00:00
|
|
|
<div class="col-xs-2 post-category">
|
2015-08-31 03:23:35 +00:00
|
|
|
{{fullCategoryPath .categories .post.Category_id}}
|
2015-08-23 18:04:14 +00:00
|
|
|
</div>
|
2015-09-30 14:33:06 +00:00
|
|
|
<div class="col-xs-8 post-title">
|
2015-08-31 03:23:35 +00:00
|
|
|
<strong>{{truncate .post.Title 100}}</strong>
|
2015-08-23 18:04:14 +00:00
|
|
|
</div>
|
2015-09-30 14:33:06 +00:00
|
|
|
<div class="col-xs-2 post-date">
|
2015-08-31 03:23:35 +00:00
|
|
|
{{dateFormat .post.Date}}
|
2015-08-23 18:04:14 +00:00
|
|
|
</div>
|
2015-08-31 03:23:35 +00:00
|
|
|
</div>
|
|
|
|
<div class="row">
|
2015-09-30 14:33:06 +00:00
|
|
|
<div class="col-xs-2"> </div>
|
|
|
|
<div class="col-xs-8 post-url">
|
2015-08-31 03:23:35 +00:00
|
|
|
<a href="{{.post.Url}}">{{truncate .post.Url 100}}</a>
|
2015-08-23 18:04:14 +00:00
|
|
|
</div>
|
2015-11-20 04:00:33 +00:00
|
|
|
<div class="col-xs-2 post-edit"><a href="/news/{{.post.Id}}/edit" class="btn btn-sm btn-block">Edit</a></div>
|
2015-08-31 03:23:35 +00:00
|
|
|
</div>
|
|
|
|
<div class="row">
|
2015-09-30 14:33:06 +00:00
|
|
|
<div class="col-xs-2"> </div>
|
2016-01-09 14:29:40 +00:00
|
|
|
<div class="col-xs-8 post-content"> {{ .post.HTMLNotes }}</div>
|
2015-11-20 04:00:33 +00:00
|
|
|
<div class="col-xs-2 post-delete">
|
|
|
|
<form method="POST" action="/news/{{.post.Id}}/delete" class="confirm-news-delete">{{ .csrfField }}
|
|
|
|
<input type="submit" class="btn btn-sm btn-block" value="Delete" />
|
|
|
|
</form>
|
|
|
|
</div>
|
2015-08-23 18:04:14 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
2015-07-21 14:10:57 +00:00
|
|
|
{{end}}
|
2015-09-24 04:12:57 +00:00
|
|
|
|
|
|
|
<!-- JS for the launcher of the add bookmarklet -->
|
2015-12-25 17:07:03 +00:00
|
|
|
{{define "launch-add"}}javascript:(function() { var d=document,w=window,e=w.getSelection,k=d.getSelection,x=d.selection,s=(e?e():(k)?k():(x?x.createRange().text:0)),f='{{.url}}/news/add',l=d.location,e=encodeURIComponent,u=f+'?popup=1&url='+e(l.href)+'&title='+e(d.title)+'&selection='+e(s);a=function(){if(!w.open(u,'t','toolbar=0,resizable=1,scrollbars=1,status=1,width=720,height=480'))l.href=u;};if (/Firefox/.test(navigator.userAgent)) setTimeout(a, 0); else a();void(0) })();{{end}}
|