mirror of
https://gitlab.com/allianceauth/allianceauth.git
synced 2025-07-14 15:00:16 +02:00
Changed timerboard to Future/Past timers (#503)
This commit is contained in:
parent
c2c03de22a
commit
7e4d411685
@ -419,12 +419,18 @@ def activate_teamspeak3(request):
|
|||||||
logger.debug("activate_teamspeak3 called by user %s" % request.user)
|
logger.debug("activate_teamspeak3 called by user %s" % request.user)
|
||||||
authinfo = AuthServicesInfoManager.get_auth_service_info(request.user)
|
authinfo = AuthServicesInfoManager.get_auth_service_info(request.user)
|
||||||
character = EveManager.get_character_by_id(authinfo.main_char_id)
|
character = EveManager.get_character_by_id(authinfo.main_char_id)
|
||||||
|
ticker = character.corporation_ticker
|
||||||
|
|
||||||
if check_if_user_has_permission(request.user, "blue_member"):
|
if check_if_user_has_permission(request.user, "blue_member"):
|
||||||
logger.debug("Adding TS3 user for blue user %s with main character %s" % (request.user, character))
|
logger.debug("Adding TS3 user for blue user %s with main character %s" % (request.user, character))
|
||||||
result = Teamspeak3Manager.add_blue_user(character.character_name, character.corporation_ticker)
|
# Blue members should have alliance ticker (if in alliance)
|
||||||
|
if EveAllianceInfo.objects.filter(alliance_id=character.alliance_id).exists():
|
||||||
|
alliance = EveAllianceInfo.objects.filter(alliance_id=character.alliance_id)[0]
|
||||||
|
ticker = alliance.alliance_ticker
|
||||||
|
result = Teamspeak3Manager.add_blue_user(character.character_name, ticker)
|
||||||
else:
|
else:
|
||||||
logger.debug("Adding TS3 user for user %s with main character %s" % (request.user, character))
|
logger.debug("Adding TS3 user for user %s with main character %s" % (request.user, character))
|
||||||
result = Teamspeak3Manager.add_user(character.character_name, character.corporation_ticker)
|
result = Teamspeak3Manager.add_user(character.character_name, ticker)
|
||||||
|
|
||||||
# if its empty we failed
|
# if its empty we failed
|
||||||
if result[0] is not "":
|
if result[0] is not "":
|
||||||
|
@ -24,107 +24,6 @@
|
|||||||
<b>{% trans "Current Eve Time:" %} </b>
|
<b>{% trans "Current Eve Time:" %} </b>
|
||||||
</div><div class="label label-info text-left" id="current-time"></div>
|
</div><div class="label label-info text-left" id="current-time"></div>
|
||||||
</div>
|
</div>
|
||||||
<h4><b>{% trans "Next Timer" %}</b></h4>
|
|
||||||
<table class="table table-responsive table-bordered">
|
|
||||||
<tr>
|
|
||||||
<th style="width:150px" class="text-center">{% trans "Details" %}</th>
|
|
||||||
<th class="text-center">{% trans "Objective" %}</th>
|
|
||||||
<th class="text-center">{% trans "System" %}</th>
|
|
||||||
<th class="text-center">{% trans "Structure" %}</th>
|
|
||||||
<th class="text-center">{% trans "Eve Time" %}</th>
|
|
||||||
<th class="text-center">{% trans "Local Time" %}</th>
|
|
||||||
<th class="text-center">{% trans "Creator" %}</th>
|
|
||||||
{% if perms.auth.timer_management %}
|
|
||||||
<th class="text-center">{% trans "Action" %}</th>
|
|
||||||
{% endif %}
|
|
||||||
</tr>
|
|
||||||
{% if closest_timer %}
|
|
||||||
{% ifequal closest_timer.important True %}
|
|
||||||
<tr class="danger">
|
|
||||||
{% else %}
|
|
||||||
<tr class="info">
|
|
||||||
{% endifequal %}
|
|
||||||
<td style="width:150px" class="text-center">{{ closest_timer.details }}</td>
|
|
||||||
<td class="text-center">
|
|
||||||
{% ifequal closest_timer.objective "Hostile" %}
|
|
||||||
<div class="label label-danger">
|
|
||||||
{% trans "Hostile" %}
|
|
||||||
</div>
|
|
||||||
{% endifequal %}
|
|
||||||
{% ifequal closest_timer.objective "Friendly" %}
|
|
||||||
<div class="label label-primary">
|
|
||||||
{% trans "Friendly" %}
|
|
||||||
</div>
|
|
||||||
{% endifequal %}
|
|
||||||
{% ifequal closest_timer.objective "Neutral" %}
|
|
||||||
<div class="label label-default">
|
|
||||||
{% trans "Neutral" %}
|
|
||||||
</div>
|
|
||||||
{% endifequal %}
|
|
||||||
</td>
|
|
||||||
<td class="text-center"><a
|
|
||||||
href="http://evemaps.dotlan.net/system/{{ closest_timer.system }}">{{ closest_timer.system }} {{ closest_timer.planet_moon }} </a>
|
|
||||||
</td>
|
|
||||||
<td class="text-center">
|
|
||||||
{% ifequal closest_timer.structure "I-HUB" %}
|
|
||||||
<div class="label label-warning">
|
|
||||||
I-HUB
|
|
||||||
</div>
|
|
||||||
{% endifequal %}
|
|
||||||
{% ifequal closest_timer.structure "POCO" %}
|
|
||||||
<div class="label label-success">
|
|
||||||
POCO
|
|
||||||
</div>
|
|
||||||
{% endifequal %}
|
|
||||||
{% ifequal closest_timer.structure "POS[S]" %}
|
|
||||||
<div class="label label-info">
|
|
||||||
POS [S]
|
|
||||||
</div>
|
|
||||||
{% endifequal %}
|
|
||||||
{% ifequal closest_timer.structure "POS[M]" %}
|
|
||||||
<div class="label label-info">
|
|
||||||
POS [M]
|
|
||||||
</div>
|
|
||||||
{% endifequal %}
|
|
||||||
{% ifequal closest_timer.structure "POS[L]" %}
|
|
||||||
<div class="label label-info">
|
|
||||||
POS [L]
|
|
||||||
</div>
|
|
||||||
{% endifequal %}
|
|
||||||
{% ifequal closest_timer.structure "Station" %}
|
|
||||||
<div class="label label-danger">
|
|
||||||
Station
|
|
||||||
</div>
|
|
||||||
{% endifequal %}
|
|
||||||
{% ifequal closest_timer.structure "TCU" %}
|
|
||||||
<div class="label label-danger">
|
|
||||||
TCU
|
|
||||||
</div>
|
|
||||||
{% endifequal %}
|
|
||||||
{% ifequal closest_timer.structure "Other" %}
|
|
||||||
<div class="label label-default">
|
|
||||||
Other
|
|
||||||
</div>
|
|
||||||
{% endifequal %}
|
|
||||||
</td>
|
|
||||||
<td class="text-center" nowrap>{{ closest_timer.eve_time | date:"Y-m-d H:i" }}</td>
|
|
||||||
<td id="countdownclosest" class="text-center" nowrap></td>
|
|
||||||
<td class="text-center">{{ closest_timer.eve_character.character_name }}</td>
|
|
||||||
{% if perms.auth.timer_management %}
|
|
||||||
<td class="text-center">
|
|
||||||
<a href="/remove_timer/{{ closest_timer.id }}">
|
|
||||||
<button type="button" class="btn btn-danger"><span
|
|
||||||
class="glyphicon glyphicon-remove"></span></button>
|
|
||||||
</a>
|
|
||||||
<a href="/edit_timer/{{ closest_timer.id }}">
|
|
||||||
<button type="button" class="btn btn-info"><span
|
|
||||||
class="glyphicon glyphicon-pencil"></span></button>
|
|
||||||
</a>
|
|
||||||
</td>
|
|
||||||
{% endif %}
|
|
||||||
{% endif %}
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
{% if corp_timers %}
|
{% if corp_timers %}
|
||||||
<h4><b>{% trans "Corp Timers" %}</b></h4>
|
<h4><b>{% trans "Corp Timers" %}</b></h4>
|
||||||
<table class="table table-bordered">
|
<table class="table table-bordered">
|
||||||
@ -228,7 +127,7 @@
|
|||||||
{% endfor %}
|
{% endfor %}
|
||||||
</table>
|
</table>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<h4><b>{% trans "Future Timers" %}</b></h4>
|
<h4><b>{% trans "Next Timers" %}</b></h4>
|
||||||
<table class="table table-bordered">
|
<table class="table table-bordered">
|
||||||
<tr>
|
<tr>
|
||||||
<th style="width:150px" class="text-center">{% trans "Details" %}</th>
|
<th style="width:150px" class="text-center">{% trans "Details" %}</th>
|
||||||
@ -242,75 +141,174 @@
|
|||||||
<th class="text-center">{% trans "Action" %}</th>
|
<th class="text-center">{% trans "Action" %}</th>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</tr>
|
</tr>
|
||||||
{% for timer in timers %}
|
{% for timer in future_timers %}
|
||||||
{% ifnotequal timer closest_timer %}
|
{% ifequal timer.important True %}
|
||||||
{% ifequal timer.important True %}
|
<tr class="danger">
|
||||||
<tr class="danger">
|
{% else %}
|
||||||
{% else %}
|
<tr class="info">
|
||||||
<tr class="info">
|
{% endifequal %}
|
||||||
{% endifequal %}
|
|
||||||
<td style="width:150px" class="text-center">{{ timer.details }}</td>
|
<td style="width:150px" class="text-center">{{ timer.details }}</td>
|
||||||
<td class="text-center">
|
<td class="text-center">
|
||||||
{% ifequal timer.objective "Hostile" %}
|
{% ifequal timer.objective "Hostile" %}
|
||||||
<div class="label label-danger">
|
<div class="label label-danger">
|
||||||
{% trans "Hostile" %}
|
{% trans "Hostile" %}
|
||||||
</div>
|
</div>
|
||||||
{% endifequal %}
|
{% endifequal %}
|
||||||
{% ifequal timer.objective "Friendly" %}
|
{% ifequal timer.objective "Friendly" %}
|
||||||
<div class="label label-primary">
|
<div class="label label-primary">
|
||||||
{% trans "Friendly" %}
|
{% trans "Friendly" %}
|
||||||
</div>
|
</div>
|
||||||
{% endifequal %}
|
{% endifequal %}
|
||||||
{% ifequal timer.objective "Neutral" %}
|
{% ifequal timer.objective "Neutral" %}
|
||||||
<div class="label label-default">
|
<div class="label label-default">
|
||||||
{% trans "Neutral" %}
|
{% trans "Neutral" %}
|
||||||
</div>
|
</div>
|
||||||
{% endifequal %}
|
{% endifequal %}
|
||||||
</td>
|
</td>
|
||||||
<td class="text-center"><a
|
<td class="text-center"><a
|
||||||
href="http://evemaps.dotlan.net/system/{{ timer.system }}">{{ timer.system }} {{ timer.planet_moon }} </a>
|
href="http://evemaps.dotlan.net/system/{{ timer.system }}">{{ timer.system }} {{ timer.planet_moon }} </a>
|
||||||
</td>
|
</td>
|
||||||
<td class="text-center">
|
<td class="text-center">
|
||||||
{% ifequal timer.structure "I-HUB" %}
|
{% ifequal timer.structure "I-HUB" %}
|
||||||
<div class="label label-warning">
|
<div class="label label-warning">
|
||||||
I-HUB
|
I-HUB
|
||||||
</div>
|
</div>
|
||||||
{% endifequal %}
|
{% endifequal %}
|
||||||
{% ifequal timer.structure "POCO" %}
|
{% ifequal timer.structure "POCO" %}
|
||||||
<div class="label label-success">
|
<div class="label label-success">
|
||||||
POCO
|
POCO
|
||||||
</div>
|
</div>
|
||||||
{% endifequal %}
|
{% endifequal %}
|
||||||
{% ifequal timer.structure "POS[S]" %}
|
{% ifequal timer.structure "POS[S]" %}
|
||||||
<div class="label label-info">
|
<div class="label label-info">
|
||||||
POS [S]
|
POS [S]
|
||||||
</div>
|
</div>
|
||||||
{% endifequal %}
|
{% endifequal %}
|
||||||
{% ifequal timer.structure "POS[M]" %}
|
{% ifequal timer.structure "POS[M]" %}
|
||||||
<div class="label label-info">
|
<div class="label label-info">
|
||||||
POS [M]
|
POS [M]
|
||||||
</div>
|
</div>
|
||||||
{% endifequal %}
|
{% endifequal %}
|
||||||
{% ifequal timer.structure "POS[L]" %}
|
{% ifequal timer.structure "POS[L]" %}
|
||||||
<div class="label label-info">
|
<div class="label label-info">
|
||||||
POS [L]
|
POS [L]
|
||||||
</div>
|
</div>
|
||||||
{% endifequal %}
|
{% endifequal %}
|
||||||
{% ifequal timer.structure "Station" %}
|
{% ifequal timer.structure "Station" %}
|
||||||
<div class="label label-danger">
|
<div class="label label-danger">
|
||||||
Station
|
Station
|
||||||
</div>
|
</div>
|
||||||
{% endifequal %}
|
{% endifequal %}
|
||||||
{% ifequal timer.structure "TCU" %}
|
{% ifequal timer.structure "TCU" %}
|
||||||
<div class="label label-danger">
|
<div class="label label-danger">
|
||||||
TCU
|
TCU
|
||||||
</div>
|
</div>
|
||||||
{% endifequal %}
|
{% endifequal %}
|
||||||
{% ifequal timer.structure "Other" %}
|
{% ifequal timer.structure "Other" %}
|
||||||
<div class="label label-default">
|
<div class="label label-default">
|
||||||
Other
|
Other
|
||||||
</div>
|
</div>
|
||||||
{% endifequal %}
|
{% endifequal %}
|
||||||
|
</td>
|
||||||
|
<td class="text-center" nowrap>{{ timer.eve_time | date:"Y-m-d H:i" }}</td>
|
||||||
|
<td class="text-center" nowrap><div id="countdown{{ timer.id }}"></div></td>
|
||||||
|
<td class="text-center">{{ timer.eve_character.character_name }}</td>
|
||||||
|
{% if perms.auth.timer_management %}
|
||||||
|
<td class="text-center">
|
||||||
|
<a href="/remove_timer/{{ timer.id }}">
|
||||||
|
<button type="button" class="btn btn-danger"><span
|
||||||
|
class="glyphicon glyphicon-remove"></span></button>
|
||||||
|
</a>
|
||||||
|
<a href="/edit_timer/{{ timer.id }}">
|
||||||
|
<button type="button" class="btn btn-info"><span
|
||||||
|
class="glyphicon glyphicon-pencil"></span></button>
|
||||||
|
</td>
|
||||||
|
{% endif %}
|
||||||
|
</tr>
|
||||||
|
{% endfor %}
|
||||||
|
</table>
|
||||||
|
<h4><b>{% trans "Past Timers" %}</b></h4>
|
||||||
|
<table class="table table-bordered">
|
||||||
|
<tr>
|
||||||
|
<th style="width:150px" class="text-center">{% trans "Details" %}</th>
|
||||||
|
<th class="text-center">{% trans "Objective" %}</th>
|
||||||
|
<th class="text-center">{% trans "System" %}</th>
|
||||||
|
<th class="text-center">{% trans "Structure" %}</th>
|
||||||
|
<th class="text-center">{% trans "Eve Time" %}</th>
|
||||||
|
<th class="text-center">{% trans "Local Time" %}</th>
|
||||||
|
<th class="text-center">{% trans "Creator" %}</th>
|
||||||
|
{% if perms.auth.timer_management %}
|
||||||
|
<th class="text-center">{% trans "Action" %}</th>
|
||||||
|
{% endif %}
|
||||||
|
</tr>
|
||||||
|
{% for timer in past_timers %}
|
||||||
|
{% ifequal timer.important True %}
|
||||||
|
<tr class="danger">
|
||||||
|
{% else %}
|
||||||
|
<tr class="info">
|
||||||
|
{% endifequal %}
|
||||||
|
<td style="width:150px" class="text-center">{{ timer.details }}</td>
|
||||||
|
<td class="text-center">
|
||||||
|
{% ifequal timer.objective "Hostile" %}
|
||||||
|
<div class="label label-danger">
|
||||||
|
{% trans "Hostile" %}
|
||||||
|
</div>
|
||||||
|
{% endifequal %}
|
||||||
|
{% ifequal timer.objective "Friendly" %}
|
||||||
|
<div class="label label-primary">
|
||||||
|
{% trans "Friendly" %}
|
||||||
|
</div>
|
||||||
|
{% endifequal %}
|
||||||
|
{% ifequal timer.objective "Neutral" %}
|
||||||
|
<div class="label label-default">
|
||||||
|
{% trans "Neutral" %}
|
||||||
|
</div>
|
||||||
|
{% endifequal %}
|
||||||
|
</td>
|
||||||
|
<td class="text-center"><a
|
||||||
|
href="http://evemaps.dotlan.net/system/{{ timer.system }}">{{ timer.system }} {{ timer.planet_moon }} </a>
|
||||||
|
</td>
|
||||||
|
<td class="text-center">
|
||||||
|
{% ifequal timer.structure "I-HUB" %}
|
||||||
|
<div class="label label-warning">
|
||||||
|
I-HUB
|
||||||
|
</div>
|
||||||
|
{% endifequal %}
|
||||||
|
{% ifequal timer.structure "POCO" %}
|
||||||
|
<div class="label label-success">
|
||||||
|
POCO
|
||||||
|
</div>
|
||||||
|
{% endifequal %}
|
||||||
|
{% ifequal timer.structure "POS[S]" %}
|
||||||
|
<div class="label label-info">
|
||||||
|
POS [S]
|
||||||
|
</div>
|
||||||
|
{% endifequal %}
|
||||||
|
{% ifequal timer.structure "POS[M]" %}
|
||||||
|
<div class="label label-info">
|
||||||
|
POS [M]
|
||||||
|
</div>
|
||||||
|
{% endifequal %}
|
||||||
|
{% ifequal timer.structure "POS[L]" %}
|
||||||
|
<div class="label label-info">
|
||||||
|
POS [L]
|
||||||
|
</div>
|
||||||
|
{% endifequal %}
|
||||||
|
{% ifequal timer.structure "Station" %}
|
||||||
|
<div class="label label-danger">
|
||||||
|
Station
|
||||||
|
</div>
|
||||||
|
{% endifequal %}
|
||||||
|
{% ifequal timer.structure "TCU" %}
|
||||||
|
<div class="label label-danger">
|
||||||
|
TCU
|
||||||
|
</div>
|
||||||
|
{% endifequal %}
|
||||||
|
{% ifequal timer.structure "Other" %}
|
||||||
|
<div class="label label-default">
|
||||||
|
Other
|
||||||
|
</div>
|
||||||
|
{% endifequal %}
|
||||||
</td>
|
</td>
|
||||||
<td class="text-center" nowrap>{{ timer.eve_time | date:"Y-m-d H:i" }}</td>
|
<td class="text-center" nowrap>{{ timer.eve_time | date:"Y-m-d H:i" }}</td>
|
||||||
<td class="text-center" nowrap><div id="countdown{{ timer.id }}"></div></td>
|
<td class="text-center" nowrap><div id="countdown{{ timer.id }}"></div></td>
|
||||||
@ -327,7 +325,6 @@
|
|||||||
</td>
|
</td>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</tr>
|
</tr>
|
||||||
{% endifnotequal %}
|
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
@ -47,7 +47,9 @@ def timer_view(request):
|
|||||||
logger.debug("Determined closest timer is %s" % closest_timer)
|
logger.debug("Determined closest timer is %s" % closest_timer)
|
||||||
render_items = {'timers': Timer.objects.all().filter(corp_timer=False),
|
render_items = {'timers': Timer.objects.all().filter(corp_timer=False),
|
||||||
'corp_timers': corp_timers,
|
'corp_timers': corp_timers,
|
||||||
'closest_timer': closest_timer}
|
'closest_timer': closest_timer,
|
||||||
|
'future_timers': Timer.objects.all().filter(corp_timer=False).filter(eve_time__gte=datetime.datetime.now()),
|
||||||
|
'past_timers': Timer.objects.all().filter(corp_timer=False).filter(eve_time__lt=datetime.datetime.now())}
|
||||||
|
|
||||||
return render_to_response('registered/timermanagement.html', render_items, context_instance=RequestContext(request))
|
return render_to_response('registered/timermanagement.html', render_items, context_instance=RequestContext(request))
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user