mirror of
https://framagit.org/les/gancio.git
synced 2025-01-31 16:42:22 +01:00
remove htmlToText from client
This commit is contained in:
parent
1fbf746e6c
commit
f4ca625fea
2 changed files with 4 additions and 3 deletions
|
@ -187,8 +187,6 @@ import EventAdmin from '@/components/eventAdmin'
|
||||||
import EmbedEvent from '@/components/embedEvent'
|
import EmbedEvent from '@/components/embedEvent'
|
||||||
import EventMapDialog from '@/components/EventMapDialog'
|
import EventMapDialog from '@/components/EventMapDialog'
|
||||||
|
|
||||||
const { htmlToText } = require('html-to-text')
|
|
||||||
|
|
||||||
import { mdiArrowLeft, mdiArrowRight, mdiDotsVertical, mdiCodeTags, mdiClose, mdiMap,
|
import { mdiArrowLeft, mdiArrowRight, mdiDotsVertical, mdiCodeTags, mdiClose, mdiMap,
|
||||||
mdiEye, mdiEyeOff, mdiDelete, mdiRepeat, mdiLock, mdiFileDownloadOutline, mdiShareAll,
|
mdiEye, mdiEyeOff, mdiDelete, mdiRepeat, mdiLock, mdiFileDownloadOutline, mdiShareAll,
|
||||||
mdiCalendarExport, mdiCalendar, mdiContentCopy, mdiMapMarker, mdiChevronUp, mdiMonitorAccount, mdiBookmark } from '@mdi/js'
|
mdiCalendarExport, mdiCalendar, mdiContentCopy, mdiMapMarker, mdiChevronUp, mdiMonitorAccount, mdiBookmark } from '@mdi/js'
|
||||||
|
@ -311,7 +309,7 @@ export default {
|
||||||
return this.event.media && this.event.media.length
|
return this.event.media && this.event.media.length
|
||||||
},
|
},
|
||||||
plainDescription () {
|
plainDescription () {
|
||||||
return htmlToText(this.event.description && this.event.description.replace('\n', '').slice(0, 1000))
|
return this.event.plain_description || ''
|
||||||
},
|
},
|
||||||
currentAttachmentLabel () {
|
currentAttachmentLabel () {
|
||||||
return get(this.selectedResource, `data.attachment[${this.currentAttachment}].name`, '')
|
return get(this.selectedResource, `data.attachment[${this.currentAttachment}].name`, '')
|
||||||
|
|
|
@ -9,6 +9,7 @@ const { DateTime } = require('luxon')
|
||||||
const helpers = require('../../helpers')
|
const helpers = require('../../helpers')
|
||||||
const Col = helpers.col
|
const Col = helpers.col
|
||||||
const notifier = require('../../notifier')
|
const notifier = require('../../notifier')
|
||||||
|
const { htmlToText } = require('html-to-text')
|
||||||
|
|
||||||
const { Event, Resource, Tag, Place, Notification, APUser } = require('../models/models')
|
const { Event, Resource, Tag, Place, Notification, APUser } = require('../models/models')
|
||||||
|
|
||||||
|
@ -181,6 +182,8 @@ const eventController = {
|
||||||
event.next = next && (next.slug || next.id)
|
event.next = next && (next.slug || next.id)
|
||||||
event.prev = prev && (prev.slug || prev.id)
|
event.prev = prev && (prev.slug || prev.id)
|
||||||
event.tags = event.tags.map(t => t.tag)
|
event.tags = event.tags.map(t => t.tag)
|
||||||
|
event.plain_description = htmlToText(event.description, event.description.replace('\n', '').slice(0, 1000) )
|
||||||
|
|
||||||
if (format === 'json') {
|
if (format === 'json') {
|
||||||
res.json(event)
|
res.json(event)
|
||||||
} else if (format === 'ics') {
|
} else if (format === 'ics') {
|
||||||
|
|
Loading…
Reference in a new issue