ViewPunishment.vue 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <template>
  2. <div>
  3. <modal title='View Punishment'>
  4. <div slot='body'>
  5. <article class="message">
  6. <div class="message-body">
  7. <strong>Type: </strong>{{ punishment.type }}<br/>
  8. <strong>Value: </strong>{{ punishment.value }}<br/>
  9. <strong>Reason: </strong>{{ punishment.reason }}<br/>
  10. <strong>Active: </strong>{{ punishment.active }}<br/>
  11. <strong>Expires at: </strong>{{ moment(punishment.expiresAt).format('MMMM Do YYYY, h:mm:ss a'); }} ({{ moment(punishment.expiresAt).fromNow() }})<br/>
  12. <strong>Punished at: </strong>{{ moment(punishment.punishedAt).format('MMMM Do YYYY, h:mm:ss a') }} ({{ moment(punishment.punishedAt).fromNow() }})<br/>
  13. <strong>Punished by: </strong>{{ punishment.punishedBy }}<br/>
  14. </div>
  15. </article>
  16. </div>
  17. <div slot='footer'>
  18. <button class='button is-danger' @click='$parent.toggleModal()'>
  19. <span>&nbsp;Close</span>
  20. </button>
  21. </div>
  22. </modal>
  23. </div>
  24. </template>
  25. <script>
  26. import io from '../../io';
  27. import { Toast } from 'vue-roaster';
  28. import Modal from './Modal.vue';
  29. import validation from '../../validation';
  30. export default {
  31. components: { Modal },
  32. data() {
  33. return {
  34. punishment: {},
  35. ban: {},
  36. moment
  37. }
  38. },
  39. methods: {},
  40. ready: function () {
  41. let _this = this;
  42. io.getSocket(socket => _this.socket = socket );
  43. },
  44. events: {
  45. closeModal: function () {
  46. this.$parent.modals.viewPunishment = false;
  47. },
  48. viewPunishment: function (punishment) {
  49. this.punishment = {
  50. type: punishment.type,
  51. value: punishment.value,
  52. reason: punishment.reason,
  53. active: punishment.active,
  54. expiresAt: punishment.expiresAt,
  55. punishedAt: punishment.punishedAt,
  56. punishedBy: punishment.punishedBy
  57. };
  58. this.$parent.toggleModal();
  59. }
  60. }
  61. }
  62. </script>