repos
/ timestrap-django master

timestrap-django

mirror archived upstream

Time tracking you can host anywhere, built on Django. Full export support in multiple formats and easily extensible.

djangodockerhandcodedpythonself-hostedtime-trackingtimetracker

1018 B · 57 lines · vue Raw History
 1<template>
 2<div class="modal" data-keyboard="false">
 3  <div class="modal-dialog modal-lg modal-dialog-centered">
 4    <form @submit.prevent="submit" class="modal-content border-0 shadow">
 5      <div class="modal-body">
 6        <slot name="modal-body"/>
 7        <button
 8          id="modal-submit"
 9          class="btn btn-lg btn-dark shadow-sm mt-5"
10          type="submit">
11          Save
12        </button>
13      </div>
14    </form>
15  </div>
16</div>
17</template>
18
19
20<script>
21import $ from 'jquery';
22
23
24export default {
25  props: [
26    'edit',
27    'create',
28    'data',
29  ],
30  methods: {
31    submit() {
32      if (this.data.id) this.edit(this.data);
33      else this.create(this.data);
34      $(this.$el).modal('hide');
35    },
36  },
37  mounted() {
38    $(this.$el).modal('show');
39    $(this.$el).on('hidden.bs.modal', function() {
40      this.$emit('close');
41    }.bind(this));
42  },
43};
44</script>
45
46
47<style lang="scss" scoped>
48.modal-body {
49  padding: 4rem;
50}
51
52.form-control-title {
53  font-size: 2rem;
54  font-weight: bold;
55}
56</style>