diff --git a/public/static/css/styles.css b/public/static/css/styles.css index 80f8766..5a8a990 100644 --- a/public/static/css/styles.css +++ b/public/static/css/styles.css @@ -107,7 +107,7 @@ Navbar margin-left: 25px; font-size:1.5em; color:white; - + max-width: 2000px; } .btn-action{ diff --git a/templates/_head.html b/templates/_head.html index 68ca833..724d4b9 100644 --- a/templates/_head.html +++ b/templates/_head.html @@ -70,6 +70,7 @@ {{ else if eq .Navigation "completed"}} {{ else if eq .Navigation "deleted"}} {{ else if eq .Navigation "edit"}} + {{ else if eq .Navigation "search"}} {{else }} diff --git a/templates/search.html b/templates/search.html index 97fa1f1..e7655ae 100644 --- a/templates/search.html +++ b/templates/search.html @@ -1,43 +1,71 @@ {{template "_head.html" .}} -
- {{ if .Tasks}} - {{range .Tasks}} -
-

{{.Title}}

- {{.Content}} - - - -
- {{end}} {{else}} -
-

No results found

-

Go to home page here

+
+ {{ if .Tasks}} {{range $key, $value := .Tasks}} +
+

{{ $value.Title}}

+ + + {{$value.Content}} +
+ {{range $value.Comments}} +
+ {{.Content}} + {{.Created}} +
{{end}} -
-{{template "_footer.html"}} +
+
+ + + +
+
+
+ + + + + +
+{{end}} {{else}} +
+

No Tasks here

+

Create new task + +

+
+{{end}} +
+ +{{template "_footer.html"}} diff --git a/views/otherViews.go b/views/otherViews.go index 9410675..62db302 100644 --- a/views/otherViews.go +++ b/views/otherViews.go @@ -79,7 +79,12 @@ func SearchTaskFunc(w http.ResponseWriter, r *http.Request) { if r.Method == "POST" { r.ParseForm() query := r.Form.Get("query") + context := db.SearchTask(query) + + categories := db.GetCategories() + context.Categories = categories + searchTemplate.Execute(w, context) } else { message = "Method not allowed"