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.

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