Added timerboard feature

This commit is contained in:
Raynaldo Rivera
2014-11-16 01:10:41 -07:00
parent 1ca376f71b
commit d1244a97e3
18 changed files with 5160 additions and 31 deletions

71
templates/public/base.html Normal file → Executable file
View File

@@ -54,9 +54,6 @@
<div class="navbar-default sidebar" role="navigation">
<div class="sidebar-nav navbar-collapse">
<ul class="nav" id="side-menu">
<li class="sidebar-search">
</li>
<li class="text-center divider-horizontal">
<h5>Main Navigation</h5>
</li>
@@ -76,30 +73,43 @@
href="{% url 'auth_api_key_management' %}"><i
class="fa fa-key fa-fw grayiconecolor"></i> Api Keys</a>
</li>
<li>
<a {% ifequal request.path "/groups/" %} class="active" {% endifequal %}
href="{% url 'auth_groups' %}"><i
class="fa fa-cogs fa-sitemap grayiconecolor"></i> Groups</a>
</li>
<li>
<a {% ifequal request.path "/services/" %} class="active" {% endifequal %}
href="{% url 'auth_services' %}"><i
class="fa fa-cogs fa-fw grayiconecolor"></i> Services</a>
</li>
{% if perms.auth.alliance_member %}
<li>
<a {% ifequal request.path "/groups/" %} class="active" {% endifequal %}
href="{% url 'auth_groups' %}"><i
class="fa fa-cogs fa-sitemap grayiconecolor"></i> Groups</a>
</li>
{% endif %}
{% if perms.auth.alliance_member or perms.auth.blue_member %}
<li>
<a {% ifequal request.path "/services/" %} class="active" {% endifequal %}
href="{% url 'auth_services' %}"><i
class="fa fa-cogs fa-fw grayiconecolor"></i> Services</a>
</li>
<li>
<a {% ifequal request.path "/timer_management" %} class="active" {% endifequal %}
href="{% url 'auth_timer_view' %}"><i
class="fa fa-clock-o fa-fw grayiconecolor"></i> OP Timers</a>
</li>
{% endif %}
{% if not perms.auth.alliance_member and not perms.auth.blue_member or perms.auth.human_resources %}
<li>
<a {% ifequal request.path "/hr_application_management/" %}
class="active" {% endifequal %}
href="{% url 'auth_hrapplications_view' %}"><i
class="fa fa-file-o fa-fw grayiconecolor"></i> Applications</a>
</li>
{% endif %}
<li>
<a {% ifequal request.path "/help/" %} class="active" {% endifequal %}
href="{% url 'auth_help' %}"><i
class="fa fa-question fa-fw grayiconecolor"></i> Help</a>
</li>
{% if not perms.auth.alliance_member or perms.auth.human_resources %}
<li>
<a {% ifequal request.path "/hr_application_management/" %} class="active" {% endifequal %}
href="{% url 'auth_hrapplications_view' %}"><i
class="fa fa-file-o fa-fw grayiconecolor"></i> Applications</a>
</li>
{% endif %}
<li class="text-center divider-horizontal">
<h5>Util</h5>
</li>
@@ -108,6 +118,15 @@
href="{% url 'password_change' %}"><i
class="fa fa-lock fa-fw grayiconecolor"></i>Change Password</a>
</li>
{% if perms.auth.alliance_member or perms.auth.blue_member %}
<li>
<a {% ifequal request.path "/tool/fleet_formatter_tool/" %}
class="active" {% endifequal %}
href="{% url 'auth_fleet_format_tool_view' %}"><i
class="fa fa-space-shuttle fa-fw grayiconecolor"></i> Fleet Broadcast Formatter</a>
</li>
{% endif %}
{% if perms.auth.corp_stats %}
<li>
<a {% ifequal request.path "/corporation_stats" %} class="active" {% endifequal %}
@@ -131,11 +150,6 @@
class="fa fa-lock fa-bullhorn grayiconecolor"></i> Jabber Broadcast</a>
</li>
{% endif %}
<li>
<a {% ifequal request.path "/tool/fleet_formatter_tool/" %} class="active" {% endifequal %}
href="{% url 'auth_fleet_format_tool_view' %}"><i
class="fa fa-space-shuttle fa-fw grayiconecolor"></i> Fleet Broadcast Formatter</a>
</li>
</ul>
</div>
<!-- /.sidebar-collapse -->
@@ -149,5 +163,10 @@
</div>
</div>
{% endif %}
<script src="{% static 'js/jquery.min.js' %}"></script>
<script src="{% static 'js/jquery.datetimepicker.js' %}"></script>
<script src="{% static 'js/bootstrap.min.js' %}"></script>
<script>{% block extra_script %}
{% endblock extra_script %}</script>
</body>
</html>

View File

@@ -0,0 +1,42 @@
{% extends "public/base.html" %}
{% load bootstrap %}
{% load staticfiles %}
{% block title %}Alliance Auth - Timer Create{% endblock %}
{% block page_title %}Timer Create{% 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">Create Timer</h1>
<div class="container-fluid">
<div class="col-md-4 col-md-offset-4">
<div class="row">
{% if success %}
<div class="alert alert-success text-center" role="alert">Application Submitted</div>
{% else %}
<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">Submit Application</button>
</form>
{% endif %}
</div>
</div>
</div>
</div>
{% endblock content %}
{% block extra_script %}
$('#id_eve_time').datetimepicker({
maskInput: true,
format: 'Y-m-d H:i',minDate:0
});
{% endblock extra_script %}

View File

@@ -0,0 +1,211 @@
{% extends "public/base.html" %}
{% load staticfiles %}
{% block title %}Alliance Auth{% endblock %}
{% block page_title %}Timer Management{% endblock page_title %}
{% block extra_css %}{% endblock extra_css %}
{% block content %}
<div class="col-lg-12">
<h1 class="page-header text-center">Operation Timers
<div class="text-right">
<a href="{% url 'auth_add_timer_view' %}">
{% if perms.auth.timer_management %}
<button type="button" class="btn btn-success">Create Timer</button>
{% endif %}
</a>
</div>
</h1>
<div class="col-lg-12 text-center">
<div class="label label-info text-left">
<b>Current Eve Time: {{ CURRENT_UTC_TIME | date:"Y-m-d H:i" }}</b>
</div>
</div>
<h4><b>Next Timer</b></h4>
<table class="table table-responsive table-bordered">
<tr>
<th style="width:150px" class="text-center">Fleet Name</th>
<th class="text-center">Fleet Type</th>
<th class="text-center">System</th>
<th class="text-center">Structure</th>
<th class="text-center">Eve Time</th>
<th class="text-center">Creator</th>
{% if perms.auth.timer_management %}
<th class="text-center">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.name }}</td>
<td class="text-center">
{% ifequal closest_timer.fleet_type "Armor" %}
<div class="label label-danger">
Armor
</div>
{% endifequal %}
{% ifequal closest_timer.fleet_type "Shield" %}
<div class="label label-primary">
Shield
</div>
{% endifequal %}
{% ifequal closest_timer.fleet_type "Other" %}
<div class="label label-default">
Other
</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 "Other" %}
<div class="label label-default">
Other
</div>
{% endifequal %}
</td>
<td class="text-center">{{ closest_timer.eve_time | date:"Y-m-d H:i" }} UTC</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>
</td>
{% endif %}
{% endif %}
</tr>
</table>
<h4><b>Future Timers</b></h4>
<table class="table table-bordered">
<tr>
<th style="width:150px" class="text-center">Fleet Name</th>
<th class="text-center">Fleet Type</th>
<th class="text-center">System</th>
<th class="text-center">Structure</th>
<th class="text-center">Eve Time</th>
<th class="text-center">Creator</th>
{% if perms.auth.timer_management %}
<th class="text-center">Action</th>
{% endif %}
</tr>
{% for timer in timers %}
{% ifnotequal timer closest_timer %}
{% ifequal timer.important True %}
<tr class="danger">
{% else %}
<tr class="info">
{% endifequal %}
<td style="width:150px" class="text-center">{{ timer.name }}</td>
<td class="text-center">
{% ifequal timer.fleet_type "Armor" %}
<div class="label label-danger">
Armor
</div>
{% endifequal %}
{% ifequal timer.fleet_type "Shield" %}
<div class="label label-primary">
Shield
</div>
{% endifequal %}
{% ifequal timer.fleet_type "Other" %}
<div class="label label-default">
Other
</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 "Other" %}
<div class="label label-default">
Other
</div>
{% endifequal %}
</td>
<td class="text-center">{{ timer.eve_time | date:"Y-m-d H:i" }} UTC</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>
</td>
{% endif %}
</tr>
{% endifnotequal %}
{% endfor %}
</table>
</div>
{% endblock content %}