frontend/src/components/lists/views/Gantt.vue
konrad 4b3f92ae34 Custom backgrounds for lists (#144)
Make backgrounds list responsive

Show initial collection of backgrounds

Remove test data

Fix "backgroundInformation is null" when navigating

Fix kanban height

Remove debug log

Move list title to top header

Add styling for title in top header

Set the current list (and background) when loading settings

Only load the background if it changed

Make task detail view look good again

Fix bottom spacing

Make list and table view look good again

Make pages with background at least 100vh

Fix kanban height

Make extra buttons look good again

Move list title and view-switcher in one row

Add styling for backgrounds

Set background globally

Add getting list background and putting it in vuex

Add setting list background

Move list background setting to seperate list

Add search timeout to not search on every keypress

Add getting thumbnails through api

Add basic search for unsplash backgrounds

Co-authored-by: kolaente <k@knt.li>
Reviewed-on: vikunja/frontend#144
2020-05-31 19:17:10 +00:00

99 lines
2.5 KiB
Vue

<template>
<div class="gantt-chart-container">
<div class="gantt-options">
<fancycheckbox v-model="showTaskswithoutDates" class="is-block">
Show tasks which don't have dates set
</fancycheckbox>
<div class="range-picker">
<div class="field">
<label class="label" for="dayWidth">Size</label>
<div class="control">
<div class="select">
<select id="dayWidth" v-model.number="dayWidth">
<option value="35">Default</option>
<option value="10">Month</option>
<option value="80">Day</option>
</select>
</div>
</div>
</div>
<div class="field">
<label class="label" for="fromDate">From</label>
<div class="control">
<flat-pickr
class="input"
v-model="dateFrom"
:config="flatPickerConfig"
id="fromDate"
placeholder="From"
/>
</div>
</div>
<div class="field">
<label class="label" for="toDate">To</label>
<div class="control">
<flat-pickr
class="input"
v-model="dateTo"
:config="flatPickerConfig"
id="toDate"
placeholder="To"
/>
</div>
</div>
</div>
</div>
<gantt-chart
:list-id="Number($route.params.listId)"
:show-taskswithout-dates="showTaskswithoutDates"
:date-from="dateFrom"
:date-to="dateTo"
:day-width="dayWidth"
/>
<!-- This router view is used to show the task popup while keeping the gantt chart itself -->
<transition name="modal">
<router-view/>
</transition>
</div>
</template>
<script>
import GanttChart from '../../tasks/gantt-component'
import flatPickr from 'vue-flatpickr-component'
import Fancycheckbox from '../../global/fancycheckbox'
import {saveListView} from '../../../helpers/saveListView'
export default {
name: 'Gantt',
components: {
Fancycheckbox,
flatPickr,
GanttChart
},
created() {
// Save the current list view to local storage
// We use local storage and not vuex here to make it persistent across reloads.
saveListView(this.$route.params.listId, this.$route.name)
},
data() {
return {
showTaskswithoutDates: false,
dayWidth: 35,
dateFrom: null,
dateTo: null,
flatPickerConfig:{
altFormat: 'j M Y',
altInput: true,
dateFormat: 'Y-m-d',
enableTime: false,
},
}
},
beforeMount() {
this.dateFrom = new Date((new Date()).setDate((new Date()).getDate() - 15))
this.dateTo = new Date((new Date()).setDate((new Date()).getDate() + 30))
},
}
</script>