Mobile indicator seems useful

This commit is contained in:
Zergling_man 2021-12-24 12:01:00 +11:00
parent d7acc197cf
commit fbe77098cd
2 changed files with 6 additions and 1 deletions

View File

@ -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')

View File

@ -60,11 +60,14 @@ def lii(obj):
name=obj.name
if obj.url: name=f"<a href='{obj.url}'>{name}</a>"
if obj.comment: name=f"{name} ({obj.comment})"
if obj.desktop: name=f"{name} 🖥"
if obj.mobile: name=f"{name} 📱"
return f"<li>{obj.proto}: {name}</li>"
@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<br/>"
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<br/>
🖥 = I will receive on my computer, 📱 = I will receive on my phone<br/>"""
contacts=sorted(Contact.objects.all(),key=lambda x:(x.group,x.priority))
out={}
for n in contacts: