v1.5.22 - Updated Push News

Added old() to different create & Edit pages
Added the removal
This commit is contained in:
Anders
2021-05-10 11:18:05 +02:00
parent 322dbaf31e
commit 4e8e2831da
21 changed files with 103 additions and 65 deletions
@@ -37,10 +37,12 @@
</style>
<link href="{{ asset("/css/quill/quill.snow.css") }}" rel="stylesheet">
<h1 id="errormesseages" >Opret ugentligt aktivitet: [Vi er i uge <?php echo date('W'); ?>]</h1>
<form method="post" action="{{ route("multiple-events.store") }}" enctype="multipart/form-data">
<!--datetime-local-->
@csrf
<input type="number" name="week" placeholder="Uge" maxlength="2" max="53" required>
<input type="number" name="week" placeholder="Uge" maxlength="2" value="{{ old('week') }}" max="53" required>
<label id="fileuploadee"for="fileuploade">Baggrundsbillede til nyheden (Valgfri)</label>
<input id="fileuploade" type="file" name="resource" accept="image/*">
<table id="table">
@@ -51,13 +53,25 @@
<th>Tidsrum (Start)</th>
<th><button type="button" class="btn btn-inline btn-sde-blue" id="add2">Tilføj Række</button></th>
</tr>
<tr>
<td><input type="text" name="name[]" maxlength="255"></td>
<td><input type="text" name="description[]"></td>
<td><input type="text" name="accountable[]" maxlength="255"></td>
<td><input type="datetime-local" name="date[]"></td>
<td><button type="button" onclick="removeRow(this)" class="btn btn-inline bg-red">Fjern Række</button></td>
</tr>
@if (!empty(old('name')))
@for ($i = 0; $i < count(old('name')); $i++)
<tr>
<td><input type="text" name="name[]" value="{{ old('name.'.$i) }}" maxlength="255"></td>
<td><input type="text" name="description[]" value="{{ old('description.'.$i) }}"></td>
<td><input type="text" name="accountable[]" value="{{ old('accountable.'.$i) }}" maxlength="255"></td>
<td><input type="datetime-local" name="date[]" value="{{ old('date.'.$i) }}"></td>
<td><button type="button" onclick="removeRow(this)" class="btn btn-inline bg-red">Fjern Række</button></td>
</tr>
@endfor
@else
<tr>
<td><input type="text" name="name[]" maxlength="255"></td>
<td><input type="text" name="description[]"></td>
<td><input type="text" name="accountable[]" maxlength="255"></td>
<td><input type="datetime-local" name="date[]"></td>
<td><button type="button" onclick="removeRow(this)" class="btn btn-inline bg-red">Fjern Række</button></td>
</tr>
@endif
</table>
<label class="toggle">