Repurposed Signature Tracker for Wormhole use.

This commit is contained in:
orbitroom 2016-03-08 16:37:38 -05:00
parent 8b205ea959
commit 3fa18a585c
5 changed files with 39 additions and 25 deletions

View File

@ -4,19 +4,18 @@ from django.core.validators import MaxValueValidator, MinValueValidator
class SignatureForm(forms.Form):
sigtype = [('Wormhole', 'Wormhole'), ('Combat', 'Combat'), ('Data', 'Data'),
('Relic', 'Relic'), ('Gas', 'Gas'), ('Ore', 'Ore')]
status = [('Open', 'Open'), ('Started', 'Started'), ('Finished', 'Finished'), ('Life cycle has not begun', 'Life cycle has not begun'),
('Probably wont last another day', 'Probably wont last another day'), ('End of its natural lifetime', 'End of its natural lifetime'),
('stability not significantly disrupted', 'stability not significantly disrupted'),
('Stability reduced not critical degree yet', 'Stability reduced not critical degree yet'),
('Wormhole stability critically disrupted', 'Wormhole stability critically disrupted')]
mass_status = [('More Than 50%', 'More Than 50%'), ('Less Than 50%', 'Less Than 50%'), ('Less Than 10%', 'Less Than 10%')]
lifetime_status = [('More Than 24 Hours', 'More Than 24 Hours'), ('Less Than 24 Hours', 'Less Than 24 Hours'), ('Less Than 4 Hours', 'Less Than 4 Hours')]
ships_size = [('Only Smallest', 'Only Smallest'), ('Up to Medium', 'Up to Medium'), ('Larger', 'Larger'), ('Very Large', 'Very Large')]
system = forms.CharField(max_length=254, required=True, label='System')
ident = forms.CharField(max_length=254, required=True, label="ID")
sigtype = forms.ChoiceField(choices=sigtype, required=True, label="Signature Type")
destination = forms.CharField(max_length=254, label="destination", required=True, initial="")
status = forms.ChoiceField(choices=status, required=True, label="Status")
lifetime_status = forms.ChoiceField(choices=lifetime_status, required=True, label="Lifetime Status")
mass_status = forms.ChoiceField(choices=mass_status, required=True, label="Mass Status")
ships_size = forms.ChoiceField(choices=ships_size, required=True, label="Ship Size")
destination = forms.CharField(max_length=254, label="End Destination", required=True, initial="")
through_dest = forms.CharField(max_length=254, label="Goes Through", required=True, initial="")
notes = forms.CharField(max_length=254, label="Notes", required=False, initial="")
@ -24,3 +23,4 @@ class SignatureForm(forms.Form):

View File

@ -11,9 +11,12 @@ class sigtracker(models.Model):
ident = models.CharField(max_length=254, default="")
system = models.CharField(max_length=254, default="")
destination = models.CharField(max_length=254, default="")
sigtype = models.CharField(max_length=254, default="")
status = models.CharField(max_length=254, default="")
lifetime_status = models.CharField(max_length=254, default="")
mass_status = models.CharField(max_length=254, default="")
ships_size = models.CharField(max_length=254, default="")
notes = models.CharField(max_length=254, default="")
through_dest = models.CharField(max_length=254, default="")
post_time = models.DateTimeField(default=timezone.now)
eve_character = models.ForeignKey(EveCharacter)

View File

@ -51,8 +51,10 @@ def add_signature_view(request):
sig.ident = form.cleaned_data['ident']
sig.system = form.cleaned_data['system']
sig.destination = form.cleaned_data['destination']
sig.sigtype = form.cleaned_data['sigtype']
sig.status = form.cleaned_data['status']
sig.lifetime_status = form.cleaned_data['lifetime_status']
sig.mass_status = form.cleaned_data['mass_status']
sig.ships_size = form.cleaned_data['ships_size']
sig.through_dest = form.cleaned_data['through_dest']
sig.notes = form.cleaned_data['notes']
sig.create_time = post_time
sig.eve_character = character
@ -94,8 +96,10 @@ def edit_signature(request, sigtracker_id):
sig.ident = form.cleaned_data['ident']
sig.system = form.cleaned_data['system']
sig.destination = form.cleaned_data['destination']
sig.sigtype = form.cleaned_data['sigtype']
sig.status = form.cleaned_data['status']
sig.lifetime_status = form.cleaned_data['lifetime_status']
sig.mass_status = form.cleaned_data['mass_status']
sig.ships_size = form.cleaned_data['ships_size']
sig.through_dest = form.cleaned_data['through_dest']
sig.notes = form.cleaned_data['notes']
sig.eve_character = character
logger.info("User %s updating sigtracker id %s " % (request.user, sigtracker_id))
@ -108,8 +112,10 @@ def edit_signature(request, sigtracker_id):
'ident': sig.ident,
'system': sig.system,
'destination': sig.destination,
'sigtype': sig.sigtype,
'status': sig.status,
'lifetime_status': sig.lifetime_status,
'mass_status': sig.mass_status,
'ships_size': sig.ships_size,
'through_dest': sig.through_dest,
'notes': sig.notes,
}
form = SignatureForm(initial= data)

View File

@ -152,7 +152,7 @@
<li>
<a {% ifequal request.path "/sigtracker" %} class="active" {% endifequal %}
href="{% url 'auth_signature_view' %}"><i
class="fa fa-compass fa-fw grayiconecolor"></i> Signature Tracker</a>
class="fa fa-compass fa-fw grayiconecolor"></i> Wormhole Tracker</a>
</li>
<li>

View File

@ -3,12 +3,12 @@
{% block title %}Alliance Auth{% endblock %}
{% block page_title %}Signature Management{% endblock page_title %}
{% block page_title %}Wormhole Signature Management{% endblock page_title %}
{% block extra_css %}{% endblock extra_css %}
{% block content %}
<div class="col-lg-12">
<h1 class="page-header text-center">Signatures
<h1 class="page-header text-center">Wormhole Signatures
<div class="text-right">
<a href="{% url 'auth_add_signature_view' %}">
{% if perms.auth.signature_management %}
@ -22,8 +22,10 @@
<th class="text-center">ID</th>
<th class="text-center">System</th>
<th class="text-center">Destination</th>
<th class="text-center">Signature Type</th>
<th class="text-center">Status</th>
<th class="text-center">Goes Through</th>
<th class="text-center">Lifetime Status</th>
<th class="text-center">Mass Status</th>
<th class="text-center">Ship Size</th>
<th class="text-center">Notes</th>
<th class="text-center">Post Time</th>
{% if perms.auth.signature_management %}
@ -40,7 +42,10 @@
<a href="http://evemaps.dotlan.net/system/{{ sigt.system }}">{{ sigt.system }}</a>
</td>
<td style="width:150px" class="text-center">{{ sigt.destination }}</td>
<td style="width:150px" class="text-center">{{ sigt.sigtype }}</td>
<td style="width:150px" class="text-center">{{ sigt.through_dest }}</td>
<td style="width:150px" class="text-center">{{ sigt.lifetime_status }}</td>
<td style="width:150px" class="text-center">{{ sigt.mass_status }}</td>
<td style="width:150px" class="text-center">{{ sigt.ships_size }}</td>
<td style="width:150px" class="text-center">{{ sigt.status }}</td>
<td style="width:150px" class="text-center">{{ sigt.notes }}</td>
<td style="width:150px" class="text-center">{{ sigt.post_time}}</td>