Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
les
gancio
Commits
5c08a96f
Commit
5c08a96f
authored
Aug 25, 2019
by
les
Browse files
minor
parent
0eb41a1e
Changes
3
Hide whitespace changes
Inline
Side-by-side
components/Event.vue
View file @
5c08a96f
...
...
@@ -17,7 +17,7 @@
ul.tags(v-if='showTags && event.tags')
li(v-for='tag in event.tags' :key='tag')
{{
tag
}}
li(v-if='event.comments
.length
') <u>
{{
$tc
(
'
common.comments
'
,
event
.
comments
.
length
)
}}
</u>
li(v-if='event.comments') <u>
{{
$tc
(
'
common.comments
'
,
event
.
comments
.
length
)
}}
</u>
</
template
>
<
script
>
import
{
mapState
,
mapActions
}
from
'
vuex
'
...
...
server/api/controller/event.js
View file @
5c08a96f
...
...
@@ -211,6 +211,7 @@ const eventController = {
attributes
:
{
exclude
:
[
'
createdAt
'
,
'
updatedAt
'
,
'
placeId
'
]
},
order
:
[[
Tag
,
'
weigth
'
,
'
DESC
'
]],
include
:
[
{
model
:
Comment
,
required
:
false
,
attributes
:
[
'
id
'
]
},
{
model
:
Tag
,
required
:
false
},
{
model
:
Place
,
required
:
false
,
attributes
:
[
'
id
'
,
'
name
'
,
'
address
'
]
}
]
...
...
server/api/models/event.js
View file @
5c08a96f
...
...
@@ -37,6 +37,10 @@ module.exports = (sequelize, DataTypes) => {
}
event
.
prototype
.
toAP
=
function
(
username
,
follower
)
{
const
tags
=
this
.
tags
&&
'
-
'
+
this
.
tags
.
map
(
t
=>
'
#
'
+
t
.
tag
).
join
(
'
'
)
const
content
=
`<b><a href='
${
config
.
baseurl
}
/event/
${
this
.
id
}
'>
${
this
.
title
}
</a></b> @
${
this
.
place
.
name
}
${
moment
.
unix
(
this
.
start_datetime
).
format
(
'
dddd, D MMMM (HH:mm)
'
)}
<br/>
${
this
.
description
.
length
>
200
?
this
.
description
.
substr
(
0
,
200
)
+
'
...
'
:
this
.
description
}
${
tags
}
<br/>`
return
{
id
:
`
${
config
.
baseurl
}
/federation/m/c_
${
this
.
id
}
`
,
type
:
'
Create
'
,
...
...
@@ -48,7 +52,7 @@ module.exports = (sequelize, DataTypes) => {
attributedTo
:
`
${
config
.
baseurl
}
/federation/u/
${
username
}
`
,
to
:
'
https://www.w3.org/ns/activitystreams#Public
'
,
cc
:
follower
?
follower
:
[],
content
:
`<b><a href='
${
config
.
baseurl
}
/event/
${
this
.
id
}
'>
${
this
.
title
}
</a></b> @
${
this
.
place
.
name
}
${
moment
.
unix
(
this
.
start_datetime
).
format
(
'
dddd, D MMMM (HH:mm)
'
)}
<br/>
${
this
.
description
.
length
>
200
?
this
.
description
.
substr
(
0
,
200
)
+
'
...
'
:
this
.
description
}
-
${
this
.
tags
.
map
(
t
=>
'
#
'
+
t
.
tag
).
join
(
'
'
)}
<br/>`
content
}
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment