added ability to search for corps, chars and alliances.

This commit is contained in:
2018-04-25 15:57:11 +01:00
parent 3839235937
commit 9f5fe51c35
8 changed files with 200 additions and 5 deletions

View File

@@ -12,23 +12,27 @@
<!-- Bootstrap core CSS -->
{% bootstrap_css %}
<!-- Font Awesome -->
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.0.10/css/all.css" integrity="sha384-+d0P83n9kaQMCwj8F4RJB66tzIwOKmrdb46+porD/OvrJ+37WqIM7UoBtwHO6Nlg" crossorigin="anonymous">
<!-- Custom styles for this template -->
<link href="/static/css/custom.css" rel="stylesheet">
</head>
<body>
{% include 'nav.html' %}
<main role="main" class="container">
{% block main_body %}
<main role="main" class="container">
<div class="starter-template">
<h1>Bootstrap starter template</h1>
<p class="lead">Use this document as a way to quickly start any new project.<br> All you get is this text and a mostly barebones HTML document.</p>
</div>
</main><!-- /.container -->
{% endblock main_body %}
<!-- Bootstrap core JavaScript
================================================== -->

49
templates/search.html Normal file
View File

@@ -0,0 +1,49 @@
{% extends 'base.html' %}
{% load bootstrap4 %}
{% block main_body %}
<div class="container">
<form method="post">
{% csrf_token %}
<div class="input-group mb-3">
{# <input type="text" class="form-control" placeholder="Search Text">#}
{{ form.search_text }}
{{ form.category }}
<div class="input-group-append">
<button class="btn btn-outline-secondary" type="submit">Search</button>
</div>
</div>
</form>
</div>
<div class="container">
{% for result in results %}
<div class="row">
<div class="col"></div>
<div class="col-md-6">
<div class="d-flex flex-row border rounded">
<div class="p-0 w-25">
{% if form.category.value == 'alliance' %}
<img src="//image.eveonline.com/Alliance/{{ result.id }}_128.png" class="img-thumbnail border-0" />
{% elif form.category.value == 'corporation' %}
<img src="//image.eveonline.com/Corporation/{{ result.id }}_128.png" class="img-thumbnail border-0" />
{% else %}
<img src="//image.eveonline.com/Character/{{ result.id }}_128.jpg" class="img-thumbnail border-0" />
{% endif %}
</div>
<div class="pl-3 pt-2 pr-2 pb-2 w-75 border-left">
<h4 class="text-primary">{{ result.name }}</h4>
{% if result.ticker %}<h5 class="text-info">&lt;{{ result.ticker }}&gt;</h5>{% endif %}
{% if result.security_status %}<h5 class="text-info">Sec Status: {{ result.security_status }}</h5>{% endif %}
<p class="text-left m-0">{{ result.description|safe }}</p>
<p class="text-right m-0"><a href="#" class="btn btn-primary"><i class="far fa-bookmark"></i> Add Rights</a></p>
</div>
</div>
</div>
<div class="col"></div>
</div>
{% endfor %}
</div>
{% endblock main_body %}