Compare commits

...

9 Commits

  1. 4
      public/index.html
  2. 17
      src/App.vue
  3. 7
      src/router/index.js
  4. 1
      src/store/index.js
  5. 15
      src/views/Menu.vue
  6. 119
      src/views/Notes.vue
  7. 24
      src/views/TasksForTracker.vue
  8. 4
      src/views/Trackers.vue

4
public/index.html

@ -5,8 +5,8 @@ @@ -5,8 +5,8 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<link rel="stylesheet" href="/app.css">
<link rel="manifest" href="/manifest.json">
<link rel="stylesheet" href="/ttrack/app.css">
<link rel="manifest" href="/ttrack/manifest.json">
<title>TTrack 🕗</title>
</head>
<body>

17
src/App.vue

@ -4,6 +4,9 @@ @@ -4,6 +4,9 @@
<Menu/>
<div class="col" id="page-wrapper">
<router-view/>
<span id="version">
v{{ version }}
</span>
</div>
</div>
</div>
@ -13,7 +16,6 @@ @@ -13,7 +16,6 @@
<TasksForTracker/>
<Tasks/>
<History/>
<Notes/>
<Settings/>
</template>
@ -28,12 +30,10 @@ import HistoryForTracker from "./views/HistoryForTracker"; @@ -28,12 +30,10 @@ import HistoryForTracker from "./views/HistoryForTracker";
import CustomBookForTracker from "./views/CustomBookForTracker";
import Settings from "./views/Settings";
import Tasks from "./views/Tasks";
import Notes from "./views/Notes";
export default {
el: '#root',
components: {
Notes,
Tasks,
Settings,
CustomBookForTracker,
@ -44,6 +44,7 @@ export default { @@ -44,6 +44,7 @@ export default {
},
data() {
return {
version: '0.8.24.1',
sounds: {
bad: [
'alert',
@ -56,7 +57,7 @@ export default { @@ -56,7 +57,7 @@ export default {
theme: 'materia',
customBookingValue: '',
customDateForPastDays: '',
newTaskInput: ''
newTaskInput: '',
}
},
mounted() {
@ -231,4 +232,12 @@ export default { @@ -231,4 +232,12 @@ export default {
#page-wrapper {
padding-top: 15px;
}
#version {
position: fixed;
bottom: 1em;
right: 2em;
z-index: -1;
color: lightgrey;
}
</style>

7
src/router/index.js

@ -3,6 +3,7 @@ import Trackers from "../views/Trackers"; @@ -3,6 +3,7 @@ import Trackers from "../views/Trackers";
import Settings from "../views/Settings";
import TrackersDetail from "../views/TrackersDetail";
import Archive from "../views/Archive";
import Notes from "../views/Notes";
Array.prototype.pushToBeginning = function (toPush) {
return this.unshift.apply(this, [toPush]);
@ -24,6 +25,11 @@ const routes = [ @@ -24,6 +25,11 @@ const routes = [
name: 'Archive',
component: Archive
},
{
path: '/notes',
name: 'Notes',
component: Notes
},
{
path: '/settings',
name: 'Settings',
@ -33,6 +39,7 @@ const routes = [ @@ -33,6 +39,7 @@ const routes = [
const router = createRouter({
history: createWebHashHistory(),
base: '/ttrack/',
routes
})

1
src/store/index.js

@ -117,6 +117,7 @@ export default createStore({ @@ -117,6 +117,7 @@ export default createStore({
},
deleteNote(state, index) {
state.notes.splice(index, 1);
localStorage.setItem('notes', JSON.stringify(state.notes));
}
}
})

15
src/views/Menu.vue

@ -46,15 +46,14 @@ @@ -46,15 +46,14 @@
</router-link>
</div>
<div class="left-menu-item">
<a type="button"
class="btn btn-info text-light bottom-menu-item"
style="background-color: #ffea77;"
data-bs-toggle="offcanvas"
data-bs-target="#notesCanvas"
data-bs-placement="top"
title="Notizen">
<router-link to="/notes"
type="button"
class="btn btn-info text-light bottom-menu-item"
style="background-color: #ffea77;"
data-bs-placement="left"
title="Notizen">
<i class="fas fa-pen"></i>
</a>
</router-link>
</div>
<div class="left-menu-item" v-if="($store.state.trackers.length + $store.state.archive.length) > 0">
<a type="button"

119
src/views/Notes.vue

@ -1,73 +1,66 @@ @@ -1,73 +1,66 @@
<template>
<div class="offcanvas offcanvas-end" id="notesCanvas"
aria-hidden="true">
<div class="offcanvas-header">
<h5><i class="fa fa-pen"></i> Notizen</h5>
<div class="row">
<div class="col-md-12">
<div class="float-end">
<a href="javascript:" v-on:click="createNote()" class="btn btn-sm btn-success">Neue Notiz</a>
</div>
</div>
<div class="filter-wrapper">
<div v-if="$store.state.notes.length > 0">
<a href="javascript:"
v-if="colorToFilter !== ''"
v-on:click="colorToFilter = ''"
class="color-change-button disable-filter-button"
:style="'background-color: '+colorToFilter">
Filter aus
</a>
<span v-for="color in noteColors"
v-bind:key="color">
<div v-if="$store.state.notes.length > 0" class="filter-wrapper">
<a href="javascript:"
v-if="colorToFilter !== color"
v-on:click="colorToFilter = color"
class="color-change-button"
:style="'background-color: ' + color">
<i class="fas fa-filter filter-icon"></i>
v-if="colorToFilter !== ''"
v-on:click="colorToFilter = ''"
class="color-change-button disable-filter-button"
:style="'background-color: '+colorToFilter">
Filter aus
</a>
</span>
</div>
</div>
<div class="offcanvas-body">
<div class="row">
<div id="note-container">
<template v-for="(note, noteIndex) in $store.state.notes" v-bind:key="noteIndex">
<div v-if="colorToFilter === '' || note.color === colorToFilter">
<div class="card">
<div class="card-body note" :style="'background-color:' + note.color ?? '#ffea77'">
<textarea v-model="note.body" spellcheck="false"
@keydown="this.$store.commit('saveNotes')"></textarea>
<div class="color-changer">
<span v-for="color in noteColors"
v-bind:key="color">
<span href="javascript:"
@click="changeColor(note, color);"
class="color-change-button"
v-if="color !== note.color"
:style="'background-color: ' + color">
</span>
</span>
</div>
<div class="float-end">
<a href="javascript:" class="delete-button"
@click="$store.commit('deleteNote', noteIndex)"><i class="fas fa-trash"></i></a>
</div>
</div>
</div>
</div>
</template>
<span v-if="colorToFilter !== '' && !notesExistInFilteredColor">
Keine Notizen mit gewählter Farbe vorhanden<br>
<span v-for="color in noteColors"
v-bind:key="color">
<a href="javascript:"
class="color-change-button disable-filter-button"
:style="'background-color: '+colorToFilter"
v-on:click="colorToFilter = ''">
Filter ausschalten
v-if="colorToFilter !== color"
v-on:click="colorToFilter = color"
class="color-change-button"
:style="'background-color: ' + color">
<i class="fas fa-filter filter-icon"></i>
</a>
</span>
</div>
<a href="javascript:" v-on:click="createNote()" class="btn btn-sm btn-success">Neue Notiz</a>
</div>
<h5><i class="fa fa-pen"></i> Notizen</h5>
</div>
<template v-for="(note, noteIndex) in $store.state.notes" v-bind:key="noteIndex">
<div v-if="colorToFilter === '' || note.color === colorToFilter" class="col-sm-6 col-md-4 col-lg-3 card-box">
<div class="card">
<div class="card-body note"
:style="'background-color:' + note.color ?? '#ffea77'">
<textarea v-model="note.body" spellcheck="false"
@keydown="this.$store.commit('saveNotes')"></textarea>
<div class="color-changer">
<span v-for="color in noteColors" v-bind:key="color">
<span href="javascript:"
@click="changeColor(note, color);"
class="color-change-button"
v-if="color !== note.color"
:style="'background-color: ' + color">
</span>
</span>
</div>
<div class="float-end">
<a href="javascript:" class="delete-button"
@click="$store.commit('deleteNote', noteIndex)"><i
class="fas fa-trash"></i></a>
</div>
</div>
</div>
</div>
</template>
<span v-if="colorToFilter !== '' && !notesExistInFilteredColor">
Keine Notizen mit gewählter Farbe vorhanden<br>
<a href="javascript:"
class="color-change-button disable-filter-button"
:style="'background-color: '+colorToFilter"
v-on:click="colorToFilter = ''">
Filter ausschalten
</a>
</span>
</div>
</template>
@ -186,6 +179,12 @@ textarea:focus { @@ -186,6 +179,12 @@ textarea:focus {
}
.filter-wrapper {
display: inline-block;
margin: 0.3em 1em;
}
.card-box {
margin-top: 0.5em;
margin-bottom: 0.5em;
}
</style>

24
src/views/TasksForTracker.vue

@ -83,13 +83,23 @@ export default { @@ -83,13 +83,23 @@ export default {
this.$store.state.selectedTracker.tasks = [];
}
this.$store.state.selectedTracker.tasks.pushToBeginning({
name: this.newTaskInput,
done: false,
created: moment(),
percentDone: 0,
finished: null
});
let newTasks = [];
if (this.newTaskInput.split(';').length > 3) {
newTasks = this.newTaskInput.split(';').reverse().map((task) => task.trim());
} else {
newTasks.push(this.newTaskInput);
}
newTasks.forEach((task) => {
this.$store.state.selectedTracker.tasks.pushToBeginning({
name: task,
done: false,
created: moment(),
percentDone: 0,
finished: null
});
})
this.newTaskInput = '';
this.$store.commit('saveTrackers');

4
src/views/Trackers.vue

@ -16,9 +16,7 @@ @@ -16,9 +16,7 @@
<div class="row">
<div v-if="tracker.tracking === true">
<div class="text-danger font-weight-bolder float-end tracker-time-info">
<div class="spinner-grow spinner-grow-sm" role="status">
<span class="sr-only">Tracking...</span>
</div>
<div class="spinner-grow spinner-grow-sm" role="status"></div>
Tracking (<i class="fas fa-play"></i> {{ getTrackingStartTime(tracker) }})
</div>
</div>

Loading…
Cancel
Save