diff --git a/Chat.go b/Chat.go index 5b79b67..4174b6c 100644 --- a/Chat.go +++ b/Chat.go @@ -296,14 +296,65 @@ func generateWelcomeChatHTML() string { } func generateEnterKeyChatHTML() string { - welcomeMessage := `To start using JADE, please enter at least one key in the settings.` + welcomeMessage := ` +

To start using JADE, please enter at least one key in the settings.

+ + ` htmlString := "
" NextMessages := []TemplateMessage{} nextMsg := TemplateMessage{ Icon: "icons/bouvai2.png", // Assuming Icon is a field you want to include from Message - Content: "
" + markdownToHTML(welcomeMessage), + Content: welcomeMessage, + Hidden: false, // Assuming Hidden is a field you want to include from Message + Id: "0", + Name: "JADE", + } + NextMessages = append(NextMessages, nextMsg) + + botOut, err := botTmpl.Execute(pongo2.Context{"Messages": NextMessages, "ConversationAreaId": 0, "NotClickable": true}) + if err != nil { + panic(err) + } + htmlString += botOut + htmlString += "
" + htmlString += "
" + + // Render the HTML template with the messages + return htmlString +} + +func generateTermAndServiceHandler(c *fiber.Ctx) error { + return c.SendString(generateTermAndServiceChatHTML()) +} + +func generateTermAndServiceChatHTML() string { + welcomeMessage := ` +

TODO Add terms and service.

+ ` + + closeBtn := ` +
+ + + + + +
` + + htmlString := "
" + + NextMessages := []TemplateMessage{} + nextMsg := TemplateMessage{ + Icon: "icons/bouvai2.png", // Assuming Icon is a field you want to include from Message + Content: welcomeMessage + closeBtn, Hidden: false, // Assuming Hidden is a field you want to include from Message Id: "0", Name: "JADE", diff --git a/main.go b/main.go index 1d337ba..67b7533 100644 --- a/main.go +++ b/main.go @@ -97,6 +97,7 @@ func main() { app.Get("/", ChatPageHandler) app.Get("/loadChat", LoadChatHandler) app.Get("/pricingTable", PricingTableHandler) + app.Get("/generateTermAndService", generateTermAndServiceHandler) // Chat routes app.Post("/deleteMessage", DeleteMessageHandler) diff --git a/views/partials/popover-conversation.html b/views/partials/popover-conversation.html index a66a052..0621247 100644 --- a/views/partials/popover-conversation.html +++ b/views/partials/popover-conversation.html @@ -25,7 +25,7 @@
-
-