mirror of
https://gitea.phreedom.club/localhost_frssoft/bloat.git
synced 2025-05-07 20:38:45 +00:00
update README and hardcode poll options to 20
This commit is contained in:
parent
8dcd6cfdd7
commit
4c0c1c40a8
7 changed files with 76 additions and 2 deletions
|
@ -7,6 +7,7 @@ import (
|
|||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
"fmt"
|
||||
|
||||
"bloat/mastodon"
|
||||
)
|
||||
|
@ -67,6 +68,14 @@ func emojiFilter(content string, emojis []mastodon.Emoji) string {
|
|||
return strings.NewReplacer(replacements...).Replace(content)
|
||||
}
|
||||
|
||||
func generatePollOptions() string {
|
||||
var pollbuilder string
|
||||
for i := 0; i < 20; i++ {
|
||||
pollbuilder = pollbuilder + `<div><input id="` + fmt.Sprintf("poll-option-%d", i) + `" name="` + fmt.Sprintf("poll-option-%d", i) + `"></div>`
|
||||
}
|
||||
return pollbuilder
|
||||
}
|
||||
|
||||
var quoteRE = regexp.MustCompile("(?mU)(^|> *|\n)(>.*)(<br|$)")
|
||||
|
||||
func statusContentFilter(content string, emojis []mastodon.Emoji, mentions []mastodon.Mention) string {
|
||||
|
@ -158,6 +167,7 @@ func NewRenderer(templateGlobPattern string) (r *renderer, err error) {
|
|||
t, err = t.Funcs(template.FuncMap{
|
||||
"EmojiFilter": emojiFilter,
|
||||
"Allowed_emoji_page": allowed_emoji_page,
|
||||
"GeneratePollOptions": generatePollOptions,
|
||||
"StatusContentFilter": statusContentFilter,
|
||||
"DisplayInteractionCount": displayInteractionCount,
|
||||
"TimeSince": timeSince,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue