Skip to content
Snippets Groups Projects
Unverified Commit 10d72742 authored by Balazs Nadasdi's avatar Balazs Nadasdi Committed by GitHub
Browse files

Ability to set header image for a Page (#6210)


* Ability to set header image for a Page

 - Add header image to Page
 - Show it on Page view
 - Show correctly it on Page list view
 - On the Page list view, pages have a light border
   to make it easier to see an image belongs to a page

* Maybe it looks better

* Use <img> instead if <x-image>

* src -> :src; set width

* Update page.vue

Co-authored-by: default avatarsyuilo <Syuilotan@yahoo.co.jp>
parent 1b9f8a87
No related branches found
No related tags found
No related merge requests found
...@@ -35,6 +35,7 @@ export default Vue.extend({ ...@@ -35,6 +35,7 @@ export default Vue.extend({
border: solid var(--lineWidth) var(--urlPreviewBorder); border: solid var(--lineWidth) var(--urlPreviewBorder);
border-radius: 4px; border-radius: 4px;
overflow: hidden; overflow: hidden;
border: 1px solid var(--divider);
&:hover { &:hover {
text-decoration: none; text-decoration: none;
...@@ -42,9 +43,8 @@ export default Vue.extend({ ...@@ -42,9 +43,8 @@ export default Vue.extend({
} }
> .thumbnail { > .thumbnail {
position: absolute; width: 100%;
width: 100px; height: 200px;
height: 100%;
background-position: center; background-position: center;
background-size: cover; background-size: cover;
display: flex; display: flex;
......
...@@ -102,6 +102,7 @@ import { blockDefs } from '../../scripts/aiscript/index'; ...@@ -102,6 +102,7 @@ import { blockDefs } from '../../scripts/aiscript/index';
import { ASTypeChecker } from '../../scripts/aiscript/type-checker'; import { ASTypeChecker } from '../../scripts/aiscript/type-checker';
import { url } from '../../config'; import { url } from '../../config';
import { collectPageVars } from '../../scripts/collect-page-vars'; import { collectPageVars } from '../../scripts/collect-page-vars';
import { selectDriveFile } from '../../scripts/select-drive-file';
export default Vue.extend({ export default Vue.extend({
i18n, i18n,
...@@ -405,9 +406,7 @@ export default Vue.extend({ ...@@ -405,9 +406,7 @@ export default Vue.extend({
}, },
setEyeCatchingImage() { setEyeCatchingImage() {
this.$chooseDriveFile({ selectDriveFile(this.$root, false).then(file => {
multiple: false
}).then(file => {
this.eyeCatchingImageId = file.id; this.eyeCatchingImageId = file.id;
}); });
}, },
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
<div class="_card" v-if="page" :key="page.id"> <div class="_card" v-if="page" :key="page.id">
<div class="_title">{{ page.title }}</div> <div class="_title">{{ page.title }}</div>
<img class="header" :src="page.eyeCatchingImage.url" v-if="page.eyeCatchingImageId" />
<div class="_content"> <div class="_content">
<x-page :page="page"/> <x-page :page="page"/>
</div> </div>
...@@ -115,6 +116,8 @@ export default Vue.extend({ ...@@ -115,6 +116,8 @@ export default Vue.extend({
<style lang="scss" scoped> <style lang="scss" scoped>
.xcukqgmh { .xcukqgmh {
> ._card > .header {
max-width: 100%;
}
} }
</style> </style>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment