blob: b92dbba03a65bda5668222cbc899c14a42706170 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
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>
}
|