From 04fb039ab6e840515fa0c306efa1f99944036abc Mon Sep 17 00:00:00 2001 From: Michael Mayer Date: Fri, 3 Aug 2018 15:17:13 +0200 Subject: [PATCH] Implemented navigation --- .gitignore | 1 + config.example.yml | 2 +- frontend/css/alerts.css | 26 +++--- frontend/css/app.css | 80 ++++++++++++------ frontend/package.json | 10 ++- frontend/src/app/pages/albums.vue | 36 ++++++++ frontend/src/app/pages/export.vue | 36 ++++++++ frontend/src/app/pages/import.vue | 36 ++++++++ .../src/app/pages/{welcome.vue => photos.vue} | 19 +---- frontend/src/app/pages/settings.vue | 52 ++++++++++++ frontend/src/app/routes.js | 16 +++- frontend/src/component/app-navigation.vue | 25 ++---- frontend/yarn.lock | 27 ++++++ indexer.go | 8 +- photo.go | 4 +- server/assets/favicon.ico | Bin 1406 -> 1150 bytes server/assets/img/logo.png | Bin 0 -> 5409 bytes server/server.go | 21 +++++ server/templates/index.tmpl | 20 ++++- tag.go | 2 +- 20 files changed, 331 insertions(+), 90 deletions(-) create mode 100644 frontend/src/app/pages/albums.vue create mode 100644 frontend/src/app/pages/export.vue create mode 100644 frontend/src/app/pages/import.vue rename frontend/src/app/pages/{welcome.vue => photos.vue} (58%) create mode 100644 frontend/src/app/pages/settings.vue create mode 100644 server/assets/img/logo.png diff --git a/.gitignore b/.gitignore index 2d6862c3d..45622e2c6 100644 --- a/.gitignore +++ b/.gitignore @@ -36,5 +36,6 @@ Thumbs.db .settings .swp .tmp +/photos/ /vendor/ node_modules/ \ No newline at end of file diff --git a/config.example.yml b/config.example.yml index 582a89aa0..ccf0d0013 100644 --- a/config.example.yml +++ b/config.example.yml @@ -1,4 +1,4 @@ -darktable-cli: /Applications/darktable.app/Contents/MacOS/darktable-cli +darktable-cli: /usr/bin/darktable-cli originals-path: photos/originals thumbnails-path: photos/thumbnails import-path: photos/import diff --git a/frontend/css/alerts.css b/frontend/css/alerts.css index c872b5f79..2c259013a 100644 --- a/frontend/css/alerts.css +++ b/frontend/css/alerts.css @@ -1,50 +1,50 @@ #alerts { position: fixed; z-index: 1051; - left: 20%; - top: 10px; - right: 20%; + top: 50px; + left: 0; + right: 0; height: auto; display: block; + opacity: 0.7; } #alerts .success { - background-color: #71D774; + background-color: #c8e5ff; } #alerts .success:after { } #alerts .error { - background-color: #FF5A5A; + background-color: #ffcaca; } #alerts .error:before { } #alerts .warning { - background-color: #FCBD39; + background-color: #ffedc1; } #alerts .warning:before { } #alerts .info { - color: #49AFF5; - background-color: #49AFF5; + background-color: #feffb8; } #alerts .alert { - color: #FFF; + color: #333; display: block; left: 0; right: 0; - min-height: 14px; - padding: 8px 10px 8px 10px; - font-size: 14px; + min-height: 13px; + padding: 4px 10px 4px 10px; + font-size: 13px; font-weight: bold; opacity: 1; - border-radius: 0; + border-radius: 0px; margin: 1px 0 0 0; } diff --git a/frontend/css/app.css b/frontend/css/app.css index 8f5ebefe2..c8722db8d 100644 --- a/frontend/css/app.css +++ b/frontend/css/app.css @@ -19,36 +19,66 @@ background-color: rgba(0,0,0,0.2); } +body { + background: #333333; + color: rgba(255,255,255,0.9); +} main { - margin: 10px 20px; -} -/* -nav { - background-color: #616161; + padding: 0; + margin: 0; } -nav a:hover { - text-decoration: none !important; - color: rgba(255, 255, 255, .87) !important; +main div.page { + padding: 2rem; } -nav a { - font-size: 14px; - font-weight: bold !important; - text-transform: uppercase; - display: inline-block; - text-align: center; - width: 120px; - background: #616161; - padding: 10px; - text-decoration: none; - border-bottom: 3px solid #616161; - color: rgba(255, 255, 255, .54) !important; +.navbar { + padding: 3px 2rem 3px 2rem; + background: black !important; } -nav a.router-link-active { - font-weight: bold !important; - border-bottom: 3px solid #E64A19; - color: rgba(255, 255, 255, .87) !important; -}*/ \ No newline at end of file +.navbar .nav-item-photos .nav-link.active, +.navbar .nav-item-photos .nav-link:hover { + color: #c8e5ff; +} + +main div.page-photos { + border-top: 2px solid #c8e5ff; +} + +.navbar .nav-item-albums .nav-link.active, +.navbar .nav-item-albums .nav-link:hover { + color: #c4ffcb; +} + +main div.page-albums { + border-top: 2px solid #c4ffcb; +} + +.navbar .nav-item-import .nav-link.active, +.navbar .nav-item-import .nav-link:hover { + color: #feffb8; +} + +main div.page-import { + border-top: 2px solid #feffb8; +} + +.navbar .nav-item-export .nav-link.active, +.navbar .nav-item-export .nav-link:hover { + color: #ffedc1; +} + +main div.page-export { + border-top: 2px solid #ffedc1; +} + +.navbar .nav-item-settings .nav-link.active, +.navbar .nav-item-settings .nav-link:hover { + color: #f5c5c5; +} + +main div.page-settings { + border-top: 2px solid #f5c5c5; +} \ No newline at end of file diff --git a/frontend/package.json b/frontend/package.json index fb8db75bf..c3f7a97ba 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -15,7 +15,9 @@ "axios-mock-adapter": "^1.8.1", "chart.js": "^2.5.0", "font-awesome": "^4.7.0", + "justified-gallery": "^0.1.0", "vue": "^2.4.4", + "vue-justified-layout": "^0.1.0", "vue-router": "^2.7.0", "vue-template-compiler": "^2.4.4" }, @@ -31,16 +33,14 @@ "babel-preset-es2015": "^6.24.1", "babel-preset-stage-2": "^6.22.0", "babel-register": "^6.22.0", - "bootstrap-vue": "^2.0.0-rc.11", "bootstrap": "^4.1.3", + "bootstrap-vue": "^2.0.0-rc.11", "chai": "^3.5.0", "chalk": "^1.1.3", "connect-history-api-fallback": "^1.3.0", "copy-webpack-plugin": "^4.0.1", "cross-env": "^3.1.4", "css-loader": "^0.28.11", - "node-sass": "^4.9.2", - "sass-loader": "^7.0.3", "eslint": "^3.14.1", "eslint-config-standard": "^6.2.1", "eslint-friendly-formatter": "^2.0.7", @@ -65,11 +65,13 @@ "karma-webpack": "^2.0.3", "lodash": "^4.17.4", "mocha": "^3.3.0", + "node-sass": "^4.9.2", "optimize-css-assets-webpack-plugin": "^1.3.0", "ora": "^1.1.0", "phantomjs-prebuilt": "^2.1.14", "pluralize": "^4.0.0", "pubsub-js": "^1.5.6", + "sass-loader": "^7.0.3", "style-loader": "^0.16.1", "svg-url-loader": "^2.0.2", "url-loader": "^0.5.8", @@ -91,4 +93,4 @@ "last 2 versions", "not ie <= 8" ] -} \ No newline at end of file +} diff --git a/frontend/src/app/pages/albums.vue b/frontend/src/app/pages/albums.vue new file mode 100644 index 000000000..96aa4459e --- /dev/null +++ b/frontend/src/app/pages/albums.vue @@ -0,0 +1,36 @@ + + + + + diff --git a/frontend/src/app/pages/export.vue b/frontend/src/app/pages/export.vue new file mode 100644 index 000000000..32740e905 --- /dev/null +++ b/frontend/src/app/pages/export.vue @@ -0,0 +1,36 @@ + + + + + diff --git a/frontend/src/app/pages/import.vue b/frontend/src/app/pages/import.vue new file mode 100644 index 000000000..e6948e7ba --- /dev/null +++ b/frontend/src/app/pages/import.vue @@ -0,0 +1,36 @@ + + + + + diff --git a/frontend/src/app/pages/welcome.vue b/frontend/src/app/pages/photos.vue similarity index 58% rename from frontend/src/app/pages/welcome.vue rename to frontend/src/app/pages/photos.vue index 64a7e8f71..1329d62d2 100644 --- a/frontend/src/app/pages/welcome.vue +++ b/frontend/src/app/pages/photos.vue @@ -1,7 +1,5 @@