Further theme updating changes.

This commit is contained in:
2011-12-04 01:39:03 +00:00
parent 1bf5099dab
commit 76c6df0fd2
20 changed files with 461 additions and 355 deletions

View File

@@ -9,126 +9,115 @@
</div>
<div class="row">
<div class="span8">
<h2>Attributes</h2>
<div class="span8">
<h2>Attributes</h2>
<ul>
<li><span class="stat">Race:</span> <span class="value">{{ character.get_race_display }}</span></li>
<li><span class="stat">Gender:</span> <span class="value">{{ character.get_gender_display }}</span></li>
<li><span class="stat">Corporation:</span> <a href="{% url eveapi-corporation character.corporation.id %}">{{ character.corporation.name }}</a></span></li>
<li><span class="stat">Joined Corporation:</span> <span class="value">{{ character.corporation_date|date:"Y/m/d H:i:s" }}</span></li>
{% if character.corporation.alliance %}
<li><span class="stat">Alliance:</span> <span class="value"><a href="{% url eveapi-alliance character.corporation.alliance.id %}">{{ character.corporation.alliance.name }}</a><span></li>
{% endif %}
<li><span class="stat">Security Status:</span> {{ character.security_status|floatformat:2 }}</span></li>
<li><span class="stat">Director:</span> <span class="value">{{ character.director }}</span></li>
{% if character.current_training %}
<li><spam class="stat">Training:</span> <span class="Value">{{ character.current_training.skill.name}} to Level {{ ch$
{% endif %}
</ul>
</div>
<ul>
<li><span class="stat">Race:</span> <span class="value">{{ character.get_race_display }}</span></li>
{% if character.gender %}<li><span class="stat">Gender:</span> <span class="value">{{ character.get_gender_display }}</span></li>{% endif %}
<li><span class="stat">Corporation:</span> <a href="{% url eveapi-corporation character.corporation.id %}">{{ character.corporation.name }}</a></span></li>
{% if character.corporation.alliance %}<li><span class="stat">Alliance:</span> <span class="value"><a href="{% url eveapi-alliance character.corporation.alliance.id %}">{{ character.corporation.alliance.name }}</a><span></li>{% endif %}
<li><span class="stat">Joined Corporation:</span> <span class="value">{{ character.corporation_date|date:"Y/m/d H:i:s" }}</span></li>
<li><span class="stat">Security Status:</span> {{ character.security_status|floatformat:2 }}</span></li>
<li><span class="stat">Director:</span> <span class="value">{{ character.director }}</span></li>
{% if character.current_training %}
<li><spam class="stat">Training:</span> <span class="Value">{{ character.current_training.skill.name}} to Level</span></li>
{% endif %}
</ul>
<div class="span5 offset3">
<div class="row pull-right">
<img src="https://image.eveonline.com/Character/{{ character.id }}_256.jpg" />
</div>
<div class="row pull-right">
<div class="span2">
<div class="row">
<span><a href="{% url eveapi-corporation character.corporation.id %}">{{ character.corporation.ticker }}</a></span>
</div>
<div class="row">
<img src="https://image.eveonline.com/Corporation/{{ character.corporation.id }}_64.png" class="pull-right"/>
</div>
</div>
<div class="span2">
{% if character.corporation.alliance %}
<div class="row">
<span><a href="{% url eveapi-alliance character.corporation.alliance.id %}">{{ character.corporation.alliance.ticker }}</a></span>
</div>
<div class="row">
<img src="https://image.eveonline.com/Alliance/{{ character.corporation.alliance.id }}_64.png" class="pull-left"/>
</div>
{% endif %}
</div>
</div>
</div>
</div>
<div class="character_stats">
<h2>Stats</h2>
<table>
<tr><th>Stat</th><th>Value</th></tr>
<tr><td class="stat">Intelligence</td><td> {{ character.attrib_intelligence }}</td></tr>
<tr><td class="stat">Memory</td><td>{{ character.attrib_memory }}</td></tr>
<tr><td class="stat">Charisma</td><td>{{ character.attrib_charisma }}</td></tr>
<tr><td class="stat">Perception</td><td>{{ character.attrib_perception }}</td></tr>
<tr><td class="stat">Willpower</td><td>{{ character.attrib_willpower }}</td></tr>
</table>
</div>
{% if character.attrib_intelligence %}
<h2>Stats</h2>
<div class="character_skills">
<h2>Skills</h2>
<div class="skill_controls">
<a href=#" id="openAll">Open All</a>
<a href=#" id="collapseAll">Collapse All</a>
</div>
<table>
{% for group in skillTree %}
{{group.items}}
<tr class="skill_heading" id="{{ group.1 }}"><th colspan=2>{{ group.1 }}</th><th>{{ group.0|intcomma }}</th></tr>
{% for skill in group.2 %}
{% if skill.in_training %}
<tr class="child intraining" parent="{{ group.1 }}"><td>{{ skill.skill.name }} - Training to Level {{ skill.in_training }}</td><td><img src="{{ STATIC_URL }}img/skills/level{{ skill.level }}t.gif" alt="Level {{ skill.level }}" /></td><td>{{ skill.skillpoints|intcomma }} SP</td></tr>
{% else %}
<tr class="child" parent="{{ group.1 }}"><td>{{ skill.skill.name }} </td><td><img src="{{ STATIC_URL }}img/skills/level{{ skill.level }}.gif" alt="Level {{ skill.level }}" /></td><td>{{ skill.skillpoints|intcomma }} SP</td></tr>
{% endif %}
{% endfor %}
{% endfor %}
<tr><th colspan=2>Total SP</th><th>{{ character.total_sp|intcomma }} SP</th></tr>
</table>
</div>
{% if employmenthistory.count %}
<div class="character_employmenthistory">
<h2>Employment History</h2>
<table>
<tr><th>Corporation</th><th>Join Date</th><th>Leave Date</th></tr>
{% for hist in employmenthistory %}
<tr><td><a href="{% url eveapi-corporation hist.corporation.id %}">{{ hist.corporation.name }}</a></td><td>{{ hist.start_date }}</td><td>{% if hist.end_date %}{{ hist.end_date }}{% endif %}</td></tr>
{% endfor %}
</table>
</div>
<table>
<thead>
<tr><th>Stat</th><th>Value</th></tr>
</thead>
<tbody>
<tr><td>Intelligence</td><td> {{ character.attrib_intelligence }}</td></tr>
<tr><td>Memory</td><td>{{ character.attrib_memory }}</td></tr>
<tr><td>Charisma</td><td>{{ character.attrib_charisma }}</td></tr>
<tr><td>Perception</td><td>{{ character.attrib_perception }}</td></tr>
<tr><td>Willpower</td><td>{{ character.attrib_willpower }}</td></tr>
</tbody>
</table>
{% endif %}
</div>
<div class="span5 offset3">
<div class="row pull-right">
<img src="https://image.eveonline.com/Character/{{ character.id }}_256.jpg" />
</div>
<div class="row pull-right">
<div class="span5">
{% if character.corporation.alliance %}
<img src="https://image.eveonline.com/Alliance/{{ character.corporation.alliance.id }}_64.png" class="pull-right" title="{{ character.corporation.alliance }} ({{ character.corporation.alliance.ticker }})"/>
{% endif %}
<img src="https://image.eveonline.com/Corporation/{{ character.corporation.id }}_64.png" class="pull-right" title="{{ character.corporation }} ({{ character.corporation.ticker }})"/>
</div>
</div>
</div>
</div>
{% if skillTree %}
<h2>Skills</h2>
<p>
<a href=#" id="openAll" class="btn">Open All</a>
<a href=#" id="collapseAll" class="btn">Collapse All</a>
</p>
<table>
{% for group in skillTree %}
{{group.items}}
<tr class="fill skill_heading" id="{{ group.1 }}"><th colspan=2>{{ group.1 }}</th><th>{{ group.0|intcomma }} SP</th></tr>
{% for skill in group.2 %}
{% if skill.in_training %}
<tr class="child intraining" parent="{{ group.1 }}"><td>{{ skill.skill.name }} - Training to Level {{ skill.in_training }}</td><td><img src="{{ STATIC_URL }}img/skills/level{{ skill.level }}t.gif" alt="Level {{ skill.level }}" /></td><td>{{ skill.skillpoints|intcomma }} SP</td></tr>
{% else %}
<tr class="child" parent="{{ group.1 }}"><td>{{ skill.skill.name }} </td><td><img src="{{ STATIC_URL }}img/skills/level{{ skill.level }}.gif" alt="Level {{ skill.level }}" /></td><td>{{ skill.skillpoints|intcomma }} SP</td></tr>
{% endif %}
{% endfor %}
{% endfor %}
<tr><th colspan=2>Total SP</th><th>{{ character.total_sp|intcomma }} SP</th></tr>
</table>
{% endif %}
{% if employmenthistory.count %}
<h2>Employment History</h2>
<table>
<thead>
<tr><th>Corporation</th><th>Join Date</th><th>Leave Date</th></tr>
</thead>
<tbody>
{% for hist in employmenthistory %}
<tr><td><a href="{% url eveapi-corporation hist.corporation.id %}">{{ hist.corporation.name }}</a></td><td>{{ hist.start_date }}</td><td>{% if hist.end_date %}{{ hist.end_date }}{% endif %}</td></tr>
{% endfor %}
</tbody>
</table>
{% endif %}
<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")
.attr("title", "Click to expand/collapse section")
.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>

View File

@@ -2,29 +2,45 @@
{% load humanize %}
{% block content %}
<script src="/static/js/jquery.tablesorter.min.js"></script>
<script >
$(function() {
$("table#characters").tablesorter({ sortList: [[0,0]] });
});
</script>
<div class="page-header">
<h1>Your Characters</h1>
</div>
<table>
{% if accounts %}
{% if characters %}
<table class="zebra-striped" id="characters">
<thead>
<tr><th>Character Name</th><th>Corporation</th><th>Alliance</th><th>Skillpoints</th><th>Training</th></tr>
</thead>
<tbody>
{% for acc in accounts %}
{% if acc.characters.count %}
<tr><th colspan=5>Key {{ acc.pk }} {% if acc.training == 0 %}<font color="#F87217">(No Character Training)</font>{% endif %}</th></tr>
{% for char in acc.characters.all %}
<tr><td><a href="{% url eveapi-character char.id %}">{{ char.name }}</a></td>
{% for char in characters %}
<tr><td><a href="{% url eveapi-character char.id %}">{{ char.name }}</a></td>
<td><a href="{% url eveapi-corporation char.corporation.id %}">{{ char.corporation }}</a></td>
<td>{% if char.corporation.alliance %}<a href="{% url eveapi-alliance char.corporation.alliance.id %}">{{ char.corporation.alliance }}</a>{% endif %}</td>
<td style="text-align: right;">{{ char.total_sp|intcomma }} SP</td>
<td>{% if char.current_training %}{{ char.current_training.skill.name }} to Level {{ char.current_training.in_training }}{% endif %}</td>
</tr>
{% endfor %}
{% endif %}
{% endfor %}
</tbody>
</table>
{% for acc in accounts %}
{% if acc.training == 0 %}<p><span class="label warning">No Character Training</span> on the account linked to API Key ID {{ acc.api_user_id }}.</p>{% endif %}
{% endfor %}
{% else %}
<p>You have no characters available on the API keys provided.</p>
{% endif %}
{% else %}
<p>You have no API keys linked to your auth account.</p>
{% endif %}
{% endblock %}

View File

@@ -30,7 +30,7 @@
</table>
{% paginate %}
<p><a href="{% url eveapi-corporation-members-csv corporation.id %}">Export as CSV</a></p>
<p><a href="{% url eveapi-corporation-members-csv corporation.id %}" class="btn" title="Exports the membership list of this corporation to a CSV file.">Export as CSV</a></p>
{% endif %}
</div>

View File

@@ -41,7 +41,7 @@ def eveapi_add(request, post_save_redirect='/', template='eve_api/add.html'):
if out:
msg = "Key %d successfully added." % form.cleaned_data['api_user_id']
else:
msg = "An issue was encountered why trying to import key %s, please recheck and try again." % form.cleaned_data['api_user_id']
msg = "An issue was encountered while trying to import key %s, Please check that you are using the correct information and try again." % form.cleaned_data['api_user_id']
messages.success(request, msg, fail_silently=True)
return redirect(post_save_redirect)
else:
@@ -183,7 +183,8 @@ def eveapi_character(request, charid=None, template='eve_api/character.html', li
return render_to_response(template, context, context_instance=RequestContext(request))
context = {
'accounts': EVEAccount.objects.select_related('characters', 'characters__corporation', 'characters__corporation__alliance').filter(user=request.user),
'accounts': EVEAccount.objects.select_related('characters__name').filter(user=request.user).exclude(api_keytype=API_KEYTYPE_CORPORATION),
'characters': EVEPlayerCharacter.objects.filter(eveaccount__user=request.user).distinct().order_by('name'),
}
return render_to_response(list_template, context, context_instance=RequestContext(request))