[FIX] Corputils search template

This commit is contained in:
Peter Pfeufer 2023-11-12 21:57:41 +01:00
parent a4901802c0
commit a9c87bc25a
No known key found for this signature in database
GPG Key ID: 6051D2C6AD4EBC27

View File

@ -1,33 +1,36 @@
{% extends "corputils/base.html" %} {% extends "corputils/base.html" %}
{% load i18n %} {% load i18n %}
{% block member_data %} {% block member_data %}
<div class="panel panel-default"> <div class="card card-default">
<div class="panel-heading clearfix"> <div class="card-header clearfix">
<div class="panel-title pull-left">{% translate "Search Results" %}</div> <div class="card-title">{% translate "Search Results" %}</div>
</div> </div>
<div class="panel-body">
<div class="card-body mt-2">
<table class="table table-hover" id="table-search"> <table class="table table-hover" id="table-search">
<thead> <thead>
<tr> <tr>
<th class="text-center"></th> <th></th>
<th class="text-center">{% translate "Character" %}</th> <th>{% translate "Character" %}</th>
<th class="text-center">{% translate "Corporation" %}</th> <th>{% translate "Corporation" %}</th>
<th class="text-center">{% translate "zKillboard" %}</th> <th>{% translate "zKillboard" %}</th>
<th class="text-center">{% translate "Main Character" %}</th> <th>{% translate "Main Character" %}</th>
<th class="text-center">{% translate "Main Corporation" %}</th> <th>{% translate "Main Corporation" %}</th>
<th class="text-center">{% translate "Main Alliance" %}</th> <th>{% translate "Main Alliance" %}</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
{% for result in results %} {% for result in results %}
<tr {% if not result.1.registered %}class="danger"{% endif %}> <tr {% if not result.1.registered %}class="danger"{% endif %}>
<td class="text-center"><img src="{{ result.1.portrait_url }}" class="img-circle" alt="{{ result.1.character_name }}"></td> <td><img src="{{ result.1.portrait_url }}" class="img-circle" alt="{{ result.1.character_name }}"></td>
<td class="text-center">{{ result.1.character_name }}</td> <td>{{ result.1.character_name }}</td>
<td class="text-center">{{ result.0.corp.corporation_name }}</td> <td >{{ result.0.corp.corporation_name }}</td>
<td class="text-center"><a href="https://zkillboard.com/character/{{ result.1.character_id }}/" class="badge bg-danger" target="_blank">{% translate "Killboard" %}</a></td> <td><a href="https://zkillboard.com/character/{{ result.1.character_id }}/" class="badge bg-danger" target="_blank">{% translate "Killboard" %}</a></td>
<td class="text-center">{{ result.1.main_character.character_name }}</td> <td>{{ result.1.main_character.character_name }}</td>
<td class="text-center">{{ result.1.main_character.corporation_name }}</td> <td>{{ result.1.main_character.corporation_name }}</td>
<td class="text-center">{{ result.1.main_character.alliance_name }}</td> <td>{{ result.1.main_character.alliance_name }}</td>
</tr> </tr>
{% endfor %} {% endfor %}
</tbody> </tbody>
@ -35,14 +38,17 @@
</div> </div>
</div> </div>
{% endblock %} {% endblock %}
{% block extra_javascript %} {% block extra_javascript %}
{% include 'bundles/datatables-js.html' %} {% include 'bundles/datatables-js-bs5.html' %}
{% endblock %} {% endblock %}
{% block extra_css %} {% block extra_css %}
{% include 'bundles/datatables-css.html' %} {% include 'bundles/datatables-css-bs5.html' %}
{% endblock %} {% endblock %}
{% block extra_script %} {% block extra_script %}
$(document).ready(function(){ $(document).ready(() => {
$('#table-search').DataTable({ $('#table-search').DataTable({
"stateSave": true, "stateSave": true,
"stateDuration": 0 "stateDuration": 0