Kasianov Nikolai Alekseevich
2 years ago
8 changed files with 332 additions and 72 deletions
@ -0,0 +1,15 @@
|
||||
{{ template "base" . }} |
||||
|
||||
{{ define "content" }} |
||||
<div class="cover-container d-flex w-100 h-100 p-3 mx-auto flex-column"> |
||||
<main class="px-3"> |
||||
<h1>Dela.</h1> |
||||
<p class="lead">A free and open-source web TODO list</p> |
||||
<p class="lead"> |
||||
<a href="/login" class="btn btn-lg btn-primary">Login</a> |
||||
<a href="/register" class="btn btn-lg btn-primary">Register</a> |
||||
</p> |
||||
</main> |
||||
</div> |
||||
|
||||
{{ end }} |
@ -1,15 +1,229 @@
|
||||
{{ template "base" . }} |
||||
|
||||
{{ define "content" }} |
||||
<div class="cover-container d-flex w-100 h-100 p-3 mx-auto flex-column"> |
||||
<main class="px-3"> |
||||
<h1>Dela.</h1> |
||||
<p class="lead">A free and open-source web TODO list</p> |
||||
<p class="lead"> |
||||
<a href="/login" class="btn btn-lg btn-primary">Login</a> |
||||
<a href="/register" class="btn btn-lg btn-primary">Register</a> |
||||
</p> |
||||
</main> |
||||
</div> |
||||
|
||||
<!-- <div class="album py-5 bg-body-tertiary"> |
||||
<div class="container"> |
||||
<div class="row row-cols-1 row-cols-sm-2 row-cols-md-3 g-3"> |
||||
<div class="col"> |
||||
<div class="card shadow-sm"> |
||||
<svg class="bd-placeholder-img card-img-top" width="100%" height="225" xmlns="http://www.w3.org/2000/svg" role="img" aria-label="Placeholder: Thumbnail" preserveAspectRatio="xMidYMid slice" focusable="false"><title>Placeholder</title><rect width="100%" height="100%" fill="#55595c"></rect><text x="50%" y="50%" fill="#eceeef" dy=".3em">Thumbnail</text></svg> |
||||
<div class="card-body"> |
||||
<p class="card-text">This is a wider card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.</p> |
||||
<div class="d-flex justify-content-between align-items-center"> |
||||
<div class="btn-group"> |
||||
<button type="button" class="btn btn-sm btn-outline-secondary">View</button> |
||||
<button type="button" class="btn btn-sm btn-outline-secondary">Edit</button> |
||||
</div> |
||||
<small class="text-body-secondary">9 mins</small> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
<div class="col"> |
||||
<div class="card shadow-sm"> |
||||
<svg class="bd-placeholder-img card-img-top" width="100%" height="225" xmlns="http://www.w3.org/2000/svg" role="img" aria-label="Placeholder: Thumbnail" preserveAspectRatio="xMidYMid slice" focusable="false"><title>Placeholder</title><rect width="100%" height="100%" fill="#55595c"></rect><text x="50%" y="50%" fill="#eceeef" dy=".3em">Thumbnail</text></svg> |
||||
<div class="card-body"> |
||||
<p class="card-text">This is a wider card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.</p> |
||||
<div class="d-flex justify-content-between align-items-center"> |
||||
<div class="btn-group"> |
||||
<button type="button" class="btn btn-sm btn-outline-secondary">View</button> |
||||
<button type="button" class="btn btn-sm btn-outline-secondary">Edit</button> |
||||
</div> |
||||
<small class="text-body-secondary">9 mins</small> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
<div class="col"> |
||||
<div class="card shadow-sm"> |
||||
<svg class="bd-placeholder-img card-img-top" width="100%" height="225" xmlns="http://www.w3.org/2000/svg" role="img" aria-label="Placeholder: Thumbnail" preserveAspectRatio="xMidYMid slice" focusable="false"><title>Placeholder</title><rect width="100%" height="100%" fill="#55595c"></rect><text x="50%" y="50%" fill="#eceeef" dy=".3em">Thumbnail</text></svg> |
||||
<div class="card-body"> |
||||
<p class="card-text">This is a wider card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.</p> |
||||
<div class="d-flex justify-content-between align-items-center"> |
||||
<div class="btn-group"> |
||||
<button type="button" class="btn btn-sm btn-outline-secondary">View</button> |
||||
<button type="button" class="btn btn-sm btn-outline-secondary">Edit</button> |
||||
</div> |
||||
<small class="text-body-secondary">9 mins</small> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
|
||||
<div class="col"> |
||||
<div class="card shadow-sm"> |
||||
<svg class="bd-placeholder-img card-img-top" width="100%" height="225" xmlns="http://www.w3.org/2000/svg" role="img" aria-label="Placeholder: Thumbnail" preserveAspectRatio="xMidYMid slice" focusable="false"><title>Placeholder</title><rect width="100%" height="100%" fill="#55595c"></rect><text x="50%" y="50%" fill="#eceeef" dy=".3em">Thumbnail</text></svg> |
||||
<div class="card-body"> |
||||
<p class="card-text">This is a wider card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.</p> |
||||
<div class="d-flex justify-content-between align-items-center"> |
||||
<div class="btn-group"> |
||||
<button type="button" class="btn btn-sm btn-outline-secondary">View</button> |
||||
<button type="button" class="btn btn-sm btn-outline-secondary">Edit</button> |
||||
</div> |
||||
<small class="text-body-secondary">9 mins</small> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
<div class="col"> |
||||
<div class="card shadow-sm"> |
||||
<svg class="bd-placeholder-img card-img-top" width="100%" height="225" xmlns="http://www.w3.org/2000/svg" role="img" aria-label="Placeholder: Thumbnail" preserveAspectRatio="xMidYMid slice" focusable="false"><title>Placeholder</title><rect width="100%" height="100%" fill="#55595c"></rect><text x="50%" y="50%" fill="#eceeef" dy=".3em">Thumbnail</text></svg> |
||||
<div class="card-body"> |
||||
<p class="card-text">This is a wider card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.</p> |
||||
<div class="d-flex justify-content-between align-items-center"> |
||||
<div class="btn-group"> |
||||
<button type="button" class="btn btn-sm btn-outline-secondary">View</button> |
||||
<button type="button" class="btn btn-sm btn-outline-secondary">Edit</button> |
||||
</div> |
||||
<small class="text-body-secondary">9 mins</small> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
<div class="col"> |
||||
<div class="card shadow-sm"> |
||||
<svg class="bd-placeholder-img card-img-top" width="100%" height="225" xmlns="http://www.w3.org/2000/svg" role="img" aria-label="Placeholder: Thumbnail" preserveAspectRatio="xMidYMid slice" focusable="false"><title>Placeholder</title><rect width="100%" height="100%" fill="#55595c"></rect><text x="50%" y="50%" fill="#eceeef" dy=".3em">Thumbnail</text></svg> |
||||
<div class="card-body"> |
||||
<p class="card-text">This is a wider card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.</p> |
||||
<div class="d-flex justify-content-between align-items-center"> |
||||
<div class="btn-group"> |
||||
<button type="button" class="btn btn-sm btn-outline-secondary">View</button> |
||||
<button type="button" class="btn btn-sm btn-outline-secondary">Edit</button> |
||||
</div> |
||||
<small class="text-body-secondary">9 mins</small> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
|
||||
<div class="col"> |
||||
<div class="card shadow-sm"> |
||||
<svg class="bd-placeholder-img card-img-top" width="100%" height="225" xmlns="http://www.w3.org/2000/svg" role="img" aria-label="Placeholder: Thumbnail" preserveAspectRatio="xMidYMid slice" focusable="false"><title>Placeholder</title><rect width="100%" height="100%" fill="#55595c"></rect><text x="50%" y="50%" fill="#eceeef" dy=".3em">Thumbnail</text></svg> |
||||
<div class="card-body"> |
||||
<p class="card-text">This is a wider card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.</p> |
||||
<div class="d-flex justify-content-between align-items-center"> |
||||
<div class="btn-group"> |
||||
<button type="button" class="btn btn-sm btn-outline-secondary">View</button> |
||||
<button type="button" class="btn btn-sm btn-outline-secondary">Edit</button> |
||||
</div> |
||||
<small class="text-body-secondary">9 mins</small> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
<div class="col"> |
||||
<div class="card shadow-sm"> |
||||
<svg class="bd-placeholder-img card-img-top" width="100%" height="225" xmlns="http://www.w3.org/2000/svg" role="img" aria-label="Placeholder: Thumbnail" preserveAspectRatio="xMidYMid slice" focusable="false"><title>Placeholder</title><rect width="100%" height="100%" fill="#55595c"></rect><text x="50%" y="50%" fill="#eceeef" dy=".3em">Thumbnail</text></svg> |
||||
<div class="card-body"> |
||||
<p class="card-text">This is a wider card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.</p> |
||||
<div class="d-flex justify-content-between align-items-center"> |
||||
<div class="btn-group"> |
||||
<button type="button" class="btn btn-sm btn-outline-secondary">View</button> |
||||
<button type="button" class="btn btn-sm btn-outline-secondary">Edit</button> |
||||
</div> |
||||
<small class="text-body-secondary">9 mins</small> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
<div class="col"> |
||||
<div class="card shadow-sm"> |
||||
<svg class="bd-placeholder-img card-img-top" width="100%" height="225" xmlns="http://www.w3.org/2000/svg" role="img" aria-label="Placeholder: Thumbnail" preserveAspectRatio="xMidYMid slice" focusable="false"><title>Placeholder</title><rect width="100%" height="100%" fill="#55595c"></rect><text x="50%" y="50%" fill="#eceeef" dy=".3em">Thumbnail</text></svg> |
||||
<div class="card-body"> |
||||
<p class="card-text">This is a wider card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.</p> |
||||
<div class="d-flex justify-content-between align-items-center"> |
||||
<div class="btn-group"> |
||||
<button type="button" class="btn btn-sm btn-outline-secondary">View</button> |
||||
<button type="button" class="btn btn-sm btn-outline-secondary">Edit</button> |
||||
</div> |
||||
<small class="text-body-secondary">9 mins</small> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> --> |
||||
|
||||
<!-- <div> |
||||
<form action="return false;"> |
||||
<input type="text" name="" id="newTodoText"> |
||||
<input type="date" name="" id="newTodoDue"> |
||||
<button>Add</button> |
||||
</form> |
||||
</div> --> |
||||
|
||||
<form> |
||||
<div class="mb-3"> |
||||
<label for="new-todo-text" class="form-label">TODO</label> |
||||
<input type="text" class="form-control" id="new-todo-text"> |
||||
</div> |
||||
<div class="mb-3"> |
||||
<label for="new-todo-due" class="form-label">Due</label> |
||||
<input type="datetime-local" class="form-control" id="new-todo-due"> |
||||
</div> |
||||
<button id="new-todo-submit" class="btn btn-primary">Add</button> |
||||
</form> |
||||
|
||||
<div id="todos"> |
||||
|
||||
</div> |
||||
|
||||
<div id="groups"> |
||||
|
||||
</div> |
||||
|
||||
<script> |
||||
document.addEventListener('DOMContentLoaded', async function() { |
||||
document.getElementById("new-todo-submit").addEventListener("click", (event) => { |
||||
|
||||
}); |
||||
|
||||
let groups = []; |
||||
let todos = []; |
||||
|
||||
let username = getUsername(); |
||||
let password = getUserPassword(); |
||||
|
||||
// TODO groups |
||||
let response = await fetch("/api/group", { |
||||
method: "GET", |
||||
headers: { |
||||
"EncryptedBase64": "false", |
||||
"Auth": username + "<-->" + password |
||||
}, |
||||
}); |
||||
|
||||
let groupsJson = await response.json(); |
||||
if (response.ok) { |
||||
let groupsDiv = document.getElementById("groups"); |
||||
groupsJson.forEach((item) => { |
||||
groupsDiv.innerHTML += "<p>" + item.Name + "</p>"; |
||||
}); |
||||
} |
||||
|
||||
// TODOs |
||||
response = await fetch("/api/todo", { |
||||
method: "GET", |
||||
headers: { |
||||
"EncryptedBase64": "false", |
||||
"Auth": username + "<-->" + password |
||||
}, |
||||
}); |
||||
|
||||
let todosJson = await response.json(); |
||||
if (response.ok) { |
||||
let todosDiv = document.getElementById("todos"); |
||||
todosJson.forEach((item) => { |
||||
todosDiv.innerHTML += "<p>" + item.Text + "</p>"; |
||||
}); |
||||
// for (let i = 0; i < todosJson.length; i++) { |
||||
// console.log(todosJson[i]); |
||||
// todosDiv.innerHTML += "<p>" + todosJson[i].text + "</p>"; |
||||
// } |
||||
} |
||||
}, false) |
||||
</script> |
||||
|
||||
{{ end }} |
@ -1,9 +0,0 @@
|
||||
{{ template "base" . }} |
||||
|
||||
{{ define "content" }} |
||||
|
||||
<script> |
||||
|
||||
</script> |
||||
|
||||
{{ end }} |
Loading…
Reference in new issue