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.

244 lines
7.1 KiB

6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
  1. <template lang='pug'>
  2. v-bottom-sheet(
  3. v-model='isShown'
  4. inset
  5. )
  6. .dialog-header
  7. v-icon(color='white') sort_by_alpha
  8. .subheading.white--text.ml-2 Page Properties
  9. v-spacer
  10. v-btn.mx-0(
  11. outline
  12. dark
  13. @click.native='close'
  14. )
  15. v-icon(left) check
  16. span {{ $t('common:actions.ok') }}
  17. v-menu
  18. v-btn.is-icon(
  19. slot='activator'
  20. outline
  21. dark
  22. )
  23. v-icon more_horiz
  24. v-list
  25. v-list-tile
  26. v-list-tile-avatar: v-icon delete
  27. v-list-tile-title Delete Page
  28. v-card(tile)
  29. v-card-text
  30. v-subheader.pl-0 Page Info
  31. v-text-field(
  32. ref='iptTitle'
  33. outline
  34. background-color='grey lighten-2'
  35. label='Title'
  36. counter='255'
  37. v-model='title'
  38. )
  39. v-text-field(
  40. outline
  41. background-color='grey lighten-2'
  42. label='Short Description'
  43. counter='255'
  44. v-model='description'
  45. )
  46. v-divider
  47. v-card-text.grey.lighten-5
  48. v-subheader.pl-0 Path &amp; Categorization
  49. v-container.pa-0(fluid, grid-list-lg)
  50. v-layout(row, wrap)
  51. v-flex(xs12, md2)
  52. v-select(
  53. outline
  54. background-color='grey lighten-2'
  55. label='Locale'
  56. suffix='/'
  57. :items='namespaces'
  58. v-model='locale'
  59. hide-details
  60. :disabled='mode !== "create"'
  61. )
  62. v-flex(xs12, md10)
  63. v-text-field(
  64. outline
  65. background-color='grey lighten-2'
  66. label='Path'
  67. append-icon='folder'
  68. v-model='path'
  69. hint='Do not include any leading or trailing slashes.'
  70. persistent-hint
  71. @click:append='showPathSelector'
  72. :disabled='mode !== "create"'
  73. )
  74. v-combobox(
  75. background-color='grey lighten-2'
  76. chips
  77. deletable-chips
  78. label='Tags'
  79. outline
  80. multiple
  81. v-model='tags'
  82. single-line
  83. hint='Use tags to categorize your pages and make them easier to find.'
  84. persistent-hint
  85. )
  86. v-divider
  87. v-card-text.pb-5.grey.lighten-4
  88. v-subheader.pl-0 Publishing State
  89. v-container.pa-0(fluid, grid-list-lg)
  90. v-layout(row, wrap)
  91. v-flex(xs12, md4)
  92. v-switch(
  93. label='Published'
  94. v-model='isPublished'
  95. color='primary'
  96. hint='Unpublished pages can still be seen by users having write permissions.'
  97. persistent-hint
  98. )
  99. v-flex(xs12, md4)
  100. v-dialog(
  101. ref='menuPublishStart'
  102. lazy
  103. :close-on-content-click='false'
  104. v-model='isPublishStartShown'
  105. :return-value.sync='publishStartDate'
  106. full-width
  107. width='460px'
  108. :disabled='!isPublished'
  109. )
  110. v-text-field(
  111. slot='activator'
  112. label='Publish starting on...'
  113. v-model='publishStartDate'
  114. prepend-icon='event'
  115. readonly
  116. outline
  117. background-color='grey lighten-2'
  118. clearable
  119. hint='Leave empty for no start date'
  120. persistent-hint
  121. :disabled='!isPublished'
  122. )
  123. v-date-picker(
  124. v-model='publishStartDate'
  125. :min='(new Date()).toISOString().substring(0, 10)'
  126. color='primary'
  127. reactive
  128. scrollable
  129. landscape
  130. )
  131. v-spacer
  132. v-btn(
  133. flat=''
  134. color='primary'
  135. @click='isPublishStartShown = false'
  136. ) Cancel
  137. v-btn(
  138. flat=''
  139. color='primary'
  140. @click='$refs.menuPublishStart.save(publishStartDate)'
  141. ) OK
  142. v-flex(xs12, md4)
  143. v-dialog(
  144. ref='menuPublishEnd'
  145. lazy
  146. :close-on-content-click='false'
  147. v-model='isPublishEndShown'
  148. :return-value.sync='publishEndDate'
  149. full-width
  150. width='460px'
  151. :disabled='!isPublished'
  152. )
  153. v-text-field(
  154. slot='activator'
  155. label='Publish ending on...'
  156. v-model='publishEndDate'
  157. prepend-icon='event'
  158. readonly
  159. outline
  160. background-color='grey lighten-2'
  161. clearable
  162. hint='Leave empty for no end date'
  163. persistent-hint
  164. :disabled='!isPublished'
  165. )
  166. v-date-picker(
  167. v-model='publishEndDate'
  168. :min='(new Date()).toISOString().substring(0, 10)'
  169. color='primary'
  170. reactive
  171. scrollable
  172. landscape
  173. )
  174. v-spacer
  175. v-btn(
  176. flat=''
  177. color='primary'
  178. @click='isPublishEndShown = false'
  179. ) Cancel
  180. v-btn(
  181. flat=''
  182. color='primary'
  183. @click='$refs.menuPublishEnd.save(publishEndDate)'
  184. ) OK
  185. v-tour(name='editorPropertiesTour', :steps='tourSteps')
  186. </template>
  187. <script>
  188. import _ from 'lodash'
  189. import { sync, get } from 'vuex-pathify'
  190. export default {
  191. data() {
  192. return {
  193. isShown: false,
  194. isPublishStartShown: false,
  195. isPublishEndShown: false,
  196. namespaces: ['en'],
  197. tourSteps: [
  198. {
  199. target: '.dialog-header',
  200. content: `First-time tour help here. <strong>TODO</strong>!`
  201. }
  202. ]
  203. }
  204. },
  205. computed: {
  206. mode: get('editor/mode'),
  207. title: sync('editor/title'),
  208. description: sync('editor/description'),
  209. locale: sync('editor/locale'),
  210. tags: sync('editor/tags'),
  211. path: sync('editor/path'),
  212. isPublished: sync('editor/isPublished'),
  213. publishStartDate: sync('editor/publishStartDate'),
  214. publishEndDate: sync('editor/publishEndDate')
  215. },
  216. mounted() {
  217. this.isShown = true
  218. _.delay(() => {
  219. this.$refs.iptTitle.focus()
  220. // this.$tours['editorPropertiesTour'].start()
  221. }, 500)
  222. },
  223. methods: {
  224. close() {
  225. this.isShown = false
  226. this.$parent.$parent.closeModal()
  227. },
  228. showPathSelector() {
  229. this.$store.commit('showNotification', {
  230. message: 'Coming soon!',
  231. style: 'purple',
  232. icon: 'directions_boat'
  233. })
  234. }
  235. }
  236. }
  237. </script>
  238. <style lang='scss'>
  239. </style>