implement link content viewer
This commit is contained in:
parent
ff4af093a8
commit
87e736d008
@ -14,8 +14,11 @@ export default {
|
||||
mnx_navToContact() {
|
||||
this.$router.push('/contact')
|
||||
},
|
||||
mnx_navToContentViewer(content_id) {
|
||||
this.$router.push('/content-viewer/' + content_id)
|
||||
mnx_navToPdfContentViewer(content_id) {
|
||||
this.$router.push('/pdf-content-viewer/' + content_id)
|
||||
},
|
||||
mnx_navToLinkContentViewer(content_link_based64) {
|
||||
this.$router.push('/link-content-viewer/' + content_link_based64)
|
||||
},
|
||||
|
||||
//common
|
||||
|
||||
@ -1,11 +1,50 @@
|
||||
<template>
|
||||
<div class="">About</div>
|
||||
<div class="directories_containter">
|
||||
<div class="directory_container" v-for="(directory, index) in directories" :key="index" @click="view_link(directory)">
|
||||
<p>{{ directory.title_text }}</p>
|
||||
<img :src="directory.cover_picture" />
|
||||
<p>{{ directory.summary_text }}</p>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { ContentApi } from '../../utils/index'
|
||||
export default {
|
||||
name: 'About',
|
||||
components: {},
|
||||
computed: {},
|
||||
methods: {}
|
||||
mounted() {
|
||||
this.retrieve_directories()
|
||||
},
|
||||
methods: {
|
||||
retrieve_directories() {
|
||||
ContentApi.retrieve_about_directories()
|
||||
.then((response) => {
|
||||
this.directories = response.data
|
||||
})
|
||||
.catch((error) => {
|
||||
this.mnx_backendErrorHandler(error)
|
||||
})
|
||||
},
|
||||
view_link(directory) {
|
||||
this.mnx_navToLinkContentViewer(btoa(directory.content_link))
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
directories: null
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.directories_containter {
|
||||
@extend .container;
|
||||
}
|
||||
|
||||
.directory_container {
|
||||
@extend .container;
|
||||
cursor: pointer;
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -13,7 +13,7 @@
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { ContentApi, mediaDataHandler } from '../../utils/index'
|
||||
import { ContentApi } from '../../utils/index'
|
||||
export default {
|
||||
name: 'Blogs',
|
||||
components: {},
|
||||
@ -32,10 +32,10 @@ export default {
|
||||
})
|
||||
},
|
||||
view_blog(blog) {
|
||||
this.mnx_navToContentViewer(blog.content_id)
|
||||
this.mnx_navToPdfContentViewer(blog.content_id)
|
||||
},
|
||||
retrieve_summary(blog) {
|
||||
return mediaDataHandler.retrieveText(blog.summary_text)
|
||||
return blog.summary_text
|
||||
}
|
||||
},
|
||||
data() {
|
||||
|
||||
40
frontend/src/pages/public/LinkContentViewer.vue
Normal file
40
frontend/src/pages/public/LinkContentViewer.vue
Normal file
@ -0,0 +1,40 @@
|
||||
<template>
|
||||
<div class="content_containter"><iframe class="link-iframe" :src="get_link()"
|
||||
frameborder="0" marginheight="0" marginwidth="0" max-width="100%"
|
||||
sandbox="allow-forms allow-modals allow-orientation-lock allow-popups allow-same-origin allow-scripts"
|
||||
scrolling="no" style="border: none; max-width: 100%; max-height: 100vh" allowfullscreen mozallowfullscreen
|
||||
msallowfullscreen webkitallowfullscreen></iframe></div>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
name: 'LinkContentViewer',
|
||||
props: {
|
||||
content_link_based64: {
|
||||
required: true,
|
||||
type: String
|
||||
}
|
||||
},
|
||||
components: {},
|
||||
computed: {},
|
||||
mounted() { },
|
||||
methods: {
|
||||
get_link() {
|
||||
return atob(this.content_link_based64)
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.content_containter {
|
||||
@extend .container;
|
||||
}
|
||||
|
||||
.link-iframe {
|
||||
@extend .container;
|
||||
height: 70vh;
|
||||
}
|
||||
</style>
|
||||
@ -3,10 +3,10 @@
|
||||
</template>
|
||||
<script>
|
||||
import { pdfjsLib } from '../../plugins/index'
|
||||
import { ContentApi, mediaDataHandler } from '../../utils/index'
|
||||
import { ContentApi } from '../../utils/index'
|
||||
import { Buffer } from 'buffer'
|
||||
export default {
|
||||
name: 'ContentViewer',
|
||||
name: 'PdfContentViewer',
|
||||
props: {
|
||||
content_id: {
|
||||
required: true,
|
||||
@ -6,7 +6,8 @@ import About from '../../pages/public/About.vue'
|
||||
import Blogs from '../../pages/public/Blogs.vue'
|
||||
import Career from '../../pages/public/Career.vue'
|
||||
import Contact from '../../pages/public/Contact.vue'
|
||||
import ContentViewer from '../../pages/public/ContentViewer.vue'
|
||||
import PdfContentViewer from '../../pages/public/PdfContentViewer.vue'
|
||||
import LinkContentViewer from '../../pages/public/LinkContentViewer.vue'
|
||||
|
||||
//guest
|
||||
import FrontDoor from '../../pages/guest/FrontDoor.vue'
|
||||
@ -110,10 +111,17 @@ const router = createRouter({
|
||||
},
|
||||
|
||||
{
|
||||
name: 'content-viewer',
|
||||
path: '/content-viewer/:content_id',
|
||||
name: 'pdf-content-viewer',
|
||||
path: '/pdf-content-viewer/:content_id',
|
||||
meta: { requiredRoles: [userRoleEnum.NONE] },
|
||||
components: { default: ContentViewer, footer: FooterGuest, header: HeaderGuest },
|
||||
components: { default: PdfContentViewer, footer: FooterGuest, header: HeaderGuest },
|
||||
props: true
|
||||
},
|
||||
{
|
||||
name: 'link-content-viewer',
|
||||
path: '/link-content-viewer/:content_link_based64',
|
||||
meta: { requiredRoles: [userRoleEnum.NONE] },
|
||||
components: { default: LinkContentViewer, footer: FooterGuest, header: HeaderGuest },
|
||||
props: true
|
||||
},
|
||||
|
||||
|
||||
@ -14,5 +14,10 @@ class ContentApi {
|
||||
)
|
||||
return request
|
||||
}
|
||||
|
||||
static retrieve_about_directories() {
|
||||
const request = backendAxios.post('/api/content/retrieve-about-directories', {}, {})
|
||||
return request
|
||||
}
|
||||
}
|
||||
export { ContentApi }
|
||||
|
||||
Loading…
Reference in New Issue
Block a user