ViewPunishment.vue 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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>
  8. {{ punishment.type }}
  9. <br />
  10. <strong>Value:</strong>
  11. {{ punishment.value }}
  12. <br />
  13. <strong>Reason:</strong>
  14. {{ punishment.reason }}
  15. <br />
  16. <strong>Active:</strong>
  17. {{ punishment.active }}
  18. <br />
  19. <strong>Expires at:</strong>
  20. {{ moment(punishment.expiresAt).format('MMMM Do YYYY, h:mm:ss a') }} ({{ moment(punishment.expiresAt).fromNow() }})
  21. <br />
  22. <strong>Punished at:</strong>
  23. {{ moment(punishment.punishedAt).format('MMMM Do YYYY, h:mm:ss a') }} ({{ moment(punishment.punishedAt).fromNow() }})
  24. <br />
  25. <strong>Punished by:</strong>
  26. {{ punishment.punishedBy }}
  27. <br />
  28. </div>
  29. </article>
  30. </div>
  31. <div slot="footer">
  32. <button class="button is-danger" v-on:click="$parent.toggleModal()">
  33. <span>&nbsp;Close</span>
  34. </button>
  35. </div>
  36. </modal>
  37. </div>
  38. </template>
  39. <script>
  40. import { mapState } from "vuex";
  41. import io from "../../io";
  42. import { Toast } from "vue-roaster";
  43. import Modal from "./Modal.vue";
  44. import validation from "../../validation";
  45. export default {
  46. components: { Modal },
  47. data() {
  48. return {
  49. ban: {},
  50. moment
  51. };
  52. },
  53. computed: {
  54. ...mapState("admin/punishments", {
  55. punishment: state => state.punishment
  56. })
  57. },
  58. methods: {},
  59. mounted: function() {
  60. let _this = this;
  61. io.getSocket(socket => (_this.socket = socket));
  62. }
  63. };
  64. </script>