Compare commits

3 Commits

Author SHA1 Message Date
encrypt
21c2c1db45 fixes on previous commit 2023-07-14 15:24:55 +02:00
encrypt
66537b02a3 let's show nothing when event is anonymous 2023-07-14 14:58:28 +02:00
encrypt
50fbecb15a show event author in event page if admin is browsing and feature is enabled from config file 2023-07-03 12:58:34 +02:00
4 changed files with 13 additions and 4 deletions

View File

@@ -29,6 +29,11 @@ v-container#event.h-event.pa-2.pa-sm-2(v-touch="{ left: goNext, right: goPrev }"
nuxt-link.vcard.ml-2.p-name.text-decoration-none.text-uppercase(itemprop="name" :to='`/place/${encodeURIComponent(event.place.name)}`') {{event.place && event.place.name}}
.font-weight-light.p-street-address(v-if='event.place.name !=="online"' itemprop='address') {{event.place && event.place.address}}
.author(v-if='$auth.user && $auth.user.is_admin && settings.show_event_author_to_admin && event.user && event.user.email' itemprop="author")
v-icon(v-text='mdiAccount' small)
span.font-weight-light.mb-3.text {{event.user.email}}
//- tags, hashtags
v-container.pt-0(v-if='event.tags && event.tags.length')
v-chip.p-category.ml-1.mt-1(v-for='tag in event.tags' small label color='primary'
@@ -194,7 +199,7 @@ const { htmlToText } = require('html-to-text')
import { mdiArrowLeft, mdiArrowRight, mdiDotsVertical, mdiCodeTags, mdiClose, mdiMap,
mdiEye, mdiEyeOff, mdiDelete, mdiRepeat, mdiLock, mdiFileDownloadOutline, mdiShareAll,
mdiCalendarExport, mdiCalendar, mdiContentCopy, mdiMapMarker, mdiChevronUp, mdiMonitorAccount, mdiBookmark } from '@mdi/js'
mdiCalendarExport, mdiCalendar, mdiContentCopy, mdiMapMarker, mdiChevronUp, mdiMonitorAccount, mdiBookmark, mdiAccount } from '@mdi/js'
export default {
name: 'Event',
@@ -216,7 +221,7 @@ export default {
data ({$store}) {
return {
mdiArrowLeft, mdiArrowRight, mdiDotsVertical, mdiCodeTags, mdiCalendarExport, mdiCalendar, mdiFileDownloadOutline,
mdiMapMarker, mdiContentCopy, mdiClose, mdiDelete, mdiEye, mdiEyeOff, mdiRepeat, mdiLock, mdiMap, mdiChevronUp, mdiMonitorAccount, mdiBookmark, mdiShareAll,
mdiMapMarker, mdiContentCopy, mdiClose, mdiDelete, mdiEye, mdiEyeOff, mdiRepeat, mdiLock, mdiMap, mdiChevronUp, mdiMonitorAccount, mdiBookmark, mdiShareAll, mdiAccount,
currentAttachment: 0,
event: {},
diocane: '',

View File

@@ -10,7 +10,7 @@ const helpers = require('../../helpers')
const Col = helpers.col
const notifier = require('../../notifier')
const { Event, Resource, Tag, Place, Notification, APUser } = require('../models/models')
const { Event, Resource, Tag, Place, Notification, User, APUser } = require('../models/models')
const exportController = require('./export')
@@ -100,6 +100,7 @@ const eventController = {
async get(req, res) {
const format = req.params.format || 'json'
const settings = res.locals.settings
const is_admin = req.user && req.user.is_admin
const slug = req.params.event_slug
@@ -128,7 +129,8 @@ const eventController = {
required: false,
attributes: ['id', 'activitypub_id', 'data', 'hidden']
},
{ model: Event, required: false, as: 'parent', attributes: ['id', 'recurrent', 'is_visible', 'start_datetime'] }
{ model: Event, required: false, as: 'parent', attributes: ['id', 'recurrent', 'is_visible', 'start_datetime'] },
...((is_admin && settings.show_event_author_to_admin) ? [{model: User, attributes: ['email']}] : [])
],
order: [[Resource, 'id', 'DESC']]
})

View File

@@ -29,6 +29,7 @@ const defaultSettings = {
allow_recurrent_event: false,
allow_online_event: true,
recurrent_event_visible: false,
show_event_author_to_admin: config.show_event_author_to_admin || false,
allow_geolocation: false,
geocoding_provider_type: 'Nominatim',
geocoding_provider: 'https://nominatim.openstreetmap.org/search',

View File

@@ -80,6 +80,7 @@ module.exports = {
allow_recurrent_event: settings.allow_recurrent_event,
allow_multidate_event: settings.allow_multidate_event,
allow_online_event: settings.allow_online_event,
show_event_author_to_admin: settings.show_event_author_to_admin,
recurrent_event_visible: settings.recurrent_event_visible,
enable_federation: settings.enable_federation,
enable_resources: settings.enable_resources,