mirror of
https://gitlab.com/allianceauth/allianceauth.git
synced 2026-02-05 06:36:19 +01:00
Move FAT templates to app folder.
Provide feedback via messages.
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
{% extends 'public/base.html' %}
|
||||
{% block title %}Fleet Participation{% endblock %}
|
||||
{% block page_title %}Fleet Participation{% endblock %}
|
||||
<div class="col-lg-12">
|
||||
<h1 class="page-header text-center">Character not found!</h1>
|
||||
<div class="col-lg-12 container" id="example">
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">{{ character_name }}</div>
|
||||
<div class="panel-body">
|
||||
<div class="col-lg-2 col-sm-2">
|
||||
<img class="ra-avatar img-responsive" src="https://image.eveonline.com/Character/{{ character_id }}_128.jpg">
|
||||
</div>
|
||||
<div class="col-lg-10 col-sm-2">
|
||||
<div class="alert alert-danger" role="alert">Character not registered!</div>
|
||||
This character is not part of any registered API-key. You must go to <a href=" {% url 'auth_api_key_management' %}">API key management</a> and add an API with the character on before being able to click fleet attendance links.
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,37 @@
|
||||
{% extends "public/base.html" %}
|
||||
{% load bootstrap %}
|
||||
{% load staticfiles %}
|
||||
{% load i18n %}
|
||||
|
||||
{% block title %}Alliance Auth - Fatlink Create{% endblock %}
|
||||
|
||||
{% block page_title %}{% trans "Create Fatlink" %}{% endblock page_title %}
|
||||
{% block extra_css %}
|
||||
<link href="{% static 'css/jquery.datetimepicker.css' %}" rel="stylesheet" type="text/css">{% endblock extra_css %}
|
||||
|
||||
{% block content %}
|
||||
<div class="col-lg-12">
|
||||
<h1 class="page-header text-center">{% trans "Create Fleet Operation" %}</h1>
|
||||
|
||||
<div class="container-fluid">
|
||||
{% if badrequest %}
|
||||
<div class="alert alert-danger" role="alert">{% trans "Bad request!" %}</div>
|
||||
{% endif %}
|
||||
{% for message in errormessages %}
|
||||
<div class="alert alert-danger" role="alert">{{ message }}</div>
|
||||
{% endfor %}
|
||||
<div class="col-md-4 col-md-offset-4">
|
||||
<div class="row">
|
||||
<form class="form-signin" role="form" action="" method="POST">
|
||||
{% csrf_token %}
|
||||
{{ form|bootstrap }}
|
||||
<br/>
|
||||
<button class="btn btn-lg btn-primary btn-block" type="submit" name="submit_fat">{% trans "Create fatlink" %}</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% endblock content %}
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
{% extends "public/base.html" %}
|
||||
{% load bootstrap %}
|
||||
{% load staticfiles %}
|
||||
{% load i18n %}
|
||||
|
||||
{% block title %}Alliance Auth{% endblock %}
|
||||
{% block page_title %}{% trans "Fatlink view" %}{% endblock page_title %}
|
||||
|
||||
{% block content %}
|
||||
<div class="col-lg-12">
|
||||
<h1 class="page-header text-center">{% blocktrans %}Edit fatlink "{{ fatlink.name }}"{% endblocktrans %}
|
||||
<div class="text-right">
|
||||
<form>
|
||||
<button type="submit" onclick="return confirm('Are you sure?')" class="btn btn-danger" name="deletefat" value="True">
|
||||
{% trans "Delete fat" %}
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
</h1>
|
||||
<h4><b>{% trans "Registered characters" %}</b></h4>
|
||||
<table class="table table-responsive table-bordered">
|
||||
<tr>
|
||||
<th class="text-center">{% trans "User" %}</th>
|
||||
<th class="text-center">{% trans "Character" %}</th>
|
||||
<th class="text-center">{% trans "System" %}</th>
|
||||
<th class="text-center">{% trans "Ship" %}</th>
|
||||
<th class="text-center">{% trans "Eve Time" %}</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
{% for fat in registered_fats %}
|
||||
<tr>
|
||||
<td class="text-center">{{ fat.user }}</td>
|
||||
<td class="text-center">{{ fat.character.character_name }}</td>
|
||||
{% if fat.station != "No Station" %}
|
||||
<td class="text-center">Docked in {{ fat.system }}</td>
|
||||
{% else %}
|
||||
<td class="text-center">{{ fat.system }}</td>
|
||||
{% endif %}
|
||||
<td class="text-center">{{ fat.shiptype }}</td>
|
||||
<td class="text-center">{{ fat.fatlink.fatdatetime }}</td>
|
||||
<td class="text-center">
|
||||
<form>
|
||||
<button type="submit" class="btn btn-warning" name="removechar" value="{{ fat.character.character_id }}"><span
|
||||
class="glyphicon glyphicon-remove"></span></button>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
</div>
|
||||
|
||||
|
||||
<script src="/static/js/dateformat.js"></script>
|
||||
|
||||
{% endblock content %}
|
||||
@@ -0,0 +1,68 @@
|
||||
{% extends "public/base.html" %}
|
||||
{% load bootstrap %}
|
||||
{% load staticfiles %}
|
||||
{% load i18n %}
|
||||
|
||||
{% block title %}Alliance Auth{% endblock %}
|
||||
{% block page_title %}{% trans "Personal fatlink statistics" %}{% endblock page_title %}
|
||||
|
||||
{% block content %}
|
||||
<div class="col-lg-12">
|
||||
<h1 class="page-header text-center">{% trans "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" %}" class="btn btn-info">{% trans "Previous month" %}</a>
|
||||
<a href="{% url 'auth_fatlink_view_user_statistics_month' char_id next_month|date:"Y" next_month|date:"m" %}" class="btn btn-info">{% trans "Next month" %}</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
</h1>
|
||||
<h2>{% blocktrans %}{{ user }} has collected {{ n_fats }} links this month.{% endblocktrans %}</h2>
|
||||
<table class="table table-responsive">
|
||||
<tr>
|
||||
<th class="col-md-2 text-center">{% trans "Ship" %}</th>
|
||||
<th class="col-md-2 text-center">{% trans "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>{% blocktrans %}{{ user }} has created {{ n_created_fats }} links this month.{% endblocktrans %}</h2>
|
||||
{% if created_fats %}
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th class="text-center">{% trans "Name" %}</th>
|
||||
<th class="text-center">{% trans "Creator" %}</th>
|
||||
<th class="text-center">{% trans "Fleet" %}</th>
|
||||
<th class="text-center">{% trans "Eve Time" %}</th>
|
||||
<th class="text-center">{% trans "Duration" %}</th>
|
||||
<th class="text-center">{% trans "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 %}
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
|
||||
<script src="/static/js/dateformat.js"></script>
|
||||
|
||||
{% endblock content %}
|
||||
@@ -0,0 +1,42 @@
|
||||
{% extends "public/base.html" %}
|
||||
{% load bootstrap %}
|
||||
{% load staticfiles %}
|
||||
{% load i18n %}
|
||||
|
||||
{% block title %}Alliance Auth{% endblock %}
|
||||
{% block page_title %}{% trans "Personal fatlink statistics" %}{% endblock page_title %}
|
||||
|
||||
{% block content %}
|
||||
<div class="col-lg-12">
|
||||
<h1 class="page-header text-center">{% trans "Participation data statistics for" %} {{ year }}
|
||||
<div class="text-right">
|
||||
<a href="{% url 'auth_fatlink_view_personal_statistics_year' previous_year %}" class="btn btn-info">{% trans "Previous year" %}</a>
|
||||
{% if next_year %}
|
||||
<a href="{% url 'auth_fatlink_view_personal_statistics_year' next_year %}" class="btn btn-info">{% trans "Next year" %}</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
</h1>
|
||||
<div class="col-lg-2 col-lg-offset-5">
|
||||
<table class="table table-responsive">
|
||||
<tr>
|
||||
<th class="col-md-2 text-center">{% trans "Month" %}</th>
|
||||
<th class="col-md-2 text-center">{% trans "Fats" %}</th>
|
||||
</tr>
|
||||
{% for monthnr, month, n_fats in monthlystats %}
|
||||
<tr>
|
||||
<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 %}
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<script src="/static/js/dateformat.js"></script>
|
||||
|
||||
{% endblock content %}
|
||||
@@ -0,0 +1,48 @@
|
||||
{% extends "public/base.html" %}
|
||||
{% load bootstrap %}
|
||||
{% load staticfiles %}
|
||||
{% load i18n %}
|
||||
|
||||
{% block title %}Alliance Auth{% endblock %}
|
||||
{% block page_title %}{% trans "Fatlink statistics" %}{% endblock page_title %}
|
||||
|
||||
{% block content %}
|
||||
<div class="col-lg-12">
|
||||
<h1 class="page-header text-center">{% blocktrans %}Participation data statistics for {{ month }}, {{ year }}{% endblocktrans %}
|
||||
<div class="text-right">
|
||||
<a href="{% url 'auth_fatlink_view_statistics_month' previous_month|date:"Y" previous_month|date:"m" %}" class="btn btn-info">{% trans "Previous month" %}</a>
|
||||
{% if next_month %}
|
||||
<a href="{% url 'auth_fatlink_view_statistics_month' next_month|date:"Y" next_month|date:"m" %}" class="btn btn-info">{% trans "Next month" %}</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
</h1>
|
||||
{% if fatStats %}
|
||||
<table class="table table-responsive">
|
||||
<tr>
|
||||
<th class="col-md-1"></th>
|
||||
<th class="col-md-2 text-center">{% trans "Ticker" %}</th>
|
||||
<th class="col-md-5 text-center">{% trans "Corp" %}</th>
|
||||
<th class="col-md-2 text-center">{% trans "Members" %}</th>
|
||||
<th class="col-md-2 text-center">{% trans "Fats" %}</th>
|
||||
<th class="col-md-2 text-center">{% trans "Average fats" %}</th>
|
||||
</tr>
|
||||
{% for corpStat in fatStats %}
|
||||
<tr>
|
||||
<td>
|
||||
<img src="https://image.eveonline.com/Corporation/{{ corpStat.corp.corporation_id }}_32.png" class="ra-avatar img-responsive">
|
||||
</td>
|
||||
<td class="text-center">[{{ corpStat.corp.corporation_ticker }}]</td>
|
||||
<td class="text-center">{{ corpStat.corp.corporation_name }}</td>
|
||||
<td class="text-center">{{ corpStat.corp.member_count }}</td>
|
||||
<td class="text-center">{{ corpStat.n_fats }}</td>
|
||||
<td class="text-center">{{ corpStat.avg_fat }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
|
||||
<script src="/static/js/dateformat.js"></script>
|
||||
|
||||
{% endblock content %}
|
||||
@@ -0,0 +1,106 @@
|
||||
{% extends "public/base.html" %}
|
||||
{% load bootstrap %}
|
||||
{% load staticfiles %}
|
||||
{% load i18n %}
|
||||
|
||||
{% block title %}Alliance Auth{% endblock %}
|
||||
{% block page_title %}{% trans "Fatlink view" %}{% endblock page_title %}
|
||||
|
||||
{% block content %}
|
||||
<div class="col-lg-12">
|
||||
<h1 class="page-header text-center">{% trans "Participation data" %}</h1>
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th class="col-md-11">
|
||||
<h4><b>{% trans "Most recent clicked fatlinks" %}</b>
|
||||
</h4>
|
||||
</th>
|
||||
<th class="col-md-1">
|
||||
<a href="{% url 'auth_fatlink_view_personal_statistics' %}" class="btn btn-info">
|
||||
{% trans "Personal statistics" %}
|
||||
</a>
|
||||
</th>
|
||||
</tr>
|
||||
</table>
|
||||
{% if fats %}
|
||||
<table class="table table-responsive">
|
||||
<tr>
|
||||
<th class="text-center">{% trans "fatname" %}</th>
|
||||
<th class="text-center">{% trans "Character" %}</th>
|
||||
<th class="text-center">{% trans "System" %}</th>
|
||||
<th class="text-center">{% trans "Ship" %}</th>
|
||||
<th class="text-center">{% trans "Eve Time" %}</th>
|
||||
</tr>
|
||||
{% for fat in fats %}
|
||||
<tr>
|
||||
<td class="text-center">{{ fat.fatlink.name }}</td>
|
||||
<td class="text-center">{{ fat.character.character_name }}</td>
|
||||
{% if fat.station != "No Station" %}
|
||||
<td class="text-center">Docked in {{ fat.system }}</td>
|
||||
{% else %}
|
||||
<td class="text-center">{{ fat.system }}</td>
|
||||
{% endif %}
|
||||
<td class="text-center">{{ fat.shiptype }}</td>
|
||||
<td class="text-center">{{ fat.fatlink.fatdatetime }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
{% else %}
|
||||
<div class="alert alert-warning text-center">No fleet activity on record.</div>
|
||||
{% endif %}
|
||||
|
||||
{% if perms.auth.fleetactivitytracking%}
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th class="col-md-10">
|
||||
<h4><b>{% trans "Most recent fatlinks" %}</b>
|
||||
</h4>
|
||||
</th>
|
||||
<th class="col-md-1">
|
||||
<a href="{% url 'auth_fatlink_view_statistics' %}" class="btn btn-info">
|
||||
{% trans "View statistics" %}
|
||||
</a>
|
||||
</th>
|
||||
<th class="col-md-1">
|
||||
<a href="{% url 'auth_create_fatlink_view' %}" class="btn btn-success">
|
||||
{% trans "Create fatlink" %}
|
||||
</a>
|
||||
</th>
|
||||
</tr>
|
||||
</table>
|
||||
{% if fatlinks %}
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th class="text-center">{% trans "Name" %}</th>
|
||||
<th class="text-center">{% trans "Creator" %}</th>
|
||||
<th class="text-center">{% trans "Fleet" %}</th>
|
||||
<th class="text-center">{% trans "Eve Time" %}</th>
|
||||
<th class="text-center">{% trans "Duration" %}</th>
|
||||
<th class="text-center">{% trans "Edit" %}</th>
|
||||
</tr>
|
||||
{% for link in fatlinks %}
|
||||
<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 }}" class="btn btn-info">
|
||||
<span class="glyphicon glyphicon-edit"></span>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
|
||||
</table>
|
||||
{% else %}
|
||||
<div class="alert alert-warning text-center">No created fatlinks on record.</div>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
|
||||
<script src="/static/js/dateformat.js"></script>
|
||||
|
||||
{% endblock content %}
|
||||
@@ -6,7 +6,7 @@ from django.contrib.auth.decorators import login_required
|
||||
from django.contrib.auth.decorators import permission_required
|
||||
from django.core.exceptions import ValidationError
|
||||
from django.utils import timezone
|
||||
|
||||
from django.contrib import messages
|
||||
from eveonline.models import EveCharacter
|
||||
from eveonline.models import EveCorporationInfo
|
||||
from eveonline.managers import EveManager
|
||||
@@ -71,7 +71,7 @@ def fatlink_view(request):
|
||||
else:
|
||||
context = {'user': user, 'fats': latest_fats}
|
||||
|
||||
return render(request, 'registered/fatlinkview.html', context=context)
|
||||
return render(request, 'fleetactivitytracking/fatlinkview.html', context=context)
|
||||
|
||||
|
||||
@login_required
|
||||
@@ -113,7 +113,7 @@ def fatlink_statistics_view(request, year=datetime.date.today().year, month=date
|
||||
context = {'fatStats': fatStatsList, 'month': start_of_month.strftime("%B"), 'year': year,
|
||||
'previous_month': start_of_previous_month}
|
||||
|
||||
return render(request, 'registered/fatlinkstatisticsview.html', context=context)
|
||||
return render(request, 'fleetactivitytracking/fatlinkstatisticsview.html', context=context)
|
||||
|
||||
|
||||
@login_required
|
||||
@@ -141,7 +141,7 @@ def fatlink_personal_statistics_view(request, year=datetime.date.today().year, m
|
||||
else:
|
||||
context = {'user': user, 'monthlystats': monthlystats, 'year': year, 'previous_year': year - 1}
|
||||
|
||||
return render(request, 'registered/fatlinkpersonalstatisticsview.html', context=context)
|
||||
return render(request, 'fleetactivitytracking/fatlinkpersonalstatisticsview.html', context=context)
|
||||
|
||||
|
||||
@login_required
|
||||
@@ -175,7 +175,7 @@ def fatlink_monthly_personal_statistics_view(request, year, month, char_id=None)
|
||||
context["created_fats"] = created_fats
|
||||
context["n_created_fats"] = len(created_fats)
|
||||
|
||||
return render(request, 'registered/fatlinkpersonalmonthlystatisticsview.html', context=context)
|
||||
return render(request, 'fleetactivitytracking/fatlinkpersonalmonthlystatisticsview.html', context=context)
|
||||
|
||||
|
||||
@login_required
|
||||
@@ -212,21 +212,21 @@ def click_fatlink_view(request, token, hash, fatname):
|
||||
try:
|
||||
fat.full_clean()
|
||||
fat.save()
|
||||
context = {'registered': True}
|
||||
messages.success(request, 'Fleet participation registered.')
|
||||
except ValidationError as e:
|
||||
messages = []
|
||||
err_messages = []
|
||||
for errorname, message in e.message_dict.items():
|
||||
messages.append(message[0].decode())
|
||||
context = {'errormessages': messages}
|
||||
err_messages.append(message[0].decode())
|
||||
messages.error(request, ' '.join(err_messages))
|
||||
else:
|
||||
context = {'character_id': token.character_id,
|
||||
'character_name': token.character_name}
|
||||
return render(request, 'registered/characternotexisting.html', context=context)
|
||||
return render(request, 'fleetactivitytracking/characternotexisting.html', context=context)
|
||||
else:
|
||||
context = {'expired': True}
|
||||
messages.error(request, 'FAT link has expired.')
|
||||
except (ObjectDoesNotExist, KeyError):
|
||||
context = {}
|
||||
return render(request, 'registered/clickfatlinkview.html', context=context)
|
||||
messages.error(request, 'Invalid FAT link.')
|
||||
return redirect('auth_fatlink_view')
|
||||
|
||||
|
||||
@login_required
|
||||
@@ -255,7 +255,7 @@ def create_fatlink_view(request):
|
||||
for errorname, message in e.message_dict.items():
|
||||
messages.append(message[0].decode())
|
||||
context = {'form': form, 'errormessages': messages}
|
||||
return render(request, 'registered/fatlinkformatter.html', context=context)
|
||||
return render(request, 'fleetactivitytracking/fatlinkformatter.html', context=context)
|
||||
else:
|
||||
form = FatlinkForm()
|
||||
context = {'form': form, 'badrequest': True}
|
||||
@@ -268,7 +268,7 @@ def create_fatlink_view(request):
|
||||
|
||||
context = {'form': form}
|
||||
|
||||
return render(request, 'registered/fatlinkformatter.html', context=context)
|
||||
return render(request, 'fleetactivitytracking/fatlinkformatter.html', context=context)
|
||||
|
||||
|
||||
@login_required
|
||||
@@ -296,4 +296,4 @@ def modify_fatlink_view(request, hash=""):
|
||||
|
||||
context = {'fatlink': fatlink, 'registered_fats': registered_fats}
|
||||
|
||||
return render(request, 'registered/fatlinkmodify.html', context=context)
|
||||
return render(request, 'fleetactivitytracking/fatlinkmodify.html', context=context)
|
||||
|
||||
Reference in New Issue
Block a user