[FIX] Tables and buttons

This commit is contained in:
Peter Pfeufer 2023-12-09 16:51:39 +01:00
parent 155494afea
commit 583a6d4c7f
No known key found for this signature in database
GPG Key ID: 6051D2C6AD4EBC27
2 changed files with 83 additions and 78 deletions

View File

@ -38,58 +38,61 @@
<div class="text-end">
<b><span style="padding-right:2.5em">{% translate "Total Losses:" %} {{ srpfleetrequests.count }}</span></b>
<b><span style="padding-right:2.5em">{% translate "Total ISK Cost:" %} {{ totalcost | intcomma }}</span></b>
{% if perms.auth.srp_management %}
<button type="submit" title="Approve" class="btn btn-success" formaction="{% url 'srp:request_approve' %}">
<span class="glyphicon glyphicon-ok"></span>
<button type="submit" title="Approve" class="btn btn-success btn-sm m-1" formaction="{% url 'srp:request_approve' %}">
<i class="fa-solid fa-thumbs-up"></i>
</button>
<button type="submit" title="Reject" class="btn btn-warning" formaction="{% url 'srp:request_reject' %}">
<span class="glyphicon glyphicon-remove"></span>
<button type="submit" title="Reject" class="btn btn-warning btn-sm m-1" formaction="{% url 'srp:request_reject' %}">
<i class="fa-solid fa-thumbs-down"></i>
</button>
<button type="submit" title="Remove" onclick="return confirm('{% translate "Are you sure you want to delete SRP requests?" %}')" class="btn btn-danger" formaction="{% url 'srp:request_remove' %}">
<span class="glyphicon glyphicon-trash"></span>
<button type="submit" title="Remove" onclick="return confirm('{% translate "Are you sure you want to delete SRP requests?" %}')" class="btn btn-danger btn-sm m-1" formaction="{% url 'srp:request_remove' %}">
<i class="fa-solid fa-trash-alt"></i>
</button>
{% endif %}
</div>
</div>
<div class="table-responsive">
<table class="table srplist">
<thead>
<th class="text-center">{% translate "Pilot Name" %}</th>
<th class="text-center">{% translate "Killboard Link" %}</th>
<th class="text-center">{% translate "Additional Info" %}</th>
<th class="text-center">{% translate "Ship Type" %}</th>
<th class="text-center">{% translate "Killboard Loss Amt" %}</th>
<th class="text-center">{% translate "SRP ISK Cost" %}
<i class="glyphicon glyphicon-question-sign" rel="tooltip" title="{% blocktranslate trimmed %}Click value to edit
<th>{% translate "Pilot Name" %}</th>
<th>{% translate "Killboard Link" %}</th>
<th>{% translate "Additional Info" %}</th>
<th>{% translate "Ship Type" %}</th>
<th>{% translate "Killboard Loss Amt" %}</th>
<th>
{% translate "SRP ISK Cost" %}
<i class="fa-solid fa-circle-question" rel="tooltip" title="{% blocktranslate trimmed %}Click value to edit
Enter to save & next
ESC to cancel{% endblocktranslate %}" id="blah"></i></th>
<th class="text-center">{% translate "Post Time" %}</th>
<th class="text-center">{% translate "Status" %}</th>
<th>{% translate "Post Time" %}</th>
<th>{% translate "Status" %}</th>
{% if perms.auth.srp_management %}
<th class="text-center">{% translate "Actions" %}</th>
<th>{% translate "Actions" %}</th>
{% endif %}
</thead>
<tbody>
{% for srpfleetrequest in srpfleetrequests %}
<tr>
<td class="text-center">
<td>
{% if srpfleetrequest.character.alliance.alliance_ticker %}
{{ srpfleetrequest.character.alliance.alliance_ticker }}
{% endif %}
[{{ srpfleetrequest.character.corporation.corporation_ticker }}]
{{ srpfleetrequest.character.character_name }}&nbsp;<i class="copy-text-fa-icon far fa-copy" data-clipboard-text="{{ srpfleetrequest.character.character_name }}"></i>
</td>
<td class="text-center">
<td>
<a href="{{ srpfleetrequest.killboard_link }}"
target="_blank" class="badge bg-warning">{% translate "Link" %}</a>
</td>
<td class="text-center">{{ srpfleetrequest.additional_info }}</td>
<td class="text-center">{{ srpfleetrequest.srp_ship_name }}</td>
<td class="text-center" data-sort="{{ srpfleetrequest.kb_total_loss }}">{{ srpfleetrequest.kb_total_loss | intcomma }} ISK</td>
<td class="srp text-center" data-name="srp_total_amount" data-type="number" data-pk="{{srpfleetrequest.id}}" data-url="{% url 'srp:request_update_amount' srpfleetrequest.id %}" data-params="{csrfmiddlewaretoken:'{{csrf_token}}'}" data-sort="{{ srpfleetrequest.srp_total_amount }}">{{ srpfleetrequest.srp_total_amount | intcomma }} ISK</td>
<td class="text-center" data-sort="{{ srpfleetrequest.post_time | date:"Y-m-d H:i" }}">{{ srpfleetrequest.post_time | date:"Y-M-d H:i" }}</td>
<td class="text-center">
<td>{{ srpfleetrequest.additional_info }}</td>
<td>{{ srpfleetrequest.srp_ship_name }}</td>
<td class="text-end" data-sort="{{ srpfleetrequest.kb_total_loss }}">{{ srpfleetrequest.kb_total_loss | intcomma }} ISK</td>
<td class="srp text-end" data-name="srp_total_amount" data-type="number" data-pk="{{srpfleetrequest.id}}" data-url="{% url 'srp:request_update_amount' srpfleetrequest.id %}" data-params="{csrfmiddlewaretoken:'{{csrf_token}}'}" data-sort="{{ srpfleetrequest.srp_total_amount }}">{{ srpfleetrequest.srp_total_amount | intcomma }} ISK</td>
<td data-sort="{{ srpfleetrequest.post_time | date:"Y-m-d H:i" }}">{{ srpfleetrequest.post_time | date:"Y-M-d H:i" }}</td>
<td>
{% if srpfleetrequest.srp_status == "Approved" %}
<div class="badge bg-success">
{% translate "Approved" %}
@ -105,7 +108,7 @@ ESC to cancel{% endblocktranslate %}" id="blah"></i></th>
{% endif %}
</td>
{% if perms.auth.srp_management %}
<td class="text-center">
<td class="text-end">
<div class="checkbox">
<label style="font-size: 1.5em">
<input type="checkbox" name="{{srpfleetrequest.id}}">
@ -117,22 +120,25 @@ ESC to cancel{% endblocktranslate %}" id="blah"></i></th>
</tr>
{% endfor %}
</tbody>
</table>
</div>
<div class="alert alert-info" role="alert">
<div class="text-end">
<b><span style="padding-right:2.5em">{% translate "Total Losses:" %} {{ srpfleetrequests.count }}</span></b>
<b><span style="padding-right:2.5em">{% translate "Total ISK Cost:" %} {{ totalcost | intcomma }}</span></b>
{% if perms.auth.srp_management %}
<button type="submit" title="Approve" class="btn btn-success" formaction="{% url 'srp:request_approve' %}">
<span class="glyphicon glyphicon-ok"></span>
<button type="submit" title="Approve" class="btn btn-success btn-sm m-1" formaction="{% url 'srp:request_approve' %}">
<i class="fa-solid fa-thumbs-up"></i>
</button>
<button type="submit" title="Reject" class="btn btn-warning" formaction="{% url 'srp:request_reject' %}">
<span class="glyphicon glyphicon-remove"></span>
<button type="submit" title="Reject" class="btn btn-warning btn-sm m-1" formaction="{% url 'srp:request_reject' %}">
<i class="fa-solid fa-thumbs-down"></i>
</button>
<button type="submit" title="Remove" onclick="return confirm('{% translate "Are you sure you want to delete SRP requests?" %}')" class="btn btn-danger" formaction="{% url 'srp:request_remove' %}">
<span class="glyphicon glyphicon-trash"></span>
<button type="submit" title="Remove" onclick="return confirm('{% translate "Are you sure you want to delete SRP requests?" %}')" class="btn btn-danger btn-sm m-1" formaction="{% url 'srp:request_remove' %}">
<i class="fa-solid fa-trash-alt"></i>
</button>
{% endif %}
</div>

View File

@ -13,62 +13,62 @@
{% block content %}
<div>
<h1 class="page-header text-center mb-3">
{% translate "SRP Management" %}
<div class="text-end">
<div class="text-end mb-3">
{% if perms.auth.srp_management %}
<a href="{% url 'srp:all' %}" class="btn btn-primary">
{% translate "View All" %}
</a>
{% endif %}
{% if perms.srp.add_srpfleetmain or perms.auth.srp_management %}
<a href="{% url 'srp:add' %}" class="btn btn-success">
{% translate "Add SRP Fleet" %}
</a>
{% endif %}
</div>
</h1>
<div class="alert alert-info" role="alert">
<div class="text-end">
<b>{% translate "Total ISK Cost:" %} {{ totalcost | intcomma }}</b>
</div>
</div>
{% if srpfleets %}
<div class="table-responsive">
<table class="table">
<tr>
<th class="text-center">{% translate "Fleet Name" %}</th>
<th class="text-center">{% translate "Fleet Time" %}</th>
<th class="text-center">{% translate "Fleet Doctrine" %}</th>
<th class="text-center">{% translate "Fleet Commander" %}</th>
<th class="text-center">{% translate "Fleet AAR" %}</th>
<th class="text-center">{% translate "Fleet SRP Code" %}</th>
<th class="text-center">{% translate "Fleet ISK Cost" %}</th>
<th class="text-center">{% translate "SRP Status" %}</th>
<th class="text-center">{% translate "Pending Requests" %}</th>
<th class="text-center" style="width: 100px;">{% translate "Actions" %}</th>
<th>{% translate "Fleet Name" %}</th>
<th>{% translate "Fleet Time" %}</th>
<th>{% translate "Fleet Doctrine" %}</th>
<th>{% translate "Fleet Commander" %}</th>
<th>{% translate "Fleet AAR" %}</th>
<th>{% translate "Fleet SRP Code" %}</th>
<th>{% translate "Fleet ISK Cost" %}</th>
<th>{% translate "SRP Status" %}</th>
<th>{% translate "Pending Requests" %}</th>
<th style="width: 110px;">{% translate "Actions" %}</th>
</tr>
{% for srpfleet in srpfleets %}
<tr>
<td class="text-center">
<td>
<div class="badge bg-info">
{{ srpfleet.fleet_name }}
</div>
</td>
<td class="text-center">{{ srpfleet.fleet_time | date:"Y-m-d H:i" }}</td>
<td class="text-center">{{ srpfleet.fleet_doctrine }}</td>
<td class="text-center">
<td>{{ srpfleet.fleet_time | date:"Y-m-d H:i" }}</td>
<td>{{ srpfleet.fleet_doctrine }}</td>
<td>
<div class="badge bg-success">
{{ srpfleet.fleet_commander.character_name }}
</div>
</td>
<td class="text-center">
<td>
{% if srpfleet.fleet_srp_aar_link %}
<a href="{{ srpfleet.fleet_srp_aar_link }}" target="_blank" class="badge bg-primary">{% translate "Link" %}</a>
{% endif %}
</td>
<td class="text-center">
<td>
{% if srpfleet.fleet_srp_code %}
<a class="badge bg-warning" href="{% url 'srp:request' srpfleet.fleet_srp_code %}">{{ srpfleet.fleet_srp_code }}</a>
{% else %}
@ -77,9 +77,9 @@
</div>
{% endif %}
</td>
<td class="text-center">ISK: {{ srpfleet.total_cost | intcomma }}</td>
<td class="text-end">{{ srpfleet.total_cost | intcomma }} ISK</td>
<td class="text-center">
<td>
{% if srpfleet.fleet_srp_status == "" %}
<div class="badge bg-warning">
{% translate "Pending" %}
@ -90,30 +90,29 @@
</div>
{% endif %}
</td>
<td class="text-center">
<td>
<div class="badge bg-warning">{{ srpfleet.pending_requests }}</div>
</td>
<td class="text-center">
<a href="{% url 'srp:fleet' srpfleet.id %}" class="btn btn-primary" title="View">
<span class="glyphicon glyphicon-eye-open"></span>
<td class="text-end">
<a href="{% url 'srp:fleet' srpfleet.id %}" class="btn btn-primary btn-sm m-1" title="View">
<i class="fa-solid fa-eye"></i>
</a>
{% if perms.auth.srp_management %}
<a href="{% url 'srp:edit' srpfleet.id %}" class="btn btn-info" title="Edit">
<span class="glyphicon glyphicon-pencil"></span>
<a href="{% url 'srp:edit' srpfleet.id %}" class="btn btn-info btn-sm m-1" title="Edit">
<i class="fa-solid fa-pen-to-square fa-fw"></i>
</a>
<a href="{% url 'srp:remove' srpfleet.id %}" onclick="return confirm('{% translate "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 href="{% url 'srp:remove' srpfleet.id %}" onclick="return confirm('{% translate "Are you sure you want to delete this SRP code and its contents?" %}')" class="btn btn-danger btn-sm m-1" title="Remove">
<i class="fa-solid fa-trash fa-fw"></i>
</a>
{% if srpfleet.fleet_srp_code %}
<a href="{% url 'srp:disable' srpfleet.id %}" class="btn btn-warning" title="Disable">
<span class="glyphicon glyphicon-remove-sign"></span>
<a href="{% url 'srp:disable' srpfleet.id %}" class="btn btn-warning btn-sm m-1" title="Disable">
<i class="fa-solid fa-ban fa-fw"></i>
</a>
{% else %}
<a href="{% url 'srp:enable' srpfleet.id %}" class="btn btn-success" title="Enable">
<span class="glyphicon glyphicon-ok-sign"></span>
<a href="{% url 'srp:enable' srpfleet.id %}" class="btn btn-success btn-sm m-1" title="Enable">
<i class="fa-solid fa-check fa-fw"></i>
</a>
{% endif %}