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
1c8cbd8a
Verified
Commit
1c8cbd8a
authored
Jun 25, 2021
by
les
Browse files
do not ask for null image
parent
9e285d8b
Changes
2
Hide whitespace changes
Inline
Side-by-side
pages/event/_id.vue
View file @
1c8cbd8a
...
...
@@ -11,7 +11,7 @@ v-container#event.pa-0.pa-sm-2
v-row
v-col.col-12.col-lg-8
//- fake image to use u-featured in h-event microformat
img.u-featured(v-show='false' :src='`${settings.baseurl}${imgPath}`')
img.u-featured(v-show='false'
v-if='event.image_path'
:src='`${settings.baseurl}${imgPath}`')
v-img.main_image.mb-3(
contain
:src='imgPath'
...
...
@@ -64,25 +64,30 @@ v-container#event.pa-0.pa-sm-2
//- resources from fediverse
#resources.mt-1(v-if='settings.enable_federation')
div.float-right(v-if='!settings.hide_boosts')
small.mr-3 🔖
{{
event
.
likes
.
length
}}
small ✊
{{
event
.
boost
.
length
}}
<br/>
//-
div.float-right(v-if='!settings.hide_boosts')
//-
small.mr-3 🔖
{{
event
.
likes
.
length
}}
//-
small ✊
{{
event
.
boost
.
length
}}
<br/>
v-dialog.showResource#resourceDialog(v-model='showResources' fullscreen
width='95vw'
v-dialog(v-model='showResources'
fullscreen
width="100%"
max-width="100%"
transition="dialog-bottom-transition"
destroy-on-close
@keydown.native.right='$refs.carousel.next()'
@keydown.native.left='$refs.carousel.prev()')
v-carousel(:interval='10000' ref='carousel' arrow='always')
v-carousel-item(v-for='attachment in selectedResource.data.attachment' :key='attachment.url')
v-img(:src='attachment.url')
v-list.mb-1(v-if='settings.enable_resources' v-for='resource in event.resources' dark
v-carousel.pa-5(:interval='10000' ref='carousel' arrow='always')
v-carousel-item(v-for='attachment in selectedResource.data.attachment'
v-if='isImg(attachment)'
:key='attachment.url'
:src='attachment.url')
v-card#resources.mb-1(v-if='settings.enable_resources' v-for='resource in event.resources'
:key='resource.id' :class='{disabled: resource.hidden}')
v-list-item
v-list-title
v-card-subtitle
v-menu(v-if='$auth.user && $auth.user.is_admin' offset-y)
template(v-slot:activator="{ on
, attrs
}")
v-btn.mr-2(v-on='on'
v-attrs='attrs'
color='primary' small icon outlined)
template(v-slot:activator="{ on }")
v-btn.mr-2(v-on='on' color='primary' small icon outlined)
v-icon mdi-dots-vertical
v-list
v-list-item(v-if='!resource.hidden' @click='hideResource(resource, true)')
...
...
@@ -97,9 +102,17 @@ v-container#event.pa-0.pa-sm-2
a(:href='resource.data.url || resource.data.context')
small
{{
resource
.
data
.
published
|
dateFormat
(
'
ddd, D MMMM HH:mm
'
)
}}
v-card-text
div.mt-1(v-html='resource_filter(resource.data.content)')
span.previewImage(@click='showResource(resource)')
img(v-for='img in resource.data.attachment' :src='img.url')
span(v-for='attachment in resource.data.attachment' :key='attachment.url' @click='showResource(resource)')
span
{{
attachment
}}
audio(v-if='isAudio(attachment)' controls)
source(:src='attachment.url')
v-img.cursorPointer(v-if='isImg(attachment)' :src='attachment.url'
max-height="200px"
max-width="200px"
contain :alt='attachment.name')
//- Next/prev arrow
.text-center.mt-5.mb-5
...
...
@@ -243,6 +256,15 @@ export default {
window
.
removeEventListener
(
'
keydown
'
,
this
.
keyDown
)
},
methods
:
{
isImg
(
attachment
)
{
const
type
=
attachment
.
mediaType
.
split
(
'
/
'
)[
0
]
console
.
error
(
type
)
return
type
===
'
image
'
},
isAudio
(
attachment
)
{
const
type
=
attachment
.
mediaType
.
split
(
'
/
'
)[
0
]
return
type
===
'
audio
'
},
keyDown
(
ev
)
{
if
(
ev
.
altKey
||
ev
.
ctrlKey
||
ev
.
metaKey
||
ev
.
shiftKey
)
{
return
}
if
(
ev
.
key
===
'
ArrowRight
'
&&
this
.
event
.
next
)
{
...
...
@@ -255,7 +277,7 @@ export default {
showResource
(
resource
)
{
this
.
showResources
=
true
this
.
selectedResource
=
resource
document
.
getElementById
(
'
resourceDialog
'
).
focus
()
//
document.getElementById('resourceDialog').focus()
},
async
hideResource
(
resource
,
hidden
)
{
await
this
.
$axios
.
$put
(
`/resources/
${
resource
.
id
}
`
,
{
hidden
})
...
...
server/federation/helpers.js
View file @
1c8cbd8a
...
...
@@ -211,7 +211,10 @@ const Helpers = {
log
.
info
(
`Actor
${
req
.
body
.
actor
}
not found`
)
return
res
.
status
(
401
).
send
(
'
Actor not found
'
)
}
if
(
httpSignature
.
verifySignature
(
parsed
,
user
.
object
.
publicKey
.
publicKeyPem
))
{
return
next
()
}
if
(
httpSignature
.
verifySignature
(
parsed
,
user
.
object
.
publicKey
.
publicKeyPem
))
{
log
.
debug
(
`Valid signature from
${
req
.
body
.
actor
}
`
)
return
next
()
}
// still not valid
log
.
info
(
`Invalid signature from user
${
req
.
body
.
actor
}
`
)
...
...
les
@les
mentioned in commit
58dda736
·
Jun 25, 2021
mentioned in commit
58dda736
mentioned in commit 58dda736f4c9080080f2920f309f4cd29ec0b5f2
Toggle commit list
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