2024-10-06 17:04:37 +03:00
|
|
|
|
package tpl
|
|
|
|
|
|
|
|
|
|
import "fmt"
|
|
|
|
|
|
|
|
|
|
templ AddQuotePage(form *AddQuoteForm, err string) {
|
|
|
|
|
@Layout(HeaderParams{}) {
|
|
|
|
|
<h2>Добавление цитаты</h2>
|
|
|
|
|
if err != "" {
|
|
|
|
|
<article>
|
|
|
|
|
<header>Ошибка</header>
|
|
|
|
|
{ err }
|
|
|
|
|
</article>
|
|
|
|
|
}
|
|
|
|
|
<form method="post">
|
|
|
|
|
<textarea rows="5" name="quote" placeholder="Текст цитаты">{ form.Quote }</textarea>
|
|
|
|
|
<input type="hidden" name="captcha_id" value={ form.CaptchaID }/>
|
2024-10-07 01:06:55 +03:00
|
|
|
|
<img class="captcha" src={ fmt.Sprintf("/captcha/download/%s.png", form.CaptchaID) }/>
|
|
|
|
|
<input type="text" name="captcha_value" placeholder="Код с картинки"/>
|
2024-10-06 17:04:37 +03:00
|
|
|
|
<input type="submit" value="Отправить на модерацию"/>
|
|
|
|
|
</form>
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type AddQuoteForm struct {
|
|
|
|
|
Quote string `form:"quote"`
|
|
|
|
|
CaptchaID string `form:"captcha_id"`
|
|
|
|
|
CaptchaValue string `form:"captcha_value"`
|
|
|
|
|
}
|