This commit is contained in:
les
2019-10-02 16:00:51 +02:00
parent 1a62db59b0
commit a743281e59
6 changed files with 27 additions and 28 deletions

View File

@@ -36,13 +36,12 @@ module.exports = (sequelize, DataTypes) => {
event.hasMany(models.comment)
}
//
event.prototype.toAP = function (username, follower = []) {
const tags = this.tags && this.tags.map(t => `<a href='/tags/${t.tag}' class='mention hashtag' rel='tag'>#${t.tag}</a>`).join(' ')
const content = `<a href='${config.baseurl}/event/${this.id}'>${this.title}</a><br/>
📍${this.place.name}<br/>
${moment.unix(this.start_datetime).format('dddd, D MMMM (HH:mm)')}<br/><br/>
${moment.unix(this.start_datetime).utc(false).format('dddd, D MMMM (HH:mm)')}<br/><br/>
${this.description.length > 200 ? this.description.substr(0, 200) + '...' : this.description}<br/>
${tags} <br/>`
@@ -74,12 +73,6 @@ module.exports = (sequelize, DataTypes) => {
content,
summary: null,
sensitive: false,
startTime: moment.unix(this.start_datetime),
location: {
type: 'Place',
name: this.place.name,
address: this.place.address
}
}
}