From ae28cc9b2d79568ae069e3f25ed29791986791d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Molakvo=C3=A6=20=28skjnldsv=29?= Date: Thu, 7 Nov 2019 19:45:14 +0100 Subject: [PATCH] Added navigation, albums, init tags MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: John Molakvoæ (skjnldsv) --- appinfo/app.php | 24 +++++++ css/icons.scss | 27 +++++++ img/app.svg | 2 +- img/photos.svg | 1 + lib/AppInfo/Application.php | 4 +- lib/Controller/PageController.php | 5 ++ package-lock.json | 26 +++---- package.json | 2 +- src/{Gallery.vue => Photos.vue} | 20 ++++++ src/components/Folder.vue | 27 ++++++- src/components/Grid.vue | 87 ++++++++++++++++++++++ src/components/Navigation.vue | 16 ++++- src/main.js | 6 +- src/router/index.js | 68 +++++++++++++++--- src/services/DavClient.js | 3 +- src/services/FileList.js | 24 ++++--- src/services/FolderInfo.js | 14 ++-- src/services/PhotoSearch.js | 6 +- src/services/SystemTags.js | 56 +++++++++++++++ src/store/index.js | 2 + src/store/systemtags.js | 99 +++++++++++++++++++++++++ src/utils/ParseFile.js | 37 ++++++++++ src/views/{Grid.vue => Albums.vue} | 60 ++-------------- src/views/Tags.vue | 111 +++++++++++++++++++++++++++++ templates/main.php | 23 +++++- webpack.common.js | 36 +++++----- 26 files changed, 659 insertions(+), 127 deletions(-) create mode 100644 appinfo/app.php create mode 100644 css/icons.scss create mode 100644 img/photos.svg rename src/{Gallery.vue => Photos.vue} (60%) create mode 100644 src/components/Grid.vue create mode 100644 src/services/SystemTags.js create mode 100644 src/store/systemtags.js create mode 100644 src/utils/ParseFile.js rename src/views/{Grid.vue => Albums.vue} (78%) create mode 100644 src/views/Tags.vue diff --git a/appinfo/app.php b/appinfo/app.php new file mode 100644 index 00000000..12482fcd --- /dev/null +++ b/appinfo/app.php @@ -0,0 +1,24 @@ + + * + * @author John Molakvoæ + * + * @license GNU AGPL version 3 or any later version + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ +use OCA\Photos\AppInfo\Application; +\OC::$server->query(Application::class); diff --git a/css/icons.scss b/css/icons.scss new file mode 100644 index 00000000..88e42707 --- /dev/null +++ b/css/icons.scss @@ -0,0 +1,27 @@ +/** + * @copyright Copyright (c) 2019 John Molakvoæ + * + * @author John Molakvoæ + * + * @license GNU AGPL version 3 or any later version + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +.icon-folder.icon-dark { + @include icon-color('folder', 'filetypes', $color-black, 1, true); +} + +@include icon-black-white('photos', 'photos', 1); diff --git a/img/app.svg b/img/app.svg index 0779a5dd..04aaca9e 100644 --- a/img/app.svg +++ b/img/app.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/img/photos.svg b/img/photos.svg new file mode 100644 index 00000000..90c3fdb6 --- /dev/null +++ b/img/photos.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/lib/AppInfo/Application.php b/lib/AppInfo/Application.php index 52139b4d..97ab98b4 100644 --- a/lib/AppInfo/Application.php +++ b/lib/AppInfo/Application.php @@ -28,9 +28,9 @@ use OCP\AppFramework\App; class Application extends App { - const appID = 'photos'; + const APP_ID = 'photos'; public function __construct() { - parent::__construct(self::appID); + parent::__construct(self::APP_ID); } } diff --git a/lib/Controller/PageController.php b/lib/Controller/PageController.php index 7f9538a6..8529441e 100644 --- a/lib/Controller/PageController.php +++ b/lib/Controller/PageController.php @@ -30,6 +30,7 @@ use OCP\AppFramework\Controller; use OCP\AppFramework\Http\TemplateResponse; use OCP\EventDispatcher\IEventDispatcher; use OCP\IRequest; +use OCP\Util; class PageController extends Controller { @@ -58,6 +59,10 @@ class PageController extends Controller { $this->eventDispatcher->dispatch(LoadSidebar::class, new LoadSidebar()); $this->eventDispatcher->dispatch(LoadViewer::class, new LoadViewer()); + + Util::addScript('photos', 'photos'); + Util::addStyle('photos', 'icons'); + $response = new TemplateResponse($this->appName, 'main'); return $response; } diff --git a/package-lock.json b/package-lock.json index c53e7e30..39a3b402 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,5 +1,5 @@ { - "name": "gallery", + "name": "photos", "version": "19.0.0", "lockfileVersion": 1, "requires": true, @@ -872,18 +872,18 @@ } }, "@nextcloud/vue": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@nextcloud/vue/-/vue-1.0.0.tgz", - "integrity": "sha512-jYggwGf9so7g9uWP59cLspSo62uN7qX0+T096T/QBxyiEhoa+yspf9+Py/RIDylLacceKPDLTU4AdxELj63ZYQ==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@nextcloud/vue/-/vue-1.1.0.tgz", + "integrity": "sha512-SGWrNTalT/59vElPnPJZ0xQb9sui1yq5fKRiIA2w81NlAK9JQGq+ADeqdVb8sciVnLGobQJ1qERhpo3pIyOhaQ==", "requires": { "@babel/polyfill": "^7.4.4", "@nextcloud/axios": "^0.4.0", "escape-html": "^1.0.3", "hammerjs": "^2.0.8", "md5": "^2.2.1", + "v-click-outside": "^2.1.4", "v-tooltip": "^2.0.0-rc.33", "vue": "^2.6.7", - "vue-click-outside": "^1.0.7", "vue-color": "^2.7.0", "vue-multiselect": "^2.1.3", "vue-visible": "^1.0.2", @@ -9307,6 +9307,11 @@ "integrity": "sha512-pW0No1RGHgzlpHJO1nsVrHKpOEIxkGg1xB+v0ZmdNH5OAeAwzAVrCnI2/6Mtx+Uys6iaylxa+D3g4j63IKKjSQ==", "dev": true }, + "v-click-outside": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/v-click-outside/-/v-click-outside-2.1.5.tgz", + "integrity": "sha512-VPNCOTZK6WZy73lcWc+R7IW1uaBFEO3/Csrs5CzWVOdvE30V8Y1+BE/BtTlcEmeDGx0eqdE7bSCg55Jj37PMJg==" + }, "v-tooltip": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/v-tooltip/-/v-tooltip-2.0.2.tgz", @@ -9382,11 +9387,6 @@ "resolved": "https://registry.npmjs.org/vue/-/vue-2.6.10.tgz", "integrity": "sha512-ImThpeNU9HbdZL3utgMCq0oiMzAkt1mcgy3/E6zWC/G6AaQoeuFdsl9nDhTDU3X1R6FK7nsIUuRACVcjI+A2GQ==" }, - "vue-click-outside": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/vue-click-outside/-/vue-click-outside-1.0.7.tgz", - "integrity": "sha1-zdKxYF48SUR4TheU6uShKg9wC9Y=" - }, "vue-color": { "version": "2.7.0", "resolved": "https://registry.npmjs.org/vue-color/-/vue-color-2.7.0.tgz", @@ -9506,9 +9506,9 @@ "integrity": "sha512-yaX2its9XAJKGuQqf7LsiZHHSkxsIK8rmCOQOvEGEoF41blKRK8qr9my4qYoD6ikdLss4n8tKqYBecmaY0+WJg==" }, "vue2-datepicker": { - "version": "2.13.2", - "resolved": "https://registry.npmjs.org/vue2-datepicker/-/vue2-datepicker-2.13.2.tgz", - "integrity": "sha512-bgtCdSTpFJogL37A5n2HnNPkyKVi0WTiM2+H+fYTHVYbRpSyNaPQ1Kj86A6tx3T14cv6qq4Oo8MrCxXiarDx2w==", + "version": "2.13.3", + "resolved": "https://registry.npmjs.org/vue2-datepicker/-/vue2-datepicker-2.13.3.tgz", + "integrity": "sha512-kAiTpCLlDC88mMTW5OqhlME0ZSB1fJKlHbKSEryPIi3lRJWHn4BlRSvGUTnSmBUr/5Qidma7Pxei9vih9Luicw==", "requires": { "fecha": "^2.3.3" } diff --git a/package.json b/package.json index 825f4348..abc6819f 100644 --- a/package.json +++ b/package.json @@ -35,7 +35,7 @@ "@nextcloud/axios": "^0.5.0", "@nextcloud/l10n": "^0.2.1", "@nextcloud/router": "^0.1.0", - "@nextcloud/vue": "^1.0.0", + "@nextcloud/vue": "^1.1.0", "cdav-library": "git+https://github.com/nextcloud/cdav-library.git", "path-posix": "^1.0.0", "qs": "^6.9.0", diff --git a/src/Gallery.vue b/src/Photos.vue similarity index 60% rename from src/Gallery.vue rename to src/Photos.vue index cb9a8882..ec26f323 100644 --- a/src/Gallery.vue +++ b/src/Photos.vue @@ -22,6 +22,17 @@