-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add preview #85
Merged
Merged
add preview #85
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
a3bf40c
add topics_detail preview
VortexExpansion ffb8075
upd default layout for preview page
VortexExpansion 063aba9
feat: adjust disabled styling
yabe-diverta dfb97df
add preview layout
VortexExpansion 2dbd701
separate AppFooter to component
VortexExpansion 149f175
nav drawer open close fix
VortexExpansion File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<template> | ||
<v-footer color="#1414A0" padless> | ||
<v-row justify="center" no-gutters class="pt-3"> | ||
<a href="https://github.com/diverta/front_nuxt_auth"><small class="my-4 pt-3 l-footer_copyright">Github repository</small></a> | ||
<a href="https://kuroco.app/"><img src="~/assets/images/logo-kuroco.svg" width="120" class="pl-4 l-footer_logo" /></a> | ||
<v-col class="#1414A0 text-center white--text" cols="12" /> | ||
</v-row> | ||
</v-footer> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<template> | ||
<ClientOnly> | ||
<v-app class="l-content_wrap p-dashboard"> | ||
<v-navigation-drawer id="c-navi_side" v-model="drawer" left fixed dark permanent> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. oh good solution |
||
<div class="text-center py-4"> | ||
<a href="/"> | ||
<img src="~/assets/images/logo.png?width=150" class="c-navi_side-logo" /> | ||
</a> | ||
</div> | ||
<v-list> | ||
<v-list-item v-for="(item, i) in items" :key="i" router exact class="l-mainmenu_item disabled"> | ||
<v-list-item-action> | ||
<v-icon>{{ item.icon }}</v-icon> | ||
</v-list-item-action> | ||
|
||
<v-list-item-title v-text="item.title" /> | ||
</v-list-item> | ||
</v-list> | ||
</v-navigation-drawer> | ||
|
||
<v-main> | ||
<v-container class="l-content_inner" fluid> | ||
<slot /> | ||
</v-container> | ||
</v-main> | ||
<AppFooter /> | ||
</v-app> | ||
</ClientOnly> | ||
</template> | ||
|
||
<script setup> | ||
const drawer = ref(false); | ||
const items = useNavDrawerItems(); | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
<template> | ||
<div> | ||
<v-progress-linear :active="loading" :indeterminate="loading" absolute top color="orange white-4" /> | ||
<template v-if="topicsDetail"> | ||
<!-- <v-row> --> | ||
<v-col> | ||
<div class="d-flex justify-space-between mb-6" flat tile> | ||
<div flat> | ||
<v-row> | ||
<v-col class="pt-0"> | ||
<h1 class="mt-3 mb-3"> | ||
{{ topicsDetail.subject }} | ||
</h1> | ||
<span class="c-btn c-btn_main c-btn_sm c-btn_disable white--text"> | ||
{{ topicsDetail.contents_type_nm }} | ||
</span> | ||
</v-col> | ||
</v-row> | ||
</div> | ||
</div> | ||
|
||
<!-- Wysiwyg contents --> | ||
<v-row v-if="topicsDetail && topicsDetail.contents" class="p-article_content"> | ||
<v-container fluid> | ||
<v-card v-for="(subtitle, index) in topicsDetail.subtitles" :key="index" class="mx-auto" max-width="7000"> | ||
<v-card-title class="c-heading_h2">{{ subtitle }}</v-card-title> | ||
<v-card-text> | ||
<div class="text--primary" v-html="topicsDetail.contents"></div> | ||
</v-card-text> | ||
</v-card> | ||
</v-container> | ||
</v-row> | ||
|
||
<!-- extension contents --> | ||
<v-row v-for="(item, idx) in items" :key="idx" class="p-article_content"> | ||
<TopicsDetail v-if="item" v-bind="item" /> | ||
</v-row> | ||
</v-col> | ||
<v-col></v-col> | ||
</template> | ||
</div> | ||
</template> | ||
<script setup> | ||
definePageMeta({ | ||
layout: 'preview' | ||
}); | ||
|
||
const { t } = useI18n(); | ||
const route = useRoute(); | ||
const preview_token = route.query.preview_token; | ||
const topicsDetail = ref(null); | ||
const loading = ref(true); | ||
const snackbar = useSnackbar(); | ||
|
||
const items = computed(() => { | ||
if (!topicsDetail.value) { | ||
return []; | ||
} | ||
|
||
const { texts, positionPatterns, imageUrls, subtitles } = topicsDetail.value; | ||
return positionPatterns.map(({ key }, i) => ({ | ||
text: texts?.[i], | ||
positionPatternKey: key, | ||
imageUrl: imageUrls?.[i]?.url ? `${imageUrls?.[i]?.url}?width=800` : null, | ||
subtitle: subtitles?.[i] | ||
})); | ||
}); | ||
|
||
try { | ||
const response = await $fetch(`${apiDomain.baseURL}/rcms-api/1/content/preview`, { | ||
credentials: 'include', | ||
params: { | ||
preview_token | ||
}, | ||
server: false | ||
}); | ||
const d = response.details; | ||
topicsDetail.value = { | ||
...d, | ||
fileType: d?.ext_1?.key, | ||
fileUrl: d?.ext_2?.url, | ||
fileDownload: d?.ext_2?.dl_link, | ||
linkUrl: d?.ext_3?.url, | ||
linkTitle: d?.ext_3?.title, | ||
|
||
// for TopicsDetail | ||
positionPatterns: d?.ext_4, | ||
texts: d?.ext_7, | ||
imageUrls: d?.ext_5, | ||
subtitles: d?.ext_9 | ||
}; | ||
loading.value = false; | ||
} catch (error) { | ||
snackbar.add({ | ||
type: 'error', | ||
text: error?.response?._data?.errors?.[0]?.message || t('common.error') | ||
}); | ||
} | ||
</script> |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would have better to provide gray text instead of back one due to looking invisible a bit so could you provide a special class for it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@yabe-diverta san
I only know inline styles like this
:style="{ color: preview_token ? 'gray' : 'white' }
.Not very experienced in styles.
And cannot find the class for the "to" link in the scss files.
Can you please suggest where to change ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@VortexExpansion
I pushed a new commit to set it, could you confirm it?
https://diverta.gyazo.com/16570bad97de39c68b41d21cb8c39140
063aba9