aboutsummaryrefslogblamecommitdiff
path: root/views/new-node.templ
blob: b92dbba03a65bda5668222cbc899c14a42706170 (plain) (tree)





























                                                                                                         
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>
}