micrach/templates/index.html

45 lines
1.2 KiB
HTML
Raw Normal View History

2021-08-28 17:34:58 +03:00
<html lang="en">
<head>
<meta charset="UTF-8"/>
<title>Micrach</title>
<link
href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.0/dist/css/bootstrap.min.css"
rel="stylesheet"
integrity="sha384-KyZXEAg3QhqLMpG8r+8fhAXLRk2vvoC2f3B09zVXn8CA5QIVfZOJ3BCsw2P0p/We"
crossorigin="anonymous"
>
<script
src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.0/dist/js/bootstrap.bundle.min.js"
integrity="sha384-U1DAWAznBHeqEIlVSCgzq+c9gqGAJn5c/t99JyeKa9xxaYpSvHU5awsuZVVFIhvj"
crossorigin="anonymous">
</script>
</head>
<body>
<h1 class="display-1 text-center">Welcome to Micrach</h1>
<div class="container">
{{range $Thread := .}}
{{$FirstPost := index $Thread.Posts 0}}
<div class="card" style="width: 18rem;">
{{$FirstFile := index $FirstPost.Files 0}}
<img
2021-08-29 10:04:14 +03:00
src="{{$FirstFile.Name}}"
class="card-img-top"
alt="Uploaded picture"
>
<div class="card-body">
<h5 class="card-title">{{$FirstPost.Title}}</h5>
<p class="card-text">{{$FirstPost.Text}}</p>
<a href="/{{$Thread.ID}}" class="btn btn-primary">Open</a>
</div>
</div>
{{end}}
2021-08-28 17:34:58 +03:00
</div>
</body>
</html>