micrach/templates/index.html

61 lines
1.6 KiB
HTML
Raw Normal View History

2021-08-28 17:34:58 +03:00
<html lang="en">
<head>
2021-09-05 15:38:08 +03:00
{{ template "static" }}
<link
href="/static/index.css"
rel="stylesheet"
>
{{ template "static-meta" }}
2021-08-28 17:34:58 +03:00
</head>
<body>
<h1 class="display-1 text-center">Welcome to Micrach</h1>
<div class="container">
{{ template "post-form" }}
2021-09-10 02:17:45 +03:00
<div id="" class="row row-cols-auto gy-4 mb-4">
{{ range $Post := .Threads }}
<div class="col col-sm-6 col-md-4 col-lg-3">
<div class="card">
2021-08-31 19:18:47 +03:00
2021-09-10 19:16:53 +03:00
{{ $length := len $Post.Files }}
{{ if gt $length 0 }}
2021-09-10 02:17:45 +03:00
{{ $FirstFile := index $Post.Files 0 }}
<img
2021-09-11 16:05:31 +03:00
src="/uploads/{{$Post.ID}}/{{$FirstFile.ID}}.{{$FirstFile.Ext}}"
class="card-img-top"
alt="Uploaded picture"
>
2021-09-10 02:17:45 +03:00
{{ end }}
2021-08-31 22:51:31 +03:00
<div class="card-body">
2021-09-10 19:16:53 +03:00
{{ if ne $Post.Title "" }}
<h5 class="card-title">{{$Post.Title}}</h5>
2021-09-10 19:16:53 +03:00
{{ end }}
<p class="card-text">{{$Post.Text}}</p>
<a href="/{{$Post.ID}}" class="btn btn-outline-primary">Open</a>
2021-08-30 23:29:51 +03:00
</div>
</div>
</div>
2021-09-10 02:17:45 +03:00
{{ end }}
</div>
<div class="col col-12">
<nav aria-label="Page navigation">
<ul id="pagesList" class="pagination justify-content-center">
{{ $ActivePage := .Page }}
{{ range $i := Iterate .PagesCount }}
<li class="page-item {{ if (eq $i $ActivePage) }} active {{ end }}">
<a class="page-link" href="/?page={{ $i }}">{{ $i }}</a>
</li>
{{ end }}
</ul>
</nav>
</div>
2021-08-30 23:29:51 +03:00
</div>
2021-08-28 17:34:58 +03:00
</body>
</html>