mirror of
https://github.com/nikdoof/test-auth.git
synced 2025-12-14 14:52:15 +00:00
Show primary character on group requests and lists
This commit is contained in:
@@ -50,6 +50,14 @@ class GroupRequest(models.Model):
|
|||||||
|
|
||||||
created_date = models.DateTimeField("Created Date/Time", auto_now_add=True)
|
created_date = models.DateTimeField("Created Date/Time", auto_now_add=True)
|
||||||
|
|
||||||
|
@property
|
||||||
|
def character(self):
|
||||||
|
char = self.user.get_profile().primary_character
|
||||||
|
if char:
|
||||||
|
return "[%s]%s" % (char.corporation.ticker, char.name)
|
||||||
|
else:
|
||||||
|
return "Unknown"
|
||||||
|
|
||||||
def __unicode__(self):
|
def __unicode__(self):
|
||||||
return u'%s - %s' % (self.user, self.group)
|
return u'%s - %s' % (self.user, self.group)
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
{% if group.user_set.all %}
|
{% if group.user_set.all %}
|
||||||
<table>
|
<table>
|
||||||
<tr><th>Member Username</th><th>Characters</th><th>Status</th><th>Actions</th></tr>
|
<tr><th>Member Username</th><th>Character</th><th>Status</th><th>Actions</th></tr>
|
||||||
{% for user, chars, status in member_list %}
|
{% for user, chars, status in member_list %}
|
||||||
<tr><td><a href="{% url sso.views.user_view user.username %}">{{ user.username }}</a></td>
|
<tr><td><a href="{% url sso.views.user_view user.username %}">{{ user.username }}</a></td>
|
||||||
<td>{{ chars }}</td>
|
<td>{{ chars }}</td>
|
||||||
@@ -26,9 +26,10 @@
|
|||||||
|
|
||||||
{% if requests %}
|
{% if requests %}
|
||||||
<table>
|
<table>
|
||||||
<tr><th>Username</th><th>Reason</th><th>Status</th><th>Created Date</th><th>Actions</th></tr>
|
<tr><th>Username</th><th>Character</th><th>Reason</th><th>Status</th><th>Created Date</th><th>Actions</th></tr>
|
||||||
{% for req in requests %}
|
{% for req in requests %}
|
||||||
<tr><td><a href="{% url sso.views.user_view req.user.username %}">{{ req.user }}</a></td>
|
<tr><td><a href="{% url sso.views.user_view req.user.username %}">{{ req.user }}</a></td>
|
||||||
|
<td>{{ req.character }}</td>
|
||||||
<td>{{ req.reason }}</td>
|
<td>{{ req.reason }}</td>
|
||||||
<td>{{ req.get_status_description }}</td>
|
<td>{{ req.get_status_description }}</td>
|
||||||
<td>{{ req.created_date }}</td>
|
<td>{{ req.created_date }}</td>
|
||||||
|
|||||||
@@ -134,11 +134,13 @@ def admin_group(request, groupid):
|
|||||||
else:
|
else:
|
||||||
status = "Member"
|
status = "Member"
|
||||||
|
|
||||||
chars = []
|
char = member.get_profile().primary_character
|
||||||
for acc in member.eveaccount_set.all():
|
if char:
|
||||||
chars.extend(acc.characters.all().values_list('name', flat=True))
|
charname = "[%s]%s" % char.corporation.ticker, char.name
|
||||||
|
else:
|
||||||
|
charname = "Unknown"
|
||||||
|
|
||||||
member_list.append((member, ', '.join(chars), status))
|
member_list.append((member, charname, status))
|
||||||
|
|
||||||
requests = group.requests.filter(status=REQUEST_PENDING)
|
requests = group.requests.filter(status=REQUEST_PENDING)
|
||||||
return render_to_response('groups/group_admin.html', locals(), context_instance=RequestContext(request))
|
return render_to_response('groups/group_admin.html', locals(), context_instance=RequestContext(request))
|
||||||
|
|||||||
Reference in New Issue
Block a user