|
|
@ -48,27 +48,6 @@ |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<!-- End Paint Canvas Modal --> |
|
|
|
<!-- End Paint Canvas Modal --> |
|
|
|
|
|
|
|
|
|
|
|
<!-- ToDo display Modal --> |
|
|
|
|
|
|
|
<div class="modal fade" id="todoModal" tabindex="-1" aria-labelledby="todoModalLabel" aria-hidden="true"> |
|
|
|
|
|
|
|
<div class="modal-dialog"> |
|
|
|
|
|
|
|
<div class="modal-content"> |
|
|
|
|
|
|
|
<div class="modal-header"> |
|
|
|
|
|
|
|
<h5 class="modal-title" id="todoModalLabel">TODO Details</h5> |
|
|
|
|
|
|
|
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
<div class="modal-body"> |
|
|
|
|
|
|
|
<p><strong>Text:</strong> <span id="modalTodoText"></span></p> |
|
|
|
|
|
|
|
<p><strong>Created:</strong> <span id="modalTodoCreated"></span></p> |
|
|
|
|
|
|
|
<p><strong>Due:</strong> <span id="modalTodoDue"></span></p> |
|
|
|
|
|
|
|
<p><strong>Completion time:</strong> <span id="modalTodoCompletionTime"></span></p> |
|
|
|
|
|
|
|
<img id="modalTodoImage" src="" class="img-fluid" style="display: none;"> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
<div class="modal-footer"> |
|
|
|
|
|
|
|
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- Sidebar --> |
|
|
|
<!-- Sidebar --> |
|
|
|
<div id="sidebar" class="col border-right shadow-lg flex-shrink-1 p-2 d-flex flex-column align-items-stretch bg-body-tertiary" style="width: 380px;"> |
|
|
|
<div id="sidebar" class="col border-right shadow-lg flex-shrink-1 p-2 d-flex flex-column align-items-stretch bg-body-tertiary" style="width: 380px;"> |
|
|
@ -96,22 +75,23 @@ |
|
|
|
|
|
|
|
|
|
|
|
<!-- Main ToDos section --> |
|
|
|
<!-- Main ToDos section --> |
|
|
|
<div class="p-2 flex-grow-1"> |
|
|
|
<div class="p-2 flex-grow-1"> |
|
|
|
<form action="javascript:void(0);" id="todoForm"> |
|
|
|
<form action="javascript:void(0);"> |
|
|
|
<div class="row g-3 align-items-center"> |
|
|
|
<div class="container"> |
|
|
|
<div class="col-md"> |
|
|
|
<div class="row"> |
|
|
|
<label for="newTodoText" class="form-label">TODO Text</label> |
|
|
|
<div class="col"> |
|
|
|
<input type="text" class="form-control" id="newTodoText" placeholder="Enter TODO text" required> |
|
|
|
<input type="text" class="form-control" id="newTodoText" placeholder="TODO text"> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
<div class="col"> |
|
|
|
|
|
|
|
<label for="newTodoDue">Due</label> |
|
|
|
|
|
|
|
<input aria-placeholder="Due" type="date" name="newTodoDue" id="newTodoDue" placeholder="Due"> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="col-md"> |
|
|
|
<div class="col"> |
|
|
|
<label for="newTodoDue" class="form-label">Due Date</label> |
|
|
|
<button class="btn btn-primary" id="newTodoPaint" onclick="openPaintModal();">Paint</button> |
|
|
|
<input type="date" class="form-control" name="newTodoDue" id="newTodoDue" required> |
|
|
|
|
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="col-auto"> |
|
|
|
<div class="col"> |
|
|
|
<button type="button" class="btn btn-primary" id="newTodoPaint" onclick="openPaintModal();">Paint</button> |
|
|
|
<button id="newTodoSubmit" class="btn btn-primary">Add</button> |
|
|
|
|
|
|
|
<button class="btn btn-secondary" id="show-done">Show Done</button> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="col-auto"> |
|
|
|
|
|
|
|
<button type="submit" id="newTodoSubmit" class="btn btn-primary">Add</button> |
|
|
|
|
|
|
|
<button type="button" id="show-done" class="btn btn-secondary">Show Done</button> |
|
|
|
|
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</form> |
|
|
|
</form> |
|
|
@ -128,7 +108,7 @@ |
|
|
|
<tbody class="text-break"> |
|
|
|
<tbody class="text-break"> |
|
|
|
{{ range .Todos }} |
|
|
|
{{ range .Todos }} |
|
|
|
{{ if not .IsDone }} |
|
|
|
{{ if not .IsDone }} |
|
|
|
<tr onclick="openTodoModal('{{.ID}}', '{{.Text}}', '{{.TimeCreated}}', '{{.Due}}', null, '{{ printf "%s" .Image }}');" draggable="true" id="todo-{{.ID}}" ondragstart="dragStart(event);"> |
|
|
|
<tr draggable="true" id="todo-{{.ID}}" ondragstart="dragStart(event);"> |
|
|
|
{{ if not .Image }} |
|
|
|
{{ if not .Image }} |
|
|
|
<!-- Display transparent white pixel --> |
|
|
|
<!-- Display transparent white pixel --> |
|
|
|
<td><img class="todo-image" src='data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7' width="64px" height="64px"></td> |
|
|
|
<td><img class="todo-image" src='data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7' width="64px" height="64px"></td> |
|
|
@ -164,7 +144,7 @@ |
|
|
|
<tbody class="text-break"> |
|
|
|
<tbody class="text-break"> |
|
|
|
{{ range .Todos }} |
|
|
|
{{ range .Todos }} |
|
|
|
{{ if .IsDone }} |
|
|
|
{{ if .IsDone }} |
|
|
|
<tr onclick="openTodoModal('{{.ID}}', '{{.Text}}', '{{.TimeCreated}}', '{{.Due}}', '{{.CompletionTime}}', '{{ printf "%s" .Image }}');"> |
|
|
|
<tr> |
|
|
|
{{ if not .Image }} |
|
|
|
{{ if not .Image }} |
|
|
|
<!-- Display transparent white pixel --> |
|
|
|
<!-- Display transparent white pixel --> |
|
|
|
<td><img src='data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7' width="64px" height="64px"></td> |
|
|
|
<td><img src='data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7' width="64px" height="64px"></td> |
|
|
@ -271,24 +251,6 @@ async function drop(event) { |
|
|
|
window.location.reload(); |
|
|
|
window.location.reload(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function openTodoModal(id, text, created, due, completionTime, image) { |
|
|
|
|
|
|
|
document.getElementById('modalTodoText').innerText = text; |
|
|
|
|
|
|
|
document.getElementById('modalTodoCreated').innerText = created; |
|
|
|
|
|
|
|
document.getElementById('modalTodoDue').innerText = due; |
|
|
|
|
|
|
|
document.getElementById('modalTodoCompletionTime').innerText = completionTime; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let img = document.getElementById('modalTodoImage'); |
|
|
|
|
|
|
|
if (img) { |
|
|
|
|
|
|
|
img.src = image; |
|
|
|
|
|
|
|
img.style.display = 'block'; |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
img.style.display = 'none'; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const todoModal = new bootstrap.Modal(document.getElementById('todoModal')); |
|
|
|
|
|
|
|
todoModal.show(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
document.addEventListener('DOMContentLoaded', async function() { |
|
|
|
document.addEventListener('DOMContentLoaded', async function() { |
|
|
|
document.getElementById("newTodoText").focus(); |
|
|
|
document.getElementById("newTodoText").focus(); |
|
|
|
|
|
|
|
|
|
|
|