Skip to content
Snippets Groups Projects
EmissionManagerModalEdit.vue 1.28 KiB
Newer Older
<template>
  <div>
    <b-modal
      ref="modalEmissionManagerEdit"
      title="Edit a schedule"
      size="lg"
    >
      <p>
        Editing a timeslot/schedule for show:
        <b v-if="loaded.modal">
          <b>{{ show.name }}</b>
        </b>
      </p>

      <p v-if="loaded.modal">
        This timeslot starts at
        <b-badge>
          {{ prettyDateTime(timeslot.start) }}
        </b-badge>
        and ends at
        <b-badge>
          {{ prettyDateTime(timeslot.end) }}
        </b-badge>
        .
      </p>
    </b-modal>
  </div>
</template>

<script>
//import axios from 'axios'
import prettyDate from '../mixins/prettyDate'
import rrules from '../mixins/rrules'

export default {
  mixins: [ prettyDate, rrules ],

  data () {
    return {
      timeslot: null,
      schedule: null,
      show: null,
      loaded: {
        modal: false,
        schedule: false,
      }
    }
  },

  methods: {

    // initialise a new schedule and open the modal
    open (timeslot, show) {
      this.$log.debug('ModalEdit.open(): timeslot:', timeslot)
      this.$log.debug('ModalEdit.open(): show:', show)
      this.timeslot = timeslot
      this.show = show
      this.loaded.modal = true
      this.$refs.modalEmissionManagerEdit.show()
    },
  }
}
</script>

<style scoped>
</style>