table view

This commit is contained in:
Alicja Cięciwa
2020-12-28 23:07:31 +01:00
parent a68bc6c7c2
commit b8c345a3b8
9 changed files with 52 additions and 14 deletions

View File

@@ -3,9 +3,7 @@
{% block content %}
{% load crispy_forms_tags %}
<!--<div class="container">-->
<!-- form to input working hours-->
<!-- <div class="row">-->
<!-- form to input workplace -->
<div class="form-hours">
<form method="post">
{% csrf_token %}
@@ -13,6 +11,4 @@
<button class="btn btn-lg btn-success btn-block" type="submit">Dodaj</button>
</form>
</div>
<!-- </div>-->
<!--</div>-->
{% endblock %}

View File

@@ -52,7 +52,7 @@
<a class="nav-link" href="{% url 'sign-up' %}">Dodaj pracownika</a>
</li>
<li class="nav-item">
<a class="nav-link" href="{% url 'addworkplace' %}">Dodaj pracę</a>
<a class="nav-link" href="{% url 'workplaces' %}">Prace</a>
</li>
{% endif %}
</ul>

26
templates/workplaces.html Normal file
View File

@@ -0,0 +1,26 @@
{% extends "base.html" %}
{% block content %}
{% load crispy_forms_tags %}
<!-- Show workplaces -->
<div class="table-view">
<a href="{% url 'addworkplace' %}">+ Dodaj pracę</a> <br><br>
<table class="table">
<thead>
<tr>
<th scope="col">Miejsca pracy</th>
</tr>
</thead>
<tbody>
{% for wp in workplaces.all %}
<tr>
<td>{{ wp.workplace }} <br></td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% endblock %}