diff --git a/sync/routes.go b/sync/routes.go index 645ecf70..feba55ce 100644 --- a/sync/routes.go +++ b/sync/routes.go @@ -64,6 +64,7 @@ func Router() chi.Router { r.Method("GET", "/signout", auth.NewEnsureAuth(getSignout)) r.Method("GET", "/source/{globalid}", auth.NewEnsureAuth(getSource)) r.Method("GET", "/trap/{globalid}", auth.NewEnsureAuth(getTrap)) + r.Method("GET", "/text/{destination}", auth.NewEnsureAuth(getTextMessages)) htmlpage.AddStaticRoute(r, "/static") return r diff --git a/sync/template/text-messages.html b/sync/template/text-messages.html new file mode 100644 index 00000000..c38c243e --- /dev/null +++ b/sync/template/text-messages.html @@ -0,0 +1,143 @@ +{{template "authenticated.html" .}} + +{{define "title"}}Dash{{end}} +{{define "extraheader"}} + +{{end}} +{{define "content"}} +
+ +
+
+
+
+
+ User avatar +
+
+
Chat with Sarah Johnson
+ Last active 5 minutes ago +
+
+
+
+
+ + +
+
+
+
+ +
+ Today, 2:30 PM +
+ + +
+ Receiver avatar +
+
+ Hi there! How's the project coming along? +
+
2:31 PM
+
+
+ + +
+ Sender avatar +
+
+ Hey! It's going pretty well. I'm working on the UI mockups right now. +
+
2:33 PM
+
+
+ + +
+ Receiver avatar +
+
+ That's great to hear! When do you think you'll be able to share them with the team? +
+
2:35 PM
+
+
+ + +
+ Sender avatar +
+
+ I'm hoping to have something ready by tomorrow afternoon. I'm just working out some details with the responsive design. +
+
2:36 PM
+
+
+ + +
+ Sender avatar +
+
+ Do you have any specific feedback on the initial concept I shared last week? +
+
2:37 PM
+
+
+ + +
+ Receiver avatar +
+
+ Yes! The team loved it. The color scheme was particularly well received. We just had some minor suggestions about the navigation that I can share during our next call. +
+
2:40 PM
+
+
+ + +
+ Sender avatar +
+
+ That sounds great! Looking forward to the feedback. +
+
2:41 PM
+
+
+
+
+
+
+
+{{end}} diff --git a/sync/text.go b/sync/text.go new file mode 100644 index 00000000..2d91cbea --- /dev/null +++ b/sync/text.go @@ -0,0 +1,28 @@ +package sync + +import ( + "net/http" + + "github.com/Gleipnir-Technology/nidus-sync/db/models" + "github.com/Gleipnir-Technology/nidus-sync/htmlpage" +) + +type ContentTextMessages struct { + User User +} + +var ( + textMessagesT = buildTemplate("text-messages", "authenticated") +) + +func getTextMessages(w http.ResponseWriter, r *http.Request, u *models.User) { + userContent, err := contentForUser(r.Context(), u) + if err != nil { + respondError(w, "Failed to get user", err, http.StatusInternalServerError) + return + } + content := ContentTextMessages{ + User: userContent, + } + htmlpage.RenderOrError(w, textMessagesT, content) +}