mirror of
https://github.com/nikdoof/apishiv.git
synced 2025-12-13 07:32:16 +00:00
Working contacts page, though there's no link to the contacs page itself and the design is terribad
This commit is contained in:
@@ -129,6 +129,29 @@ def character(character_id):
|
||||
return render_template('character.html', character=charsheet, corp=corp, skilllist=skilllist, charinfo=charinfo)
|
||||
return redirect(url_for('characters'))
|
||||
|
||||
@app.route('/contacts/<character_id>')
|
||||
def contact(character_id):
|
||||
if mask_check(session['accessmask'], 4):
|
||||
auth = auth_from_session(session)
|
||||
contactlist = auth.char.ContactList(characterID=character_id)
|
||||
contacts = []
|
||||
for row in contactlist.contactList:
|
||||
temp = {}
|
||||
try:
|
||||
temp['contactInfo'] = eveapi.eve.CharacterInfo(characterID=row.contactID)
|
||||
except:
|
||||
temp['contactInfo'] = False
|
||||
temp['contactID'] = row.contactID
|
||||
temp['contactName'] = row.contactName
|
||||
temp['inWatchlist'] = row.inWatchlist
|
||||
temp['standing'] = row.standing
|
||||
contacts.append(temp)
|
||||
return render_template('contacts.html', contactlist=contacts)
|
||||
return redirect(url_for('characters'))
|
||||
|
||||
|
||||
|
||||
|
||||
@app.route('/clear')
|
||||
def clear():
|
||||
session.clear()
|
||||
|
||||
37
apishiv/templates/contacts.html
Normal file
37
apishiv/templates/contacts.html
Normal file
@@ -0,0 +1,37 @@
|
||||
{% extends "layout.html" %}
|
||||
{% block body %}
|
||||
|
||||
{% for contact in contactlist %}<div>
|
||||
{% if contact.contactInfo %}
|
||||
<img src="https://image.eveonline.com/Character/{{contact.contactID}}_64.jpg" style="float:left" /><span style="float:right">{{contact.contactName}}<br>{{contact.contactInfo.corporation}}<br>{{contact.contactInfo.alliance}}</span>
|
||||
{% else %}
|
||||
<img src="https://image.eveonline.com/Character/{{contact.contactID}}_64.jpg" style="float:left" /><span style="float:right">{{contact.contactName}}<br>{{contact.inWatchlist, contact.standing}}<br></span>
|
||||
{% endif %}
|
||||
</div><br>
|
||||
{% endfor %}
|
||||
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js" type="text/javascript"></script>
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
$(".skill_heading")
|
||||
.css("cursor", "pointer")
|
||||
.attr("title", "Click to expand/collapse")
|
||||
.click(function(){
|
||||
$('tr[parent$=' + $(this).attr('id') + ']').toggle();
|
||||
});
|
||||
|
||||
$("#openAll").bind("click", function(e){
|
||||
e.preventDefault();
|
||||
$(".child").show();
|
||||
});
|
||||
|
||||
$("#collapseAll").bind("click", function(e){
|
||||
e.preventDefault();
|
||||
$(".child").hide();
|
||||
});
|
||||
|
||||
$('tr[parent]').hide();
|
||||
});
|
||||
</script>
|
||||
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user