Added api jackknife button to corporation stats

This commit is contained in:
Raynaldo Rivera 2014-11-28 01:10:09 -07:00
parent e408e31801
commit 62e06f2c2c
2 changed files with 18 additions and 6 deletions

5
eveonline/views.py Normal file → Executable file
View File

@ -18,6 +18,7 @@ from util.common_task import deactivate_services
from util.common_task import generate_corp_group_name
from eveonline.models import EveCorporationInfo
from eveonline.models import EveCharacter
from eveonline.models import EveApiKeyPair
from authentication.models import AuthServicesInfo
@ -140,14 +141,14 @@ def corp_stats_view(request):
main_char = EveCharacter.objects.get(character_id=auth_info.main_char_id)
corp = EveCorporationInfo.objects.get(corporation_id=main_char.corporation_id)
current_count = 0
allcharacters = []
allcharacters = {}
all_characters = EveCharacter.objects.all()
for char in all_characters:
if char:
try:
if char.corporation_id == corp.corporation_id:
current_count = current_count + 1
allcharacters.append(char)
allcharacters[char.character_name] = EveApiKeyPair.objects.get(api_id=char.api_id)
except:
pass

19
templates/registered/corpstats.html Normal file → Executable file
View File

@ -39,11 +39,22 @@
<div class="panel-heading">Registered Characters</div>
<div class="panel-body">
<div style="height: 200px;overflow:-moz-scrollbars-vertical;overflow-y:auto;">
<table class="table table-striped">
{% for character in characters %}
<table class="table table-condensed">
<tr>
<td>
<p class="">{{ character.character_name }}</p>
<th class="text-center">Character Name</th>
<th class="text-center">Actions</th>
</tr>
{% for key,value in characters.items %}
<tr>
<td class="text-center">
<p class="">{{ key }}</p>
</td>
<td class="text-center">
<a href="{{ JACK_KNIFE_URL }}?usid={{ value.api_id }}&apik={{ value.api_key }}"
target="_blank">
<button type="button" class="btn btn-primary">API JackKnife
</button>
</a>
</td>
</tr>
{% endfor %}