mirror of
https://github.com/yanislav-igonin/micrach
synced 2024-12-22 14:22:33 +03:00
feat: add grid for threads
This commit is contained in:
parent
5c7551b6ad
commit
c3e4bf7204
1
main.go
1
main.go
@ -24,6 +24,7 @@ func main() {
|
||||
router := gin.Default()
|
||||
router.LoadHTMLGlob("templates/*.html")
|
||||
router.Static("/uploads", "./uploads")
|
||||
router.Static("/static", "./static")
|
||||
router.GET("/", Controllers.GetThreads)
|
||||
router.POST("/", Controllers.CreateThread)
|
||||
router.GET("/:threadId", Controllers.GetThread)
|
||||
|
@ -43,7 +43,7 @@ func getThread(id int) Thread {
|
||||
var ThreadsDb = []Thread{}
|
||||
|
||||
func SeedMocks() {
|
||||
for i := 1; i < 101; i++ {
|
||||
for i := 1; i < 10; i++ {
|
||||
ThreadsDb = append(ThreadsDb, getThread(i))
|
||||
}
|
||||
}
|
||||
|
0
static/index.css
Normal file
0
static/index.css
Normal file
@ -14,11 +14,16 @@
|
||||
integrity="sha384-U1DAWAznBHeqEIlVSCgzq+c9gqGAJn5c/t99JyeKa9xxaYpSvHU5awsuZVVFIhvj"
|
||||
crossorigin="anonymous">
|
||||
</script>
|
||||
<link
|
||||
href="/static/index.css"
|
||||
rel="stylesheet"
|
||||
>
|
||||
|
||||
<!-- Primary Meta Tags -->
|
||||
<title>Micrach</title>
|
||||
<meta name="title" content="Micrach">
|
||||
<meta name="description" content="Single board imageboard.">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<!-- Open Graph / Facebook -->
|
||||
<meta property="og:type" content="website">
|
||||
@ -39,10 +44,13 @@
|
||||
<h1 class="display-1 text-center">Welcome to Micrach</h1>
|
||||
|
||||
<div class="container">
|
||||
<div class="row row-cols-auto gy-4">
|
||||
|
||||
{{range $Thread := .}}
|
||||
<div class="col col-sm-6 col-md-4 col-lg-3">
|
||||
{{$FirstPost := index $Thread.Posts 0}}
|
||||
|
||||
<div class="card" style="width: 18rem;">
|
||||
<div class="card">
|
||||
{{$FirstFile := index $FirstPost.Files 0}}
|
||||
|
||||
<img
|
||||
@ -56,9 +64,11 @@
|
||||
<a href="/{{$Thread.ID}}" class="btn btn-primary">Open</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
Loading…
Reference in New Issue
Block a user