mirror of
https://framagit.org/les/gancio.git
synced 2025-01-31 16:42:22 +01:00
update deps, better announcement, followme, home, embed, rules validators
This commit is contained in:
parent
f9dd4e05f7
commit
cc4eb2043c
8 changed files with 617 additions and 495 deletions
|
@ -1,6 +1,6 @@
|
|||
<template lang="pug">
|
||||
nuxt-link(:to='`/announcement/${announcement.id}`')
|
||||
v-alert.mb-0(border='left' color="primary") {{announcement.title}}
|
||||
v-alert.mb-0(border='left' type='info' color="primary" show-icon) {{announcement.title}}
|
||||
|
||||
</template>
|
||||
<script>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<template lang='pug'>
|
||||
div
|
||||
v-card
|
||||
p(v-html="$t('event.follow_me_description', { title: settings.title, account: `@${settings.instance_name}@${domain}`})")
|
||||
v-text-field(v-model='instance_hostname' ref='instance')
|
||||
a(slot='append' :href='link' target='_blank')
|
||||
|
|
|
@ -60,4 +60,8 @@ export default {
|
|||
flex-wrap: wrap;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.v-dialog {
|
||||
width: unset !important;
|
||||
}
|
||||
</style>
|
||||
|
|
42
package.json
42
package.json
|
@ -28,56 +28,56 @@
|
|||
],
|
||||
"dependencies": {
|
||||
"@nuxtjs/auth": "^4.9.1",
|
||||
"@nuxtjs/axios": "^5.12.0",
|
||||
"@nuxtjs/axios": "^5.12.2",
|
||||
"accept-language": "^3.0.18",
|
||||
"axios": "^0.19.2",
|
||||
"axios": "^0.20.0",
|
||||
"bcryptjs": "^2.4.3",
|
||||
"body-parser": "^1.18.3",
|
||||
"config": "^3.3.1",
|
||||
"consola": "^2.13.0",
|
||||
"consola": "^2.15.0",
|
||||
"cookie-parser": "^1.4.5",
|
||||
"cors": "^2.8.5",
|
||||
"cross-env": "^7.0.2",
|
||||
"date-fns": "^2.15.0",
|
||||
"dayjs": "^1.8.32",
|
||||
"dompurify": "^2.0.11",
|
||||
"date-fns": "^2.16.0",
|
||||
"dayjs": "^1.8.34",
|
||||
"dompurify": "^2.0.13",
|
||||
"email-templates": "^7.1.0",
|
||||
"express": "^4.17.1",
|
||||
"express-oauth-server": "^2.0.0",
|
||||
"http-signature": "^1.3.4",
|
||||
"ics": "^2.22.1",
|
||||
"ics": "^2.24.0",
|
||||
"inquirer": "^7.3.3",
|
||||
"jsdom": "^16.3.0",
|
||||
"jsdom": "^16.4.0",
|
||||
"jsonwebtoken": "^8.5.1",
|
||||
"less": "^3.12.2",
|
||||
"linkifyjs": "^2.1.9",
|
||||
"lodash": "^4.17.19",
|
||||
"lodash": "^4.17.20",
|
||||
"mkdirp": "^1.0.4",
|
||||
"moment-timezone": "^0.5.31",
|
||||
"morgan": "^1.10.0",
|
||||
"multer": "^1.4.2",
|
||||
"nuxt": "^2.14.1",
|
||||
"nuxt": "^2.14.4",
|
||||
"nuxt-express-module": "^0.0.11",
|
||||
"pg": "^8.3.0",
|
||||
"pg": "^8.3.3",
|
||||
"sequelize": "^6.3.4",
|
||||
"sequelize-cli": "^6.2.0",
|
||||
"sharp": "^0.25.4",
|
||||
"sharp": "^0.26.0",
|
||||
"sqlite3": "^5.0.0",
|
||||
"tiptap": "^1.29.3",
|
||||
"tiptap-extensions": "^1.31.3",
|
||||
"tiptap": "^1.29.6",
|
||||
"tiptap-extensions": "^1.32.5",
|
||||
"to-ico": "^1.1.5",
|
||||
"url": "^0.11.0",
|
||||
"v-calendar": "^1.0.8",
|
||||
"vue-clipboard2": "^0.3.1",
|
||||
"vue-i18n": "^8.20.0",
|
||||
"vue-i18n": "^8.21.0",
|
||||
"yargs": "^15.4.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@mdi/font": "^5.4.55",
|
||||
"@mdi/font": "^5.5.55",
|
||||
"@nuxtjs/eslint-config": "^3.1.0",
|
||||
"@nuxtjs/vuetify": "^1.11.2",
|
||||
"babel-eslint": "^10.1.0",
|
||||
"eslint": "^7.6.0",
|
||||
"eslint": "^7.7.0",
|
||||
"eslint-config-prettier": "^6.11.0",
|
||||
"eslint-config-standard": ">=14.1.1",
|
||||
"eslint-loader": "^4.0.2",
|
||||
|
@ -88,19 +88,19 @@
|
|||
"eslint-plugin-promise": ">=4.0.1",
|
||||
"eslint-plugin-standard": ">=4.0.1",
|
||||
"eslint-plugin-vue": "^6.2.2",
|
||||
"less-loader": "^6.2.0",
|
||||
"less-loader": "^7.0.0",
|
||||
"nodemon": "^2.0.4",
|
||||
"prettier": "^2.0.5",
|
||||
"prettier": "^2.1.1",
|
||||
"pug-plain-loader": "^1.0.0",
|
||||
"sass": "^1.19.0",
|
||||
"sass-loader": "^9.0.2",
|
||||
"sass-loader": "^10.0.1",
|
||||
"vue-cli-plugin-vuetify": "~2.0.7",
|
||||
"vuetify-loader": "^1.3.0",
|
||||
"webpack-cli": "^3.3.12"
|
||||
},
|
||||
"resolutions": {
|
||||
"prosemirror-model": "1.11.0"
|
||||
},
|
||||
},
|
||||
"bin": {
|
||||
"gancio": "server/cli.js"
|
||||
},
|
||||
|
|
|
@ -35,23 +35,25 @@
|
|||
:label="$t('common.tags')")
|
||||
|
||||
//- WHERE
|
||||
//- v-divider
|
||||
//- i.el-icon-location-outline
|
||||
//- span {{$t('common.where')}}
|
||||
//- p(v-html="$t('event.where_description')")
|
||||
v-combobox(v-model='event.place.name'
|
||||
v-combobox.mt-2(v-model='event.place.name'
|
||||
:rules="[validators.required('place')]"
|
||||
:label="$t('common.where')"
|
||||
:hint="$t('event.where_description')"
|
||||
persistent-hint
|
||||
:items="places"
|
||||
item-text='name'
|
||||
@change='selectPlace')
|
||||
@input='selectPlace')
|
||||
template(v-slot:item="{ item }")
|
||||
v-list
|
||||
v-list-item-content
|
||||
v-list-item-title {{item.name}}
|
||||
v-list-item-subtitle {{item.address}}
|
||||
|
||||
//- div {{$t("common.address")}}
|
||||
v-text-field(ref='address' :label="$t('common.address')" v-model='event.place.address' :disabled='disableAddress')
|
||||
v-text-field.mt-3(ref='address'
|
||||
:rules="[validators.required('address')]"
|
||||
:label="$t('common.address')"
|
||||
v-model='event.place.address'
|
||||
:disabled='disableAddress')
|
||||
|
||||
//- WHEN
|
||||
//- v-divider <v-icon name='clock'/> {{$t('common.when')}}
|
||||
|
@ -103,10 +105,10 @@
|
|||
template(v-slot:activator='{ on }')
|
||||
v-text-field(
|
||||
:label="$t('event.from')"
|
||||
:rules="validators.required('from')"
|
||||
:value='time.start'
|
||||
v-on='on'
|
||||
clearable
|
||||
readonly)
|
||||
clearable)
|
||||
v-time-picker(
|
||||
v-if='fromDateMenu'
|
||||
:label="$t('event.from')"
|
||||
|
@ -326,42 +328,16 @@ export default {
|
|||
})))
|
||||
|
||||
return attributes
|
||||
},
|
||||
// filteredTags () {
|
||||
// const queryTags = this.queryTags.toLowerCase()
|
||||
// return _(this.tags)
|
||||
// .filter(t => !this.event.tags.includes(t.tag))
|
||||
// .filter(t => t.tag.includes(queryTags))
|
||||
// // .pick('tag')
|
||||
// .take(5)
|
||||
// .value()
|
||||
// },
|
||||
// couldProceed () {
|
||||
// return true
|
||||
// return (this.event.place.name.length > 0 &&
|
||||
// this.event.place.address.length > 0 &&
|
||||
// (this.date && this.time.start) &&
|
||||
// this.event.title.length > 0)
|
||||
// }
|
||||
}
|
||||
},
|
||||
// mounted () {
|
||||
// this.$refs.title.focus()
|
||||
// },
|
||||
methods: {
|
||||
...mapActions(['addEvent', 'updateEvent', 'updateMeta', 'updateEvents']),
|
||||
// filterPlaces (q, cb) {
|
||||
// const query = q.toLowerCase()
|
||||
// const ret = _(this.places)
|
||||
// .filter(p => p.name.toLowerCase().includes(query))
|
||||
// .take(5)
|
||||
// .map(p => ({ value: p.name }))
|
||||
// .value()
|
||||
// ret.unshift({ value: q })
|
||||
// cb(ret)
|
||||
// },
|
||||
selectPlace (p) {
|
||||
console.error('dentro selecte place ', p)
|
||||
const place = this.places.find(place => place.id === p)
|
||||
const place = this.places.find(place => place.id === p.id)
|
||||
console.error('vediamo se ho trovato il place', place)
|
||||
if (place && place.address) {
|
||||
this.event.place.address = place.address
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
<template lang="pug">
|
||||
v-card.h-event.eventDetail
|
||||
//- .d-block
|
||||
v-container
|
||||
v-list-item(two-line)
|
||||
v-list-item-content
|
||||
|
@ -22,81 +21,77 @@
|
|||
:to='`/event/${event.next}`' :disabled='!event.next')
|
||||
v-icon mdi-arrow-right
|
||||
|
||||
v-card-text
|
||||
//- v-dialog.embedDialog(:visible.sync='showEmbed')
|
||||
h4(slot='title') {{$t('common.embed_title')}}
|
||||
EmbedEvent(:event='event')
|
||||
v-container
|
||||
v-dialog(v-model='showEmbed')
|
||||
EmbedEvent(:event='event')
|
||||
|
||||
//- v-row
|
||||
v-col(sm="10")
|
||||
//- TOFIX: avoid reflow
|
||||
//- event image
|
||||
v-img.main_image.mb-3(
|
||||
contain
|
||||
:src='imgPath'
|
||||
:lazy-src='thumbImgPath'
|
||||
v-if='event.image_path')
|
||||
//- template(v-slot:placeholder)
|
||||
//- v-row(
|
||||
//- class="fill-height ma-0"
|
||||
//- align="center"
|
||||
//- justify="center")
|
||||
//- v-progress-circular(indeterminate
|
||||
//- color="grey lighten-5")
|
||||
|
||||
//- event image
|
||||
v-img.main_image.mb-3(
|
||||
contain
|
||||
lazy
|
||||
:src='imgPath'
|
||||
:lazy-src='thumbImgPath'
|
||||
v-if='event.image_path')
|
||||
template(v-slot:placeholder)
|
||||
v-row(
|
||||
class="fill-height ma-0"
|
||||
align="center"
|
||||
justify="center")
|
||||
v-progress-circular(indeterminate
|
||||
color="grey lighten-5")
|
||||
div.p-description(v-html='event.description')
|
||||
v-chip.p-category.ml-1(small v-for='tag in event.tags' color='primary' outlined :key='tag') {{tag}}
|
||||
|
||||
div.p-description(v-html='event.description')
|
||||
v-chip.p-category.ml-1(small v-for='tag in event.tags' color='primary' outlined :key='tag') {{tag}}
|
||||
//- info & actions
|
||||
v-btn(text color='primary'
|
||||
v-clipboard:success='copyLink'
|
||||
v-clipboard:copy='`${settings.baseurl}/event/${event.id}`') {{$t('common.copy_link')}}
|
||||
|
||||
//- info & actions
|
||||
v-btn(text color='primary'
|
||||
v-clipboard:success='copyLink'
|
||||
v-clipboard:copy='`${settings.baseurl}/event/${event.id}`') {{$t('common.copy_link')}}
|
||||
v-btn(@click='showEmbed=true' text color='primary') {{$t('common.embed')}}
|
||||
|
||||
v-btn(@click='showEmbed=true' text color='primary') {{$t('common.embed')}}
|
||||
v-btn(:href='`${settings.baseurl}/api/event/${event.id}.ics`' text color='primary') {{$t('common.add_to_calendar')}}
|
||||
EventAdmin(v-if='is_mine' :event='event')
|
||||
|
||||
v-btn(:href='`${settings.baseurl}/api/event/${event.id}.ics`' text color='primary') {{$t('common.add_to_calendar')}}
|
||||
EventAdmin(v-if='is_mine' :event='event')
|
||||
//- hr
|
||||
|
||||
//- hr
|
||||
//- 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/>
|
||||
|
||||
//- 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/>
|
||||
p.p-2
|
||||
v-btn(type='text' @click='showFollowMe=true') {{$t('event.interact_with_me')}}
|
||||
span(v-if='settings.enable_resources && event.resources.length') - {{$tc('common.n_resources', event.resources.length)}}
|
||||
|
||||
p.p-2
|
||||
v-btn(type='text' @click='showFollowMe=true') {{$t('event.interact_with_me')}}
|
||||
span(v-if='settings.enable_resources && event.resources.length') - {{$tc('common.n_resources', event.resources.length)}}
|
||||
v-dialog(v-model='showFollowMe' destroy-on-close)
|
||||
h4(slot='title') {{$t('common.follow_me_title')}}
|
||||
FollowMe
|
||||
|
||||
v-dialog(v-model='showFollowMe' destroy-on-close)
|
||||
h4(slot='title') {{$t('common.follow_me_title')}}
|
||||
FollowMe
|
||||
v-dialog.showResource#resourceDialog(v-model='showResources' fullscreen
|
||||
width='95vw'
|
||||
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-card.mb-1(v-if='settings.enable_resources' v-for='resource in event.resources' :key='resource.id' :class='{disabled: resource.hidden}')
|
||||
span
|
||||
v-dropdown.mr-2(v-if='$auth.user && $auth.user.is_admin')
|
||||
v-btn(circle icon='el-icon-more' size='mini')
|
||||
v-menu(slot='dropdown')
|
||||
el-dropdown-item(v-if='!resource.hidden' icon='el-icon-remove' @click.native='hideResource(resource, true)') {{$t('admin.hide_resource')}}
|
||||
el-dropdown-item(v-else icon='el-icon-success' @click.native='hideResource(resource, false)') {{$t('admin.show_resource')}}
|
||||
el-dropdown-item(icon='el-icon-delete' @click.native='deleteResource(resource)') {{$t('admin.delete_resource')}}
|
||||
el-dropdown-item(icon='el-icon-lock' @click.native='blockUser(resource)') {{$t('admin.block_user')}}
|
||||
a(:href='resource.data.url || resource.data.context')
|
||||
small {{resource.data.published|dateFormat('ddd, D MMMM HH:mm')}}
|
||||
|
||||
v-dialog.showResource#resourceDialog(v-model='showResources' fullscreen
|
||||
width='95vw'
|
||||
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-card.mb-1(v-if='settings.enable_resources' v-for='resource in event.resources' :key='resource.id' :class='{disabled: resource.hidden}')
|
||||
span
|
||||
v-dropdown.mr-2(v-if='$auth.user && $auth.user.is_admin')
|
||||
v-btn(circle icon='el-icon-more' size='mini')
|
||||
v-menu(slot='dropdown')
|
||||
el-dropdown-item(v-if='!resource.hidden' icon='el-icon-remove' @click.native='hideResource(resource, true)') {{$t('admin.hide_resource')}}
|
||||
el-dropdown-item(v-else icon='el-icon-success' @click.native='hideResource(resource, false)') {{$t('admin.show_resource')}}
|
||||
el-dropdown-item(icon='el-icon-delete' @click.native='deleteResource(resource)') {{$t('admin.delete_resource')}}
|
||||
el-dropdown-item(icon='el-icon-lock' @click.native='blockUser(resource)') {{$t('admin.block_user')}}
|
||||
a(:href='resource.data.url || resource.data.context')
|
||||
small {{resource.data.published|dateFormat('ddd, D MMMM HH:mm')}}
|
||||
|
||||
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')
|
||||
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')
|
||||
|
||||
</template>
|
||||
<script>
|
||||
|
@ -312,7 +307,6 @@ export default {
|
|||
.eventDetail {
|
||||
.main_image {
|
||||
width: 100%;
|
||||
transition: all 1s;
|
||||
margin: 0 auto;
|
||||
max-height: 83vh;
|
||||
}
|
||||
|
|
|
@ -1,11 +1,15 @@
|
|||
<template lang='pug'>
|
||||
v-row(:gutter='10')
|
||||
v-col(:span='12' :xs='24')
|
||||
v-alert.mb-1.mt-1(type='info' show-icon) {{$t('common.embed_help')}}
|
||||
v-text-field(v-model='code')
|
||||
el-button(slot='append' v-clipboard:copy='code' v-clipboard:success='copyLink'
|
||||
plain type="primary" icon='el-icon-document') {{$t("common.copy")}}
|
||||
v-col.mt-2(:span='12' :xs='24' v-html='code')
|
||||
v-card
|
||||
v-card-title(v-text="$t('common.embed_title')")
|
||||
v-card-text
|
||||
v-row(:gutter='10')
|
||||
v-col(:span='12' :xs='24')
|
||||
v-alert.mb-1.mt-1(type='info' show-icon) {{$t('common.embed_help')}}
|
||||
v-text-field(v-model='code')
|
||||
v-col.mt-2(:span='12' :xs='24' v-html='code')
|
||||
v-card-actions
|
||||
v-spacer
|
||||
v-btn(slot='append' v-clipboard:copy='code' v-clipboard:success='copyLink' color="primary") {{$t("common.copy")}}
|
||||
</template>
|
||||
<script>
|
||||
import { mapState } from 'vuex'
|
||||
|
|
Loading…
Reference in a new issue