123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139 |
- <template>
- <div>
- <Header
- title="Manage your Blogs"
- exitLink="/"
- />
- <div class="instructor-blogs">
- <div class="container">
- <div class="section">
- <div class="header-block">
- <h2>Your Stories</h2>
- <div class="title-menu">
- <button @click="$router.push('/instructor/blog/editor')" class="button">Write a story</button>
- </div>
- </div>
- <div class="tabs">
- <ul>
- <!-- set here active tab -->
- <li @click="activeTab = 0">
- <a :class="{'is-active': activeTab === 0}">Drafts</a>
- </li>
- <!-- set here active tab -->
- <li @click="activeTab = 1">
- <a :class="{'is-active': activeTab === 1}">Published</a>
- </li>
- </ul>
- </div>
- <div class="blogs-container">
- <template v-if="activeTab === 0">
- <div>
- <div class="blog-card">
- <h2>Some Title</h2>
- <div class="blog-card-footer">
- <span>
- Last Edited 17th December, 2018
- </span>
- <!-- Dropdown with menu here -->
- </div>
- </div>
- <div class="blog-card">
- <h2>Some Title</h2>
- <div class="blog-card-footer">
- <span>
- Last Edited 17th December, 2018
- </span>
- <!-- Dropdown with menu here -->
- </div>
- </div>
- </div>
- <!-- In case of no drafts blogs -->
- <!-- <div class="blog-error">
- No Drafts :(
- </div> -->
- </template>
- <template v-if="activeTab === 1">
- <div>
- <div class="blog-card">
- <h2>Published Blog</h2>
- <div class="blog-card-footer">
- <span>
- Last Edited 17th December, 2018
- </span>
- <!-- Dropdown with menu here -->
- </div>
- </div>
- <div class="blog-card">
- <h2>Published Blog</h2>
- <div class="blog-card-footer">
- <span>
- Last Edited 17th December, 2018
- </span>
- <!-- Dropdown with menu here -->
- </div>
- </div>
- </div>
- <!-- In case of no drafts blogs -->
- <!-- <div class="blog-error">
- No Drafts :(
- </div> -->
- </template>
- </div>
- </div>
- </div>
- </div>
- </div>
- </template>
- <script>
- import Header from '~/components/shared/Header'
- export default {
- layout: 'instructor',
- components: {Header},
- data() {
- return {
- activeTab: 0
- }
- },
- async fetch({store}) {
- await store.dispatch('instructor/blog/fetchUserBlogs')
- }
- }
- </script>
- <style scoped lang="scss">
- .is-active {
- border-bottom-color: #363636;
- color: #363636;
- }
- .blog-error {
- font-size: 35px;
- }
- .blog-card {
- border-bottom: 1px solid rgba(0, 0, 0, 0.1);
- padding: 20px 0;
- > h2 {
- font-size: 30px;
- font-weight: bold;
- }
- &-footer {
- color: rgba(0, 0, 0, 0.54);
- }
- &.featured {
- border-left: 5px solid #3cc314;
- padding-left: 10px;
- transition: border ease-out 0.2s;
- }
- }
- .header-block {
- display: flex;
- flex-direction: row;
- align-items: center;
- > h2 {
- font-size: 40px;
- font-weight: bold;
- }
- .title-menu {
- margin-left: auto;
- }
- }
- </style>
|