More statistics features for Fatlink (#423)

* Fixed a bug with links not registering correctly when undocked. Also removed some typos.

* Adding functionality to view individual members stats as an admin, to see ships flown, and paps created, if any. Also correcting a incorrectly sorted table, and a faulty link.
This commit is contained in:
Joakim Strandberg
2016-05-05 09:18:35 +02:00
committed by Mr McClain
parent dbc9b584d1
commit 20fdcc5b31
8 changed files with 160 additions and 17 deletions

View File

@@ -107,7 +107,12 @@
<th class="col-md-2">Main corporation</th>
<th class="col-md-2">Character list</th>
<th class="col-md-1">Fats</th>
{% if perms.auth.fleetactivitytracking_statistics %}
<th class="col-md-1">Killboard</th>
<th class="col-md-2">Fleet statistics</th>
{% else %}
<th class="col-md-3">Killboard</th>
{% endif %}
<th class="col-md-2">API JackKnife</th>
</tr>
{% for maincharname, player in characters_with_api %}
@@ -142,6 +147,14 @@
<p><a href="https://zkillboard.com/character/{{ char.character_id }}/" class="label label-danger" target="_blank">Killboard</a></p>
{% endfor %}
</td>
{% if perms.auth.fleetactivitytracking %}
<td>
<a href="{% url 'auth_fatlink_view_user_statistics_month' player.main.character_id this_month|date:"Y" this_month|date:"m" %}">
<button type="button" class="btn btn-primary">Statistics
</button>
</a>
</td>
{% endif %}
<td>
{% for apiinfo in player.apilist %}
<p>

View File

@@ -37,7 +37,12 @@
<th class="col-md-1"></th>
<th class="col-md-2">Character</th>
<th class="col-md-2">Main character</th>
{% if perms.auth.fleetactivitytracking%}
<th class="col-md-2">Killboard</th>
<th class="col-md-2">Fleet statistics</th>
{% else %}
<th class="col-md-5">Killboard</th>
{% endif %}
<th class="col-md-2">API JackKnife</th>
</tr>
{% for result in results %}
@@ -48,7 +53,7 @@
<td>{{ result.name }}</td>
<td>
{% if result.api_registered%}
{{ result.main }}
{{ result.main.character_name }}
{% else %}
<span class="label label-danger">No API registered!</span>
{% endif %}
@@ -57,6 +62,19 @@
<p><a href="https://zkillboard.com/character/{{ result.char.character_id }}/" class="label label-danger" target="_blank">Killboard</a></p>
</td>
{% if perms.auth.fleetactivitytracking %}
{% if result.main %}
<td>
<a href="{% url 'auth_fatlink_view_user_statistics_month' result.main.character_id year month%}">
<button type="button" class="btn btn-primary">Statistics
</button>
</a>
</td>
{% else %}
<td></td>
{% endif %}
{% endif %}
<td>
{% if result.api_registered %}
<a href="{{ JACK_KNIFE_URL }}?usid={{ result.apiinfo.api_id }}&apik={{ result.apiinfo.api_key }}"

View File

@@ -0,0 +1,69 @@
{% extends "public/base.html" %}
{% load bootstrap %}
{% load staticfiles %}
{% block title %}Alliance Auth{% endblock %}
{% block page_title %}Personal fatlink statistics{% endblock page_title %}
{% block content %}
<div class="col-lg-12">
<h1 class="page-header text-center">Participation data statistics for {{ month }}, {{ year }}
{% if char_id %}
<div class="text-right">
<a href="{% url 'auth_fatlink_view_user_statistics_month' char_id previous_month|date:"Y" previous_month|date:"m" %}">
<button type="button" class="btn btn-info">Previous month</button>
</a>
<a href="{% url 'auth_fatlink_view_user_statistics_month' char_id next_month|date:"Y" next_month|date:"m" %}">
<button type="button" class="btn btn-info">Next month</button>
</a>
</div>
{% endif %}
</h1>
<h2>{{ user }} has collected {{ n_fats }} links this month.</h2>
<table class="table table-responsive table-bordered">
<tr>
<th class="col-md-2 text-center">Ship</th>
<th class="col-md-2 text-center">Times used</th>
</tr>
{% for ship, n_fats in shipStats %}
<tr>
<td class="text-center">{{ ship }}</td>
<td class="text-center">{{ n_fats }}</td>
</tr>
{% endfor %}
</table>
{% if created_fats %}
<h2>{{ user }} has created {{ n_created_fats }} links this month.</h2>
<table class="table table-bordered">
<tr>
<th class="text-center">Name</th>
<th class="text-center">Creator</th>
<th class="text-center">Fleet</th>
<th class="text-center">Eve Time</th>
<th class="text-center">Duration</th>
<th class="text-center">Edit</th>
</tr>
{% for link in created_fats %}
<tr>
<td class="text-center"><a href="{% url 'auth_click_fatlink_view' %}{{ link.hash }}/{{ link.name }}">{{ link.name }}</a></td>
<td class="text-center">{{ link.creator.username }}</td>
<td class="text-center">{{ link.fleet }}</td>
<td class="text-center">{{ link.fatdatetime }}</td>
<td class="text-center">{{ link.duration }}</td>
<td class="text-center">
<a href="{% url 'auth_modify_fatlink_view' %}{{ link.hash }}/{{ link.name }}">
<button type="button" class="btn btn-info"><span
class="glyphicon glyphicon-edit"></span></button>
</a>
</td>
</tr>
{% endfor %}
</table>
{% endif %}
</div>
<script src="/static/js/dateformat.js"></script>
{% endblock content %}

View File

@@ -9,11 +9,11 @@
<div class="col-lg-12">
<h1 class="page-header text-center">Participation data statistics for {{ year }}
<div class="text-right">
<a href="{% url 'auth_fatlink_view_personal_statistics' previous_year %}">
<a href="{% url 'auth_fatlink_view_personal_statistics_year' previous_year %}">
<button type="button" class="btn btn-info">Previous year</button>
</a>
{% if next_year %}
<a href="{% url 'auth_fatlink_view_personal_statistics' next_year %}">
<a href="{% url 'auth_fatlink_view_personal_statistics_year' next_year %}">
<button type="button" class="btn btn-info">Next year</button>
</a>
{% endif %}
@@ -24,9 +24,13 @@
<th class="col-md-2 text-center">Month</th>
<th class="col-md-2 text-center">Fats</th>
</tr>
{% for month, n_fats in monthlystats.items %}
{% for monthnr, month, n_fats in monthlystats %}
<tr>
<td class="text-center">{{ month }}</td>
<td class="text-center">
<a href="{% url 'auth_fatlink_view_personal_statistics_month' year monthnr %}">
{{ month }}
</a>
</td>
<td class="text-center">{{ n_fats }}</td>
</tr>
{% endfor %}

View File

@@ -15,7 +15,7 @@
</h4>
</th>
<th class="col-md-1">
<a href="{% url 'auth_fatlink_view_statistics' %}">
<a href="{% url 'auth_fatlink_view_personal_statistics' %}">
<button type="button" class="btn btn-info">Personal statistics</button>
</a>
</th>