index.vue 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. <template>
  2. <div>
  3. <Header
  4. title="Manage your Blogs"
  5. exitLink="/"
  6. />
  7. <div class="instructor-blogs">
  8. <div class="container">
  9. <div class="section">
  10. <div class="header-block">
  11. <h2>Your Stories</h2>
  12. <div class="title-menu">
  13. <button @click="$router.push('/instructor/blog/editor')" class="button">Write a story</button>
  14. </div>
  15. </div>
  16. <div class="tabs">
  17. <ul>
  18. <li><a>Drafts</a></li>
  19. <li><a>Published</a></li>
  20. </ul>
  21. </div>
  22. <div class="blogs-container">
  23. <template>
  24. <div>
  25. <div class="blog-card">
  26. <h2>Some Title</h2>
  27. <div class="blog-card-footer">
  28. <span>
  29. Last Edited 17th December, 2018
  30. </span>
  31. <!-- Dropdown with menu here -->
  32. </div>
  33. </div>
  34. <div class="blog-card">
  35. <h2>Some Title</h2>
  36. <div class="blog-card-footer">
  37. <span>
  38. Last Edited 17th December, 2018
  39. </span>
  40. <!-- Dropdown with menu here -->
  41. </div>
  42. </div>
  43. </div>
  44. <!-- In case of no drafts blogs -->
  45. <!-- <div class="blog-error">
  46. No Drafts :(
  47. </div> -->
  48. </template>
  49. </div>
  50. </div>
  51. </div>
  52. </div>
  53. </div>
  54. </template>
  55. <script>
  56. import Header from '~/components/shared/Header'
  57. export default {
  58. layout: 'instructor',
  59. components: {Header},
  60. async fetch({store}) {
  61. await store.dispatch('instructor/blog/fetchUserBlogs')
  62. }
  63. }
  64. </script>
  65. <style scoped lang="scss">
  66. .blog-error {
  67. font-size: 35px;
  68. }
  69. .blog-card {
  70. border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  71. padding: 20px 0;
  72. > h2 {
  73. font-size: 30px;
  74. font-weight: bold;
  75. }
  76. &-footer {
  77. color: rgba(0, 0, 0, 0.54);
  78. }
  79. &.featured {
  80. border-left: 5px solid #3cc314;
  81. padding-left: 10px;
  82. transition: border ease-out 0.2s;
  83. }
  84. }
  85. .header-block {
  86. display: flex;
  87. flex-direction: row;
  88. align-items: center;
  89. > h2 {
  90. font-size: 40px;
  91. font-weight: bold;
  92. }
  93. .title-menu {
  94. margin-left: auto;
  95. }
  96. }
  97. </style>