caret

[ACTIVE] a command line tool for browsing Lobsters in your terminal
git clone git://git.figbert.com/caret.git
Log | Files | Refs | README | LICENSE

commit 05812e216cefa55e4b54ddf63c7270217eb6ee47
parent 8626bf108a0c0c577abdf93d507f6045572d3acd
Author: FIGBERT <figbert@figbert.com>
Date:   Wed, 20 Mar 2024 12:37:04 -0700

Mark items authored by the poster

Diffstat:
Mitem.go | 9+++++++--
1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/item.go b/item.go @@ -32,11 +32,16 @@ func (i item) Title() string { } func (itm item) Description() string { created := utils.TimeFromAPI(itm.post.CreatedAt) + relationship := "via" + if itm.post.UserIsAuthor { + relationship = "authored by" + } intro := ui.Gray().Render( fmt.Sprintf( - "%d upvotes via %s | %s | ", - itm.post.Score, itm.post.User, humanize.Time(created), + "%d upvotes %s %s | %s | ", + itm.post.Score, relationship, + itm.post.User, humanize.Time(created), ), )