From 6ae65e91693424398067b632b170866b8f9c68f1 Mon Sep 17 00:00:00 2001 From: Senad Uka Date: Sun, 17 Nov 2024 20:40:50 +0100 Subject: [PATCH] Flow now works --- application/controllers/index.go | 9 + .../controllers/{advanced.go => thankyou.go} | 9 +- application/server.go | 2 +- application/static/css/main.css | 5 + application/static/img/steps-line.svg | 43 ++++ application/views/advanced.html | 198 ------------------ application/views/signup.html | 141 ++++++------- application/views/thankyou.html | 13 ++ 8 files changed, 144 insertions(+), 276 deletions(-) rename application/controllers/{advanced.go => thankyou.go} (90%) create mode 100644 application/static/img/steps-line.svg delete mode 100644 application/views/advanced.html create mode 100644 application/views/thankyou.html diff --git a/application/controllers/index.go b/application/controllers/index.go index b258dd7..3b31860 100644 --- a/application/controllers/index.go +++ b/application/controllers/index.go @@ -1,6 +1,8 @@ package controllers import ( + "fmt" + "html" "html/template" "log" "net/http" @@ -9,6 +11,13 @@ import ( ) func Index(w http.ResponseWriter, r *http.Request) { + + if r.URL.Path != "/" { + w.WriteHeader(http.StatusNotFound) + fmt.Fprintf(w, "Error: 404 %s not found.", html.EscapeString(r.URL.Path)) + return + } + lp := filepath.Join("application", "layouts", "main.html") fp := filepath.Join("application", "views", "index.html") diff --git a/application/controllers/advanced.go b/application/controllers/thankyou.go similarity index 90% rename from application/controllers/advanced.go rename to application/controllers/thankyou.go index 8da6ead..432f772 100644 --- a/application/controllers/advanced.go +++ b/application/controllers/thankyou.go @@ -10,7 +10,7 @@ import ( "risklet/db" ) -func Advanced(w http.ResponseWriter, r *http.Request) { +func ThankYou(w http.ResponseWriter, r *http.Request) { if r.Method == "GET" { handleAdvancedGet(w, r) } else if r.Method == "POST" { @@ -43,12 +43,11 @@ func handleAdvancedPost(w http.ResponseWriter, r *http.Request) { } func handleAdvancedGet(w http.ResponseWriter, r *http.Request) { - companyId := r.PathValue("companyId") lp := filepath.Join("application", "layouts", "main.html") - fp := filepath.Join("application", "views", "advanced.html") + fp := filepath.Join("application", "views", "thankyou.html") - log.Println("Hitting Advanced") + log.Println("Hitting ThankYou") // Return a 404 if the template doesn't exist info, err := os.Stat(fp) @@ -74,7 +73,7 @@ func handleAdvancedGet(w http.ResponseWriter, r *http.Request) { return } - err = tmpl.ExecuteTemplate(w, "main.html", companyId) + err = tmpl.ExecuteTemplate(w, "main.html", nil) if err != nil { log.Print(err.Error()) http.Error(w, http.StatusText(500), 500) diff --git a/application/server.go b/application/server.go index 2338a05..c95fd50 100644 --- a/application/server.go +++ b/application/server.go @@ -9,6 +9,6 @@ func SetupAppServer() { fs := http.FileServer(http.Dir("./application/static")) http.Handle("GET /static/", http.StripPrefix("/static/", fs)) http.HandleFunc("/signup/", controllers.Signup) - http.HandleFunc("/advanced/{companyString}", controllers.Advanced) + http.HandleFunc("/thankyou", controllers.ThankYou) http.HandleFunc("/", controllers.Index) } diff --git a/application/static/css/main.css b/application/static/css/main.css index 266a822..cf61923 100644 --- a/application/static/css/main.css +++ b/application/static/css/main.css @@ -1,4 +1,9 @@ body { font-family: 'Jost', sans-serif; + font-size: var(--bs-body-font-size); +} + +:root { + --bs-body-font-size: 1.5rem; } \ No newline at end of file diff --git a/application/static/img/steps-line.svg b/application/static/img/steps-line.svg new file mode 100644 index 0000000..8bfe665 --- /dev/null +++ b/application/static/img/steps-line.svg @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/application/views/advanced.html b/application/views/advanced.html deleted file mode 100644 index c7a56ec..0000000 --- a/application/views/advanced.html +++ /dev/null @@ -1,198 +0,0 @@ -{{define "content"}} -
-
-
-

Advanced Risk Assessment

-
-
- -
- -
- - Determines exposure to different cybersecurity regulations. -
- - -
- -
- - Assesses potential impact of data breaches. -
- - -
- -
- - Defines data protection requirements. -
- - -
- -
- - Indicates the variety of systems requiring protection. -
- - -
- -
- - Assesses third-party cybersecurity risks. -
- - -
- -
-
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- Determines specific cybersecurity controls. -
- - -
- -
-
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- Evaluates cybersecurity needs based on IP ownership. -
- - -
- -
-
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- Identifies required compliance frameworks. -
- - -
- -
- - Evaluates potential for cascade failures. -
- - -
- -
- - Determines the scope of remote access security requirements. -
- -
- - -
-
-
-
-
-{{end}} - -{{define "bottom"}} - -{{end}} diff --git a/application/views/signup.html b/application/views/signup.html index 2b127e8..c814aea 100644 --- a/application/views/signup.html +++ b/application/views/signup.html @@ -2,14 +2,19 @@
-

Risk Assessment Questions

+
+ Steps image +
+

Risk Assessment Questions



- +
+ +
Name of the Organization that will appear in the report.
@@ -18,8 +23,11 @@

- - Email of the person responsible for using Risklet. Report +
+ +
+ Email of the person responsible for using Risklet. + Report and magic link for login will be sent to this email.
@@ -28,7 +36,7 @@

-
+
@@ -58,7 +66,7 @@

-
+
@@ -90,7 +98,7 @@
-
+
@@ -121,7 +129,7 @@
-
+
@@ -216,8 +224,8 @@
- Not dependent at all - Heavily dependent + Not dependent at all + Heavily dependent
Measures the potential business impact of IT disruptions and @@ -228,7 +236,7 @@

-
+
@@ -265,7 +273,7 @@
-
+
@@ -296,7 +304,7 @@

-
+
@@ -326,7 +334,7 @@

-
+
@@ -357,7 +365,7 @@
-
+
@@ -384,16 +392,37 @@
+
+ + + +
+
+
+ +
+
+ Click Next if you want to provide more details. Each + question is + optional. +
+ + -
+
+ +
-
+
+ value="single-country">
@@ -418,13 +447,13 @@
-
+

-
+
+ value="few-key">
@@ -444,13 +473,13 @@ -
+

-
+
+ value="b2b">
@@ -469,13 +498,13 @@ -
+

-
+
+ value="single">
@@ -495,13 +524,13 @@
-
+

-
+
+ id="supplier-single-critical" value="single-critical">
@@ -521,10 +550,10 @@
-
+

-
+
@@ -555,11 +584,11 @@
-
+

-
+
@@ -591,10 +620,10 @@
-
+

-
+
@@ -626,17 +655,17 @@
- Identifies required compliance frameworks. + Identifies compliance frameworks.
-
+

-
+
+ id="integration-fully-integrated" value="fully-integrated">
@@ -660,38 +689,6 @@ Evaluates potential for cascade failures.
- -
- -
-
-
- - -
-
- - -
-
- - -
-
- - -
-
- Determines the scope of remote access security - requirements. -
-
diff --git a/application/views/thankyou.html b/application/views/thankyou.html new file mode 100644 index 0000000..af25dab --- /dev/null +++ b/application/views/thankyou.html @@ -0,0 +1,13 @@ +{{define "content"}} +
+
+
+

Thank you

+
+
+
+{{end}} + +{{define "bottom"}} + +{{end}}