From fd871ec411d56c04336033055fc03079107f7338 Mon Sep 17 00:00:00 2001 From: Tom Andrade Date: Thu, 19 Sep 2019 16:23:49 +0200 Subject: [PATCH] Delete old templates and add response.html that deals with all responses --- templates/400.html | 40 ------ templates/404.html | 41 ------ templates/500.html | 35 ----- templates/footer.html | 5 - templates/index.html | 18 --- templates/ok.html | 10 -- templates/{header.html => response.html} | 170 ++++++++++++++++------- templates/returnPage.html | 10 -- templates/slimheader.html | 72 ---------- 9 files changed, 122 insertions(+), 279 deletions(-) delete mode 100644 templates/400.html delete mode 100644 templates/404.html delete mode 100644 templates/500.html delete mode 100644 templates/footer.html delete mode 100644 templates/index.html delete mode 100644 templates/ok.html rename templates/{header.html => response.html} (73%) delete mode 100644 templates/returnPage.html delete mode 100644 templates/slimheader.html diff --git a/templates/400.html b/templates/400.html deleted file mode 100644 index 0184d44..0000000 --- a/templates/400.html +++ /dev/null @@ -1,40 +0,0 @@ - - - {{ template "header" }} - -
-
-

400

-

Bad Request

-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-

Boo, looks like a ghost didn't like your request! -
- But you can try again, type an URL below to shorten it

- -
- - {{ template "footer" }} - - \ No newline at end of file diff --git a/templates/404.html b/templates/404.html deleted file mode 100644 index be7cd44..0000000 --- a/templates/404.html +++ /dev/null @@ -1,41 +0,0 @@ - - - {{ template "header" }} - - -
-
-

404

-

page not found

-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-

Boo, looks like a ghost stole this page! -
- But you can type an URL below to shorten it

- -
- - {{ template "footer" }} - - \ No newline at end of file diff --git a/templates/500.html b/templates/500.html deleted file mode 100644 index df07b3a..0000000 --- a/templates/500.html +++ /dev/null @@ -1,35 +0,0 @@ - - - {{ template "header" }} - - -
-
-

500

-

Internal server error

-
-
-
-
-
-
-
-
-
-
-

X

-

X

-
-
-
-
-
-
-

Boo, the ghost is broken :( -
- His last words where: {{ . }}

-
- - {{ template "footer" }} - - \ No newline at end of file diff --git a/templates/footer.html b/templates/footer.html deleted file mode 100644 index 9e1b755..0000000 --- a/templates/footer.html +++ /dev/null @@ -1,5 +0,0 @@ -{{ define "footer" }} - -{{ end }} \ No newline at end of file diff --git a/templates/index.html b/templates/index.html deleted file mode 100644 index b4e2f7b..0000000 --- a/templates/index.html +++ /dev/null @@ -1,18 +0,0 @@ - - - {{ template "slimheader" }} - -
-

Welcome to Short, the simple URL shortener, -
- Type an URL below to shorten it

- -
- {{ template "footer" }} - - \ No newline at end of file diff --git a/templates/ok.html b/templates/ok.html deleted file mode 100644 index ef328cc..0000000 --- a/templates/ok.html +++ /dev/null @@ -1,10 +0,0 @@ - - - {{ template "slimheader" }} - -
-

{{ . }}

-
- {{ template "footer" }} - - \ No newline at end of file diff --git a/templates/header.html b/templates/response.html similarity index 73% rename from templates/header.html rename to templates/response.html index 6b2bb2a..3f0f8a7 100644 --- a/templates/header.html +++ b/templates/response.html @@ -1,4 +1,5 @@ -{{ define "header" }} + + Short: the simple url shortener -{{ end }} + + {{ if eq .IsGhost true }} +
+
+

{{ .H1 }}

+

{{ .H3 }}

+
+
+
+
+
+
+
+
+
+
+ {{ if or (eq .H1 "404") (eq .H1 "400" ) }} +
+
+ {{ else if eq .H1 "500" }} +

X

+

X

+ {{ end }} + {{ if eq .H1 "404" }} +
+ {{ else if or ( eq .H1 "400") (eq .H1 "500") }} +
+ {{ end }} +
+
+
+
+ {{ end }} +
+ {{ if eq .IsLink true }} +

URL Shortened to {{ .Line1 }}

+

+ {{ else }} +

{{ .Line1 }} +
+ {{ .Line2 }}

+ {{ end }} + {{ if eq .HasForm true }} + + {{ end }} +
+ + + \ No newline at end of file diff --git a/templates/returnPage.html b/templates/returnPage.html deleted file mode 100644 index f1bcfc0..0000000 --- a/templates/returnPage.html +++ /dev/null @@ -1,10 +0,0 @@ - - - {{ template "slimheader" }} - -
-

URL Shortened to {{ . }}

-
- {{ template "footer" }} - - \ No newline at end of file diff --git a/templates/slimheader.html b/templates/slimheader.html deleted file mode 100644 index 21e877e..0000000 --- a/templates/slimheader.html +++ /dev/null @@ -1,72 +0,0 @@ -{{ define "slimheader" }} - - Short: the simple url shortener - - -{{ end }} \ No newline at end of file