show event author in event page if admin is browsing and feature is enabled from config file
This commit is contained in:
@@ -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}}
|
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}}
|
.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' itemprop="author")
|
||||||
|
v-icon(v-text='mdiAccount' small)
|
||||||
|
span.font-weight-light.mb-3.text {{event.user.email}}
|
||||||
|
|
||||||
|
|
||||||
//- tags, hashtags
|
//- tags, hashtags
|
||||||
v-container.pt-0(v-if='event.tags && event.tags.length')
|
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'
|
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,
|
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, mdiAccount } from '@mdi/js'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'Event',
|
name: 'Event',
|
||||||
@@ -216,7 +221,7 @@ export default {
|
|||||||
data ({$store}) {
|
data ({$store}) {
|
||||||
return {
|
return {
|
||||||
mdiArrowLeft, mdiArrowRight, mdiDotsVertical, mdiCodeTags, mdiCalendarExport, mdiCalendar, mdiFileDownloadOutline,
|
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,
|
currentAttachment: 0,
|
||||||
event: {},
|
event: {},
|
||||||
diocane: '',
|
diocane: '',
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ const helpers = require('../../helpers')
|
|||||||
const Col = helpers.col
|
const Col = helpers.col
|
||||||
const notifier = require('../../notifier')
|
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')
|
const exportController = require('./export')
|
||||||
@@ -100,6 +100,7 @@ const eventController = {
|
|||||||
|
|
||||||
async get(req, res) {
|
async get(req, res) {
|
||||||
const format = req.params.format || 'json'
|
const format = req.params.format || 'json'
|
||||||
|
const settings = res.locals.settings
|
||||||
const is_admin = req.user && req.user.is_admin
|
const is_admin = req.user && req.user.is_admin
|
||||||
const slug = req.params.event_slug
|
const slug = req.params.event_slug
|
||||||
|
|
||||||
@@ -128,7 +129,8 @@ const eventController = {
|
|||||||
required: false,
|
required: false,
|
||||||
attributes: ['id', 'activitypub_id', 'data', 'hidden']
|
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']]
|
order: [[Resource, 'id', 'DESC']]
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ const defaultSettings = {
|
|||||||
allow_recurrent_event: false,
|
allow_recurrent_event: false,
|
||||||
allow_online_event: true,
|
allow_online_event: true,
|
||||||
recurrent_event_visible: false,
|
recurrent_event_visible: false,
|
||||||
|
show_event_author_to_admin: config.show_event_author_to_admin || false,
|
||||||
allow_geolocation: false,
|
allow_geolocation: false,
|
||||||
geocoding_provider_type: 'Nominatim',
|
geocoding_provider_type: 'Nominatim',
|
||||||
geocoding_provider: 'https://nominatim.openstreetmap.org/search',
|
geocoding_provider: 'https://nominatim.openstreetmap.org/search',
|
||||||
|
|||||||
@@ -80,6 +80,7 @@ module.exports = {
|
|||||||
allow_recurrent_event: settings.allow_recurrent_event,
|
allow_recurrent_event: settings.allow_recurrent_event,
|
||||||
allow_multidate_event: settings.allow_multidate_event,
|
allow_multidate_event: settings.allow_multidate_event,
|
||||||
allow_online_event: settings.allow_online_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,
|
recurrent_event_visible: settings.recurrent_event_visible,
|
||||||
enable_federation: settings.enable_federation,
|
enable_federation: settings.enable_federation,
|
||||||
enable_resources: settings.enable_resources,
|
enable_resources: settings.enable_resources,
|
||||||
|
|||||||
Reference in New Issue
Block a user