You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

81 lines
1.6 KiB

  1. <template lang='pug'>
  2. v-app(:dark='darkMode').source
  3. nav-header
  4. v-content
  5. v-toolbar(color='primary', dark)
  6. .subheading Viewing source of page #[strong /{{path}}]
  7. v-spacer
  8. .caption.blue--text.text--lighten-3 ID {{pageId}}
  9. v-btn.ml-4(depressed, color='blue darken-1', @click='goLive') Return to Normal View
  10. v-card(tile)
  11. v-card-text
  12. v-card.grey.radius-7(flat, :class='darkMode ? `darken-4` : `lighten-4`')
  13. v-card-text
  14. pre
  15. code
  16. slot
  17. nav-footer
  18. </template>
  19. <script>
  20. import { get } from 'vuex-pathify'
  21. export default {
  22. props: {
  23. pageId: {
  24. type: Number,
  25. default: 0
  26. },
  27. locale: {
  28. type: String,
  29. default: 'en'
  30. },
  31. path: {
  32. type: String,
  33. default: 'home'
  34. }
  35. },
  36. data() {
  37. return {}
  38. },
  39. computed: {
  40. darkMode: get('site/dark')
  41. },
  42. created () {
  43. this.$store.commit('page/SET_ID', this.id)
  44. this.$store.commit('page/SET_LOCALE', this.locale)
  45. this.$store.commit('page/SET_PATH', this.path)
  46. this.$store.commit('page/SET_MODE', 'history')
  47. },
  48. methods: {
  49. goLive() {
  50. window.location.assign(`/${this.path}`)
  51. }
  52. }
  53. }
  54. </script>
  55. <style lang='scss'>
  56. .source {
  57. pre > code {
  58. box-shadow: none;
  59. color: mc('grey', '800');
  60. font-family: 'Source Code Pro', sans-serif;
  61. font-weight: 400;
  62. font-size: 1rem;
  63. @at-root .theme--dark.source pre > code {
  64. background-color: mc('grey', '900');
  65. color: mc('grey', '400');
  66. }
  67. &::before {
  68. display: none;
  69. }
  70. }
  71. }
  72. </style>