diff --git a/static/post.css b/static/post.css new file mode 100644 index 0000000..df678d0 --- /dev/null +++ b/static/post.css @@ -0,0 +1,20 @@ +.post-container { + border: 1px solid rgba(0,0,0,.125); + border-radius: .25rem; + display: flex; +} + +.files-container { + display: flex; +} + +.file-container { + max-width: 5rem; +} + +.file { + width: 100%; +} + +.data-container { +} \ No newline at end of file diff --git a/templates/thread.html b/templates/thread.html index dd16646..85d4011 100644 --- a/templates/thread.html +++ b/templates/thread.html @@ -4,36 +4,50 @@ {{ template "static" }} {{ template "meta" $FirstPost }} + -

Welcome to Micrach

+

+ {{ if ne $FirstPost.Title "" }} + {{$FirstPost.Title}} + {{ else }} + Welcome to Micrach + {{ end }} +

{{ template "post-form" $FirstPost.ID }} -
+
{{range $Post := .}} -
-
+
- {{ $length := len $Post.Files }} {{ if gt $length 0 }} - {{$FirstFile := index $Post.Files 0}} - Uploaded picture - {{end}} - -
- {{ if ne $Post.Title "" }} -
{{$Post.Title}}
+ {{ $filesLength := len $Post.Files }} + {{ if gt $filesLength 0 }} +
+ {{ range $File := $Post.Files }} +
+ + Uploaded picture + +
{{ end }} +
+ {{ end }} + +

{{$Post.Text}}

+
-
{{end}}
diff --git a/utils/utils.go b/utils/utils.go index 96cd941..0e1da55 100644 --- a/utils/utils.go +++ b/utils/utils.go @@ -48,5 +48,7 @@ func CreateThreadFolder(postID int) error { } func ValidatePost(title, text string) bool { - return (title == "" && text != "") || (title != "" && text == "") + return (title == "" && text != "") || + (title != "" && text == "") || + (title != "" && text != "") }