index.vue 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  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. <!-- set here active tab -->
  19. <li @click="activeTab = 0">
  20. <a :class="{'is-active': activeTab === 0}">Drafts</a>
  21. </li>
  22. <!-- set here active tab -->
  23. <li @click="activeTab = 1">
  24. <a :class="{'is-active': activeTab === 1}">Published</a>
  25. </li>
  26. </ul>
  27. </div>
  28. <div class="blogs-container">
  29. <template v-if="activeTab === 0">
  30. <div>
  31. <div class="blog-card">
  32. <h2>Some Title</h2>
  33. <div class="blog-card-footer">
  34. <span>
  35. Last Edited 17th December, 2018
  36. </span>
  37. <!-- Dropdown with menu here -->
  38. </div>
  39. </div>
  40. <div class="blog-card">
  41. <h2>Some Title</h2>
  42. <div class="blog-card-footer">
  43. <span>
  44. Last Edited 17th December, 2018
  45. </span>
  46. <!-- Dropdown with menu here -->
  47. </div>
  48. </div>
  49. </div>
  50. <!-- In case of no drafts blogs -->
  51. <!-- <div class="blog-error">
  52. No Drafts :(
  53. </div> -->
  54. </template>
  55. <template v-if="activeTab === 1">
  56. <div>
  57. <div class="blog-card">
  58. <h2>Published Blog</h2>
  59. <div class="blog-card-footer">
  60. <span>
  61. Last Edited 17th December, 2018
  62. </span>
  63. <!-- Dropdown with menu here -->
  64. </div>
  65. </div>
  66. <div class="blog-card">
  67. <h2>Published Blog</h2>
  68. <div class="blog-card-footer">
  69. <span>
  70. Last Edited 17th December, 2018
  71. </span>
  72. <!-- Dropdown with menu here -->
  73. </div>
  74. </div>
  75. </div>
  76. <!-- In case of no drafts blogs -->
  77. <!-- <div class="blog-error">
  78. No Drafts :(
  79. </div> -->
  80. </template>
  81. </div>
  82. </div>
  83. </div>
  84. </div>
  85. </div>
  86. </template>
  87. <script>
  88. import Header from '~/components/shared/Header'
  89. export default {
  90. layout: 'instructor',
  91. components: {Header},
  92. data() {
  93. return {
  94. activeTab: 0
  95. }
  96. },
  97. async fetch({store}) {
  98. await store.dispatch('instructor/blog/fetchUserBlogs')
  99. }
  100. }
  101. </script>
  102. <style scoped lang="scss">
  103. .is-active {
  104. border-bottom-color: #363636;
  105. color: #363636;
  106. }
  107. .blog-error {
  108. font-size: 35px;
  109. }
  110. .blog-card {
  111. border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  112. padding: 20px 0;
  113. > h2 {
  114. font-size: 30px;
  115. font-weight: bold;
  116. }
  117. &-footer {
  118. color: rgba(0, 0, 0, 0.54);
  119. }
  120. &.featured {
  121. border-left: 5px solid #3cc314;
  122. padding-left: 10px;
  123. transition: border ease-out 0.2s;
  124. }
  125. }
  126. .header-block {
  127. display: flex;
  128. flex-direction: row;
  129. align-items: center;
  130. > h2 {
  131. font-size: 40px;
  132. font-weight: bold;
  133. }
  134. .title-menu {
  135. margin-left: auto;
  136. }
  137. }
  138. </style>