|
| 1 | + |
| 2 | +<!-- |
| 3 | + |
| 4 | + A clone of capsidissue, shows the latest capsid |
| 5 | + |
| 6 | + --> |
| 7 | + |
| 8 | +<template> |
| 9 | + <div class="CapsidIssue _section-page _margin-top _margin-center"> |
| 10 | + <div class="_section-content _margin-center _padding-bottom-2"> |
| 11 | + <div class="" v-html="$md.render(title || '')" /> |
| 12 | + </div> |
| 13 | + |
| 14 | + <div class="_section-content _margin-center"> |
| 15 | + <Capsid :issues="issues" :show-preview="showPreview" /> |
| 16 | + |
| 17 | + <div v-if="issues.length == 0"> |
| 18 | + <h4>Sorry, no Capsid & Tail issue was found at this URL</h4> |
| 19 | + <div> |
| 20 | + If you think this is a bug, please email us at <a href="mailto: [email protected]"> [email protected]</a> |
| 21 | + </div> |
| 22 | + </div> |
| 23 | + </div> |
| 24 | + |
| 25 | + <div class="CapsidIssue-footer _section-content _margin-center"> |
| 26 | + <CapsidMicroBanner class="_section-article _margin-center _margin-top-2 _margin-bottom" /> |
| 27 | + <div class="_section-article _margin-center _margin-bottom-2" v-html="$md.render(highlight)" /> |
| 28 | + <!-- <Capsid :issues="issues" :show-preview="showPreview" /> --> |
| 29 | + </div> |
| 30 | + |
| 31 | + <div class="_section-content _margin-center"> |
| 32 | + <div class="_section-article _margin-center _font-small" v-html="$md.render(fineprint || '')" /> |
| 33 | + </div> |
| 34 | + |
| 35 | + </div> |
| 36 | +</template> |
| 37 | + |
| 38 | +<script> |
| 39 | + |
| 40 | +// import Article from '~/components/Article.vue' |
| 41 | +import CapsidBanner from '~/components/CapsidBanner.vue' |
| 42 | +import CapsidMicroBanner from '~/components/CapsidMicroBanner.vue' |
| 43 | +import Capsid from '~/components/Capsid.vue' |
| 44 | + |
| 45 | +export default { |
| 46 | + |
| 47 | + components: { |
| 48 | + CapsidBanner, |
| 49 | + CapsidMicroBanner, |
| 50 | + Capsid, |
| 51 | + }, |
| 52 | + |
| 53 | + layout: 'contentframe', |
| 54 | + middleware: 'pageload', |
| 55 | + meta: { |
| 56 | + tableQueries: ["_capsid-content", "_capsid-data"] // combine queries |
| 57 | + }, |
| 58 | + |
| 59 | + // these are dynamic, and aren't grabbed on generation |
| 60 | + // async asyncData({env, route, store}) { |
| 61 | + async asyncData({route}) { |
| 62 | + |
| 63 | + // await loadNews(env, store, 'capsid') |
| 64 | + |
| 65 | + const slug = unescape(route.params.slug) |
| 66 | + return { |
| 67 | + slug, |
| 68 | + showPreview: slug ? true : false, // used to show previews on capsid/slug titles, for testing |
| 69 | + } |
| 70 | + }, |
| 71 | + |
| 72 | + data: function () { |
| 73 | + return { |
| 74 | + title: this.$cytosis.find('Content.capsid-title', {'Content': this.$store.state['Content']} )[0]['fields']['Markdown'], |
| 75 | + fineprint: this.$cytosis.find('Content.capsid-fine', {'Content': this.$store.state['Content']} )[0]['fields']['Markdown'], |
| 76 | + intro: this.$cytosis.find('Content.capsid-intro', {'Content': this.$store.state['Content']} )[0]['fields']['Markdown'], |
| 77 | + highlight: this.$cytosis.find('Content.capsid-highlight', {'Content': this.$store.state['Content']} )[0]['fields']['Markdown'], |
| 78 | + } |
| 79 | + }, |
| 80 | + |
| 81 | + computed: { |
| 82 | + |
| 83 | + issues() { |
| 84 | + |
| 85 | + let result = [this.$store.state['C&T'][0]] |
| 86 | + |
| 87 | + // console.log('issue slug: ', result) |
| 88 | + return result // array of issues |
| 89 | + } |
| 90 | + |
| 91 | + }, |
| 92 | + |
| 93 | + mounted: async function () { |
| 94 | + }, |
| 95 | + |
| 96 | + methods: { |
| 97 | + } |
| 98 | + |
| 99 | +} |
| 100 | +</script> |
| 101 | + |
| 102 | + |
| 103 | +<style lang="scss" scoped> |
| 104 | + |
| 105 | +</style> |
| 106 | + |
0 commit comments