mirror of
https://framagit.org/les/gancio.git
synced 2025-01-31 16:42:22 +01:00
Merge branch 'master' into dev
This commit is contained in:
commit
019161eff9
12 changed files with 713 additions and 595 deletions
|
@ -1,5 +1,14 @@
|
|||
All notable changes to this project will be documented in this file.
|
||||
|
||||
### 1.5.5 - 21 set '22
|
||||
- fix #185 - wrong res.download api usage
|
||||
- fix some dialog background on light theme
|
||||
- update sequelize and remove live patch
|
||||
- improve events filtering on selected day
|
||||
- allow tags complete removals
|
||||
- improve homepage performance
|
||||
- docs: add scheme to nginx proxy configuration
|
||||
|
||||
### 1.5.4 - 6 set '22
|
||||
- Update webcomponent deps
|
||||
- Refactor datime display in webcomponent
|
||||
|
|
|
@ -1,13 +1,11 @@
|
|||
import dayjs from 'dayjs'
|
||||
|
||||
export function attributesFromEvents(_events) {
|
||||
|
||||
// const colors = ['teal', 'green', 'yellow', 'teal', 'indigo', 'green', 'red', 'purple', 'pink', 'gray']
|
||||
// merge events with same date
|
||||
let attributes = []
|
||||
const now = dayjs().unix()
|
||||
for (let e of _events) {
|
||||
const key = dayjs.unix(e.start_datetime).tz().format('YYYYMMDD')
|
||||
const key = Math.floor(e.start_datetime/(3600*24)) // dayjs.unix(e.start_datetime).tz().format('YYYYMMDD')
|
||||
const c = (e.end_datetime || e.start_datetime) < now ? 'vc-past' : ''
|
||||
|
||||
if (e.multidate) {
|
||||
|
|
|
@ -16,52 +16,15 @@ v-card.h-event.event.d-flex(itemscope itemtype="https://schema.org/Event")
|
|||
v-chip.ml-1.mt-1(v-for='tag in event.tags.slice(0, 6)' small :to='`/tag/${tag}`'
|
||||
:key='tag' outlined color='primary') {{ tag }}
|
||||
|
||||
client-only
|
||||
v-menu(offset-y eager)
|
||||
template(v-slot:activator="{ on }")
|
||||
v-btn.align-self-end(icon v-on='on' color='primary' title='more' aria-label='more')
|
||||
v-icon(v-text='mdiDotsVertical')
|
||||
v-list(dense)
|
||||
v-list-item-group
|
||||
v-list-item(@click='clipboard(`${settings.baseurl}/event/${event.slug || event.id}`)')
|
||||
v-list-item-icon
|
||||
v-icon(v-text='mdiContentCopy')
|
||||
v-list-item-content
|
||||
v-list-item-title {{ $t('common.copy_link') }}
|
||||
v-list-item(:href='`/api/event/${event.slug || event.id}.ics`')
|
||||
v-list-item-icon
|
||||
v-icon(v-text='mdiCalendarExport')
|
||||
v-list-item-content
|
||||
v-list-item-title {{ $t('common.add_to_calendar') }}
|
||||
v-list-item(v-if='is_mine' :to='`/add/${event.id}`')
|
||||
v-list-item-icon
|
||||
v-icon(v-text='mdiPencil')
|
||||
v-list-item-content
|
||||
v-list-item-title {{ $t('common.edit') }}
|
||||
v-list-item(v-if='is_mine' @click='remove(false)')
|
||||
v-list-item-icon
|
||||
v-icon(color='error' v-text='mdiDeleteForever')
|
||||
v-list-item-content
|
||||
v-list-item-title {{ $t('common.remove') }}
|
||||
template(#placeholder)
|
||||
v-btn.align-self-end(icon color='primary' aria-label='more')
|
||||
v-icon(v-text='mdiDotsVertical')
|
||||
</template>
|
||||
<script>
|
||||
import { mapState } from 'vuex'
|
||||
import clipboard from '../assets/clipboard'
|
||||
import MyPicture from '~/components/MyPicture'
|
||||
import {
|
||||
mdiRepeat, mdiPencil, mdiDotsVertical, mdiContentCopy,
|
||||
mdiCalendarExport, mdiDeleteForever, mdiCalendar, mdiMapMarker
|
||||
} from '@mdi/js'
|
||||
import { mdiRepeat } from '@mdi/js'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
mdiRepeat, mdiPencil, mdiDotsVertical, mdiContentCopy, mdiCalendarExport,
|
||||
mdiDeleteForever, mdiMapMarker, mdiCalendar
|
||||
}
|
||||
return { mdiRepeat }
|
||||
},
|
||||
components: {
|
||||
MyPicture
|
||||
|
@ -70,27 +33,6 @@ export default {
|
|||
event: { type: Object, default: () => ({}) },
|
||||
lazy: Boolean
|
||||
},
|
||||
mixins: [clipboard],
|
||||
computed: {
|
||||
...mapState(['settings']),
|
||||
is_mine() {
|
||||
if (!this.$auth.user) {
|
||||
return false
|
||||
}
|
||||
return (
|
||||
this.event.userId === this.$auth.user.id || this.$auth.user.is_admin
|
||||
)
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async remove() {
|
||||
const ret = await this.$root.$confirm('event.remove_confirmation')
|
||||
if (!ret) { return }
|
||||
await this.$axios.delete(`/event/${this.event.id}`)
|
||||
this.$emit('destroy', this.event.id)
|
||||
this.$root.$message('admin.event_remove_ok')
|
||||
|
||||
}
|
||||
}
|
||||
computed: mapState(['settings'])
|
||||
}
|
||||
</script>
|
||||
|
|
|
@ -8,6 +8,15 @@ nav_order: 10
|
|||
|
||||
All notable changes to this project will be documented in this file.
|
||||
|
||||
### 1.5.5 - 21 set '22
|
||||
- fix #185 - wrong res.download api usage
|
||||
- fix some dialog background on light theme
|
||||
- update sequelize and remove live patch
|
||||
- improve events filtering on selected day
|
||||
- allow tags complete removals
|
||||
- improve homepage performance
|
||||
- docs: add scheme to nginx proxy configuration
|
||||
|
||||
### 1.5.4 - 6 set '22
|
||||
- Update webcomponent deps
|
||||
- Refactor datime display in webcomponent
|
||||
|
|
|
@ -29,6 +29,8 @@ server {
|
|||
|
||||
location @proxy {
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
proxy_pass http://127.0.0.1:13120;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"common": {
|
||||
"add_event": "Nuovo evento",
|
||||
"add_event": "Aggiungi evento",
|
||||
"next": "Continua",
|
||||
"export": "Esporta",
|
||||
"send": "Invia",
|
||||
|
|
16
package.json
16
package.json
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "gancio",
|
||||
"version": "1.5.4",
|
||||
"version": "1.5.5",
|
||||
"description": "A shared agenda for local communities",
|
||||
"author": "lesion",
|
||||
"scripts": {
|
||||
|
@ -51,7 +51,7 @@
|
|||
"http-signature": "^1.3.6",
|
||||
"https-proxy-agent": "^5.0.1",
|
||||
"ical.js": "^1.5.0",
|
||||
"ics": "^2.37.0",
|
||||
"ics": "^2.40.0",
|
||||
"jsdom": "^20.0.0",
|
||||
"jsonwebtoken": "^8.5.1",
|
||||
"linkify-html": "^3.0.4",
|
||||
|
@ -63,10 +63,10 @@
|
|||
"mkdirp": "^1.0.4",
|
||||
"multer": "^1.4.5-lts.1",
|
||||
"mysql2": "^2.3.3",
|
||||
"nuxt-edge": "2.16.0-27616340.013f051b",
|
||||
"nuxt-edge": "2.16.0-27715704.54e852f",
|
||||
"pg": "^8.8.0",
|
||||
"sequelize": "^6.21.4",
|
||||
"sequelize-slugify": "^1.6.1",
|
||||
"sequelize": "^6.21.6",
|
||||
"sequelize-slugify": "^1.6.2",
|
||||
"sharp": "^0.27.2",
|
||||
"sqlite3": "^5.0.11",
|
||||
"telegraf": "^4.9.1",
|
||||
|
@ -75,14 +75,14 @@
|
|||
"umzug": "^2.3.0",
|
||||
"v-calendar": "^2.4.1",
|
||||
"vue-i18n": "^8.26.7",
|
||||
"vuetify": "2.6.9",
|
||||
"winston": "^3.8.1",
|
||||
"vuetify": "2.6.10",
|
||||
"winston": "^3.8.2",
|
||||
"winston-daily-rotate-file": "^4.7.1",
|
||||
"yargs": "^17.5.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@nuxtjs/vuetify": "^1.12.3",
|
||||
"jest": "^29.0.0",
|
||||
"jest": "^29.0.3",
|
||||
"prettier": "^2.7.1",
|
||||
"pug": "^3.0.2",
|
||||
"pug-plain-loader": "^1.1.0",
|
||||
|
|
|
@ -91,7 +91,7 @@ export default {
|
|||
if (this.selectedDay) {
|
||||
const min = dayjs.tz(this.selectedDay).startOf('day').unix()
|
||||
const max = dayjs.tz(this.selectedDay).endOf('day').unix()
|
||||
return this.events.filter(e => (e.start_datetime <= max && e.end_datetime >= min) && (this.show_recurrent || !e.parentId))
|
||||
return this.events.filter(e => (e.start_datetime <= max && (e.end_datetime || e.start_datetime) >= min) && (this.show_recurrent || !e.parentId))
|
||||
} else if (this.isCurrentMonth) {
|
||||
return this.events.filter(e => ((e.end_datetime ? e.end_datetime > now : e.start_datetime + 2 * 60 * 60 > now) && (this.show_recurrent || !e.parentId)))
|
||||
} else {
|
||||
|
|
|
@ -570,8 +570,8 @@ const eventController = {
|
|||
let tags = []
|
||||
if (body.tags) {
|
||||
tags = await tagController._findOrCreate(body.tags)
|
||||
await event.setTags(tags)
|
||||
}
|
||||
await event.setTags(tags)
|
||||
|
||||
let newEvent = await Event.findByPk(event.id, { include: [Tag, Place] })
|
||||
newEvent = newEvent.get()
|
||||
|
|
|
@ -1,9 +1,5 @@
|
|||
const Sequelize = require('sequelize')
|
||||
|
||||
// this is an hack: https://github.com/sequelize/sequelize/pull/14800
|
||||
const livePatchMariaDBDialect = require('sequelize/lib/dialects/mariadb/query')
|
||||
livePatchMariaDBDialect.prototype.handleJsonSelectQuery = () => null
|
||||
|
||||
const Umzug = require('umzug')
|
||||
const path = require('path')
|
||||
const config = require('../../config')
|
||||
|
|
|
@ -108,8 +108,12 @@ module.exports = {
|
|||
const router = express.Router()
|
||||
// serve images/thumb
|
||||
router.use('/media/', express.static(config.upload_path, { immutable: true, maxAge: '1y' }), (_req, res) => res.sendStatus(404))
|
||||
router.use('/download/:filename', (req, res, next) => {
|
||||
return res.download(req.params.filename, undefined, { root: config.upload_path }, err => res.status(404).send('Not found (but nice try 😊)'))
|
||||
router.use('/download/:filename', (req, res) => {
|
||||
return res.download(req.params.filename, undefined, { root: config.upload_path }, err => {
|
||||
if (err) {
|
||||
res.status(404).send('Not found (but nice try 😊)')
|
||||
}
|
||||
})
|
||||
})
|
||||
router.use('/noimg.svg', express.static('./static/noimg.svg'))
|
||||
|
||||
|
|
Loading…
Reference in a new issue