Compare commits

..

7 Commits

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

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>

6
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',

3
src/store/index.js

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
import {createStore} from 'vuex'
import {createStore} from 'vuex'
import moment from "moment";
export default createStore({
@ -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>

45
src/views/PluginStore.vue

@ -1,45 +0,0 @@ @@ -1,45 +0,0 @@
<template>
<div class="offcanvas offcanvas-end" id="moduleStoreCanvas"
aria-hidden="true">
<div class="offcanvas-header">
<h5><i class="fa-solid fa-puzzle-piece"></i> Plugins</h5>
<button type="button" class="btn-close" data-bs-dismiss="offcanvas" aria-label="Close"></button>
</div>
<div class="offcanvas-body">
<div class="col-12" v-for="(plugin, pluginKey) in plugins" v-bind:key="pluginKey">
<div class="card" :style="'background-color: '+plugin.color">
<div class="plugin-card-icon">
<i :class="plugin.icon"></i>
</div>
<div class="card-body">
{{ plugin.name }}
</div>
</div>
</div>
</div>
</div>
</template>
<script>
export default {
name: "PluginStore",
data() {
return {
plugins: {
notes: {
name: 'Notizen',
icon: 'fa-solid fa-pencil',
color: '#ffea77',
active: true
}
}
}
}
}
</script>
<style scoped>
.plugin-card-icon {
display: inline-block;
}
</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');

Loading…
Cancel
Save