From 3f49c915ab0c4b93ffeec91dd3ff673a4d6ce245 Mon Sep 17 00:00:00 2001 From: les Date: Fri, 31 Jul 2020 01:03:19 +0200 Subject: [PATCH] refactoring with vuetify --- components/Calendar.vue | 2 - components/Event.vue | 2 +- components/FollowMe.vue | 2 +- components/Home.vue | 13 +- components/List.vue | 19 - components/Nav.vue | 86 +- components/Search.vue | 58 +- components/admin/Settings.vue | 5 +- components/admin/Theme.vue | 62 +- layouts/default.vue | 3 +- layouts/error.vue | 13 +- locales/it.json | 4 +- nuxt.config.js | 6 +- package.json | 20 +- pages/Admin.vue | 4 +- pages/Login.vue | 15 +- pages/Register.vue | 10 +- pages/about.vue | 4 +- pages/add/_edit.vue | 3 +- pages/event/_id.vue | 21 +- pages/event/embedEvent.vue | 15 +- pages/settings.vue | 5 +- pages/user_confirm/_code.vue | 7 +- pages/user_confirm_pwd/_code.vue | 7 +- yarn.lock | 1371 ++++++++++++------------------ 25 files changed, 686 insertions(+), 1071 deletions(-) diff --git a/components/Calendar.vue b/components/Calendar.vue index 9f714152..6e665b20 100644 --- a/components/Calendar.vue +++ b/components/Calendar.vue @@ -4,7 +4,6 @@ title-position='left' :is-dark="settings['theme.is_dark']" @update:from-page='updatePage' - :columns="$screens({ default: 1, lg: 2 })" :locale='$i18n.locale' :attributes='attributes' transition='fade' @@ -84,7 +83,6 @@ export default { diff --git a/components/Nav.vue b/components/Nav.vue index a40aeaf7..4df67797 100644 --- a/components/Nav.vue +++ b/components/Nav.vue @@ -68,54 +68,6 @@ v-btn(icon v-clipboard:copy='feedLink' v-clipboard:success='copyLink') v-icon(color='orange') mdi-rss - //- el-menu-item(type='text' v-clipboard:copy='feedLink' v-clipboard:success='copyLink') - //- v-icon(color='orange' name='rss') - - //- el-header#header - //- img(src='/favicon.ico') - //- span.ml-1.hidden-xs-only {{settings.title}} - //- small.hidden-sm-only {{settings.description}} - - //- el-menu#menu(mode='horizontal' router ) - //- el-menu-item(v-if='could_add' index='/add') - //- i.el-icon-plus - //- span.hidden-xs-only {{$t('common.add_event')}} - - //- //- nuxt-link(to='/export') - //- el-menu-item(index='/export') - //- i.el-icon-share - //- span.hidden-xs-only {{$t('common.share')}} - - //- el-submenu(v-if='settings.enable_trusted_instances && settings.trusted_instances && settings.trusted_instances.length' index=4) - //- template(slot='title') - //- i.el-icon-guide - //- span.hidden-xs-only {{$t('common.places')}} - //- el-menu-item(v-for='instance in settings.trusted_instances' :key='instance.name') - //- a(:href='instance.url' target='_link') - //- img.mr-1(:src='`${instance.url}/favicon.ico`' style='height: 25px;') - //- span.ml-1 {{instance.label || instance.name}} - - //- el-menu-item(v-if='!$auth.loggedIn' index='/login') - //- i.el-icon-user - //- span.hidden-xs-only {{$t('common.login')}} - - //- el-submenu(v-if='$auth.loggedIn' index=3) - //- template(slot='title') - //- i.el-icon-user - //- span.hidden-xs-only {{$t('common.user')}} - //- el-menu-item(divided index='/settings') - //- i.el-icon-s-tools - //- span {{$t('common.settings')}} - //- el-menu-item(v-if='$auth.user.is_admin' index='/admin') - //- i.el-icon-s-operation - //- span {{$t('common.admin')}} - //- el-menu-item(@click='logout') - //- i.el-icon-switch-button - //- span {{$t('common.logout')}} - - //- el-menu-item(type='text' v-clipboard:copy='feedLink' v-clipboard:success='copyLink') - //- v-icon(color='orange' name='rss') - - - diff --git a/components/Search.vue b/components/Search.vue index 7f1c9ad3..ef5891f5 100644 --- a/components/Search.vue +++ b/components/Search.vue @@ -11,19 +11,38 @@ :label="$t('event.show_past')" v-model='showPast') - v-autocomplete#searchInput.mt-0(:placeholder='$t("common.filter")' - v-model='search' :debounce='200' - :fetch-suggestions='querySearch' clearable - @select='addFilter') - template(slot-scope='{ item }') - span.float-left {{ item.label }} - i.float-right.el-icon-place(v-if='item.type==="place"') - i.float-right.el-icon-collection-tag(v-if='item.type==="tag"') - #filters - v-vtn.mr-1.bg-dark(type='text' round plain v-for='t in filters.tags' size='mini' - :key='t' @click='removeTag(t)') {{t}} - v-btn.mr-1.bg-dark.text-warning(type='text' round plain v-for='p in selectedPlaces' size='mini' - :key='p.id' @click='removePlace(p.id)') {{p.name}} + p {{filter}} + v-autocomplete.mt-0( + :label='$t("common.filter")' + :items='keywords' + v-model='filter' + :search-input.sync='search' + item-text='label' + chips + multiple + ) + template(v-slot:selection="data") + v-chip(v-bind="data.attrs" + :input-value="data.selected" + close + @click="data.select" + @click:close="remove(data.item)") + v-avatar(left) + v-icon + //- + //- + span {{ data.item.name }} + template(v-slot:item='{ item }') + v-list-item-content + v-list-item-title(v-text='item.label') + //- span.float-left {{ item.label }} + //- i.float-right.el-icon-place(v-if='item.type==="place"') + //- i.float-right.el-icon-collection-tag(v-if='item.type==="tag"') + //- #filters + //- v-vtn.mr-1.bg-dark(type='text' round plain v-for='t in filters.tags' size='mini' + //- :key='t' @click='removeTag(t)') {{t}} + //- v-btn.mr-1.bg-dark.text-warning(type='text' round plain v-for='p in selectedPlaces' size='mini' + //- :key='p.id' @click='removePlace(p.id)') {{p.name}} diff --git a/layouts/error.vue b/layouts/error.vue index d145ae0c..cba06d62 100644 --- a/layouts/error.vue +++ b/layouts/error.vue @@ -1,7 +1,7 @@ @@ -16,10 +16,3 @@ export default { } } - diff --git a/locales/it.json b/locales/it.json index a335b5f2..1e1ef4fc 100644 --- a/locales/it.json +++ b/locales/it.json @@ -80,7 +80,9 @@ "delete": "Elimina", "announcements": "Annunci", "url": "Indirizzo URL", - "place": "Luogo" + "place": "Luogo", + "tags": "Tags", + "theme": "Tema" }, "login": { "description": "Entrando puoi pubblicare nuovi eventi.", diff --git a/nuxt.config.js b/nuxt.config.js index cf9d92dc..0630fa5b 100644 --- a/nuxt.config.js +++ b/nuxt.config.js @@ -24,13 +24,14 @@ module.exports = { /* ** Global CSS */ - // css: [ + css: [ + '@mdi/font/css/materialdesignicons.css' // 'bootstrap/dist/css/bootstrap.min.css', // 'element-ui/lib/theme-chalk/index.css', // 'element-ui/lib/theme-chalk/display.css', // '@/assets/theme/index.css' // '@/assets/style.less' - // ], + ], /* ** Plugins to load before mounting the App @@ -98,6 +99,7 @@ module.exports = { '@nuxtjs/vuetify' ], vuetify: { + defaultAssets: false, optionsPath: './vuetify.options.js' /* module options */ }, diff --git a/package.json b/package.json index c68624bc..f0aac2d4 100644 --- a/package.json +++ b/package.json @@ -33,16 +33,14 @@ "axios": "^0.19.2", "bcryptjs": "^2.4.3", "body-parser": "^1.18.3", - "bootstrap": "^4.5.0", "config": "^3.3.1", "consola": "^2.13.0", "cookie-parser": "^1.4.5", "cors": "^2.8.5", "cross-env": "^7.0.2", "date-fns": "^2.15.0", - "dayjs": "^1.8.30", + "dayjs": "^1.8.31", "dompurify": "^2.0.11", - "element-ui": "^2.13.2", "email-templates": "^7.1.0", "express": "^4.17.1", "express-oauth-server": "^2.0.0", @@ -58,26 +56,25 @@ "moment-timezone": "^0.5.31", "morgan": "^1.10.0", "multer": "^1.4.2", - "nominatim-geocoder": "^0.1.4", - "nuxt": "^2.13.3", + "nuxt": "^2.14.0", "nuxt-express-module": "^0.0.11", "pg": "^8.3.0", "sequelize": "^6.3.3", "sequelize-cli": "^6.2.0", "sharp": "^0.25.4", "sqlite3": "^5.0.0", - "tiptap": "^1.29.1", - "tiptap-extensions": "^1.31.1", + "tiptap": "^1.29.3", + "tiptap-extensions": "^1.31.3", "to-ico": "^1.1.5", "url": "^0.11.0", "v-calendar": "^1.0.8", - "vue-awesome": "^4.1.0", "vue-clipboard2": "^0.3.1", - "vue-i18n": "^8.18.2", + "vue-i18n": "^8.20.0", "yargs": "^15.4.1" }, "devDependencies": { - "@nuxtjs/eslint-config": "^3.0.0", + "@mdi/font": "^5.4.55", + "@nuxtjs/eslint-config": "^3.1.0", "@nuxtjs/vuetify": "^1.11.2", "babel-eslint": "^10.1.0", "eslint": "^7.5.0", @@ -124,8 +121,5 @@ "repository": { "type": "git", "url": "https://framagit.org/les/gancio" - }, - "resolutions": { - "prosemirror-model": "1.10.0" } } diff --git a/pages/Admin.vue b/pages/Admin.vue index 06ee2ed2..5fe0579f 100644 --- a/pages/Admin.vue +++ b/pages/Admin.vue @@ -52,7 +52,6 @@