Event description pic & meta and email share fixes

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel 2019-10-14 12:56:37 +02:00
parent ef953d1376
commit 0fa9a0bcb1
No known key found for this signature in database
GPG key ID: A061B9DDE0CA0773

View file

@ -151,7 +151,7 @@ import {ParticipantRole} from "@/types/event.model";
<section class="share" v-if="!event.draft"> <section class="share" v-if="!event.draft">
<div class="container"> <div class="container">
<div class="columns"> <div class="columns">
<div class="column is-half has-text-centered"> <div class="column is-half-desktop has-text-centered">
<h3 class="title">{{ $t('Share this event') }}</h3> <h3 class="title">{{ $t('Share this event') }}</h3>
<small class="maximumNumberOfPlacesWarning" v-if="!eventCapacityOK"> <small class="maximumNumberOfPlacesWarning" v-if="!eventCapacityOK">
{{ $t('All the places have already been taken') }} {{ $t('All the places have already been taken') }}
@ -284,6 +284,10 @@ import { RouteName } from '@/router';
title: this.eventTitle, title: this.eventTitle,
// all titles will be injected into this template // all titles will be injected into this template
titleTemplate: '%s | Mobilizon', titleTemplate: '%s | Mobilizon',
meta: [
// @ts-ignore
{ name: 'description', content: this.eventDescription },
],
}; };
}, },
}) })
@ -306,6 +310,11 @@ export default class Event extends EventMixin {
return this.event.title; return this.event.title;
} }
get eventDescription() {
if (!this.event) return undefined;
return this.event.description;
}
mounted() { mounted() {
this.identity = this.currentActor; this.identity = this.currentActor;
} }
@ -522,7 +531,8 @@ export default class Event extends EventMixin {
get textDescription(): string { get textDescription(): string {
const meta = document.querySelector("meta[property='og:description']"); const meta = document.querySelector("meta[property='og:description']");
if (!meta) return ''; if (!meta) return '';
return meta.getAttribute('content') || ''; const desc = meta.getAttribute('content') || '';
return desc.substring(0, 1000);
} }
get eventCapacityOK(): boolean { get eventCapacityOK(): boolean {
@ -743,10 +753,13 @@ export default class Event extends EventMixin {
.description { .description {
padding-top: 10px; padding-top: 10px;
min-height: 40rem; min-height: 40rem;
@media screen and (min-width: 1216px) {
background-repeat: no-repeat; background-repeat: no-repeat;
background-size: 800px; background-size: 600px;
background-position: 95% 101%; background-position: 95% 101%;
background-image: url('../../assets/texting.svg'); background-image: url('../../assets/texting.svg');
}
border-top: solid 1px #111; border-top: solid 1px #111;
border-bottom: solid 1px #111; border-bottom: solid 1px #111;