diff --git a/.angular-cli.json b/.angular-cli.json index 7d6c35f2..2d6f4b56 100644 --- a/.angular-cli.json +++ b/.angular-cli.json @@ -21,6 +21,7 @@ "styles": [ "../node_modules/ng2-toastr/bundles/ng2-toastr.min.css", "../node_modules/bootstrap/dist/css/bootstrap.css", + "../node_modules/open-iconic/font/css/open-iconic-bootstrap.css", "styles.css" ], "scripts": [], diff --git a/README.md b/README.md index fd3f91e3..09b35de2 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,6 @@ [![Build Status](https://travis-ci.org/bpatrik/pigallery2.svg?branch=master)](https://travis-ci.org/bpatrik/pigallery2) [![Coverage Status](https://coveralls.io/repos/github/bpatrik/PiGallery2/badge.svg?branch=master)](https://coveralls.io/github/bpatrik/PiGallery2?branch=master) [![Heroku](https://heroku-badge.herokuapp.com/?app=pigallery2&style=flat)](https://pigallery2.herokuapp.com) -[![Code Climate](https://codeclimate.com/github/bpatrik/pigallery2/badges/gpa.svg)](https://codeclimate.com/github/bpatrik/pigallery2) [![Dependency Status](https://david-dm.org/bpatrik/pigallery2.svg)](https://david-dm.org/bpatrik/pigallery2) [![devDependency Status](https://david-dm.org/bpatrik/pigallery2/dev-status.svg)](https://david-dm.org/bpatrik/pigallery2#info=devDependencies) diff --git a/backend/middlewares/GalleryMWs.ts b/backend/middlewares/GalleryMWs.ts index 8d1d9d4b..cda96758 100644 --- a/backend/middlewares/GalleryMWs.ts +++ b/backend/middlewares/GalleryMWs.ts @@ -18,7 +18,6 @@ export class GalleryMWs { public static async listDirectory(req: Request, res: Response, next: NextFunction) { - console.log('listDirectory'); const directoryName = req.params.directory || '/'; const absoluteDirectoryName = path.join(ProjectPath.ImageFolder, directoryName); @@ -34,8 +33,6 @@ export class GalleryMWs { req.resultPipe = new ContentWrapper(null, null, true); return next(); } - console.log(req.session.user); - console.log(directory); if (req.session.user.permissions && req.session.user.permissions.length > 0 && req.session.user.permissions[0] !== '/*') { diff --git a/backend/server.ts b/backend/server.ts index 5ded0cc0..4195ac8c 100644 --- a/backend/server.ts +++ b/backend/server.ts @@ -100,11 +100,6 @@ export class Server { keys: ['key1' + s4() + s4() + s4() + s4(), 'key2' + s4() + s4() + s4() + s4(), 'key3' + s4() + s4() + s4() + s4()] })); - /* this.app.use((req: Request, res: Response, next: NextFunction) => { - res.setHeader('Accept-Ranges', 'none'); - res.setHeader('Connection', 'close'); - next(); - });*/ /** * Parse parameters in POST diff --git a/common/entities/PhotoDTO.ts b/common/entities/PhotoDTO.ts index 65953de8..93f5db9c 100644 --- a/common/entities/PhotoDTO.ts +++ b/common/entities/PhotoDTO.ts @@ -44,5 +44,17 @@ export interface GPSMetadata { latitude?: number; longitude?: number; altitude?: number; - +} + +export module PhotoDTO { + export const hasPositionData = (photo: PhotoDTO): boolean => { + return !!photo.metadata.positionData && + !!(photo.metadata.positionData.city || + photo.metadata.positionData.state || + photo.metadata.positionData.country || + (photo.metadata.positionData.GPSData && + photo.metadata.positionData.GPSData.altitude && + photo.metadata.positionData.GPSData.latitude && + photo.metadata.positionData.GPSData.longitude)); + }; } diff --git a/frontend/app/admin/admin.component.html b/frontend/app/admin/admin.component.html index 843422d7..b8d61276 100644 --- a/frontend/app/admin/admin.component.html +++ b/frontend/app/admin/admin.component.html @@ -1,11 +1,11 @@
-
-
-

Server notifications

-
-
+
+
+ Server notifications +
+
-
-
- -
- - -
+
+ + +
diff --git a/frontend/app/app.module.ts b/frontend/app/app.module.ts index 28482120..52545515 100644 --- a/frontend/app/app.module.ts +++ b/frontend/app/app.module.ts @@ -47,6 +47,7 @@ import {InfoPanelLightboxComponent} from './gallery/lightbox/infopanel/info-pane import {MapSettingsComponent} from './settings/map/map.settings.component'; import {TooltipModule} from 'ngx-bootstrap/tooltip'; import {BsDropdownModule} from 'ngx-bootstrap/dropdown'; +import {CollapseModule} from 'ngx-bootstrap/collapse'; import {ThumbnailSettingsComponent} from './settings/thumbnail/thumbanil.settings.component'; import {SearchSettingsComponent} from './settings/search/search.settings.component'; import {SettingsService} from './settings/settings.service'; @@ -90,6 +91,7 @@ export class CustomUrlSerializer implements UrlSerializer { } } +// use the require method provided by webpack declare const require; export function translationsFactory(locale: string) { @@ -109,6 +111,7 @@ export function translationsFactory(locale: string) { TooltipModule.forRoot(), ToastModule.forRoot(), ModalModule.forRoot(), + CollapseModule.forRoot(), BsDropdownModule.forRoot(), AgmCoreModule.forRoot(), SlimLoadingBarModule.forRoot() @@ -168,7 +171,13 @@ export function translationsFactory(locale: string) { useFactory: translationsFactory, deps: [LOCALE_ID] }, - I18n + I18n, + /* + {provide: TRANSLATIONS, useValue: translationsFactory('en')}, + {provide: TRANSLATIONS_FORMAT, useValue: 'xlf'}, + {provide: LOCALE_ID, useValue: 'en'}, + {provide: MISSING_TRANSLATION_STRATEGY, useValue: MissingTranslationStrategy.Ignore}, + */ ], bootstrap: [AppComponent] }) diff --git a/frontend/app/frame/frame.component.css b/frontend/app/frame/frame.component.css index 58f5c8a7..3aa5c9bb 100644 --- a/frontend/app/frame/frame.component.css +++ b/frontend/app/frame/frame.component.css @@ -1,3 +1,7 @@ +nav { + z-index: 999; +} + .navbar { margin-bottom: 20px; } @@ -18,7 +22,7 @@ ng2-slim-loading-bar { .admin-link { padding-bottom: 0; padding-left: 0; - font-size: 20px; + font-size: 18px; } .divider-vertical:first-child { @@ -26,10 +30,8 @@ ng2-slim-loading-bar { } .navbar .divider-vertical { - height: 30px; - margin: 10px; - border-right: 1px solid #ffffff; - border-left: 1px solid #f2f2f2; + margin: 5px 10px; + border-left: 1px solid rgba(255, 255, 255, 0.5); } .navbar-inverse .divider-vertical { @@ -61,5 +63,9 @@ ng2-slim-loading-bar { app-language { display: block; - margin-right: 10px; +} + +.navbar-expand .navbar-nav .nav-link { + padding-right: 1.0rem; + padding-left: 1.0rem; } diff --git a/frontend/app/frame/frame.component.html b/frontend/app/frame/frame.component.html index 4de6cd28..b7adf4d2 100644 --- a/frontend/app/frame/frame.component.html +++ b/frontend/app/frame/frame.component.html @@ -1,55 +1,47 @@ - diff --git a/frontend/app/frame/frame.component.ts b/frontend/app/frame/frame.component.ts index acf4f246..77b37cbb 100644 --- a/frontend/app/frame/frame.component.ts +++ b/frontend/app/frame/frame.component.ts @@ -5,6 +5,7 @@ import {UserDTO, UserRoles} from '../../../common/entities/UserDTO'; import {Config} from '../../../common/config/public/Config'; import {BehaviorSubject} from 'rxjs/BehaviorSubject'; import {NotificationService} from '../model/notification.service'; +import {ShareService} from '../gallery/share.service'; @Component({ selector: 'app-frame', @@ -18,17 +19,18 @@ export class FrameComponent { user: BehaviorSubject; authenticationRequired = false; public title: string; - isIn = false; + collapsed = true; constructor(private _authService: AuthenticationService, - public notificationService: NotificationService) { + public notificationService: NotificationService, + public _shareService: ShareService) { this.user = this._authService.user; this.authenticationRequired = Config.Client.authenticationRequired; this.title = Config.Client.applicationTitle; } toggleState() { // click handler - this.isIn = !this.isIn; + this.collapsed = !this.collapsed; } isAdmin() { diff --git a/frontend/app/gallery/Photo.ts b/frontend/app/gallery/Photo.ts index b78dc01c..a11aef9a 100644 --- a/frontend/app/gallery/Photo.ts +++ b/frontend/app/gallery/Photo.ts @@ -57,6 +57,10 @@ export class Photo extends IconPhoto { } + hasPositionData(): boolean { + return PhotoDTO.hasPositionData(this.photo); + } + getThumbnailPath() { const size = this.getThumbnailSize(); return Utils.concatUrls(Config.Client.urlBase, diff --git a/frontend/app/gallery/directory/directory.gallery.component.html b/frontend/app/gallery/directory/directory.gallery.component.html index 7fadf6f2..2549cccc 100644 --- a/frontend/app/gallery/directory/directory.gallery.component.html +++ b/frontend/app/gallery/directory/directory.gallery.component.html @@ -9,9 +9,8 @@
-
diff --git a/frontend/app/gallery/gallery.component.html b/frontend/app/gallery/gallery.component.html index 31b77657..b9e166ad 100644 --- a/frontend/app/gallery/gallery.component.html +++ b/frontend/app/gallery/gallery.component.html @@ -3,25 +3,25 @@ -
  • -
  • -
  • +
  • -
  • +
  • -
    +
    @@ -34,7 +34,7 @@ [lightbox]="lightbox">
    -
    +