Kalender mit pagination

This commit is contained in:
mbremer
2021-07-12 21:27:26 +02:00
parent 4d6642c144
commit 12a3370d8e
5 changed files with 88 additions and 106 deletions

View File

@@ -1,95 +0,0 @@
{#include base.html}
{#kalender_active}active{/}
{#contents}
<div class="mt-2">
Heute ist {today.formatCommon}
</div>
<div class="mt-2">
<table class="table table-striped table-bordered">
<thead>
<tr>
<th scope="col" class="col-2">Ich will ins Büro</th>
<th scope="col" class="col-3">Datum</th>
<th scope="col">Im Büro</th>
</tr>
</thead>
<tbody>
{#for day in week0}
<tr>
<td>
<form action="/kalender/inoffice/{day.day}" method="POST" name="kalenderForm" enctype="multipart/form-data">
<div class="form-check form-switch">
<input class="form-check-input" type="checkbox" name="inoffice" onchange="this.form.submit()"
{#if day.isCurrentUserInOffice}checked{/if} >
</div>
</form>
</td>
<td>
{day.day.formatCommon}
</td>
<td>
{#if day.inOffice}{day.inOffice.username}{/if}
</td>
</tr>
{/for}
</tbody>
</table>
</div>
<div class="mt-2">
<table class="table table-striped table-bordered">
<tbody>
{#for day in week1}
<tr>
<td class="col-2">
<form action="/kalender/inoffice/{day.day}" method="POST" name="kalenderForm" enctype="multipart/form-data">
<div class="form-check form-switch">
<input class="form-check-input" type="checkbox" name="inoffice" onchange="this.form.submit()"
{#if day.isCurrentUserInOffice}checked{/if} >
</div>
</form>
</td>
<td class="col-3">
{day.day.formatCommon}
</td>
<td>
{#if day.inOffice}{day.inOffice.username}{/if}
</td>
</tr>
{/for}
</tbody>
</table>
<div class="mt-2">
<table class="table table-striped table-bordered">
<tbody>
{#for day in week2}
<tr>
<td class="col-2">
<form action="/kalender/inoffice/{day.day}" method="POST" name="kalenderForm" enctype="multipart/form-data">
<div class="form-check form-switch">
<input class="form-check-input" type="checkbox" name="inoffice" onchange="this.form.submit()"
{#if day.isCurrentUserInOffice}checked{/if} >
</div>
</form>
</td>
<td class="col-3">
{day.day.formatCommon}
</td>
<td>
{#if day.inOffice}{day.inOffice.username}{/if}
</td>
</tr>
{/for}
</tbody>
</table>
</div>
{/contents}
{/include}

View File

@@ -0,0 +1,61 @@
{#include base.html}
{#kalender_active}active{/}
{#contents}
<div class="mt-2">
Heute ist {today.formatCommon}
</div>
<div class="mt-2">
<nav aria-label="Page navigation example">
<ul class="pagination">
<li class="page-item"><a class="page-link" href="/kalender">aktuelle Woche</a></li>
<li class="page-item">
<a class="page-link" href="/kalender/offset/{offset.minus(1)}" aria-label="Previous">
<span aria-hidden="true">&laquo;</span>
</a>
</li>
<li class="page-item">
<a class="page-link" href="/kalender/offset/{offset.plus(1)}" aria-label="Next">
<span aria-hidden="true">&raquo;</span>
</a>
</li>
</ul>
</nav>
</div>
<div class="mt-2">
<table class="table table-striped table-bordered">
<thead>
<tr>
<th scope="col" class="col-2">Ich will ins Büro</th>
<th scope="col" class="col-3">Datum</th>
<th scope="col">Im Büro</th>
</tr>
</thead>
<tbody>
{#for day in week}
<tr {#if day.isToday}class="table-primary"{/if}>
<td>
<form action="/kalender/inoffice/{day.day}?offset={offset}" method="POST" name="kalenderForm" enctype="multipart/form-data">
<div class="form-check form-switch">
<input class="form-check-input" type="checkbox" name="inoffice" onchange="this.form.submit()"
{#if day.isCurrentUserInOffice}checked{/if} >
</div>
</form>
</td>
<td>
{day.day.formatCommon}
</td>
<td>
{#if day.inOffice}{day.inOffice.username}{/if}
</td>
</tr>
{/for}
</tbody>
</table>
</div>
{/contents}
{/include}