all repos — honk @ 58ed56ad5f02c5a060aef87929b038d581329c29

my fork of honk

add notes field to filters for record keeping
Ted Unangst tedu@tedunangst.com
Mon, 02 Dec 2019 18:02:33 -0500
commit

58ed56ad5f02c5a060aef87929b038d581329c29

parent

e9e55d8804fda2300d815d5991e1719199000bf6

5 files changed, 12 insertions(+), 1 deletions(-)

jump to
M docs/changelog.txtdocs/changelog.txt

@@ -2,6 +2,8 @@ changelog

-- next ++ Add notes field to filters for record keeping. + + Negated search -terms. + A raw sendactivity API action for the bold.
M hfcs.gohfcs.go

@@ -44,6 +44,7 @@ Rewrite string `json:",omitempty"`

re_rewrite *regexp.Regexp Replace string `json:",omitempty"` Expiration time.Time + Notes string } type filtType uint
M views/hfcs.htmlviews/hfcs.html

@@ -9,6 +9,9 @@ <hr>

<h3>new filter</h3> <p><label for="name">filter name:</label><br> <input tabindex=1 type="text" name="name" value="" autocomplete=off> +<p><label for="filtnotes">notes:</label><br> +<textarea tabindex=1 name="filtnotes" height=4> +</textarea> <hr> <h3>match</h3> <p><label for="actor">who or where:</label><br>

@@ -48,6 +51,7 @@ {{ $csrf := .FilterCSRF }}

{{ range .Filters }} <section class="honk"> <p>Name: {{ .Name }} +{{ with .Notes }}<p>Notes: {{ . }}{{ end }} <p>Date: {{ .Date.Format "2006-01-02" }} {{ with .Actor }}<p>Who: {{ . }}{{ end }} {{ with .IncludeAudience }} (inclusive) {{ end }} {{ with .Text }}<p>Text: {{ . }}{{ end }}
M views/style.cssviews/style.css

@@ -143,10 +143,13 @@ font-size: 1em;

background: var(--bg-page); color: var(--fg); width: 600px; - height: 8em; + height: 4em; margin-bottom: 0.5em; box-sizing: border-box; max-width: 100%; +} +textarea#hostnoise { + height: 8em; } input[type="checkbox"] { position: fixed;
M web.goweb.go

@@ -1878,6 +1878,7 @@ filt.Replace = strings.TrimSpace(r.FormValue("filtreplace"))

if dur := parseDuration(r.FormValue("filtduration")); dur > 0 { filt.Expiration = time.Now().UTC().Add(dur) } + filt.Notes = strings.TrimSpace(r.FormValue("filtnotes")) if filt.Actor == "" && filt.Text == "" && !filt.IsAnnounce { log.Printf("blank filter")