From f6fcfa97cad2b8bd33f6003fdfbcf4ca5d04375f Mon Sep 17 00:00:00 2001 From: navanchauhan Date: Mon, 17 Oct 2022 00:06:30 -0600 Subject: shifted templates --- main.go | 4 ++-- results.gtpl | 36 ------------------------------------ search.gtpl | 10 ---------- templates/results.gtpl | 36 ++++++++++++++++++++++++++++++++++++ templates/search.gtpl | 10 ++++++++++ 5 files changed, 48 insertions(+), 48 deletions(-) delete mode 100644 results.gtpl delete mode 100644 search.gtpl create mode 100644 templates/results.gtpl create mode 100644 templates/search.gtpl diff --git a/main.go b/main.go index 98aa5d5..535e575 100644 --- a/main.go +++ b/main.go @@ -53,7 +53,7 @@ func main() { index := client.Index("fda510k") http.HandleFunc("/classic/", func(w http.ResponseWriter, r *http.Request) { - t, _ := template.ParseFiles("search.gtpl") + t, _ := template.ParseFiles("templates/search.gtpl") t.Execute(w, nil) }) @@ -69,7 +69,7 @@ func main() { } //searchResTemplate := template.Must(template.ParseFiles("results.gtpl")) - searchResTemplate := template.Must(template.New("results.gtpl").Funcs(funcMap).ParseFiles("results.gtpl")) + searchResTemplate := template.Must(template.New("results.gtpl").Funcs(funcMap).ParseFiles("templates/results.gtpl")) // v2.0 UI searchResultsTemplate2 := template.Must(template.New("search_results.html").Funcs(funcMap).ParseFiles("templates/search_results.html")) diff --git a/results.gtpl b/results.gtpl deleted file mode 100644 index 151a7d3..0000000 --- a/results.gtpl +++ /dev/null @@ -1,36 +0,0 @@ - - - -

Search Results

-

Showing results for {{.OriginalQuery.Query}}

-

Go home

-

Showing {{.NumResults}} of {{.TotalResults}}

- - - - - - - - - - {{ range .SearchResults }} - - - - - - - - - {{ end }} -
510(k) NumberTitleApplicantHit DetailsSubmission DatePredicates
{{ .id }}{{ .title }}{{ .applicant }}{{unescapeHTML ._formatted.full_text}}{{ .submission_date }}{{ range .predicates}} - {{ . }}, - {{ end }} -
- {{ if .MoreResults }} -

Previous Page

-

Next Page

- {{ end }} - - \ No newline at end of file diff --git a/search.gtpl b/search.gtpl deleted file mode 100644 index c14c02b..0000000 --- a/search.gtpl +++ /dev/null @@ -1,10 +0,0 @@ - - - -

DogeKnows

-
- - -
- - \ No newline at end of file diff --git a/templates/results.gtpl b/templates/results.gtpl new file mode 100644 index 0000000..151a7d3 --- /dev/null +++ b/templates/results.gtpl @@ -0,0 +1,36 @@ + + + +

Search Results

+

Showing results for {{.OriginalQuery.Query}}

+

Go home

+

Showing {{.NumResults}} of {{.TotalResults}}

+ + + + + + + + + + {{ range .SearchResults }} + + + + + + + + + {{ end }} +
510(k) NumberTitleApplicantHit DetailsSubmission DatePredicates
{{ .id }}{{ .title }}{{ .applicant }}{{unescapeHTML ._formatted.full_text}}{{ .submission_date }}{{ range .predicates}} + {{ . }}, + {{ end }} +
+ {{ if .MoreResults }} +

Previous Page

+

Next Page

+ {{ end }} + + \ No newline at end of file diff --git a/templates/search.gtpl b/templates/search.gtpl new file mode 100644 index 0000000..c14c02b --- /dev/null +++ b/templates/search.gtpl @@ -0,0 +1,10 @@ + + + +

DogeKnows

+
+ + +
+ + \ No newline at end of file -- cgit v1.2.3