-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #25 from ronardcaktus/country-comparison
Country comparison
- Loading branch information
Showing
9 changed files
with
149 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
apps/countries/templates/country/autocomplete_country_1.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<table id="autocomplete-comparison-list" class="table table-borderless"> | ||
<tbody class="text-start"> | ||
<tr> | ||
{% for country in countries %} | ||
<td><a class="lead text-decoration-none" href="{% url 'comparison_country_1' country_id=country.id %}" | ||
style="color: black;"> | ||
{{ country.flag }} {{ country.name }}</a> | ||
</td> | ||
<td><a class="lead text-decoration-none" href="{% url 'comparison_country_1' country_id=country.id %}" | ||
style="color: black;"> | ||
{{ country.region_formatted}}</a> | ||
</td> | ||
</tr> | ||
{% endfor %} | ||
</tbody> | ||
</table> |
16 changes: 16 additions & 0 deletions
16
apps/countries/templates/country/autocomplete_country_2.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<table style="margin-left: 8em" class="table table-borderless"> | ||
<tbody class="text-start"> | ||
<tr> | ||
{% for country in countries %} | ||
<td><a class="lead text-decoration-none" href="{% url 'comparison_country_2' country_id=country.id %}" | ||
style="color: black;"> | ||
{{ country.flag }} {{ country.name }}</a> | ||
</td> | ||
<td><a class="lead text-decoration-none" href="{% url 'comparison_country_2' country_id=country.id %}" | ||
style="color: black;"> | ||
{{ country.region_formatted}}</a> | ||
</td> | ||
</tr> | ||
{% endfor %} | ||
</tbody> | ||
</table> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
<span>{{ country.flag }}</span> | ||
<h2> {{ country.name }} </h2> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
<span>{{ country.flag }}</span> | ||
<h2> {{ country.name }} </h2> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
{% extends "base.html" %} | ||
|
||
{% block title %} Compare Countries {% endblock title %} | ||
|
||
{% block content %} | ||
<!-- HTML forms --> | ||
<div class="container py-4 pt-5"> | ||
<div class="row justify-content-center align-items-center"> | ||
<div class="col-md-5"> | ||
<div class="input-group"> | ||
<input class="form-control border-end-0 border rounded-pill form-control-lg" autocomplete="off" | ||
name="q_country_1" type="text" placeholder="Search..." hx-get="{% url 'search_countries' %}" | ||
hx-include="[name='q_country_1']" hx-trigger="keyup changed delay:200ms, search" | ||
hx-target="#country-search-1" /> | ||
</div> | ||
</div> | ||
<div class="col-md-2 text-center"> | ||
<h3 class="lead text-muted">vs.</h3> | ||
</div> | ||
<div class="col-md-5"> | ||
<div class="input-group"> | ||
<input class="form-control border-end-0 border rounded-pill form-control-lg" autocomplete="off" | ||
name="q_country_2" type="text" placeholder="Search..." hx-get="{% url 'search_countries' %}" | ||
hx-include="[name='q_country_2']" hx-trigger="keyup changed delay:200ms, search" | ||
hx-target="#country-search-2" /> | ||
</div> | ||
</div> | ||
<!-- Autocomplete results --> | ||
<div class="row"> | ||
<div class="col"> | ||
<div id="country-search-1"></div> | ||
</div> | ||
<div class="col"> | ||
<div id="country-search-2"></div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
{% endblock content %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters