cleaning
This commit is contained in:
parent
a4148f139c
commit
a6a465d1d0
8 changed files with 1319 additions and 1664 deletions
|
@ -15,7 +15,7 @@
|
|||
v-tooltip(bottom) {{$t('common.add_event')}}
|
||||
template(v-slot:activator='{ on }')
|
||||
v-btn(v-if='could_add' icon nuxt to='/add' v-on='on')
|
||||
v-icon mdi-calendar-plus
|
||||
v-icon(large color='primary') mdi-plus
|
||||
|
||||
v-tooltip(bottom) {{$t('common.share')}}
|
||||
template(v-slot:activator='{ on }')
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
<template lang='pug'>
|
||||
v-app(app)
|
||||
v-app
|
||||
Snackbar
|
||||
Confirm
|
||||
Nav
|
||||
|
||||
v-main(app)
|
||||
v-main
|
||||
v-fade-transition(hide-on-leave)
|
||||
nuxt
|
||||
|
||||
|
|
46
package.json
46
package.json
|
@ -28,7 +28,7 @@
|
|||
],
|
||||
"dependencies": {
|
||||
"@nuxtjs/auth": "^4.9.1",
|
||||
"@nuxtjs/axios": "^5.12.4",
|
||||
"@nuxtjs/axios": "^5.12.5",
|
||||
"accept-language": "^3.0.18",
|
||||
"axios": "^0.21.1",
|
||||
"bcryptjs": "^2.4.3",
|
||||
|
@ -39,9 +39,9 @@
|
|||
"cors": "^2.8.5",
|
||||
"cross-env": "^7.0.3",
|
||||
"date-fns": "^2.16.1",
|
||||
"dayjs": "^1.9.6",
|
||||
"dayjs": "^1.10.3",
|
||||
"dompurify": "^2.2.6",
|
||||
"email-templates": "^8.0.2",
|
||||
"email-templates": "^8.0.3",
|
||||
"express": "^4.17.1",
|
||||
"express-oauth-server": "^2.0.0",
|
||||
"fs": "^0.0.1-security",
|
||||
|
@ -51,7 +51,7 @@
|
|||
"inquirer": "^7.3.3",
|
||||
"jsdom": "^16.4.0",
|
||||
"jsonwebtoken": "^8.5.1",
|
||||
"less": "^4.0.0",
|
||||
"less": "^4.1.0",
|
||||
"linkifyjs": "^2.1.9",
|
||||
"lodash": "^4.17.20",
|
||||
"microformat-node": "^2.0.1",
|
||||
|
@ -62,44 +62,44 @@
|
|||
"nuxt": "^2.14.12",
|
||||
"nuxt-express-module": "^0.0.11",
|
||||
"pg": "^8.5.1",
|
||||
"sequelize": "^6.3.5",
|
||||
"sequelize": "^6.4.0",
|
||||
"sequelize-cli": "^6.2.0",
|
||||
"sharp": "^0.27.0",
|
||||
"sqlite3": "^5.0.0",
|
||||
"tiptap": "^1.30.0",
|
||||
"tiptap-extensions": "^1.33.2",
|
||||
"sqlite3": "^5.0.1",
|
||||
"tiptap": "^1.31.0",
|
||||
"tiptap-extensions": "^1.34.0",
|
||||
"to-ico": "^1.1.5",
|
||||
"url": "^0.11.0",
|
||||
"v-calendar": "^2.1.3",
|
||||
"v-calendar": "^2.2.0",
|
||||
"vue-clipboard2": "^0.3.1",
|
||||
"vue-i18n": "^8.22.2",
|
||||
"vue-i18n": "^8.22.4",
|
||||
"yargs": "^16.1.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@mdi/font": "^5.8.55",
|
||||
"@mdi/font": "^5.9.55",
|
||||
"@nuxtjs/eslint-config": "^5.0.0",
|
||||
"@nuxtjs/vuetify": "^1.11.2",
|
||||
"@nuxtjs/vuetify": "^1.11.3",
|
||||
"babel-eslint": "^10.1.0",
|
||||
"eslint": "^7.16.0",
|
||||
"eslint-config-prettier": "^7.1.0",
|
||||
"eslint": "^7.18.0",
|
||||
"eslint-config-prettier": "^7.2.0",
|
||||
"eslint-config-standard": "^16.0.2",
|
||||
"eslint-loader": "^4.0.2",
|
||||
"eslint-plugin-import": "^2.22.1",
|
||||
"eslint-plugin-node": ">=11.1.0",
|
||||
"eslint-plugin-nuxt": "^2.0.0",
|
||||
"eslint-plugin-prettier": "^3.3.0",
|
||||
"eslint-plugin-prettier": "^3.3.1",
|
||||
"eslint-plugin-promise": ">=4.0.1",
|
||||
"eslint-plugin-standard": "^5.0.0",
|
||||
"eslint-plugin-vue": "^7.3.0",
|
||||
"less-loader": "^7.2.0",
|
||||
"nodemon": "^2.0.6",
|
||||
"eslint-plugin-vue": "^7.5.0",
|
||||
"less-loader": "^7.3.0",
|
||||
"nodemon": "^2.0.7",
|
||||
"prettier": "^2.2.1",
|
||||
"pug-plain-loader": "^1.1.0",
|
||||
"sass": "^1.30.0",
|
||||
"sass-loader": "^10.1.0",
|
||||
"vue-cli-plugin-vuetify": "~2.0.8",
|
||||
"sass": "^1.32.5",
|
||||
"sass-loader": "^10.1.1",
|
||||
"vue-cli-plugin-vuetify": "~2.0.9",
|
||||
"vuetify-loader": "^1.3.0",
|
||||
"webpack-cli": "^4.3.0"
|
||||
"webpack-cli": "^4.4.0"
|
||||
},
|
||||
"resolutions": {
|
||||
"prosemirror-model": "1.13.1"
|
||||
|
@ -112,7 +112,7 @@
|
|||
"url": "https://framagit.org/les/gancio/issues"
|
||||
},
|
||||
"homepage": "https://gancio.org",
|
||||
"keywords": [
|
||||
"keywords": [
|
||||
"AP",
|
||||
"gancio",
|
||||
"events",
|
||||
|
|
|
@ -178,8 +178,10 @@ export default {
|
|||
await this.$axios.$post('/event', formData)
|
||||
}
|
||||
this.updateMeta()
|
||||
this.$router.replace('/')
|
||||
this.$root.$message(this.$auth.loggedIn ? 'event.added' : 'event.added_anon', { color: 'success' })
|
||||
this.$router.push('/')
|
||||
this.$nextTick(() => {
|
||||
this.$root.$message(this.$auth.loggedIn ? 'event.added' : 'event.added_anon', { color: 'success' })
|
||||
})
|
||||
} catch (e) {
|
||||
switch (e.request.status) {
|
||||
case 413:
|
||||
|
|
|
@ -29,13 +29,13 @@ v-container
|
|||
.title.text-h5
|
||||
b.p-name {{event.title}}
|
||||
|
||||
time.dt-start.text-h5(:datetime='event.start_datetime|unixFormat("YYYY-MM-DD HH:mm")')
|
||||
time.dt-start.text-h6(:datetime='event.start_datetime|unixFormat("YYYY-MM-DD HH:mm")')
|
||||
v-icon mdi-calendar
|
||||
b.ml-2 {{event|when}}
|
||||
div.subtitle-1 {{event.start_datetime|from}}
|
||||
small(v-if='event.parentId') ({{event|recurrentDetail}})
|
||||
|
||||
.text-h5.p-location
|
||||
.text-h6.p-location
|
||||
v-icon mdi-map-marker
|
||||
b.vcard.ml-2 {{event.place.name}}
|
||||
p.adr {{event.place.address}}
|
||||
|
@ -58,7 +58,7 @@ v-container
|
|||
:href='`/api/event/${event.id}.ics`')
|
||||
v-icon mdi-calendar-export
|
||||
|
||||
.p-description.text-h6(v-html='event.description')
|
||||
.p-description.text-body-1.px-5(v-html='event.description')
|
||||
v-chip.p-category.ml-1(v-for='tag in event.tags' color='primary'
|
||||
outlined :key='tag' v-text='tag')
|
||||
|
||||
|
@ -258,6 +258,7 @@ export default {
|
|||
},
|
||||
methods: {
|
||||
keyDown (ev) {
|
||||
if (ev.altKey || ev.ctrlKey || ev.metaKey || ev.shiftKey) { return }
|
||||
if (ev.key === 'ArrowRight' && this.event.next) {
|
||||
this.$router.push(`/event/${this.event.next}`)
|
||||
}
|
||||
|
|
|
@ -17,9 +17,9 @@
|
|||
v-chip(v-if='selectedDay' close @click:close='dayChange({ date: selectedDay})') {{selectedDay}}
|
||||
|
||||
//- Events
|
||||
#events
|
||||
Event(v-for='(event, idx) in events' :key='event.id' :event='event' :show='idx>=firstVisibleItem && idx<=lastVisibleItem'
|
||||
@tagclick='tagClick' @placeclick='placeClick')
|
||||
#events.mt-1
|
||||
//- div.event(v-for='(event, idx) in events' :key='event.id' v-intersect="(entries, observer, isIntersecting) => intersecting[event.id] = isIntersecting")
|
||||
Event(:event='event' v-for='(event, idx) in events' :key='event.id' @tagclick='tagClick' @placeclick='placeClick')
|
||||
|
||||
</template>
|
||||
|
||||
|
@ -50,45 +50,17 @@ export default {
|
|||
end: null,
|
||||
filters: { tags: [], places: [], show_recurrent: $store.state.settings.allow_recurrent_event && $store.state.settings.recurrent_event_visible },
|
||||
selectedDay: null,
|
||||
firstVisibleItem: 0,
|
||||
lastVisibleItem: 20
|
||||
// intersecting: {}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapState(['settings', 'announcements'])
|
||||
},
|
||||
mounted () {
|
||||
let last_known_scroll_position = 0
|
||||
let ticking = false
|
||||
|
||||
document.addEventListener('scroll', e => {
|
||||
last_known_scroll_position = window.scrollY
|
||||
|
||||
if (!ticking) {
|
||||
window.requestAnimationFrame(() => {
|
||||
this.scroll(last_known_scroll_position)
|
||||
ticking = false
|
||||
})
|
||||
|
||||
ticking = true
|
||||
}
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
// onIntersect (isIntersecting, eventId) {
|
||||
// this.intersecting[eventId] = isIntersecting
|
||||
// },
|
||||
...mapActions(['setFilters']),
|
||||
scroll (y) {
|
||||
const rowHeight = 370
|
||||
const nItems = this.events.length
|
||||
const fullHeight = document.getElementById('events').offsetHeight
|
||||
const nRows = fullHeight / rowHeight
|
||||
const itemPerRow = nItems / nRows
|
||||
const visibleRows = 10
|
||||
this.firstVisibleItem = Math.trunc(((y - 370) / rowHeight) * itemPerRow) - (5 * itemPerRow)
|
||||
this.lastVisibleItem = this.firstVisibleItem + (visibleRows * itemPerRow)
|
||||
|
||||
console.error('Scrolled to ', y, ' nItems', nItems, 'fullHeight', fullHeight, ' itemPerRow', itemPerRow, ' nRow', nRows)
|
||||
console.error('mostro dal ', this.firstVisibleItem, this.lastVisibleItem)
|
||||
},
|
||||
async updateEvents () {
|
||||
this.events = await this.$api.getEvents({
|
||||
start: this.start,
|
||||
|
|
|
@ -70,7 +70,7 @@ export default ({ app, store }) => {
|
|||
|
||||
// multidate
|
||||
if (event.multidate) {
|
||||
return `${start.format('ddd, D MMMM HH:mm')} - ${end.format('ddd, D MMMM')}`
|
||||
return `${start.format('ddd, D MMM HH:mm')} - ${end.format('ddd, D MMM')}`
|
||||
}
|
||||
|
||||
// normal event
|
||||
|
|
Loading…
Reference in a new issue