Show newthread error underneath subject.
This commit is contained in:
parent
702967f624
commit
f6e6929c25
2 changed files with 7 additions and 0 deletions
|
|
@ -1120,6 +1120,9 @@ proc executeNewThread(c: TForumData, subject, msg: string): (int64, int64) =
|
||||||
if subject.len > 100:
|
if subject.len > 100:
|
||||||
raise newForumError("Subject is too long", @["subject"])
|
raise newForumError("Subject is too long", @["subject"])
|
||||||
|
|
||||||
|
if msg.len == 0:
|
||||||
|
raise newForumError("Message is empty", @["msg"])
|
||||||
|
|
||||||
if not validateRst(c, msg):
|
if not validateRst(c, msg):
|
||||||
raise newForumError("Message needs to be valid RST", @["msg"])
|
raise newForumError("Message needs to be valid RST", @["msg"])
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -52,8 +52,12 @@ when defined(js):
|
||||||
input(class="form-input", `type`="text", name="username",
|
input(class="form-input", `type`="text", name="username",
|
||||||
placeholder="Type the title here",
|
placeholder="Type the title here",
|
||||||
onChange=(e: Event, n: VNode) => onSubjectChange(e, n, state))
|
onChange=(e: Event, n: VNode) => onSubjectChange(e, n, state))
|
||||||
|
if state.error.isSome():
|
||||||
|
p(class="text-error"):
|
||||||
|
text state.error.get().message
|
||||||
renderContent(state.replyBox, none[Thread](), none[Post]())
|
renderContent(state.replyBox, none[Thread](), none[Post]())
|
||||||
tdiv(class="footer"):
|
tdiv(class="footer"):
|
||||||
|
|
||||||
button(class=class(
|
button(class=class(
|
||||||
{"loading": state.loading},
|
{"loading": state.loading},
|
||||||
"btn btn-primary"
|
"btn btn-primary"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue