@@ -9,15 +9,15 @@ from ._provided import blueprint | |||||
SCOPES = {"esi-corporations.read_corporation_membership.v1"} | SCOPES = {"esi-corporations.read_corporation_membership.v1"} | ||||
_Member = namedtuple("_Member", ["id", "name"]) | |||||
_Member = namedtuple("_Member", ["id", "name", "roles"]) | |||||
# ... show roles if possible | |||||
# ... sort by seniority | |||||
def get_members(): | def get_members(): | ||||
"""Return a list of the members of the user's corporation. | """Return a list of the members of the user's corporation. | ||||
Members are returned as 2-namedtuples of (id, name). An empty list is | |||||
returned if there was some error with tokens. | |||||
Members are returned as 3-namedtuples of (id, name, roles). An empty list | |||||
is returned if there was some error with tokens. | |||||
""" | """ | ||||
token = g.auth.get_token() | token = g.auth.get_token() | ||||
if not token: | if not token: | ||||
@@ -26,8 +26,10 @@ def get_members(): | |||||
corp_id = g.config.get("corp.id") | corp_id = g.config.get("corp.id") | ||||
resp = g.eve.esi(token).v2.corporations(corp_id).members.get() | resp = g.eve.esi(token).v2.corporations(corp_id).members.get() | ||||
cids = ",".join(str(item["character_id"]) for item in resp) | cids = ",".join(str(item["character_id"]) for item in resp) | ||||
ceo_id = g.eve.esi(token).v2.corporations(corp_id).get()["ceo_id"] | |||||
resp = g.eve.esi(token).v1.characters.names.get(character_ids=cids) | resp = g.eve.esi(token).v1.characters.names.get(character_ids=cids) | ||||
return [_Member(item["character_id"], item["character_name"]) | |||||
return [_Member(item["character_id"], item["character_name"], | |||||
"CEO" if item["character_id"] == ceo_id else None) | |||||
for item in resp] | for item in resp] | ||||
def home(): | def home(): | ||||
@@ -150,7 +150,7 @@ header nav > ul > li { | |||||
display: inline-block; | display: inline-block; | ||||
} | } | ||||
header nav > ul > li:not(:last-child):after { | |||||
header nav > ul > li:not(:last-child)::after { | |||||
content: " \007c"; | content: " \007c"; | ||||
color: #777; | color: #777; | ||||
} | } | ||||
@@ -175,7 +175,7 @@ footer ul li { | |||||
list-style: none; | list-style: none; | ||||
} | } | ||||
footer ul li:not(:last-child):after { | |||||
footer ul li:not(:last-child)::after { | |||||
content: " \00b7"; | content: " \00b7"; | ||||
} | } | ||||
@@ -251,7 +251,7 @@ footer ul li:not(:last-child):after { | |||||
border-width: 1px; | border-width: 1px; | ||||
} | } | ||||
#character-options:after, #character-options:before { | |||||
#character-options::after, #character-options::before { | |||||
bottom: 100%; | bottom: 100%; | ||||
left: 20px; | left: 20px; | ||||
border: solid transparent; | border: solid transparent; | ||||
@@ -262,13 +262,13 @@ footer ul li:not(:last-child):after { | |||||
pointer-events: none; | pointer-events: none; | ||||
} | } | ||||
#character-options:after { | |||||
#character-options::after { | |||||
border-bottom-color: black; | border-bottom-color: black; | ||||
border-width: 10px; | border-width: 10px; | ||||
margin-left: -10px; | margin-left: -10px; | ||||
} | } | ||||
#character-options:before { | |||||
#character-options::before { | |||||
border-bottom-color: #4A4A4A; | border-bottom-color: #4A4A4A; | ||||
border-width: 12px; | border-width: 12px; | ||||
margin-left: -12px; | margin-left: -12px; | ||||
@@ -331,22 +331,30 @@ footer ul li:not(:last-child):after { | |||||
column-count: 2; | column-count: 2; | ||||
} | } | ||||
#members-list > li { | |||||
#members-list li { | |||||
margin-bottom: 0.5em; | margin-bottom: 0.5em; | ||||
} | } | ||||
#members-list > li a:hover { | |||||
#members-list a:hover { | |||||
text-decoration: none; | text-decoration: none; | ||||
} | } | ||||
#members-list > li img { | |||||
#members-list img { | |||||
width: 48px; | width: 48px; | ||||
height: 48px; | height: 48px; | ||||
vertical-align: middle; | vertical-align: middle; | ||||
border-width: 1px; | border-width: 1px; | ||||
} | } | ||||
#members-list > li span { | |||||
#members-list span { | |||||
margin-left: 0.5em; | margin-left: 0.5em; | ||||
vertical-align: middle; | vertical-align: middle; | ||||
} | } | ||||
#members-list em { | |||||
font-size: 90%; | |||||
} | |||||
#members-list em::before { | |||||
content: ", "; | |||||
} |
@@ -7,7 +7,7 @@ | |||||
<a href="${g.eve.image.character(member.id, 1024)}"> | <a href="${g.eve.image.character(member.id, 1024)}"> | ||||
<img class="styled-border" title="${member.name}" alt="${member.name}'s Portrait" src="${g.eve.image.character(member.id, 256)}"/> | <img class="styled-border" title="${member.name}" alt="${member.name}'s Portrait" src="${g.eve.image.character(member.id, 256)}"/> | ||||
</a> | </a> | ||||
<span>${member.name}</span> | |||||
<span>${member.name} <em>${member.roles}</em></span> | |||||
</li> | </li> | ||||
% endfor | % endfor | ||||
</ul> | </ul> |