Working contacts page, though there's no link to the contacs page itself and the design is terribad

This commit is contained in:
david
2011-09-14 04:51:46 -05:00
parent 267b9153a3
commit 55b70e0ecd
2 changed files with 195 additions and 135 deletions

View File

@@ -129,6 +129,29 @@ def character(character_id):
return render_template('character.html', character=charsheet, corp=corp, skilllist=skilllist, charinfo=charinfo) return render_template('character.html', character=charsheet, corp=corp, skilllist=skilllist, charinfo=charinfo)
return redirect(url_for('characters')) 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') @app.route('/clear')
def clear(): def clear():
session.clear() session.clear()

View 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 %}