diff --git a/css/app.css b/css/app.css
index 5d3c796..abd2d79 100644
--- a/css/app.css
+++ b/css/app.css
@@ -222,3 +222,15 @@ nav, .card {
bottom: 0;
left: 0;
}
+
+.finished-task {
+ text-decoration: line-through;
+}
+
+#trackerTasksModal a li {
+ color: black !important;
+}
+
+#trackerTasksModal input[type=range] {
+ width: 100%;
+}
diff --git a/index.html b/index.html
index f0ee5ed..826cb41 100644
--- a/index.html
+++ b/index.html
@@ -92,6 +92,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+ {{ task.name }}
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+ {{ task.name }}
+
+
+
+
+
+
+
+
{
let historyModal = new bootstrap.Modal(document.getElementById('historyModal'));
historyModal.toggle();
}, 50);
},
+ openTasksForTracker(tracker) {
+ this.selectedTracker = tracker;
+ this.$forceUpdate();
+ setTimeout(() => {
+ let tasksModal = new bootstrap.Modal(document.getElementById('trackerTasksModal'));
+ tasksModal.toggle();
+ }, 50);
+ },
showCustomBookingForTracker(ticket) {
this.selectedTracker = ticket;
this.$forceUpdate();
@@ -677,10 +686,52 @@ const TimeTrack = {
tellJoke(category, language = 'en') {
let jokeService = new JokeService(category ?? undefined, language);
jokeService.tell();
+ },
+ addTask() {
+ if (this.newTaskInput.length <= 0 || this.newTaskInput.trim() === '') {
+ return false;
+ }
+
+ if (!this.selectedTracker.tasks) {
+ this.selectedTracker.tasks = [];
+ }
+
+ this.selectedTracker.tasks.push({
+ name: this.newTaskInput,
+ done: false,
+ created: moment(),
+ percentDone: 0,
+ finished: null
+ });
+
+ this.newTaskInput = '';
+ this.updateStorage();
+ },
+ deleteTask(taskIndex) {
+ this.selectedTracker.tasks.splice(taskIndex, 1)
+ this.updateStorage();
+ },
+ toggleTask(task) {
+ task.done = !task.done;
+
+ if (task.done) {
+ task.finished = moment();
+ task.percentDone = 100;
+ } else {
+ task.finished = null;
+ task.percentDone = 0;
+ }
+
+ this.updateStorage();
+ },
+ checkForCompletionOfTask(task) {
+ task.done = task.percentDone == 100;
+ this.$forceUpdate();
+ this.updateStorage();
}
},
beforeDestroy() {
- this.stopTrackingTicket();
+ this.stopActiveTracker();
},
watch: {
publicDB() {