diff --git a/main.go b/main.go index 7dbf4db..70e434d 100644 --- a/main.go +++ b/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) diff --git a/repositories/mocks.go b/repositories/mocks.go index 42d70c8..27662fd 100644 --- a/repositories/mocks.go +++ b/repositories/mocks.go @@ -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)) } } diff --git a/static/index.css b/static/index.css new file mode 100644 index 0000000..e69de29 diff --git a/templates/index.html b/templates/index.html index a9d57c9..1c28957 100644 --- a/templates/index.html +++ b/templates/index.html @@ -14,11 +14,16 @@ integrity="sha384-U1DAWAznBHeqEIlVSCgzq+c9gqGAJn5c/t99JyeKa9xxaYpSvHU5awsuZVVFIhvj" crossorigin="anonymous"> + Micrach + @@ -39,26 +44,31 @@

Welcome to Micrach

- {{range $Thread := .}} - {{$FirstPost := index $Thread.Posts 0}} +
+ + {{range $Thread := .}} +
+ {{$FirstPost := index $Thread.Posts 0}} + +
+ {{$FirstFile := index $FirstPost.Files 0}} + + Uploaded picture +
+
{{$FirstPost.Title}}
+

{{$FirstPost.Text}}

+ Open +
+
+
-
- {{$FirstFile := index $FirstPost.Files 0}} - - Uploaded picture -
-
{{$FirstPost.Title}}
-

{{$FirstPost.Text}}

- Open -
+ {{end}}
- - {{end}} -
+
\ No newline at end of file