diff options
Diffstat (limited to 'views/new-node.templ')
-rw-r--r-- | views/new-node.templ | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/views/new-node.templ b/views/new-node.templ new file mode 100644 index 0000000..b92dbba --- /dev/null +++ b/views/new-node.templ @@ -0,0 +1,30 @@ +package views + +import ( + "fmt" + "gitrepo.ru/neonxp/gorum/models" + "strconv" +) + +templ NewNode(parent *models.Node) { + <details> + <summary>Создать топик</summary> + <form method="post" action={ templ.URL(fmt.Sprintf("/n/%d/new", parent.ID)) }> + @CSRF() + <input type="hidden" name="type" value={ strconv.Itoa(int(models.TopicType)) }/> + <label for="text">Топик</label> + <input type="text" name="text" id="text" placeholder="имя темы..."/> + <input type="submit" value="Создать"/> + </form> + </details> + <details> + <summary>Создать пост</summary> + <form method="post" action={ templ.URL(fmt.Sprintf("/n/%d/new", parent.ID)) }> + @CSRF() + <input type="hidden" name="type" value={ strconv.Itoa(int(models.PostType)) }/> + <label for="text">Текст</label> + <textarea name="text" id="text" placeholder="текст..." rows="10"></textarea> + <input type="submit" value="Создать"/> + </form> + </details> +} |