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.

83 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. notify
  19. search-results
  20. </template>
  21. <script>
  22. import { get } from 'vuex-pathify'
  23. export default {
  24. props: {
  25. pageId: {
  26. type: Number,
  27. default: 0
  28. },
  29. locale: {
  30. type: String,
  31. default: 'en'
  32. },
  33. path: {
  34. type: String,
  35. default: 'home'
  36. }
  37. },
  38. data() {
  39. return {}
  40. },
  41. computed: {
  42. darkMode: get('site/dark')
  43. },
  44. created () {
  45. this.$store.commit('page/SET_ID', this.id)
  46. this.$store.commit('page/SET_LOCALE', this.locale)
  47. this.$store.commit('page/SET_PATH', this.path)
  48. this.$store.commit('page/SET_MODE', 'history')
  49. },
  50. methods: {
  51. goLive() {
  52. window.location.assign(`/${this.path}`)
  53. }
  54. }
  55. }
  56. </script>
  57. <style lang='scss'>
  58. .source {
  59. pre > code {
  60. box-shadow: none;
  61. color: mc('grey', '800');
  62. font-family: 'Source Code Pro', sans-serif;
  63. font-weight: 400;
  64. font-size: 1rem;
  65. @at-root .theme--dark.source pre > code {
  66. background-color: mc('grey', '900');
  67. color: mc('grey', '400');
  68. }
  69. &::before {
  70. display: none;
  71. }
  72. }
  73. }
  74. </style>