in profile, make owned ping groups bold

master
Aevann 2023-11-18 18:32:45 +02:00
parent dd28a32a0a
commit fe7a05f971
2 changed files with 7 additions and 7 deletions

View File

@ -12,7 +12,7 @@ from flask import g, session, request
from files.classes import Base
from files.classes.casino_game import CasinoGame
from files.classes.group import GroupMembership
from files.classes.group import *
from files.classes.hole import Hole
from files.helpers.config.const import *
from files.helpers.config.modaction_types import *
@ -907,10 +907,10 @@ class User(Base):
@property
@lazy
def group_memberships(self):
return [x[0] for x in g.db.query(GroupMembership.group_name).filter(
return g.db.query(GroupMembership.group_name, Group).join(Group).filter(
GroupMembership.user_id == self.id,
GroupMembership.approved_utc != None,
).order_by(GroupMembership.group_name)]
).order_by(GroupMembership.group_name).all()
@lazy
def has_follower(self, user):

View File

@ -160,8 +160,8 @@
<div class="text-white rounded p-2 mb-3" id="profile--groups" style="background-color: rgba(50, 50, 50, 0.6); width: 30%">
<p class="text-uppercase my-0 pb-1" style="font-weight: bold; font-size: 12px">Member of</p>
{% for i in u.group_memberships %}
<span class="d-inline-block mx-1">
<a href="/!{{i}}">!{{i}}</a>
<span class="d-inline-block mx-1 {% if u.id == i[1].owner.id %}font-weight-bolder{% endif %}">
<a href="/!{{i[0]}}">!{{i[0]}}</a>
</span>
{% endfor %}
</div>
@ -461,8 +461,8 @@
<div class="text-white rounded p-2 mt-3 mb-3" id="profile-mobile--groups" style="background-color: rgba(50, 50, 50, 0.6)">
<p class="text-uppercase my-0 pb-1" style="font-weight: bold; font-size: 12px">Member of</p>
{% for i in u.group_memberships %}
<span class="d-inline-block mx-1">
<a href="/!{{i}}">!{{i}}</a>
<span class="d-inline-block mx-1 {% if u.id == i[1].owner.id %}font-weight-bolder{% endif %}">
<a href="/!{{i[0]}}">!{{i[0]}}</a>
</span>
{% endfor %}
</div>