Skip to content

Commit

Permalink
Fixing tables
Browse files Browse the repository at this point in the history
  • Loading branch information
gm3dmo committed Jun 3, 2024
1 parent d477a71 commit c34aff6
Show file tree
Hide file tree
Showing 10 changed files with 166 additions and 85 deletions.
6 changes: 3 additions & 3 deletions templates/cmp/cemeteries.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
{% block title %}Cemeteries {% endblock %}
{% block content %}

<div class="center-content">
<h1>Cemeteries</h1>

<table>
Expand All @@ -27,6 +28,5 @@ <h1>Cemeteries</h1>
{% endfor %}
</tbody>
</table>


{% endblock %}
{% endblock %}
<div>
24 changes: 12 additions & 12 deletions templates/cmp/edit-cemeteries.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@
{% block title %}Cemeteries Form{% endblock %}
{% block content %}

<h1>Edit Cemetery</h1>
<div>
<form method="POST">
{% csrf_token %}
{{ form.management_form }}
{{ form.errors }}
{{form | crispy}}
<button type="submit" class="btn btn-primary">Save</button>
</form>

<div class="center-content">
<h3>Edit Cemetery</h3>
<div>
<form method="POST">
{% csrf_token %}
{{ form.management_form }}
{{ form.errors }}
{{form | crispy}}
<button type="submit" class="btn btn-primary">Save</button>
</form>
</div>

{% endblock %}
{% endblock %}
</div>
27 changes: 15 additions & 12 deletions templates/cmp/edit-companies.html
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
{% extends "base.html" %}
{% load static crispy_forms_tags %}
{% block title %}Decorations Form{% endblock %}
{% block title %}Companies Form{% endblock %}
{% block content %}

<h1>Edit Decoration</h1>
<div>
<form method="POST">
{% csrf_token %}
{{ form.management_form }}
{{ form.errors }}
{{form | crispy}}
<button type="submit" class="btn btn-primary">Save</button>
</form>
</div>
<div class="center-content">
<h3>Edit Companies</h3>

{% endblock %}
<div>
<form method="POST">
{% csrf_token %}
{{ form.management_form }}
{{ form.errors }}
{{form | crispy}}
<button type="submit" class="btn btn-primary">Save</button>
</form>
</div>

{% endblock %}
</div>
11 changes: 6 additions & 5 deletions templates/cmp/edit-countries.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,18 @@
{% block title %}Country Form{% endblock %}
{% block content %}

<h1>Edit Country Details</h1>
<div class="center-content">
<h3>Edit Country Details</h3>

<div>
<form method="POST">
{% csrf_token %}
{{ form.management_form }}
{{ form.errors }}
{{form | crispy}}
<button type="submit" class="btn btn-primary">Save</button>
<button type="submit" class="btn btn-primary">SAVE</button>
</form>
</div>

</div>

{% endblock %}
{% endblock %}
</div>
42 changes: 27 additions & 15 deletions templates/cmp/search-cemeteries.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,35 @@
{% block title %}Cemeteries{% endblock %}
{% block content %}

<h1> Search Cemeteries</h1>
<div class="center-content">
<h3> Search Cemeteries</h3>

<div name="search-input" class="search-input">
<form method="get">
<input type="text" name="q" placeholder="Search Cemeteries to edit">
<input type="submit" value="Search">
</form>
</div>
<div name="search-input" class="search-input">
<form method="get">
<input type="text" name="q" placeholder="Search Cemeteries ">
<input type="submit" value="Search">
</form>
</div>


<div>
{% for cemetery in cemeteries %}
<p>
<a href="{% url 'edit-cemeteries' cemetery.id %}">{{ cemetery.name }}</a>
</p>
{% endfor %}
</div>
<div>
<table class="content-table">
<thead class="">
<tr>
<th></th>
<th>NAME</th>
<th>COUNTRY</th>
</tr>
</thead>

{% for cemetery in cemeteries %}
<tr>
<td><button class="glossy-button" onclick="location.href='{% url 'edit-cemeteries' cemetery.id %}'" type="button">EDIT</button></td>
<td><span class="soldier-info">{{ cemetery.name }}</span></td>
<td><span class="soldier-info">{{ cemetery.country.name }} {{cemetery.country.flag}} </span></td>
</tr>
{% endfor %}
</div>

{% endblock %}
{% endblock %}
</div>
32 changes: 22 additions & 10 deletions templates/cmp/search-companies.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
{% block title %}Companies{% endblock %}
{% block content %}

<h1>Search Companies</h1>
<div class="center-content">
<h3>Search Companies</h3>

<div name="search-input" class="search-input">
<form method="get">
Expand All @@ -13,17 +14,26 @@ <h1>Search Companies</h1>
</div>

<div>
{% for company in page_obj %}
<p class="soldier-details">
<button class="glossy-button" onclick="location.href='{% url 'edit-companies' company.id %}'" type="button">Edit</button>
<span class="soldier-info">{{ company.name}} </span>
</p>
{% endfor %}
</div>
<table class="content-table">
<thead class="">
<tr>
<th></th>
<th>NAME</th>
</tr>
</thead>

{% for company in page_obj %}
<tr>
<td><button class="glossy-button" onclick="location.href='{% url 'edit-companies' company.id %}'" type="button">EDIT</button></td>
<td><span class="soldier-info">{{ company.name }}</span></td>
</tr>

{% endfor %}
</table>
</div>

<p>Page {{ page_obj.number }} of {{ page_obj.paginator.num_pages }}</p>


{% if page_obj.has_previous %}
<a href="?q={{ request.GET.q }}&page={{ page_obj.previous_page_number }}">Previous</a>
{% endif %}
Expand All @@ -32,4 +42,6 @@ <h1>Search Companies</h1>
<a href="?q={{ request.GET.q }}&page={{ page_obj.next_page_number }}">Next</a>
{% endif %}

{% endblock %}
{% endblock %}
</div>
kk
27 changes: 20 additions & 7 deletions templates/cmp/search-countries.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
{% block title %}Countries{% endblock %}
{% block content %}

<h1>Search Countries</h1>
<div class="center-content">
<h3>Search Countries</h3>

<div name="search-input" class="search-input">
<form method="get">
Expand All @@ -12,13 +13,25 @@ <h1>Search Countries</h1>
</form>
</div>

<div>
<table class="content-table">
<thead class="">
<tr>
<th></th>
<th>NAME</th>
<th>FLAG</th>
</tr>
</thead>

{% for country in countries %}
<p>
<a href="{% url 'edit-countries' country.id %}">{{ country.name }}</a>
</p>
<tr>
<td><button class="glossy-button" onclick="location.href='{% url 'edit-countries' country.id %}'" type="button">EDIT</button></td>
<td><span class="soldier-info">{{ country.name }}</span></td>
<td><span class="soldier-info">{{ country.flag }}</span></td>
</tr>
{% endfor %}
</table>
</div>



{% endblock %}
{% endblock %}
</div>
27 changes: 21 additions & 6 deletions templates/cmp/search-decorations.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
{% block title %}Decorations{% endblock %}
{% block content %}

<h1>Search Decorations</h1>
<div class="center-content">
<h3>Search Decorations</h3>

<div name="search-input" class="search-input">
<form method="get">
Expand All @@ -13,12 +14,23 @@ <h1>Search Decorations</h1>
</div>

<div>
<table class="content-table">
<thead class="">
<tr>
<th></th>
<th>NAME</th>
<th>COUNTRY</th>
</tr>
</thead>

{% for decoration in page_obj %}
<p class="soldier-details">
<button class="glossy-button" onclick="location.href='{% url 'edit-decorations' decoration.id %}'" type="button">Edit</button>
<span class="soldier-info">{{ decoration.name}} {{ decoration.country.name }} {{ decoration.country.flag }} </span>
</p>
<tr>
<td><button class="glossy-button" onclick="location.href='{% url 'edit-decorations' decoration.id %}'" type="button">EDIT</button></td>
<td><span class="soldier-info">{{ decoration.name }}</span></td>
<td><span class="soldier-info">{{ decoration.country.flag }} {{ decoration.country.name }} </span></td>
</tr>
{% endfor %}
</table>
</div>

<p>Page {{ page_obj.number }} of {{ page_obj.paginator.num_pages }}</p>
Expand All @@ -27,12 +39,15 @@ <h1>Search Decorations</h1>
<!-- Display the soldier -->
{% endfor %}

<span>
{% if page_obj.has_previous %}
<a href="?q={{ request.GET.q }}&page={{ page_obj.previous_page_number }}">Previous</a>
{% endif %}

{% if page_obj.has_next %}
<a href="?q={{ request.GET.q }}&page={{ page_obj.next_page_number }}">Next</a>
{% endif %}
</span>

{% endblock %}
{% endblock %}
</div>
27 changes: 21 additions & 6 deletions templates/cmp/search-prisoner-of-war-camps.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,34 @@
{% block title %}Countries{% endblock %}
{% block content %}

<h1>Search Prisoner of War Camps</h1>
<div class="center-content">
<h3>Search Prisoner of War Camps</h3>

<div name="search-input" class="search-input">
<form method="get">
<input type="text" name="q" placeholder="Search Prisoner of War Camps to edit">
<input type="text" name="q" placeholder="PoW Camp Name">
<input type="submit" value="Search">
</form>
</div>

<div>
<table class="content-table">
<thead class="">
<tr>
<th></th>
<th>NAME</th>
<th>COUNTRY</th>
</tr>
</thead>
{% for powcamp in powcamps %}
<p>
<a href="{% url 'edit-prisoner-of-war-camps' powcamp.id %}">{{ powcamp.name }}</a>
</p>
<tr>
<td><button class="glossy-button" onclick="location.href='{% url 'edit-prisoner-of-war-camps' powcamp.id %}'" type="button">EDIT</button></td>
<td><span class="soldier-info">{{ powcamp.name }}</span></td>
<td><span class="soldier-info">{{ powcamp.country.flag }} {{ powcamp.country.name }}</span></td>
</tr>


{% endfor %}

{% endblock %}
{% endblock %}
</div>
Loading

0 comments on commit c34aff6

Please sign in to comment.