recurrent events only if allowed
This commit is contained in:
@@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
ul.tags(v-if='showTags && event.tags')
|
ul.tags(v-if='showTags && event.tags')
|
||||||
li(v-for='tag in event.tags' :key='tag') {{tag}}
|
li(v-for='tag in event.tags' :key='tag') {{tag}}
|
||||||
li(v-if='event.comments && event.comments.length') <u>{{$tc('common.comments', event.comments.length)}}</u>
|
li(v-if='settings.enable_federation && event.comments && event.comments.length') <u>{{$tc('common.comments', event.comments.length)}}</u>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import { mapState, mapActions } from 'vuex'
|
import { mapState, mapActions } from 'vuex'
|
||||||
@@ -35,6 +35,7 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
...mapState(['settings']),
|
||||||
date () {
|
date () {
|
||||||
return new Date(this.event.start_datetime).getDate()
|
return new Date(this.event.start_datetime).getDate()
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -50,12 +50,11 @@
|
|||||||
//- WHEN
|
//- WHEN
|
||||||
el-tab-pane
|
el-tab-pane
|
||||||
span(slot='label') {{$t('common.when')}} <v-icon name='clock'/>
|
span(slot='label') {{$t('common.when')}} <v-icon name='clock'/>
|
||||||
|
|
||||||
.text-center
|
.text-center
|
||||||
el-radio-group(v-model="event.type")
|
el-radio-group(v-model="event.type")
|
||||||
el-radio-button(label="normal") <v-icon name='calendar-day'/> {{$t('event.normal')}}
|
el-radio-button(label="normal") <v-icon name='calendar-day'/> {{$t('event.normal')}}
|
||||||
el-radio-button(label="multidate") <v-icon name='calendar-week'/> {{$t('event.multidate')}}
|
el-radio-button(label="multidate") <v-icon name='calendar-week'/> {{$t('event.multidate')}}
|
||||||
el-radio-button(label="recurrent") <v-icon name='calendar-alt'/> {{$t('event.recurrent')}}
|
el-radio-button(v-if='settings.allow_recurrent_event' label="recurrent") <v-icon name='calendar-alt'/> {{$t('event.recurrent')}}
|
||||||
br
|
br
|
||||||
span {{$t(`event.${event.type}_description`)}}
|
span {{$t(`event.${event.type}_description`)}}
|
||||||
el-select.ml-2(v-if='event.type==="recurrent"' v-model='event.recurrent.frequency' placeholder='Frequenza')
|
el-select.ml-2(v-if='event.type==="recurrent"' v-model='event.recurrent.frequency' placeholder='Frequenza')
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ const debug = require('debug')('controller:event')
|
|||||||
|
|
||||||
const eventController = {
|
const eventController = {
|
||||||
|
|
||||||
|
// NOT USED ANYWHERE, comments are added from fediverse
|
||||||
async addComment (req, res) {
|
async addComment (req, res) {
|
||||||
// comment could be added to an event or to another comment
|
// comment could be added to an event or to another comment
|
||||||
let event = await Event.findOne({ where: { activitypub_id: { [Op.eq]: req.body.id } } })
|
let event = await Event.findOne({ where: { activitypub_id: { [Op.eq]: req.body.id } } })
|
||||||
@@ -202,7 +203,7 @@ const eventController = {
|
|||||||
// return only confirmed events
|
// return only confirmed events
|
||||||
is_visible: true,
|
is_visible: true,
|
||||||
[Op.or]: [
|
[Op.or]: [
|
||||||
// return all recurrent events
|
// return all recurrent events regardless start_datetime
|
||||||
{ recurrent: { [Op.ne]: null } },
|
{ recurrent: { [Op.ne]: null } },
|
||||||
|
|
||||||
// and events in specified range
|
// and events in specified range
|
||||||
@@ -226,7 +227,7 @@ const eventController = {
|
|||||||
// build singular events from a recurrent pattern
|
// build singular events from a recurrent pattern
|
||||||
function createEventsFromRecurrent (e, dueTo = null) {
|
function createEventsFromRecurrent (e, dueTo = null) {
|
||||||
const events = []
|
const events = []
|
||||||
const recurrent = e.recurrent
|
const recurrent = JSON.parse(e.recurrent)
|
||||||
if (!recurrent.frequency) { return false }
|
if (!recurrent.frequency) { return false }
|
||||||
|
|
||||||
let cursor = moment(start).startOf('week')
|
let cursor = moment(start).startOf('week')
|
||||||
|
|||||||
@@ -57,11 +57,6 @@ module.exports = (sequelize, DataTypes) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
// id: `${config.baseurl}/federation/m/c_${this.id}`,
|
|
||||||
// type: 'Create',
|
|
||||||
// actor: `${config.baseurl}/federation/u/${username}`,
|
|
||||||
// url: `${config.baseurl}/federation/m/${this.id}`,
|
|
||||||
// object: {
|
|
||||||
type: 'Note',
|
type: 'Note',
|
||||||
id: `${config.baseurl}/federation/m/${this.id}`,
|
id: `${config.baseurl}/federation/m/${this.id}`,
|
||||||
url: `${config.baseurl}/federation/m/${this.id}`,
|
url: `${config.baseurl}/federation/m/${this.id}`,
|
||||||
|
|||||||
Reference in New Issue
Block a user