-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding companies and decorations to management screen
- Loading branch information
Showing
10 changed files
with
236 additions
and
30 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
{% extends "base.html" %} | ||
{% load static crispy_forms_tags %} | ||
{% block title %}Companies{% endblock %} | ||
{% block content %} | ||
|
||
<h1>{{ Company.name }} Details</h1> | ||
|
||
<div> | ||
<table class="table table-borderless table-lg"> | ||
<thead> | ||
<tr> | ||
<th>Flag</th> | ||
<th>Name</th> | ||
<th>Alpha2</th> | ||
<th>Alpha3</th> | ||
<th>Country #</th> | ||
<th>Edit</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<tr> | ||
<td> | ||
{{ company.name }} | ||
</td> | ||
<td> | ||
<a class="btn btn-primary btn-sm" href="{% url 'edit-companies' company_id=company.id %}">Edit | ||
</a> | ||
</td> | ||
</tr> | ||
</table> | ||
</div> | ||
|
||
{% endblock %} |
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,17 @@ | ||
{% extends "base.html" %} | ||
{% load static crispy_forms_tags %} | ||
{% block title %}Decorations 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> | ||
|
||
{% endblock %} |
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,17 @@ | ||
{% extends "base.html" %} | ||
{% load static crispy_forms_tags %} | ||
{% block title %}Companies Form{% endblock %} | ||
{% block content %} | ||
|
||
<h1>Edit Company</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> | ||
|
||
{% endblock %} |
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
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,35 @@ | ||
{% extends "base.html" %} | ||
{% load static crispy_forms_tags %} | ||
{% block title %}Companies{% endblock %} | ||
{% block content %} | ||
|
||
<h1>Search Companies</h1> | ||
|
||
<div name="search-input" class="search-input"> | ||
<form method="get"> | ||
<input type="text" name="q" value="{{ request.GET.q }}" placeholder="Search Companies"> | ||
<input type="submit" value="Search"> | ||
</form> | ||
</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> | ||
|
||
<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 %} | ||
|
||
{% if page_obj.has_next %} | ||
<a href="?q={{ request.GET.q }}&page={{ page_obj.next_page_number }}">Next</a> | ||
{% endif %} | ||
|
||
{% endblock %} |
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,38 @@ | ||
{% extends "base.html" %} | ||
{% load static crispy_forms_tags %} | ||
{% block title %}Decorations{% endblock %} | ||
{% block content %} | ||
|
||
<h1>Search Decorations</h1> | ||
|
||
<div name="search-input" class="search-input"> | ||
<form method="get"> | ||
<input type="text" name="q" value="{{ request.GET.q }}" placeholder="Search Decorations"> | ||
<input type="submit" value="Search"> | ||
</form> | ||
</div> | ||
|
||
<div> | ||
{% 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> | ||
{% endfor %} | ||
</div> | ||
|
||
<p>Page {{ page_obj.number }} of {{ page_obj.paginator.num_pages }}</p> | ||
|
||
{% for decoration in page_obj %} | ||
<!-- Display the soldier --> | ||
{% endfor %} | ||
|
||
{% 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 %} | ||
|
||
{% endblock %} |