Adarnof 1b4f5e4e88 Adarnof's Little Things (#547)
* Port to Django 1.10
Initial migrations for current states of all models. Requires faking to retain data.
Removed all references to render_to_response, replacing with render shortcut.
Same for HttpResponseRedirect to render shortcut.
Corrected notification signal import to wait for app registry to finish loading.

* Correct typos from render conversion

* Modify models to suppress Django field warnings

* Script for automatic database conversion
 - fakes initial migrations to preserve data
Include LOGIN_URL setting

* Correct context processor import typo

* Removed pathfinder support.
Current pathfinder versions require SSO, not APIs added to database.
Conditionally load additional database definitions only if services are enabled.
Prevents errors when running auth without creating all possible databases.

* Condense context processors

* Include Django 1.10 installation in migrate script
Remove syncdb/evolve, replace with migrate for update script

* Replaced member/blue perms with user state system
Removed sigtracker
Initial migrations for default perms and groups
Removed perm bootstrapping on first run

* Clean up services list

* Remove fleet fittings page

* Provide action feedback via django messaging
Display unread notification count
Correct left navbar alignment

* Stop storing service passwords.
Provide them one time upon activation or reset.
Closes #177

* Add group sync buttons to admin site
Allow searcing of AuthServicesInfo models
Display user main character

* Correct button CSS to remove underlines on hover

* Added bulk actions to notifications
Altered notification default ordering

* Centralize API key validation.
Remove unused error count on API key model.
Restructure API key refresh task to queue all keys per user and await completion.
Closes #350

* Example configuration files for supervisor.
Copy to /etc/supervisor/conf.d and restart to take effect.
Closes #521
Closes #266

* Pre-save receiver for member/blue state switching
Removed is_blue field
Added link to admin site

* Remove all hardcoded URLs from views and templates
Correct missing render arguments
Closes #540

* Correct celeryd process directory

* Migration to automatically set user states.
Runs instead of waiting for next API refresh cycle. Should make the transition much easier.

* Verify service accounts accessible to member state

* Restructure project to remove unnecessary apps.
(celerytask, util, portal, registraion apps)
Added workarounds for python 3 compatibility.

* Correct python2 compatibility

* Check services against state being changed to

* Python3 compatibility fixes

* Relocate x2bool py3 fix

* SSO integration for logging in to existing accounts.

* Add missing url names for fleetup reverse

* Sanitize groupnames before syncing.

* Correct trailing slash preventing url resolution

* Alter group name sanitization to allow periods and hyphens

* Correct state check on pre_save model for corp/alliance group assignment

* Remove sigtracker table from old dbs to allow user deletion

* Include missing celery configuration

* Teamspeak error handling

* Prevent celery worker deadlock on async group result wait

* Correct active navbar links for translated urls.
Correct corp status url resolution for some links.
Remove DiscordAuthToken model.
2016-10-16 18:01:14 -04:00

230 lines
15 KiB
HTML

{% extends "public/base.html" %}
{% load bootstrap %}
{% load staticfiles %}
{% load i18n %}
{% block title %}Alliance Auth{% endblock %}
{% block page_title %}{% trans "Corporation Member Tracking" %}{% endblock page_title %}
{% block content %}
<div class="col-lg-12">
<h1 class="page-header text-center">{% trans "Corporation Member Data" %}</h1>
<div class="col-lg-12 container" id="example">
{% if corp %}
<div class="row">
<div class="col-lg-12">
<div class="panel panel-default">
<div class="panel-heading">{% trans "Corporation" %}</div>
<div class="panel-body">
<div class="col-lg-5 col-sm-2">
<img class="ra-avatar img-responsive" src="https://image.eveonline.com/Corporation/{{ corp.corporation_id }}_128.png">
</div>
<div class="col-lg-7 col-sm-2">
<h4 class="">{{ corp.corporation_name }}</h4>
<p>{% trans "Ticker:" %} {{ corp.corporation_ticker }}</p>
<p>{% trans "Member count:" %} {{ corp.member_count }}</p>
<p>{% trans "Player count:" %} {{characters_with_api|length}}</p>
<p>{% trans "Unregistered characters:" %} {{characters_without_api|length|add:n_unacounted}}</p>
</div>
<div class="col-lg-12 col-sm-5">
<b>{% trans "API Index:" %}</b>
<div class="progress">
<div class="progress-bar progress-bar-striped" role="progressbar" aria-valuenow="{{ n_registered }}" aria-valuemin="0" aria-valuemax="{{ corp.member_count }}" style="width: {% widthratio characters_with_api|length corp.member_count 100 %}%;">
{{n_registered}}/{{ corp.member_count }}
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<nav class="navbar navbar-default">
<div class="container-fluid">
<ul class="nav navbar-nav navbar-wide">
{% if membercorplist and perms.auth.alliance_apis %}
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">{% trans "Alliance corporations" %} <span class="caret"></span></a>
<ul class="dropdown-menu scrollable">
{% for membercorpid, membercorpname in membercorplist %}
<li>
<a href="{% url 'auth_corputils_corp_view' membercorpid %}">{{ membercorpname }}</a>
</li>
{% endfor %}
</ul>
</li>
{% endif %}
<li style="float: right">
<p class="navbar-form">
Statistics for:
<a href="{% url 'auth_corputils_month' corp.corporation_id previous_month|date:"Y" previous_month|date:"m" %}">
<i class="fa fa-arrow-circle-left fa-fw grayiconecolor"></i>
</a>
{{ this_month|date:"M" }}, {{ this_month|date:"Y" }}
{% if next_month %}
<a href="{% url 'auth_corputils_month' corp.corporation_id next_month|date:"Y" next_month|date:"m" %}" >
<i class="fa fa-arrow-circle-right fa-fw grayiconecolor"></i>
</a>
<a href="{% url 'auth_corputils' %}" >
<i class="fa fa-angle-double-right fa-fw grayiconecolor"></i>
</a>
{% endif %}
</p>
</li>
<li style="float: right">
<p class="navbar-btn">
<a href="https://zkillboard.com/corporation/{{ corp.corporation_id }}/" class="btn btn-default" target="_blank">{{ corp.corporation_name }} {% trans "Killboard" %}</a>
</p>
</li>
<li style="float: right">
<form class="navbar-form navbar-left" role="search" action={% url 'auth_corputils_search' %}{{ corp.corporation_id }}/ method="POST">
<div class="form-group">
{% csrf_token %}
{{ search_form.as_table }}
</div>
<button class="btn btn-default" type="submit">{% trans "Search" %}</button>
</form>
</li>
</ul>
</div>
</nav>
<ul class="nav nav-tabs">
<li class="active"><a data-toggle="tab" href="#gotapi">{% blocktrans %}Registered Main Characters{% endblocktrans %} <b>({{characters_with_api|length}})</b></a></li>
<li><a data-toggle="tab" href="#noapi">{% blocktrans %}Characters without API{% endblocktrans %} <b>({{characters_without_api|length|add:n_unacounted}})</b></a></li>
</ul>
<div class="tab-content">
<div id="gotapi" class="tab-pane fade in active">
{% if characters_with_api %}
<div class="panel-body">
<div class="table-responsive">
<table class="table table-condensed table-hover table-striped">
<tr>
<th class="col-md-1"></th>
<th class="col-md-2">{% trans "Main character" %}</th>
<th class="col-md-2">{% trans "Main corporation" %}</th>
<th class="col-md-2">{% trans "Character list" %}</th>
<th class="col-md-1">{% trans "Fats" %}</th>
{% if perms.auth.fleetactivitytracking_statistics %}
<th class="col-md-3">{% trans "Killboard" %}</th>
<th class="col-md-2">{% trans "Fleet statistics" %}</th>
{% else %}
<th class="col-md-3">{% trans "Killboard" %}</th>
{% endif %}
<th class="col-md-2">{% trans "API JackKnife" %}</th>
</tr>
{% for maincharname, player in characters_with_api %}
<tr >
<td>
<img src="http://image.eveonline.com/Character/{{ player.main.character_id }}_32.jpg" class="img-circle">
</td>
<td>
<p>{{ maincharname }}</p>
</td>
<td>
{% if not corp.corporation_name == player.maincorp%}
<span class="label label-danger">
{{ player.maincorp }}
</span>
{% else %}
<span class="label label-success">
{{ player.maincorp }}
</span>
{% endif %}
</td>
<td>
{% for char in player.altlist %}
<p>{{ char.character_name }}</p>
{% endfor %}
</td>
<td>
{{ player.n_fats }}
</td>
<td>
{% for char in player.altlist %}
<p><a href="https://zkillboard.com/character/{{ char.character_id }}/" class="label label-danger" target="_blank">{% trans "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>
<a href="{{ JACK_KNIFE_URL }}?usid={{ apiinfo.api_id }}&apik={{ apiinfo.api_key }}" target="_blank" class="btn btn-primary">
{% trans "API JackKnife" %}
</a>
</p>
{% endfor %}
</td>
</tr>
{% endfor %}
</table>
</div>
</div>
{% else %}
<div class="alert alert-danger" role="alert">
<h3>{% blocktrans %}Seems there are no characters in {{ corp.corporation_name }} tied to a registered API!{% endblocktrans %}</h3>
</div>
{% endif %}
</div>
<div id="noapi" class="tab-pane fade">
{% if characters_without_api %}
<div class="panel-body">
<div class="table-responsive">
{% if 0 < n_unacounted %}
<div class="alert alert-danger" role="alert">
<h3>{% blocktrans %}There are atleast {{ n_unacounted }} characters not accounted for in EveWho.{% endblocktrans %}</h3>
</div>
{% endif %}
<table class="table table-condensed table-hover table-striped">
<tr>
<th class="col-md-1"></th>
<th class="col-md-2">{% trans "Character" %}</th>
<th class="col-md-5">{% trans "Killboard" %}</th>
</tr>
{% for character_name, character_id in characters_without_api %}
<tr>
<td>
<img src="http://image.eveonline.com/Character/{{ character_id }}_32.jpg" class="img-circle">
</td>
<td>
<p>{{ character_name }}</p>
</td>
<td>
<a href="https://zkillboard.com/character/{{ character_id }}/" class="label label-danger" target="_blank">{% trans "Killboard" %}</a>
</td>
</tr>
{% endfor %}
</table>
</div>
</div>
{% else %}
<div class="alert alert-success" role="alert">
<h3>{% blocktrans %}Good job! Every character in {{ corp.corporation_name }} seem to be tied to an API!{% endblocktrans %}</h3>
</div>
{% endif %}
</div>
</div>
{% else %}
<div class="container-fluid">
<div class="col-md-4 col-md-offset-4">
<div class="row">
<div class="alert alert-danger text-center" role="alert">{% trans "No corporation model found. Contact your admin." %}</div>
</div>
</div>
</div>
</div>
{% endif %}
</div>
</div>
{% endblock content %}