Hide likes and replies from the homepage

This commit is contained in:
Danielle McLean 2017-11-13 08:54:23 +11:00
parent 28e4a71cae
commit adb302ebe3
Signed by untrusted user: 00dani
GPG key ID: 5A5D2D1AFF12EEC5
2 changed files with 10 additions and 3 deletions

View file

@ -1,8 +1,9 @@
class Entry:
def __init__(self, id, plural, icon, slug=False):
def __init__(self, id, plural, icon, on_home=True, slug=False):
self.id = id
self.plural = plural
self.icon = icon
self.on_home = on_home
self.slug = slug
@property
@ -46,12 +47,14 @@ Reply = Entry(
id='reply',
icon='fa fa-comment',
plural='replies',
on_home=False,
)
Like = Entry(
id='like',
icon='fa fa-heart',
plural='likes',
on_home=False,
)
Repost = Entry(
@ -61,5 +64,6 @@ Repost = Entry(
)
all = (Note, Article, Photo, Reply, Like, Repost)
on_home = (k.id for k in all if k.on_home)
from_id = {k.id: k for k in all}
from_plural = {k.plural: k for k in all}