You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to see how many unread items are left while seeing a single entry. The information is already shown next to the header in /unread, /feed/X/entries and /category/X/entries and goes into the template through that total variable e.g. here.
I want to add an equivalent to the template of a single entry, probably here.
The total variable also appears e.g. here and its value is calculated through that builder.CountEntries() function here.
First I tried view.Set("total", h.store.CountUnreadEntries(feed.ID)) but that didn't work and I found that this function only takes user IDs but nothing else I guess.
So I tried to add count, err := builder.CountEntries() and view.Set("total", count) analogously to the list views into unread_entry_feed.go and unread_entry_category.go but it then always returned only 1 - and I figure that is because that builder object there has only one entry item, in contrast to the list views, where it has multiple items obviously.
I also tried to add the builder.CountEntries() before the builder.WithEntryID(entryID) because until then the code in feed_entries.go and unread_entry_feed.go looked quite similar, but I probably did not understand it correctly. The best I came out with was that it showed the number of all known items of that feed, but not just the unread ones.
So here I am asking for help in this mission. What do I need to add to get view.Set("total", count) to get the number of unread items in that feed or category? If there are other/more obvious ways to show the number in a sigle entry view, I am also happy to learn them.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I want to see how many unread items are left while seeing a single entry. The information is already shown next to the header in
/unread
,/feed/X/entries
and/category/X/entries
and goes into the template through thattotal
variable e.g. here.I want to add an equivalent to the template of a single entry, probably here.
The
total
variable also appears e.g. here and its value is calculated through thatbuilder.CountEntries()
function here.First I tried
view.Set("total", h.store.CountUnreadEntries(feed.ID))
but that didn't work and I found that this function only takes user IDs but nothing else I guess.So I tried to add
count, err := builder.CountEntries()
andview.Set("total", count)
analogously to the list views intounread_entry_feed.go
andunread_entry_category.go
but it then always returned only1
- and I figure that is because thatbuilder
object there has only one entry item, in contrast to the list views, where it has multiple items obviously.I also tried to add the
builder.CountEntries()
before thebuilder.WithEntryID(entryID)
because until then the code in feed_entries.go andunread_entry_feed.go
looked quite similar, but I probably did not understand it correctly. The best I came out with was that it showed the number of all known items of that feed, but not just the unread ones.So here I am asking for help in this mission. What do I need to add to get
view.Set("total", count)
to get the number of unread items in that feed or category? If there are other/more obvious ways to show the number in a sigle entry view, I am also happy to learn them.Beta Was this translation helpful? Give feedback.
All reactions