Commit 55ff53b6 authored by les's avatar les
Browse files

Merge branch 'dev'

parents 6901c056 8d942642
{
"done": [
{
"assignedTo": {
"name": "lesion"
},
"creation_time": "2019-05-27T15:45:39.093Z",
"id": "23",
"references": [],
"title": "colori te prego!"
},
{
"assignedTo": {
"name": "lesion"
},
"creation_time": "2019-05-27T20:42:22.581Z",
"id": "24",
"references": [],
"title": "copy to clipboard"
},
{
"assignedTo": {
"name": "lesion"
},
"creation_time": "2019-06-01T21:00:07.431Z",
"id": "27",
"references": [],
"title": "eventi ricorrenti"
},
{
"assignedTo": {
"name": "lesion"
},
"creation_time": "2019-04-29T10:01:01.632Z",
"id": "14",
"references": [],
"title": "gestione errori quando non c'e' un evento"
},
{
"assignedTo": {
"name": "lesion"
},
"creation_time": "2019-05-02T16:15:07.106Z",
"id": "19",
"references": [],
"title": "modifica eventi multigiorno"
},
{
"assignedTo": {
"name": "lesion"
},
"creation_time": "2019-05-02T11:50:28.476Z",
"id": "18",
"references": [],
"title": "notifiche email / iscrizione / evento da confermare"
},
{
"assignedTo": {
"name": "lesion"
},
"creation_time": "2019-06-01T21:15:42.190Z",
"id": "29",
"references": [],
"title": "settings di istanza (default filter, eg, eventi ricorrenti)"
}
],
"in-progress": [],
"testing": [],
"todo": [
{
"assignedTo": {
"name": "lesion"
},
"creation_time": "2019-06-01T21:00:22.155Z",
"id": "28",
"references": [],
"title": "activitypub stream"
},
{
"assignedTo": {
"name": "lesion"
},
"creation_time": "2019-05-27T15:42:35.467Z",
"id": "21",
"references": [],
"title": "all'admin deve mostrare un badge se ci sono pending operation"
},
{
"assignedTo": {
"name": "lesion"
},
"creation_time": "2019-05-29T13:08:20.887Z",
"id": "25",
"references": [],
"title": "creazione script di backup"
},
{
"assignedTo": {
"name": "lesion"
},
"category": "feature",
"creation_time": "2019-04-23T19:47:10.704Z",
"id": "4",
"prio": 0,
"references": [],
"title": "traduzione in inglese"
},
{
"assignedTo": {
"name": "lesion"
},
"category": "feature",
"creation_time": "2019-04-23T19:51:05.917Z",
"id": "9",
"prio": -1,
"references": [],
"title": "documentare sorgenti",
"type": "bug"
}
]
}
\ No newline at end of file
All notable changes to this project will be documented in this file.
### unreleased
- [model] migrations setup
- [feat] embeddable event widget/iframe
### 0.15.2
- [fix] delete event
- [fix] wrong html hierarchy
......
<template lang="pug">
nuxt-link.event(:to='`event/${link}`' :class='{ withImg: event.image_path }')
nuxt-link.event(:to='`/event/${link}`' target='_blank' :class='{ withImg: event.image_path }')
//- image
img(v-if='showImage && event.image_path' :src='`/media/thumb/${event.image_path}`')
//- image
img(v-if='showImage && event.image_path' :src='`/media/thumb/${event.image_path}`')
.event-info
.content-info
.event-info
.content-info
//- title
h2 {{event.title}}
//- title
h2 {{event.title}}
//- date / place
.date
div <v-icon name='clock'/> {{event|when('home')}}
div <v-icon name='map-marker-alt' /> {{event.place.name}}
//- date / place
.date
div <v-icon name='clock'/> {{event|when('home')}}
div <v-icon name='map-marker-alt' /> {{event.place.name}}
ul.tags(v-if='showTags && event.tags')
li(v-for='tag in event.tags' :key='tag') {{tag}}
li(v-if='settings.enable_federation && event.comments && event.comments.length') <u>{{$tc('common.comments', event.comments.length)}}</u>
ul.tags(v-if='showTags && event.tags')
li(v-for='tag in event.tags' :key='tag') {{tag}}
li(v-if='settings.enable_federation && event.comments && event.comments.length') <u>{{$tc('common.comments', event.comments.length)}}</u>
</template>
<script>
import { mapState, mapActions } from 'vuex'
......
<template lang='pug'>
.container
#error
el-main
el-card#error
h1(v-if="error.statusCode === 404") {{error.message}}
h1(v-else) An error occurred: {{error.message}}
</template>
......
......@@ -40,7 +40,7 @@ module.exports = {
{ src: '@/plugins/v-calendar', ssr: false }, // calendar, fix ssr
'@/plugins/i18n.js'
],
compression: false,
/*
** Nuxt.js modules
*/
......
......@@ -59,16 +59,17 @@
el-option(:label="$t('event.each_2w')" value='2w' key='2w')
//- el-option(:label="$t('event.each_month')" value='1m' key='1m')
v-date-picker.mb-2.mt-3(
:mode='event.type === "multidate" ? "range" : event.type === "recurrent" ? "multiple" : "single"'
:attributes='attributes'
v-model='date'
:locale='$i18n.locale'
:from-page.sync='page'
is-inline
is-expanded
:min-date='event.type !== "recurrent" && new Date()'
)
#picker.mx-auto
v-date-picker.mb-2.mt-3(
:mode='event.type === "multidate" ? "range" : event.type === "recurrent" ? "multiple" : "single"'
:attributes='attributes'
v-model='date'
:locale='$i18n.locale'
:from-page.sync='page'
is-inline
is-expanded
:min-date='event.type !== "recurrent" && new Date()'
)
div.text-center.mb-2(v-if='event.type === "recurrent"')
span(v-if='event.recurrent.frequency !== "1m" && event.recurrent.frequency !== "2m"') {{whenPatterns}}
......@@ -419,3 +420,8 @@ export default {
}
}
</script>
<style>
#picker {
max-width: 400px;
}
</style>
\ No newline at end of file
<template lang="pug">
nuxt-link.embed_event(:to='`/event/${link}`' target='_blank' :class='{ withImg: event.image_path }')
//- image
img.float-left(v-if='event.image_path' :src='`/media/thumb/${event.image_path}`')
.event-info
//- title
.date {{event|when('home')}}<br/>
h4 {{event.title}}
//- date / place
.date {{event.place.name}}<br/> {{event.place.address}}
</template>
<script>
import { mapState } from 'vuex'
import Event from '../../components/Event'
import moment from 'dayjs'
import get from 'lodash/get'
export default {
layout: 'event_iframe',
components: { Event },
data: {
loading: true
},
async asyncData ({ $axios, params, error, store }) {
try {
const [ id, start_datetime ] = params.event_id.split('_')
const event = await $axios.$get(`/event/${id}`)
event.start_datetime = start_datetime ? Number(start_datetime) : event.start_datetime
event.end_datetime = event.end_datetime
return { event, id: Number(id) }
} catch (e) {
error({ statusCode: 404, message: 'Event not found' })
}
},
computed: {
...mapState(['settings']),
date () {
return new Date(this.event.start_datetime).getDate()
},
link () {
if (this.event.recurrent) {
return `${this.event.id}_${this.event.start_datetime}`
}
return this.event.id
}
}
}
/**
* <style>
.embedded_gancio {
border: none;
width: 450px;
height: 220px;
float: left;
}</style>
<iframe src='http://localhost:13120/embed/1' class='embedded_gancio'></iframe>
*/
</script>
<style lang='less'>
a {
transition: margin .1s;
}
a:hover {
transform: prospective(10) translateX(10);
margin-left: 5px;
}
.embed_event {
background-image: url('/favicon.ico');
background-repeat: no-repeat;
background-position-x: right;
background-position-y: bottom;
img {
width: 150px;
object-fit: cover;
object-position: top;
margin-right: 5px;
height: 100%;
}
.event-info {
height: 100%;
color: #eee !important;
display: flex;
flex-direction: column;
padding: 5px;
.date {
color: #999;
}
}
background-color: #1f1f1f;
display: inline-block;
border: 1px solid #b1a3a3;
margin: 0px auto;
padding: 0px;
width: 400px;
height: 210px;
overflow: hidden;
border-radius: 10px;
// transition: all .2s;
margin: 0px;
}
// .embed_event:hover {
// transform: scale(1.03);
// }
</style>
......@@ -127,15 +127,6 @@ export default {
error({ statusCode: 404, message: 'Event not found' })
}
},
// async fetch ({ $axios, store }) {
// try {
// // const now = new Date()
// // const events = await $axios.$get(`/event/${now.getMonth()}/${now.getFullYear()}`)
// // return store.commit('setEvents', events)
// } catch (e) {
// console.error(e)
// }
// },
computed: {
...mapGetters(['filteredEvents']),
...mapState(['settings']),
......@@ -199,6 +190,8 @@ export default {
#eventDetail {
background-color: white;
margin-bottom: 30px;
padding-top: 0px;
.head {
z-index: 1;
position: sticky;
......
......@@ -94,8 +94,7 @@ const eventController = {
const format = req.params.format || 'json'
const is_admin = req.user && req.user.is_admin
const id = req.params.event_id
const event = await Event.findByPk(id, {
plain: true,
let event = await Event.findByPk(id, {
attributes: {
exclude: ['createdAt', 'updatedAt']
},
......@@ -109,6 +108,8 @@ const eventController = {
})
if (event && (event.is_visible || is_admin)) {
event = event.toJSON()
event.tags = event.tags.map(t => t.tag)
if (format === 'json') {
res.json(event)
} else if (format === 'ics') {
......
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment