From fbe77098cd156d2c4273734fa3480cc28fe66133 Mon Sep 17 00:00:00 2001 From: Zergling_man Date: Fri, 24 Dec 2021 12:01:00 +1100 Subject: [PATCH] Mobile indicator seems useful --- main/models.py | 2 ++ main/views.py | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/main/models.py b/main/models.py index b16d250..8ff3b51 100644 --- a/main/models.py +++ b/main/models.py @@ -20,6 +20,8 @@ class Contact(models.Model): groups={0:'Preferred',1:'Suitable',2:'Discouraged',3:'Ignored',4:'Discontinued',5:'NSFW'} group=models.IntegerField(choices=list(groups.items())) priority=models.IntegerField() + desktop=models.BooleanField(default=True) + mobile=models.BooleanField(default=True) def save(self,*args,**kwargs): a,_=Update.objects.get_or_create(page='contact') diff --git a/main/views.py b/main/views.py index c7ad1c6..5e78b5f 100644 --- a/main/views.py +++ b/main/views.py @@ -60,11 +60,14 @@ def lii(obj): name=obj.name if obj.url: name=f"{name}" if obj.comment: name=f"{name} ({obj.comment})" + if obj.desktop: name=f"{name} 🖥" + if obj.mobile: name=f"{name} 📱" return f"
  • {obj.proto}: {name}
  • " @rerender def contact(): - head="Certain people keep asking me about the best ways to contact me. So here they are, in rough order of most to least preferred. More to come as I remember them/feel like it
    " + head="""Certain people keep asking me about the best ways to contact me. So here they are, in rough order of most to least preferred. More to come as I remember them/feel like it
    +🖥 = I will receive on my computer, 📱 = I will receive on my phone
    """ contacts=sorted(Contact.objects.all(),key=lambda x:(x.group,x.priority)) out={} for n in contacts: