mirror of
https://gitlab.com/allianceauth/allianceauth.git
synced 2025-07-16 16:00:17 +02:00
Added portraits in the list, because why not.
This commit is contained in:
parent
986816fdc7
commit
bd7bbc9339
@ -44,7 +44,7 @@ def corp_member_view(request, corpid = settings.CORP_ID):
|
|||||||
member_list = EveWhoManager.get_corporation_members(corpid)
|
member_list = EveWhoManager.get_corporation_members(corpid)
|
||||||
|
|
||||||
characters_with_api = {}
|
characters_with_api = {}
|
||||||
characters_without_api = []
|
characters_without_api = {}
|
||||||
|
|
||||||
for char_id, member_data in member_list.items():
|
for char_id, member_data in member_list.items():
|
||||||
try:
|
try:
|
||||||
@ -58,7 +58,9 @@ def corp_member_view(request, corpid = settings.CORP_ID):
|
|||||||
maincorpid = mainchar.corporation_id
|
maincorpid = mainchar.corporation_id
|
||||||
except (ValueError, EveCharacter.DoesNotExist):
|
except (ValueError, EveCharacter.DoesNotExist):
|
||||||
mainname = "User: " + user.username
|
mainname = "User: " + user.username
|
||||||
maincorp = None
|
mainchar = char
|
||||||
|
maincorp = mainchar.corporation_name
|
||||||
|
maincorpid = mainchar.corporation_id
|
||||||
characters_with_api.setdefault(mainname, Player(main=mainchar,
|
characters_with_api.setdefault(mainname, Player(main=mainchar,
|
||||||
maincorp=maincorp,
|
maincorp=maincorp,
|
||||||
maincorpid=maincorpid,
|
maincorpid=maincorpid,
|
||||||
@ -66,7 +68,7 @@ def corp_member_view(request, corpid = settings.CORP_ID):
|
|||||||
).altlist.append(char)
|
).altlist.append(char)
|
||||||
|
|
||||||
except EveCharacter.DoesNotExist:
|
except EveCharacter.DoesNotExist:
|
||||||
characters_without_api.append(member_data["name"])
|
characters_without_api.update({member_data["name"]: member_data["id"]})
|
||||||
|
|
||||||
|
|
||||||
if not settings.IS_CORP:
|
if not settings.IS_CORP:
|
||||||
@ -74,13 +76,13 @@ def corp_member_view(request, corpid = settings.CORP_ID):
|
|||||||
context = {"form": form,
|
context = {"form": form,
|
||||||
"corp": corp,
|
"corp": corp,
|
||||||
"characters_with_api": sorted(characters_with_api.items()),
|
"characters_with_api": sorted(characters_with_api.items()),
|
||||||
"characters_without_api": sorted(characters_without_api),
|
"characters_without_api": sorted(characters_without_api.items()),
|
||||||
"search_form": CorputilsSearchForm()}
|
"search_form": CorputilsSearchForm()}
|
||||||
else:
|
else:
|
||||||
logger.debug("corp_member_view running in corportation mode")
|
logger.debug("corp_member_view running in corportation mode")
|
||||||
context = {"corp": corp,
|
context = {"corp": corp,
|
||||||
"characters_with_api": sorted(characters_with_api.items()),
|
"characters_with_api": sorted(characters_with_api.items()),
|
||||||
"characters_without_api": sorted(characters_without_api),
|
"characters_without_api": sorted(characters_without_api.items()),
|
||||||
"search_form": CorputilsSearchForm()}
|
"search_form": CorputilsSearchForm()}
|
||||||
|
|
||||||
|
|
||||||
|
@ -16,4 +16,4 @@ class EveWhoManager():
|
|||||||
jsondata = requests.get(url).content
|
jsondata = requests.get(url).content
|
||||||
data=json.loads(jsondata.decode())
|
data=json.loads(jsondata.decode())
|
||||||
|
|
||||||
return {row["character_id"]:{"name":row["name"]} for row in data["characters"]}
|
return {row["character_id"]:{"name":row["name"], "id":row["character_id"]} for row in data["characters"]}
|
||||||
|
@ -66,14 +66,19 @@
|
|||||||
<div style="overflow:auto;overflow-y:auto;">
|
<div style="overflow:auto;overflow-y:auto;">
|
||||||
<table class="table table-condensed">
|
<table class="table table-condensed">
|
||||||
<tr>
|
<tr>
|
||||||
|
<th class="""></th>
|
||||||
<th class="text-center">Main character</th>
|
<th class="text-center">Main character</th>
|
||||||
<th class="text-center">Main corporation</th>
|
<th class="text-center">Main corporation</th>
|
||||||
<th class="text-center">Character list</th>
|
<th class="text-center">Character list</th>
|
||||||
</tr>
|
</tr>
|
||||||
{% for mainchar, player in characters_with_api %}
|
{% for maincharname, player in characters_with_api %}
|
||||||
<tr >
|
<tr >
|
||||||
|
<td>
|
||||||
|
<img class="ra-avatar img-responsive"
|
||||||
|
src="https://image.eveonline.com/Character/{{ player.main.character_id }}_64.jpg">
|
||||||
|
</td>
|
||||||
<td class="text-center">
|
<td class="text-center">
|
||||||
<p class="">{{ mainchar }}</p>
|
<p class="">{{ maincharname }}</p>
|
||||||
</td>
|
</td>
|
||||||
<td class="text-center" {% if not corp.corporation_name == player.maincorp%} bgcolor="#FF99AA" {% endif %} >
|
<td class="text-center" {% if not corp.corporation_name == player.maincorp%} bgcolor="#FF99AA" {% endif %} >
|
||||||
<p class="">{{ player.maincorp }}</p>
|
<p class="">{{ player.maincorp }}</p>
|
||||||
@ -85,10 +90,14 @@
|
|||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% for charname in characters_without_api %}
|
{% for character_name, character_id in characters_without_api %}
|
||||||
<tr bgcolor="#DD8822">
|
<tr bgcolor="#DD8822">
|
||||||
|
<td>
|
||||||
|
<img class="ra-avatar img-responsive"
|
||||||
|
src="https://image.eveonline.com/Character/{{ character_id }}_64.jpg">
|
||||||
|
</td>
|
||||||
<td class="text-center">
|
<td class="text-center">
|
||||||
<p class="">{{ charname }}</p>
|
<p class="">{{ character_name }}</p>
|
||||||
</td>
|
</td>
|
||||||
<td class="text-center">
|
<td class="text-center">
|
||||||
<p class=""></p>
|
<p class=""></p>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user