From a4c3484f186c3dd900c3e5c03b75dd1fe1d3e926 Mon Sep 17 00:00:00 2001 From: Amy Gale Ruth Bowersox Date: Tue, 28 Oct 2025 22:19:31 -0600 Subject: [PATCH] added "preview" elements to "new topic" template --- conference.go | 10 ++++++- ui/views/new_topic.jet | 65 +++++++++++++++++++++++++++++++++++------- 2 files changed, 64 insertions(+), 11 deletions(-) diff --git a/conference.go b/conference.go index 528d812..e556cf0 100644 --- a/conference.go +++ b/conference.go @@ -95,7 +95,7 @@ func Conferences(ctxt ui.AmContext) (string, any, error) { return "framed_template", "conflist.jet", err } -/* Topics displayes the list of topics in a conference. +/* Topics displays the list of topics in a conference. * Parameters: * ctxt - The AmContext for the request. * Returns: @@ -167,6 +167,14 @@ func Topics(ctxt ui.AmContext) (string, any, error) { return "framed_template", "topiclist.jet", nil } +/* NewTopicForm displays the form for creating a new topic. + * Parameters: + * ctxt - The AmContext for the request. + * Returns: + * Command string dictating what to be rendered. + * Data as a parameter for the command string. + * Standard Go error status. + */ func NewTopicForm(ctxt ui.AmContext) (string, any, error) { cmd, arg, err := singleConferencePrequel(ctxt) if cmd != "" { diff --git a/ui/views/new_topic.jet b/ui/views/new_topic.jet index 85d0743..3aab8cc 100644 --- a/ui/views/new_topic.jet +++ b/ui/views/new_topic.jet @@ -8,11 +8,46 @@ *}
-

Create New Topic

+ {{ if isset(previewPb) }} +

Preview New Topic

+ {{ else }} +

Create New Topic

+ {{ end }} in: {{ conferenceName }}
+ {{ if isset(previewPb) }} + +
+ + {{ if nError == 0 }} +
+

+ Your post did not contain any spelling errors. +

+
+ {{ else }} +
+

+ {{ if nError == 1 }} + There was 1 spelling error in your post. + {{ else }} + There were {{ nError }} spelling errors in your post. + {{ end }} +

+
+ {{ end }} + + +
+
{{ previewPb }}
+
+ +
+
+ {{ end }} +
@@ -56,7 +91,7 @@
-
\ No newline at end of file +