Commit 7a54ff6b authored by les's avatar les
Browse files

Merge branch 'dev' into weblate

parents dd36337a f84916a4
// .v-list {
// color: pink;
// }
// :focus {outline:none;}
// ::-moz-focus-inner {border:0;}
......
......@@ -84,6 +84,7 @@ export default {
name: 'Editor',
components: { EditorContent, EditorMenuBar, EditorMenuBubble },
props: {
label: { type: String, default: 'Editor' },
value: { type: String, default: '' },
border: { type: Boolean, default: false },
noSave: { type: Boolean, default: false },
......@@ -155,6 +156,15 @@ export default {
font-style: italic;
}
.editor {
.label {
left: 0px;
position: absolute;
transition: translateY .3s, scale .3s;
&.focused {
color: orange;
transform: translateY(-10px) scale(0.75);
}
}
// max-height: auto;
// height: auto;
overflow-y: auto;
......
......@@ -83,7 +83,8 @@
"place": "Place",
"tags": "Tags",
"theme": "Theme",
"reset": "Reset"
"reset": "Reset",
"import": "Import"
},
"login": {
"description": "By logging in you can publish new events.",
......@@ -149,7 +150,9 @@
"interact_with_me_at": "Interact with me on fediverse at",
"follow_me_description": "One of the ways to stay up to date on events published here on {title},\nis following the account <u>{account}</u> from the fediverse, for example via mastodon, and possibly add resources to an event from there.<br/><br/>\nIf you have never heard of Mastodon and the fediverse we recommend reading <a href='https://www.savjee.be/videos/simply-explained/mastodon-and-fediverse-explained/'>this article</a>.<br/><br/>Enter your instance below (e.g. mastodon.social)",
"interact_with_me": "Follow me",
"remove_recurrent_confirmation": "Are you sure you want to remove this recurring event?\nPast events will be maintained, but no further events will be created."
"remove_recurrent_confirmation": "Are you sure you want to remove this recurring event?\nPast events will be maintained, but no further events will be created.",
"import_URL": "Import from URL",
"import_ICS": "Import from ICS"
},
"admin": {
"place_description": "If you have gotten the place or address wrong, you can change it.<br/>All current and past events associated with this place will change address.",
......
{
"common": {
"next": "Suivant",
"add_event": "Ajouter un évènement"
}
}
<template lang="pug">
v-card(color='secondary')
v-card-title {{$t('event.importURL')}}
v-card-title {{$t('common.import')}}
v-card-text
v-form(v-model='valid' ref='form' lazy-validation)
v-text-field(v-model='URL' :loading='loading' :error='error' :error-messages='errorMessage')
v-text-field(v-model='URL'
:label="$t('common.url')"
:hint="$t('event.import_URL')"
persistent-hint
:loading='loading' :error='error'
:error-messages='errorMessage')
v-file-input(
v-model='file'
accept=".ics"
:label="$t('common.ics')"
:hint="$t('event.import_ICS')"
persistent-hint
)
p {{event}}
v-card-actions
v-spacer
v-btn(@click='$emit("close")' color='warning') {{$t('common.cancel')}}
v-btn(@click='importURL' :loading='loading' :disabled='loading'
v-btn(@click='importGeneric' :loading='loading' :disabled='loading'
color='primary') {{$t('common.import')}}
</template>
<script>
import ical from 'ical.js'
export default {
name: 'ImportDialog',
data () {
return {
file: null,
errorMessage: '',
error: false,
loading: false,
......@@ -28,6 +44,26 @@ export default {
}
},
methods: {
importGeneric () {
if (this.file) {
this.importICS()
} else {
this.importURL()
}
},
async importICS() {
const reader = new FileReader()
reader.readAsText(this.file)
reader.onload = () => {
const data = reader.result
console.error(data)
const event = ical.parse(data)
console.error(event)
this.event = {
title: event.name
}
}
},
async importURL() {
if (!this.URL) {
this.errorMessage = this.$validators.required('common.URL')('')
......
......@@ -4,7 +4,8 @@
v-card-title
h4 {{edit?$t('common.edit_event'):$t('common.add_event')}}
v-spacer
v-btn(link text color='primary' @click='openImportDialog=true') <v-icon>mdi-file-import</v-icon> {{$t('event.import_URL')}}
v-btn(link text color='primary' @click='openImportDialog=true')
<v-icon>mdi-file-import</v-icon> {{$t('common.import')}}
v-dialog(v-model='openImportDialog')
ImportDialog(@close='openImportDialog=false' @imported='eventImported')
......@@ -372,11 +373,9 @@ export default {
methods: {
...mapActions(['addEvent', 'updateEvent', 'updateMeta', 'updateEvents']),
eventImported (event) {
console.error('sono dentro event imported', event)
this.event = event
},
selectPlace (p) {
console.error('sono dentro selectePlace')
const place = p && this.places.find(place => place.id === p.id)
if (place && place.address) {
this.event.place.name = p.name
......
<template lang="pug">
v-card.h-event.eventDetail
v-container
//- EVENT PAGE
//- gancio supports microformats (http://microformats.org/wiki/h-event)
v-card.h-event
v-card-text
//- event admin controls
EventAdmin(v-if='is_mine' :event='event')
//- v-list-item(two-line)
//- v-list-item-content
//- Title
.text-h5.text-sm-h4
b.p-name {{event.title}}
v-row
v-col.col-12.col-lg-9
//- TOFIX: avoid reflow
//- event image
v-img.main_image.mb-3(
contain
:src='imgPath'
......@@ -39,7 +40,7 @@
b.vcard.ml-2 {{event.place.name}}
p.adr {{event.place.address}}
//- info & actions
//- info & actions
v-list
v-list-item(link)
v-list-item-content.primary--text.text-uppercase(
......@@ -49,80 +50,73 @@
v-list-item(link)
v-list-item-content.primary--text.text-uppercase(@click='showEmbed=true' text color='primary') {{$t('common.embed')}}
v-list-item(link)
v-list-item-content.primary--text.text-uppercase(:href='`${settings.baseurl}/api/event/${event.id}.ics`' text color='primary') {{$t('common.add_to_calendar')}}
v-container
v-dialog(v-model='showEmbed')
EmbedEvent(:event='event' @close='showEmbed=false')
p.p-description.text-h6(v-html='event.description')
v-chip.p-category.ml-1(small v-for='tag in event.tags' color='primary' outlined :key='tag') {{tag}}
v-list-item(link :href='`/api/event/${event.id}.ics`')
v-list-item-content.primary--text.text-uppercase
//- v-btn(nuxt block link :href='`/api/event/${event.id}.ics`' text color='primary') {{$t('common.add_to_calendar')}}
//- //- 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')}}
.p-description.text-h6(v-html='event.description')
v-chip.p-category.ml-1(v-for='tag in event.tags' color='primary'
outlined :key='tag' v-text='tag')
//- v-btn(:href='`${settings.baseurl}/api/event/${event.id}.ics`' text color='primary') {{$t('common.add_to_calendar')}}
//- 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 max-width='500px')
h4(slot='title') {{$t('common.follow_me_title')}}
FollowMe(@close='showFollowMe=false' is-dialog)
//- v-dialog(v-model='showFollowMe' destroy-on-close max-width='500px')
h4(slot='title') {{$t('common.follow_me_title')}}
FollowMe(@close='showFollowMe=false' is-dialog)
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-list.mb-1(v-if='settings.enable_resources' v-for='resource in event.resources' dark
:key='resource.id' :class='{disabled: resource.hidden}')
v-list-item
v-list-title
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)
v-icon mdi-dots-vertical
v-list
v-list-item(v-if='!resource.hidden' @click='hideResource(resource, true)')
v-list-item-title <v-icon left>mdi-eye-off</v-icon> {{$t('admin.hide_resource')}}
v-list-item(v-else @click='hideResource(resource, false)')
v-list-item-title <v-icon left>mdi-eye-on</v-icon> {{$t('admin.show_resource')}}
v-list-item(@click='deleteResource(resource)')
v-list-item-title <v-icon left>mdi-delete</v-icon> {{$t('admin.delete_resource')}}
v-list-item(@click='blockUser(resource)')
v-list-item-title <v-icon left>mdi-lock</v-icon> {{$t('admin.block_user')}}
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-list.mb-1(v-if='settings.enable_resources' v-for='resource in event.resources' dark
:key='resource.id' :class='{disabled: resource.hidden}')
v-list-item
v-list-title
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)
v-icon mdi-dots-vertical
v-list
v-list-item(v-if='!resource.hidden' @click='hideResource(resource, true)')
v-list-item-title <v-icon left>mdi-eye-off</v-icon> {{$t('admin.hide_resource')}}
v-list-item(v-else @click='hideResource(resource, false)')
v-list-item-title <v-icon left>mdi-eye-on</v-icon> {{$t('admin.show_resource')}}
v-list-item(@click='deleteResource(resource)')
v-list-item-title <v-icon left>mdi-delete</v-icon> {{$t('admin.delete_resource')}}
v-list-item(@click='blockUser(resource)')
v-list-item-title <v-icon left>mdi-lock</v-icon> {{$t('admin.block_user')}}
a(:href='resource.data.url || resource.data.context')
small {{resource.data.published|dateFormat('ddd, D MMMM HH:mm')}}
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')
//- Next/prev arrow
.text-center
v-btn.mr-2(nuxt icon outlined color='primary'
:to='`/event/${event.prev}`' :disabled='!event.prev')
v-icon mdi-arrow-left
v-btn(nuxt bottom right outlined icon color='primary'
:to='`/event/${event.next}`' :disabled='!event.next')
v-icon mdi-arrow-right
//- Next/prev arrow
.text-center
v-btn.mr-2(nuxt icon outlined color='primary'
:to='`/event/${event.prev}`' :disabled='!event.prev')
v-icon mdi-arrow-left
v-btn(nuxt bottom right outlined icon color='primary'
:to='`/event/${event.next}`' :disabled='!event.next')
v-icon mdi-arrow-right
v-dialog(v-model='showEmbed')
EmbedEvent(:event='event' @close='showEmbed=false')
</template>
<script>
......
......@@ -87,7 +87,7 @@ Event.prototype.toAP = function (username, locale, to = []) {
id: `${config.baseurl}/federation/m/${this.id}`,
name: this.title,
url: `${config.baseurl}/event/${this.id}`,
type: 'Event',
type: 'Note',
startTime: moment.unix(this.start_datetime).locale(locale).format(),
endTime: moment.unix(this.end_datetime).locale(locale).format(),
location: {
......
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