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.

85 lines
1.8 KiB

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