Merge branch 'master' of https://github.com/Adarnof/allianceauth into custom_user

# Conflicts:
#	alliance_auth/settings.py.example
#	eveonline/views.py

Fix some tests.
This commit is contained in:
Adarnof
2017-05-27 17:25:15 -04:00
39 changed files with 997 additions and 417 deletions

View File

@@ -0,0 +1,58 @@
.checkbox label:after,
.radio label:after {
content: '';
display: table;
clear: both;
}
.checkbox .cr,
.radio .cr {
position: relative;
display: inline-block;
border: 1px solid #a9a9a9;
border-radius: .25em;
width: 1.3em;
height: 1.3em;
float: left;
margin-right: .5em;
}
.radio .cr {
border-radius: 50%;
}
.checkbox .cr .cr-icon,
.radio .cr .cr-icon {
position: absolute;
font-size: .8em;
line-height: 0;
top: 50%;
left: 20%;
}
.radio .cr .cr-icon {
margin-left: 0.04em;
}
.checkbox label input[type="checkbox"],
.radio label input[type="radio"] {
display: none;
}
.checkbox label input[type="checkbox"] + .cr > .cr-icon,
.radio label input[type="radio"] + .cr > .cr-icon {
transform: scale(3) rotateZ(-20deg);
opacity: 0;
transition: all .3s ease-in;
}
.checkbox label input[type="checkbox"]:checked + .cr > .cr-icon,
.radio label input[type="radio"]:checked + .cr > .cr-icon {
transform: scale(1) rotateZ(0deg);
opacity: 1;
}
.checkbox label input[type="checkbox"]:disabled + .cr,
.radio label input[type="radio"]:disabled + .cr {
opacity: .5;
}

View File

@@ -0,0 +1,4 @@
{% load static %}
<!-- Start X-Editablle js -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/x-editable/1.5.1/bootstrap3-editable/js/bootstrap-editable.min.js"></script>
<!-- End X-Editable js -->

View File

@@ -0,0 +1,4 @@
{% load staticfiles %}
<!-- X-Editable Core CSS -->
<link href="https://cdnjs.cloudflare.com/ajax/libs/x-editable/1.5.1/bootstrap3-editable/css/bootstrap-editable.css" rel="stylesheet">
<!-- End Bootstrap CSS -->

View File

@@ -0,0 +1,44 @@
{% load i18n %}
{% block content %}
<table class="table">
<thead>
<tr>
<th class="text-center col-lg-3">{% trans "Operation Name" %}</th>
<th class="text-center col lg-2">{% trans "Doctrine" %}</th>
<th class="text-center col-lg-1">{% trans "Form Up System" %}</th>
<th class="text-center col-lg-1">{% trans "Start Time" %}</th>
<th class="text-center col-lg-1">{% trans "Local Time" %}</th>
<th class="text-center col-lg-1">{% trans "Duration" %}</th>
<th class="text-center col-lg-1">{% trans "FC" %}</th>
{% if perms.auth.optimer_management %}
<th class="text-center col-lg-1">{% trans "Creator" %}</th>
<th class="text-center col-lg-2">{% trans "Action" %}</th>
{% endif %}
</tr>
</thead>
{% for ops in timers %}
<tbody>
<tr>
<td class="text-center">{{ ops.operation_name }}</td>
<td class="text-center">{{ ops.doctrine }}</td>
<td class="text-center">
<a href="http://evemaps.dotlan.net/system/{{ ops.system }}">{{ ops.system }}</a>
</td>
<td class="text-center" nowrap>{{ ops.start | date:"Y-m-d H:i" }}</td>
<td class="text-center" nowrap><div id="localtime{{ ops.id }}"></div><div id="countdown{{ ops.id }}"></div></td>
<td class="text-center">{{ ops.duration }}</td>
<td class="text-center">{{ ops.fc }}</td>
{% if perms.auth.optimer_management %}
<td class="text-center">{{ ops.eve_character }}</td>
<td class="text-center">
<a href="{% url 'auth_remove_optimer' ops.id %}" class="btn btn-danger">
<span class="glyphicon glyphicon-remove"></span>
</a><a href="{% url 'auth_edit_optimer' ops.id %}" class="btn btn-info"><span class="glyphicon glyphicon-pencil"></span></a>
</td>
{% endif %}
</tr>
</tbody>
{% endfor %}
</table>
{% endblock content %}

View File

@@ -17,62 +17,26 @@
{% endif %}
</div>
</h1>
<div class="col-lg-12 text-center row">
<div class="label label-info text-left">
<b>{% trans "Current Eve Time:" %} </b>
</div><div class="label label-info text-left" id="current-time"></div>
<br />
</div>
{% if optimer %}
<table class="table table-responsive">
<tr>
<th class="text-center">{% trans "Operation Name" %}</th>
<th class="text-center">{% trans "Doctrine" %}</th>
<th class="text-center">{% trans "Form Up System" %}</th>
<th class="text-center">{% trans "Form Up Location" %}</th>
<th class="text-center">{% trans "Start Time" %}</th>
<th class="text-center">{% trans "Local Time" %}</th>
<th class="text-center">{% trans "Duration" %}</th>
<th class="text-center">{% trans "FC" %}</th>
<th class="text-center">{% trans "Details" %}</th>
<th class="text-center">{% trans "Post Time" %}</th>
{% if perms.auth.optimer_management %}
<th class="text-center">{% trans "Creator" %}</th>
<th class="text-center">{% trans "Action" %}</th>
{% endif %}
</tr>
{% for ops in optimer %}
<tr>
<td style="width:150px" class="text-center">{{ ops.operation_name }}</td>
<td style="width:150px" class="text-center">{{ ops.doctrine }}</td>
<td class="text-center">
<a href="http://evemaps.dotlan.net/system/{{ ops.system }}">{{ ops.system }}</a>
</td>
<td style="width:150px" class="text-center">{{ ops.location }}</td>
<td style="width:150px" class="text-center" nowrap>{{ ops.start | date:"Y-m-d H:i" }}</td>
<td class="text-center" nowrap><div id="localtime{{ ops.id }}"></div><div id="countdown{{ ops.id }}"></div></td>
<td style="width:150px" class="text-center">{{ ops.duration }}</td>
<td style="width:150px" class="text-center">{{ ops.fc }}</td>
<td style="width:150px" class="text-center">{{ ops.details }}</td>
<td style="width:150px" class="text-center">{{ ops.post_time}}</td>
{% if perms.auth.optimer_management %}
<td style="width:150px" class="text-center">{{ ops.eve_character }}</td>
<td class="text-center">
<a href="{% url 'auth_remove_optimer' ops.id %}" class="btn btn-danger" title="{% trans 'Delete' %}">
<span class="glyphicon glyphicon-remove"></span>
</a>
<a href="{% url 'auth_edit_optimer' ops.id %}" class="btn btn-info" title="{% trans 'Edit' %}">
<span class="glyphicon glyphicon-pencil"></span>
</a>
</td>
{% endif %}
</tr>
{% endfor %}
</tr>
</table>
<div class="col-lg-12 text-center row">
<div class="label label-info text-left">
<b>{% trans "Current Eve Time:" %} </b>
</div><div class="label label-info text-left" id="current-time"></div>
<br />
</div>
<h4><b>{% trans "Next Timers" %}</b></h4>
{% if future_timers %}
{% include "registered/fleetoptable.html" with timers=future_timers %}
{% else %}
<br /><div class="alert alert-warning text-center">{% trans "No fleet operations found." %}</div>
<div class="alert alert-warning text-center">{% trans "No upcoming timers." %}</div>
{% endif %}
<h4><b>{% trans "Past Timers" %}</b></h4>
{% if past_timers %}
{% include "registered/fleetoptable.html" with timers=past_timers %}
{% else %}
<div class="alert alert-warning text-center">{% trans "No past timers." %}</div>
{% endif %}
</div>

View File

@@ -7,7 +7,42 @@
{% block title %}Alliance Auth{% endblock %}
{% block page_title %}Srp Fleet Data{% endblock page_title %}
{% block extra_css %}{% endblock extra_css %}
{% block extra_css %}
{% include 'bundles/x-editable.css.html' %}
<link href="{% static 'css/checkbox.css' %}" rel="stylesheet" type="text/css">
<style>
.radio label, .checkbox label {
padding-left: 10px;
}
.editable {
width:150px;
text-align: center;
}
.editableform .form-control {
width: 95%;
text-align: center;
margin-left: 10px;
}
.editable-input {
width: 95%;
}
.radio, .checkbox {
margin-top: 0px;
margin-bottom: 0px;
}
.editable-error-block {
white-space: nowrap;
}
.editable-click, a.editable-click, a.editable-click:hover {
border-bottom: none;
}
.tooltip-inner {
white-space:pre;
max-width: none;
}
</style>
{% endblock extra_css %}
{% block content %}
<div class="col-lg-12">
@@ -27,92 +62,147 @@
{% endif %}
</div>
</h1>
<div class="alert alert-info" role="alert">
<div class="text-right">
<b>{% trans "Total Losses:" %} {{ srpfleetrequests.count }}</b>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<b>{% trans "Total ISK Cost:" %} {{ totalcost | intcomma }}</b>
</div>
</div>
{% if srpfleetrequests %}
<table class="table">
<tr>
<th class="text-center">{% trans "Pilot Name" %}</th>
<th class="text-center">{% trans "Killboard Link" %}</th>
<th class="text-center">{% trans "Additional Info" %}</th>
<th class="text-center">{% trans "Ship Type" %}</th>
<th class="text-center">{% trans "Killboard Loss Amt" %}</th>
<th class="text-center">{% trans "SRP ISK Cost" %}</th>
<th class="text-center">{% trans "Post Time" %}</th>
<th class="text-center">{% trans "Status" %}</th>
{% if perms.auth.srp_management %}
<th class="text-center">{% trans "Actions" %}</th>
{% endif %}
</tr>
{% for srpfleetrequest in srpfleetrequests %}
<tr>
<td class="text-center">{{ srpfleetrequest.character.character_name }}</td>
<td class="text-center">
<a href="{{ srpfleetrequest.killboard_link }}"
target="_blank" class="label label-warning">Link</a>
</td>
<td class="text-center">{{ srpfleetrequest.additional_info }}</td>
<td class="text-center">{{ srpfleetrequest.srp_ship_name }}</td>
<td class="text-center">ISK: {{ srpfleetrequest.kb_total_loss | intcomma }}</td>
<td class="text-center">ISK: {{ srpfleetrequest.srp_total_amount | intcomma }}</td>
<td class="text-center">{{ srpfleetrequest.post_time | date:"Y-m-d H:i" }}</td>
<td class="text-center">
{% if srpfleetrequest.srp_status == "Approved" %}
<div class="label label-success">
{% trans "Approved" %}
</div>
{% elif srpfleetrequest.srp_status == "Rejected" %}
<div class="label label-danger">
{% trans "Rejected" %}
</div>
{% else %}
<div class="label label-warning">
{% trans "Pending" %}
</div>
{% endif %}
</td>
<form method="POST">
{% csrf_token %}
<div class="alert alert-info" role="alert">
<div class="text-right">
<b><span style="padding-right:2.5em">{% trans "Total Losses:" %} {{ srpfleetrequests.count }}</span></b>
<b><span style="padding-right:2.5em">{% trans "Total ISK Cost:" %} {{ totalcost | intcomma }}</span></b>
{% if perms.auth.srp_management %}
<td class="text-center">
<a href="{% url 'auth_srp_request_update_amount_view' srpfleetrequest.id %}" class="btn btn-info" title="Update Value">
<span class="glyphicon glyphicon-usd"></span>
</a>
{% if srpfleetrequest.srp_status in "RejectedPending" %}
<a href="{% url 'auth_srp_request_approve' srpfleetrequest.id %}" class="btn btn-success" title="Approve">
<span class="glyphicon glyphicon-ok"></span>
</a>
{% elif srpfleetrequest.srp_status == "" %}
<a href="{% url 'auth_srp_request_approve' srpfleetrequest.id %}" class="btn btn-success" title="Approve">
<span class="glyphicon glyphicon-ok"></span>
</a>
{% endif %}
{% if srpfleetrequest.srp_status in "ApprovedPending" %}
<a href="{% url 'auth_srp_request_reject' srpfleetrequest.id %}" class="btn btn-warning" title="Reject">
<span class="glyphicon glyphicon-remove"></span>
</a>
{% elif srpfleetrequest.srp_status == "" %}
<a href="{% url 'auth_srp_request_reject' srpfleetrequest.id %}" class="btn btn-warning" title="Reject">
<span class="glyphicon glyphicon-remove"></span>
</a>
{% endif %}
<a href="{% url 'auth_srp_request_remove' srpfleetrequest.id %}" class="btn btn-danger" title="Remove">
<span class="glyphicon glyphicon-trash"></span>
</a>
</td>
<button type="submit" title="Approve" class="btn btn-success" formaction="{% url 'auth_srp_request_approve' %}">
<span class="glyphicon glyphicon-ok"></span>
</button>
<button type="submit" title="Reject" class="btn btn-warning" formaction="{% url 'auth_srp_request_reject' %}">
<span class="glyphicon glyphicon-remove"></span>
</button>
<button type="submit" title="Remove" onclick="return confirm('{% trans "Are you sure you want to delete SRP requests?" %}')" class="btn btn-danger" formaction="{% url 'auth_srp_request_remove' %}">
<span class="glyphicon glyphicon-trash"></span>
</button>
{% endif %}
</div>
</div>
<table class="table">
<tr>
<th class="text-center">{% trans "Pilot Name" %}</th>
<th class="text-center">{% trans "Killboard Link" %}</th>
<th class="text-center">{% trans "Additional Info" %}</th>
<th class="text-center">{% trans "Ship Type" %}</th>
<th class="text-center">{% trans "Killboard Loss Amt" %}</th>
<th class="text-center">{% trans "SRP ISK Cost" %}
{% blocktrans %}<i class="glyphicon glyphicon-question-sign" rel="tooltip" title="Click value to edit
Enter to save&next
ESC to cancel"
id="blah"></i></th>{% endblocktrans %}
<th class="text-center">{% trans "Post Time" %}</th>
<th class="text-center">{% trans "Status" %}</th>
{% if perms.auth.srp_management %}
<th class="text-center">{% trans "Actions" %}</th>
{% endif %}
</tr>
{% endfor %}
</table>
{% for srpfleetrequest in srpfleetrequests %}
<tr>
<td class="text-center">{{ srpfleetrequest.character.character_name }}</td>
<td class="text-center">
<a href="{{ srpfleetrequest.killboard_link }}"
target="_blank" class="label label-warning">Link</a>
</td>
<td class="text-center">{{ srpfleetrequest.additional_info }}</td>
<td class="text-center">{{ srpfleetrequest.srp_ship_name }}</td>
<td class="text-center">{{ srpfleetrequest.kb_total_loss | intcomma }} ISK</td>
<td class="srp" data-name="srp_total_amount" data-type="number" data-pk="{{srpfleetrequest.id}}" data-url="{% url 'auth_srp_request_update_amount' srpfleetrequest.id %}" data-params="{csrfmiddlewaretoken:'{{csrf_token}}'}" class="text-center">{{ srpfleetrequest.srp_total_amount | intcomma }} ISK</td>
<td class="text-center">{{ srpfleetrequest.post_time | date:"Y-m-d H:i" }}</td>
<td class="text-center">
{% if srpfleetrequest.srp_status == "Approved" %}
<div class="label label-success">
{% trans "Approved" %}
</div>
{% elif srpfleetrequest.srp_status == "Rejected" %}
<div class="label label-danger">
{% trans "Rejected" %}
</div>
{% else %}
<div class="label label-warning">
{% trans "Pending" %}
</div>
{% endif %}
</td>
{% if perms.auth.srp_management %}
<td class="text-center">
<div class="checkbox">
<label style="font-size: 1.5em">
<input type="checkbox" name="{{srpfleetrequest.id}}">
<span class="cr"><i class="cr-icon fa fa-check"></i></span>
</label>
</div>
</td>
{% endif %}
</tr>
{% endfor %}
</table>
<div class="alert alert-info" role="alert">
<div class="text-right">
<b><span style="padding-right:2.5em">{% trans "Total Losses:" %} {{ srpfleetrequests.count }}</span></b>
<b><span style="padding-right:2.5em">{% trans "Total ISK Cost:" %} {{ totalcost | intcomma }}</span></b>
{% if perms.auth.srp_management %}
<button type="submit" title="Approve" class="btn btn-success" formaction="{% url 'auth_srp_request_approve' %}">
<span class="glyphicon glyphicon-ok"></span>
</button>
<button type="submit" title="Reject" class="btn btn-warning" formaction="{% url 'auth_srp_request_reject' %}">
<span class="glyphicon glyphicon-remove"></span>
</button>
<button type="submit" title="Remove" onclick="return confirm('{% trans "Are you sure you want to delete SRP requests?" %}')" class="btn btn-danger" formaction="{% url 'auth_srp_request_remove' %}">
<span class="glyphicon glyphicon-trash"></span>
</button>
{% endif %}
</div>
</div>
</form>
{% else %}
<div class="alert alert-warning text-center">{% trans "No SRP requests for this fleet." %}</div>
{% endif %}
</div>
</div>
{% endblock content %}
{% block extra_javascript %}
{% include 'bundles/x-editable-js.html' %}
{% endblock %}
{% block extra_script %}
$(document).ready(function() {
$.fn.editable.defaults.mode = 'inline';
$.fn.editable.defaults.showbuttons = false;
$.fn.editable.defaults.highlight = "#AAFF80";
$('.srp').editable({
display: function(value, response) {
return false;
},
success: function(response, newValue) {
newValue = parseInt(newValue);
newvalue = newValue.toLocaleString() + " ISK";
$(this).html(newvalue.bold());
},
validate: function(value) {
if (value === null || value === '') {
return 'Empty values not allowed';
}
}
});
$('.srp').on('hidden', function(e, reason){
if(reason === 'save' || reason === 'nochange') {
var $next = $(this).closest('tr').next().find('.editable');
setTimeout(function() {
$next.editable('show');
}, 400);
}
});
});
$(document).ready(function(){
$("[rel=tooltip]").tooltip({ placement: 'top'});
});
{% endblock extra_script %}

View File

@@ -1,31 +0,0 @@
{% extends "registered/base.html" %}
{% load bootstrap %}
{% load staticfiles %}
{% load i18n %}
{% block title %}Alliance Auth - Update SRP Amount{% endblock %}
{% block page_title %}{% trans "Update SRP Amount" %}{% endblock page_title %}
{% block content %}
<div class="col-lg-12">
<h1 class="page-header text-center">{% trans "Update SRP Amount" %}</h1>
<div class="container-fluid">
<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">{% trans "Update SRP Request Amount" %}
</button>
</form>
</div>
</div>
</div>
</div>
{% endblock content %}

View File

@@ -41,7 +41,7 @@
<th class="text-center">{% trans "Fleet ISK Cost" %}</th>
<th class="text-center">{% trans "SRP Status" %}</th>
<th class="text-center">{% trans "Pending Requests" %}</th>
<th class="text-center">{% trans "Actions" %}</th>
<th width="100px" class="text-center">{% trans "Actions" %}</th>
</tr>
{% for srpfleet in srpfleets %}
<tr>
@@ -98,7 +98,7 @@
<span class="glyphicon glyphicon-pencil"></span>
</a>
<a href="{% url 'auth_srp_fleet_remove' srpfleet.id %}" class="btn btn-danger" title="Remove">
<a href="{% url 'auth_srp_fleet_remove' srpfleet.id %}" onclick="return confirm('{% trans "Are you sure you want to delete this SRP code and its contents?" %}')" class="btn btn-danger" title="Remove">
<span class="glyphicon glyphicon-trash"></span>
</a>
{% if srpfleet.fleet_srp_code %}