diff --git a/service-ejb/src/main/java/com/mowesta/service/entity/CityEntity.java b/service-ejb/src/main/java/com/mowesta/service/entity/CityEntity.java index 24553f51..93d40e0c 100644 --- a/service-ejb/src/main/java/com/mowesta/service/entity/CityEntity.java +++ b/service-ejb/src/main/java/com/mowesta/service/entity/CityEntity.java @@ -34,6 +34,7 @@ import com.mowesta.api.location.CityType; @Entity @Table(name = "city", indexes = { @Index(columnList = "externalId", unique = true), @Index(columnList = "deleted,modificationTime", unique = false), + @Index(columnList = "deleted,capital,population", unique = false), @Index(columnList = "state_id,deleted,capital,population", unique = false), @Index(columnList = "country_id,deleted,capital,population", unique = false) }) diff --git a/web-angular/src/app/app.module.ts b/web-angular/src/app/app.module.ts index d07f1685..06af4aea 100644 --- a/web-angular/src/app/app.module.ts +++ b/web-angular/src/app/app.module.ts @@ -42,13 +42,15 @@ import { LayoutDrawerComponent, LayoutPlainComponent, DrawerComponent, FooterCom import { ToolbarButtonComponent, DecisionPanelComponent, EmailFieldComponent, LanguageSelectComponent, LoginFieldComponent, MapComponent, NameFieldComponent, PasswordFieldComponent, ProfileButtonComponent, - SearchFieldComponent } from './widgets-common'; + SearchFieldComponent, FavoriteButtonComponent } from './widgets-common'; import { CitiesListComponent, WeatherConditionComponent, WeatherForecastComponent, WeatherVideoComponent, - WeatherVideoBarComponent, WeatherVideoListComponent, WeatherStationsListComponent, WeatherReportsListComponent, WeatherReportComponent } from './widgets-weather'; -import { LoginComponent, ActivateComponent, ChangeComponent, RegisterComponent, ResetComponent } from './views-common'; + WeatherVideoBarComponent, WeatherVideoListComponent, WeatherStationsListComponent, WeatherReportsListComponent, + WeatherReportComponent } from './widgets-weather'; +import { LoginComponent, ActivateComponent, ChangeComponent, RegisterComponent, ResetComponent, + LoadingComponent } from './views-common'; import { CitiesComponent, CityComponent, CountryComponent, StateComponent, VideosComponent, StationsComponent, StationComponent } from './views-weather'; -import { UserAccountComponent, UserDevicesComponent } from './views-user'; +import { UserAccountComponent, UserDevicesComponent, UserFavoritesComponent } from './views-user'; import { ManageLogComponent, ManageSystemComponent, ManageUsersComponent } from './views-manage'; import { DelayInterceptor, AuthInterceptor } from './interceptors'; @@ -56,14 +58,17 @@ import { DefaultService, Configuration } from './api'; import { MessageDialogComponent, ConfirmationDialogComponent, LogDialogComponent } from './dialogs'; import { ConsoleService, UserService, CredentialService, DeviceService, ManageLogService, ManageUserService, - ResourceService, VersionService, CitiesService, VideosService, StationsService, ReportsService } from './services'; + ResourceService, VersionService, CitiesService, VideosService, StationsService, ReportsService, + SettingsService } from './services'; import { UseParentFormDirective } from './directives'; import { GermanPaginatorProvider } from './providers/paginator.provider'; -import { CityResolver, UserResolver, StateResolver, CountryResolver, StationResolver } from './resolvers'; +import { CityResolver, UserResolver, StateResolver, CountryResolver, StationResolver, + LanguageResolver, BootstrapResolver } from './resolvers'; -import { HumidityPipe, CloudPipe, PressurePipe, TemperaturePipe, SpeedPipe, SnowPipe, PrecipitationPipe, - WeatherPipe, DirectionPipe, SourcePipe, LocalTimePipe, LocalDatePipe, LocalNamePipe, BingMapsPipe, - GoogleMapsPipe, WikipediaPipe, CityTypePipe, VideoSourcePipe, VideoTypePipe +import { HumidityPipe, CloudPipe, PressurePipe, TemperaturePipe, SpeedPipe, SnowPipe, PrecipitationPipe, + WeatherPipe, DirectionPipe, SourcePipe, LocalTimePipe, LocalDatePipe, LocalNamePipe, BingMapsPipe, + GoogleMapsPipe, WikipediaPipe, CityTypePipe, VideoSourcePipe, VideoTypePipe, LocationIconPipe, WeatherIconPipe, + DirectionIconPipe } from './pipes'; /** @@ -99,12 +104,13 @@ registerLocaleData(LocaleDE); UserDevicesComponent, UserAccountComponent, ManageLogComponent, LogDialogComponent, ManageSystemComponent, ManageUsersComponent, SearchFieldComponent, CityComponent, CountryComponent, StateComponent, MapComponent, WeatherConditionComponent, CitiesListComponent, CitiesComponent, WeatherVideoListComponent, - WeatherForecastComponent, WeatherVideoComponent, WeatherVideoBarComponent, VideosComponent, + WeatherForecastComponent, WeatherVideoComponent, WeatherVideoBarComponent, VideosComponent, WeatherStationsListComponent, StationsComponent, StationComponent, WeatherReportsListComponent, - WeatherReportComponent, + WeatherReportComponent, UserFavoritesComponent, FavoriteButtonComponent, LoadingComponent, HumidityPipe, CloudPipe, PressurePipe, TemperaturePipe, SpeedPipe, SnowPipe, PrecipitationPipe, WeatherPipe, DirectionPipe, SourcePipe, BingMapsPipe, GoogleMapsPipe, WikipediaPipe, LocalTimePipe, - LocalDatePipe, LocalNamePipe, CityTypePipe, VideoSourcePipe, VideoTypePipe, + LocalDatePipe, LocalNamePipe, LocationIconPipe, CityTypePipe, VideoSourcePipe, VideoTypePipe, + WeatherIconPipe, DirectionIconPipe, UseParentFormDirective, ], imports: [ @@ -137,11 +143,13 @@ registerLocaleData(LocaleDE); // change the locale to DE and add custom paginator provider for tables { provide: LOCALE_ID, useValue: 'de' }, { provide: MatPaginatorIntl, useClass: GermanPaginatorProvider }, - DatePipe, + DatePipe, LocalNamePipe, // add our application services (api access, logging, authentication) DefaultService, ConsoleService, UserResolver, CityResolver, StateResolver, CountryResolver, StationResolver, + LanguageResolver, BootstrapResolver, ResourceService, CredentialService, UserService, VersionService, DeviceService, - ManageLogService, ManageUserService, CitiesService, VideosService, StationsService, ReportsService + ManageLogService, ManageUserService, CitiesService, VideosService, StationsService, ReportsService, + SettingsService ], entryComponents: [MessageDialogComponent, ConfirmationDialogComponent, LogDialogComponent], bootstrap: [AppComponent] diff --git a/web-angular/src/app/app.routing.ts b/web-angular/src/app/app.routing.ts index d745e812..b36d57fd 100644 --- a/web-angular/src/app/app.routing.ts +++ b/web-angular/src/app/app.routing.ts @@ -3,59 +3,68 @@ import { Routes, RouterModule } from '@angular/router'; // Import custom pages import { LayoutDrawerComponent } from './layouts'; -import { LoginComponent, RegisterComponent, ActivateComponent, ChangeComponent, ResetComponent } from './views-common'; +import { LoginComponent, RegisterComponent, ActivateComponent, ChangeComponent, ResetComponent, LoadingComponent } from './views-common'; import { CityComponent, StateComponent, CountryComponent, CitiesComponent, VideosComponent, StationsComponent, StationComponent } from './views-weather'; -import { UserDevicesComponent, UserAccountComponent } from './views-user'; +import { UserDevicesComponent, UserAccountComponent, UserFavoritesComponent } from './views-user'; import { ManageLogComponent, ManageSystemComponent, ManageUsersComponent } from './views-manage'; -import { CityResolver, StateResolver, CountryResolver, UserResolver, StationResolver } from './resolvers'; +import { CityResolver, StateResolver, CountryResolver, UserResolver, StationResolver, LanguageResolver, + BootstrapResolver } from './resolvers'; export const routes: Routes = [ - { path: '', component: LayoutDrawerComponent, resolve: { user: UserResolver }, children: [ - /// administrative functions - { path: 'manage', children: [ - { path: 'logs', component: ManageLogComponent }, - { path: 'system', component: ManageSystemComponent }, - { path: 'users', component: ManageUsersComponent }, - { path: '**', redirectTo: '/manage/system' } - ]}, - // user functions - { path: 'user', children: [ - { path: 'devices', component: UserDevicesComponent }, - { path: 'account', component: UserAccountComponent }, - { path: '**', redirectTo: '/user/account' } - ]}, - // weather functions - { path: 'weather', children: [ - { path: 'cities', children: [ - { path: ':id', component: CityComponent, resolve: { city: CityResolver } }, - { path: '**', component: CitiesComponent }, + // backwards compatibility + { path: 'activate/:token', resolve: { bs: BootstrapResolver}, component: LoadingComponent }, + { path: 'reset/:token', resolve: { bs: BootstrapResolver}, component: LoadingComponent }, + { path: 'loading', component: LoadingComponent }, + // main app routing + { path: ':lang', component: LayoutDrawerComponent, resolve: { user: UserResolver, lang: LanguageResolver }, children: [ + /// administrative functions + { path: 'manage', children: [ + { path: 'logs', component: ManageLogComponent }, + { path: 'system', component: ManageSystemComponent }, + { path: 'users', component: ManageUsersComponent }, + { path: '**', redirectTo: '/manage/system' } ]}, - { path: 'states', children: [ - { path: ':id', component: StateComponent, resolve: { state: StateResolver } } + // user functions + { path: 'user', children: [ + { path: 'devices', component: UserDevicesComponent }, + { path: 'account', component: UserAccountComponent }, + { path: 'favorites', component: UserFavoritesComponent }, + { path: '**', redirectTo: '/user/account' } ]}, - { path: 'countries', children: [ - { path: ':id', component: CountryComponent, resolve: { country: CountryResolver } } + // weather functions + { path: 'weather', children: [ + { path: 'cities', children: [ + { path: ':id', component: CityComponent, resolve: { city: CityResolver } }, + { path: '**', component: CitiesComponent }, + ]}, + { path: 'states', children: [ + { path: ':id', component: StateComponent, resolve: { state: StateResolver } } + ]}, + { path: 'countries', children: [ + { path: ':id', component: CountryComponent, resolve: { country: CountryResolver } } + ]}, + { path: 'stations', children: [ + { path: ':id', component: StationComponent, resolve: { station: StationResolver } }, + { path: '**', component: StationsComponent }, + ]}, + { path: 'videos', component: VideosComponent }, ]}, - { path: 'stations', children: [ - { path: ':id', component: StationComponent, resolve: { station: StationResolver } }, - { path: '**', component: StationsComponent }, + // common functions + { path: 'login', component: LoginComponent }, + { path: 'register', component: RegisterComponent }, + { path: 'reset', children: [ + { path: '', component: ResetComponent }, + { path: ':token', component: ChangeComponent } ]}, - { path: 'videos', component: VideosComponent }, + { path: 'activate', children: [ + { path: ':token', component: ActivateComponent } + ] }, + // catch all + { path: '**', redirectTo: 'login' } ]}, - // common functions - { path: 'login', component: LoginComponent }, - { path: 'register', component: RegisterComponent }, - { path: 'reset', children: [ - { path: '', component: ResetComponent }, - { path: ':token', component: ChangeComponent } - ]}, - { path: 'activate', children: [ - { path: ':token', component: ActivateComponent } - ] }, - // catch all - { path: '**', redirectTo: '/login' } - ]} + // catch all, redirect to browser language + { path: '**', resolve: { bs: BootstrapResolver}, component: LoadingComponent } ]; @NgModule({ diff --git a/web-angular/src/app/layouts/drawer.component.html b/web-angular/src/app/layouts/drawer.component.html index b90e7bbb..ac81755f 100644 --- a/web-angular/src/app/layouts/drawer.component.html +++ b/web-angular/src/app/layouts/drawer.component.html @@ -1,32 +1,32 @@

{{res.strings('drawer_weather')}}

- + location_city {{ res.strings('cities_title') }} - + toys {{ res.strings('stations_title') }} - + video_library {{ res.strings('videos_title') }} - + favorite {{ res.strings('user_favorites_title') }} - + devices {{ res.strings('user_devices_title') }} @@ -35,19 +35,19 @@

{{res.strings('drawer_management')}}

- + equalizer {{ res.strings('manage_system_title') }} - + subject {{ res.strings('manage_logs_title') }} - + people {{ res.strings('manage_users_title') }} @@ -56,27 +56,27 @@

{{res.strings('drawer_account')}}

- + perm_identity {{ res.strings('user_account_title') }} - security + exit_to_app {{ res.strings('button_logout') }} - - lock_open + + open_in_browser {{ res.strings('login_login_title') }} - + edit {{ res.strings('register_title') }} diff --git a/web-angular/src/app/layouts/drawer.component.ts b/web-angular/src/app/layouts/drawer.component.ts index 950547bf..b71c2972 100644 --- a/web-angular/src/app/layouts/drawer.component.ts +++ b/web-angular/src/app/layouts/drawer.component.ts @@ -32,8 +32,8 @@ export class DrawerComponent implements OnInit, OnDestroy { onLogout(): void { this.userService.logout(); - this.router.navigate(['/']); + this.router.navigateByUrl('/' + this.res.getLanguage() + '/'); } - + } diff --git a/web-angular/src/app/layouts/footer.component.html b/web-angular/src/app/layouts/footer.component.html index 365d4728..b1bc54b9 100644 --- a/web-angular/src/app/layouts/footer.component.html +++ b/web-angular/src/app/layouts/footer.component.html @@ -2,22 +2,22 @@
- - + +
\ No newline at end of file diff --git a/web-angular/src/app/layouts/footer.component.ts b/web-angular/src/app/layouts/footer.component.ts index d72a9eff..499824c0 100644 --- a/web-angular/src/app/layouts/footer.component.ts +++ b/web-angular/src/app/layouts/footer.component.ts @@ -1,9 +1,11 @@ import { Component } from '@angular/core'; import { ResourceService } from '../services'; +import { Router } from '@angular/router'; /** * The responsive footer of the web application - * that contains a couple of links. + * that contains a couple of links and enables + * the user to set the user interface language */ @Component({ selector: 'app-footer', @@ -11,6 +13,13 @@ import { ResourceService } from '../services'; }) export class FooterComponent { - constructor(public res: ResourceService) { } + constructor(public res: ResourceService, private router: Router) { } + + setLanguage(lang: 'en'|'de') { + // this is pretty hacky, but apparently there is no really good way to do this + const target = '/' + lang + this.router.url.substr(3); + this.router.navigateByUrl('/loading').then(() => + this.router.navigateByUrl(target, { replaceUrl: true })); + } } diff --git a/web-angular/src/app/layouts/layout_drawer.component.ts b/web-angular/src/app/layouts/layout_drawer.component.ts index 4662ae51..f18f9519 100644 --- a/web-angular/src/app/layouts/layout_drawer.component.ts +++ b/web-angular/src/app/layouts/layout_drawer.component.ts @@ -10,7 +10,7 @@ import { ResourceService, UserService } from '../services'; }) export class LayoutDrawerComponent implements OnInit, OnDestroy { - private static readonly DRAWER_BREAKPOINT = 960; + private static readonly DRAWER_BREAKPOINT = 1300; private drawerSubscription: Subscription; private routerSubscription: Subscription; diff --git a/web-angular/src/app/pipes/location.pipes.ts b/web-angular/src/app/pipes/location.pipes.ts index c165a72d..001d9639 100644 --- a/web-angular/src/app/pipes/location.pipes.ts +++ b/web-angular/src/app/pipes/location.pipes.ts @@ -44,7 +44,7 @@ export class WikipediaPipe implements PipeTransform { * * Usage: date | localTime:timeZone */ -@Pipe({name: 'cityType', pure: false }) +@Pipe({name: 'cityType' }) export class CityTypePipe implements PipeTransform { constructor(private res: ResourceService) { } transform(city: City): string { @@ -66,7 +66,7 @@ export class CityTypePipe implements PipeTransform { * * Usage: date | localTime:timeZone */ -@Pipe({name: 'localTime'}) +@Pipe({name: 'localTime' }) export class LocalTimePipe implements PipeTransform { constructor(private res: ResourceService) { } transform(date: Date|number, timezone?: string): string { @@ -92,7 +92,7 @@ export class LocalTimePipe implements PipeTransform { * * Usage: date | localDate:timeZone */ -@Pipe({name: 'localDate'}) +@Pipe({name: 'localDate' }) export class LocalDatePipe implements PipeTransform { constructor(private res: ResourceService) { } transform(date: Date|string|number, timezone?: string): string { @@ -112,20 +112,40 @@ export class LocalDatePipe implements PipeTransform { /** * The pipe that extracts the localized name. + * + * Usage: names | localName:compact */ @Pipe({name: 'localName', pure: false }) export class LocalNamePipe implements PipeTransform { constructor(private res: ResourceService) { } - transform(names: Map): string { + transform(names: { [key: string]: string }, compact?: boolean): string { let name = names[this.res.getLanguage()]; if (name == null) { name = names['local']; } + if (compact && names['acronym']) { + name = names['acronym']; + } return name; } } - +/** + * A pipe that returns the location icon for a hierarchy type. + */ +@Pipe({name: 'locationIcon'}) +export class LocationIconPipe implements PipeTransform { + transform(locationType: LocationHierarchy.TypeEnum): string { + switch (locationType) { + case LocationHierarchy.TypeEnum.CITY: + return 'place'; + case LocationHierarchy.TypeEnum.STATE: + return 'map'; + default: + return 'public'; + } + } +} diff --git a/web-angular/src/app/pipes/weather.pipes.ts b/web-angular/src/app/pipes/weather.pipes.ts index 84875580..59f9ebe0 100644 --- a/web-angular/src/app/pipes/weather.pipes.ts +++ b/web-angular/src/app/pipes/weather.pipes.ts @@ -5,7 +5,7 @@ import { WeatherCondition, WeatherVideo } from '../api'; /** * The pipe to print humidity values. */ -@Pipe({name: 'humidity'}) +@Pipe({ name: 'humidity' }) export class HumidityPipe implements PipeTransform { transform(value: number): string { if (value == null) { @@ -19,7 +19,7 @@ export class HumidityPipe implements PipeTransform { /** * The pipe to print cloud depth and coverage values. */ -@Pipe({name: 'cloud'}) +@Pipe({ name: 'cloud' }) export class CloudPipe implements PipeTransform { transform(value: number): string { return (value * 100).toFixed(0) + ' %'; @@ -29,7 +29,7 @@ export class CloudPipe implements PipeTransform { /** * The pipe to print temperature values. */ -@Pipe({name: 'temperature'}) +@Pipe({ name: 'temperature' }) export class TemperaturePipe implements PipeTransform { transform(value: number): string { if (value == null) { @@ -43,7 +43,7 @@ export class TemperaturePipe implements PipeTransform { /** * The pipe to print pressure values. */ -@Pipe({name: 'pressure'}) +@Pipe({ name: 'pressure' }) export class PressurePipe implements PipeTransform { transform(value: number): string { if (value == null) { @@ -57,7 +57,7 @@ export class PressurePipe implements PipeTransform { /** * The pipe to print wind speed values. */ -@Pipe({name: 'speed'}) +@Pipe({ name: 'speed' }) export class SpeedPipe implements PipeTransform { transform(value: number): string { return (value * 3.6).toFixed(0) + ' km/h / ' + (value * 3.6 * 0.6213711922373339136).toFixed(0) + ' mph'; @@ -67,83 +67,114 @@ export class SpeedPipe implements PipeTransform { /** * The pipe to print precipitation values. */ -@Pipe({name: 'precipitation'}) +@Pipe({ name: 'precipitation' }) export class PrecipitationPipe implements PipeTransform { transform(value: number): string { - return Math.max(0, value).toFixed(3) + ' kg/hm²'; + return Math.max(0, value).toFixed(1) + ' kg/hm²'; } } /** * The pipe to print snow depth values. */ -@Pipe({name: 'snow'}) +@Pipe({ name: 'snow' }) export class SnowPipe implements PipeTransform { transform(value: number): string { - return value.toFixed(2) + ' m'; + return value.toFixed(2) + ' m'; } } /** * The pipe to print weather type values. */ -@Pipe({name: 'weather', pure: false }) +@Pipe({ name: 'weather' }) export class WeatherPipe implements PipeTransform { constructor(private res: ResourceService) { } transform(value: WeatherCondition.TypeEnum): string { if (!value) { return ''; } - return this.res.strings('pipe_weather_' + value.toString().toLowerCase()); + return this.res.strings('pipe_weather_' + value.toString().toLowerCase()); } } /** * The pipe to print wind direction values. */ -@Pipe({name: 'direction', pure: false }) +@Pipe({ name: 'direction' }) export class DirectionPipe implements PipeTransform { constructor(private res: ResourceService) { } transform(value: WeatherCondition.WindDirectionEnum): string { if (!value) { return ''; } - return this.res.strings('pipe_direction_' + value.toString().toLowerCase()); + return this.res.strings('pipe_direction_' + value.toString().toLowerCase()); } } +@Pipe({ name: 'directionIcon' }) +export class DirectionIconPipe implements PipeTransform { + transform(value: WeatherCondition.WindDirectionEnum): string { + if (!value) { return ''; } + return 'wi wi-wind-direction ' + this.getIconClass(value); + } + + getIconClass(value: WeatherCondition.WindDirectionEnum): string { + switch (value) { + case WeatherCondition.WindDirectionEnum.NORTH: + return ''; + case WeatherCondition.WindDirectionEnum.NORTHEAST: + return 'rotate-45'; + case WeatherCondition.WindDirectionEnum.EAST: + return 'rotate-90'; + case WeatherCondition.WindDirectionEnum.SOUTHEAST: + return 'rotate-135'; + case WeatherCondition.WindDirectionEnum.SOUTH: + return 'rotate-180'; + case WeatherCondition.WindDirectionEnum.SOUTHWEST: + return 'rotate-225'; + case WeatherCondition.WindDirectionEnum.WEST: + return 'rotate-270'; + case WeatherCondition.WindDirectionEnum.NORTHWEST: + return 'rotate-315'; + } + return ''; + } +} + + /** * The pipe to print weathe source values. */ -@Pipe({name: 'source', pure: false }) +@Pipe({ name: 'source' }) export class SourcePipe implements PipeTransform { constructor(private res: ResourceService) { } transform(value: WeatherCondition.SourceEnum): string { if (!value) { return ''; } - return this.res.strings('pipe_source_' + value.toString().toLowerCase()); + return this.res.strings('pipe_source_' + value.toString().toLowerCase()); } } /** * The pipe to print weather video source values. */ -@Pipe({name: 'videoSource', pure: false }) +@Pipe({ name: 'videoSource' }) export class VideoSourcePipe implements PipeTransform { constructor(private res: ResourceService) { } transform(value: WeatherVideo.SourceEnum): string { if (!value) { return ''; } - return this.res.strings('pipe_video_source_' + value.toString().toLowerCase()); + return this.res.strings('pipe_video_source_' + value.toString().toLowerCase()); } } /** * The pipe to print weather video type values. */ -@Pipe({name: 'videoType', pure: false }) +@Pipe({ name: 'videoType' }) export class VideoTypePipe implements PipeTransform { constructor(private res: ResourceService) { } transform(value: WeatherVideo.TypeEnum): string { if (!value) { return ''; } - return this.res.strings('pipe_video_type_' + value.toString().toLowerCase()); + return this.res.strings('pipe_video_type_' + value.toString().toLowerCase()); } } @@ -164,7 +195,7 @@ export class VideoTypePipe implements PipeTransform { * For freezing rain and drizzle we use snow flake icon to * warn the user about the possible problematic road condition. */ -@Pipe({name: 'weatherIcon' }) +@Pipe({ name: 'weatherIcon' }) export class WeatherIconPipe implements PipeTransform { constructor() { } @@ -173,6 +204,10 @@ export class WeatherIconPipe implements PipeTransform { if (alternate === undefined) { alternate = false; } + return 'wi ' + this.getIconClass(value, alternate); + } + + private getIconClass(value: WeatherCondition.TypeEnum, alternate: boolean): string { switch (value) { case WeatherCondition.TypeEnum.UNKNOWN: break; diff --git a/web-angular/src/app/resolvers/bootstrap.resolver.ts b/web-angular/src/app/resolvers/bootstrap.resolver.ts new file mode 100644 index 00000000..26cd22cf --- /dev/null +++ b/web-angular/src/app/resolvers/bootstrap.resolver.ts @@ -0,0 +1,25 @@ +import { Injectable } from '@angular/core'; +import { Resolve, ActivatedRouteSnapshot, Router } from '@angular/router'; +import { EMPTY } from 'rxjs'; +import { ResourceService, ConsoleService } from '../services'; + +@Injectable() +export class BootstrapResolver implements Resolve { + + constructor(private router: Router, private consoleService: ConsoleService, private res: ResourceService) {} + + resolve(route: ActivatedRouteSnapshot) { + console.dir(route); + const url = route.pathFromRoot.map(v => v.url.map(segment => segment.toString()).join('/')).join('/'); + this.consoleService.log(`Bootstrapping url ${url}.`); + if (url.startsWith('/reset') || url.startsWith('/activate') || url === '/') { + this.consoleService.log('Forwarding to proper language.'); + this.router.navigateByUrl('/' + this.res.getLanguage() + url); + } else { + this.consoleService.log('Forwarding to login page.'); + this.router.navigateByUrl('/' + this.res.getLanguage() + '/login'); + } + return EMPTY; + } + +} diff --git a/web-angular/src/app/resolvers/index.ts b/web-angular/src/app/resolvers/index.ts index 3f192e56..67c3e1a4 100644 --- a/web-angular/src/app/resolvers/index.ts +++ b/web-angular/src/app/resolvers/index.ts @@ -3,3 +3,5 @@ export * from './city.resolver'; export * from './station.resolver'; export * from './state.resolver'; export * from './country.resolver'; +export * from './language.resolver'; +export * from './bootstrap.resolver'; diff --git a/web-angular/src/app/resolvers/language.resolver.ts b/web-angular/src/app/resolvers/language.resolver.ts new file mode 100644 index 00000000..6c89da44 --- /dev/null +++ b/web-angular/src/app/resolvers/language.resolver.ts @@ -0,0 +1,30 @@ +import { Injectable } from '@angular/core'; +import { Resolve, ActivatedRouteSnapshot, Router } from '@angular/router'; +import { Subject, EMPTY } from 'rxjs'; +import { ResourceService, ConsoleService } from '../services'; + +@Injectable() +export class LanguageResolver implements Resolve { + + constructor(private router: Router, private consoleService: ConsoleService, private res: ResourceService) {} + + resolve(route: ActivatedRouteSnapshot) { + const s = new Subject(); + const lang = route.paramMap.get('lang'); + this.consoleService.log(`Language is set to ${lang}.`); + if (lang === 'de' || lang === 'en') { + this.consoleService.log('Continue normal page load.'); + this.res.setLanguage(lang); + setTimeout(() => { + s.next(lang); + s.complete(); + }, 0); + return s; + } else { + this.consoleService.log('Redirect to app root: ' + this.res.getLanguage()); + this.router.navigateByUrl('/' + this.res.getLanguage() + '/'); + return EMPTY; + } + } +} + diff --git a/web-angular/src/app/resolvers/user.resolver.ts b/web-angular/src/app/resolvers/user.resolver.ts index 149a3b86..055d41ab 100644 --- a/web-angular/src/app/resolvers/user.resolver.ts +++ b/web-angular/src/app/resolvers/user.resolver.ts @@ -1,14 +1,14 @@ import { Injectable } from '@angular/core'; import { Resolve, ActivatedRouteSnapshot, RouterStateSnapshot, Router } from '@angular/router'; import { User } from '../api'; -import { UserService, UserState, UserRole, ConsoleService } from '../services'; +import { UserService, UserState, UserRole, ConsoleService, ResourceService } from '../services'; import { Observable, Subject, EMPTY, Subscription } from 'rxjs'; @Injectable() export class UserResolver implements Resolve { - constructor(private userService: UserService, private consoleService: ConsoleService, private router: Router) {} + constructor(private res: ResourceService, private userService: UserService, private consoleService: ConsoleService, private router: Router) {} resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable { const result = new Subject(); @@ -23,10 +23,10 @@ export class UserResolver implements Resolve { result.complete(); } else { this.consoleService.log(`Aborting to route to ${state.url}.`); - this.router.navigate(['/']); + this.router.navigateByUrl(`/${this.res.getLanguage()}/`); } - subscriptions.forEach((subscription) => subscription.unsubscribe()); - } + subscriptions.forEach((subscription) => subscription.unsubscribe()); + } })); } else if (this.canActivate(state.url)) { setTimeout(() => { @@ -37,7 +37,7 @@ export class UserResolver implements Resolve { return result; } else { this.consoleService.log(`Aborting to route to ${state.url}.`); - this.router.navigate(['/']); + this.router.navigateByUrl(`/${this.res.getLanguage()}/`); return EMPTY; } } diff --git a/web-angular/src/app/services/index.ts b/web-angular/src/app/services/index.ts index ed24ab3a..e5a7c4b4 100644 --- a/web-angular/src/app/services/index.ts +++ b/web-angular/src/app/services/index.ts @@ -10,3 +10,4 @@ export * from './version.service'; export * from './videos.service'; export * from './stations.service'; export * from './reports.service'; +export * from './settings.service'; diff --git a/web-angular/src/app/services/resource.service.ts b/web-angular/src/app/services/resource.service.ts index efe48b73..3d66d072 100644 --- a/web-angular/src/app/services/resource.service.ts +++ b/web-angular/src/app/services/resource.service.ts @@ -71,51 +71,72 @@ export class ResourceService { 'password_field_show': 'Passwort anzeigen', 'password_field_hide': 'Passwort verbergen', // views - + // new stuff - + + 'button_favorite_add' : 'Favorit hinzufügen', + 'button_favorite_remove' : 'Favorit entfernen', + 'button_google_maps' : 'Bei Google Maps anzeigen', + 'button_bing_maps' : 'Bei Bing Maps anzeigen', + 'button_wikipedia' : 'Bei Wikipedia anzeigen', + 'videos_title': 'Videos', 'videos_no_selection': 'Kein Video ausgewählt', 'cities_title': 'Städte', - 'stations_title': 'Stationen', - 'user_favorites_title': 'Favoriten', - 'state_title' : 'Bereich', + 'stations_title': 'Stationen', + 'stations_search_label' : 'Station finden', + 'stations_search_placeholder' : 'Stationsname', + 'stations_search_clear' : 'Zurücksetzen', + + 'user_favorites_title': 'Favoriten', + 'user_favorites_hint_title' : 'Tipp', + 'user_favorites_hint_subtitle' : 'Favoriten verwalten', + 'user_favorites_hint_content' : 'Hier kannst Du Deine Lieblingsorte auf einen Blick sehen. ' + + 'Um einen Ort hinzuzufügen, öffne die Seite mit dem Ort und ' + + 'tippe auf den Knopf mit dem Herz in der oberen, rechten ' + + 'Ecke. Wenn Du den Knopf nochmal drückst, wird der Ort ' + + 'wieder entfernt.', + 'state_title' : 'Region', 'country_title' : 'Land', + 'city_title' : 'Ort', + 'city_info_title' : 'Aktuelle Informationen', + 'city_forecast_daily' : 'Tag', + 'city_forecast_hourly' : 'Stunde', 'station_title': 'Station', 'station_latest_report' : 'Letzte Messung', + + 'search_field_label' : 'Wetter abrufen', + 'search_field_placeholder' : 'Ortsname', - 'cities_list_city' : 'Stadt', - 'cities_list_country' : 'Land', - 'cities_list_state' : 'Bereich', - 'cities_list_type' : 'Typ', - 'cities_list_population' : 'Einwohner', + 'label_city' : 'Stadt', + 'label_country' : 'Land', + 'label_state' : 'Region', + 'label_city_type' : 'Ortstyp', + 'label_population' : 'Einwohner', + 'label_timezone' : 'Zeitzone', + 'label_local_time' : 'Ortszeit', + 'label_source' : 'Quelle', - 'weather_reports_list_time' : 'Zeit', - 'weather_reports_list_date' : 'Datum', - 'weather_reports_list_temperature' : 'Temperatur', - 'weather_reports_list_pressure' : 'Luftdruck', - 'weather_reports_list_humidity' : 'Luftfeuchtigkeit', + 'label_time' : 'Zeit', + 'label_date' : 'Datum', + 'label_temperature' : 'Temperatur', + 'label_wind_speed' : 'Windgeschwindigkeit', + 'label_cloud_coverage' : 'Wolkendichte', + 'label_pressure' : 'Luftdruck', + 'label_humidity' : 'Luftfeuchtigkeit', + 'label_snow_depth' : 'Schneehöhe', + 'label_precipitation' : 'Niederschlag', + 'label_longitude' : 'Längengrad', + 'label_latitude' : 'Breitengrad', + 'label_altitude' : 'Höhe', + 'label_name' : 'Name', + 'label_operator' : 'Betreiber', + 'label_video_type' : 'Videoart', + 'label_video_source' : 'Videoquelle', - 'weather_report_time' : 'Zeit', - 'weather_report_date' : 'Datum', - 'weather_report_temperature' : 'Temperatur', - 'weather_report_pressure' : 'Luftdruck', - 'weather_report_humidity' : 'Luftfeuchtigkeit', - - - 'stations_list_longitude' : 'Breitengrad', - 'stations_list_latitude' : 'Längengrad', - 'stations_list_altitude' : 'Höhe', - 'stations_list_name' : 'Bezeichnung', - 'stations_list_operator' : 'Betreiber', - - 'weather_video_list_date': 'Datum', - 'weather_video_list_time': 'Zeit', - 'weather_video_list_type': 'Videoart', - 'weather_video_list_source': 'Videoquelle', // end new stuff @@ -350,7 +371,7 @@ export class ResourceService { 'pipe_weather_moderate_fall_of_snowflakes': 'Mäßiger Schneefall', 'pipe_weather_heavy_fall_of_snowflakes': 'Starker Schneefall', 'pipe_weather_snow_grains': 'Schnee', - 'pipe_weather_rain_shower_slight': 'Leiche Regenschauer', + 'pipe_weather_rain_shower_slight': 'Leichte Regenschauer', 'pipe_weather_rain_shower_moderate_heavy': 'Mäßige Regenschauer', 'pipe_weather_rain_shower_violent': 'Heftige Regenschauer', 'pipe_weather_snow_shower_slight': 'Leichte Schneeschauer ', @@ -429,6 +450,77 @@ export class ResourceService { 'password_field_show': 'Show password', 'password_field_hide': 'Hide password', // views + + + // new stuff + + 'button_favorite_add' : 'Add favorite', + 'button_favorite_remove' : 'Remove favorite', + 'button_google_maps' : 'Show on Google Maps', + 'button_bing_maps' : 'Show on Bing Maps', + 'button_wikipedia' : 'Show on Wikipedia', + + 'videos_title': 'Videos', + 'videos_no_selection': 'No video selected', + 'cities_title': 'Cities', + + 'stations_title': 'Stations', + 'stations_search_label' : 'Find station', + 'stations_search_placeholder' : 'Station name', + 'stations_search_clear' : 'Reset', + + 'user_favorites_title': 'Favorites', + 'user_favorites_hint_title' : 'Tip', + 'user_favorites_hint_subtitle' : 'Manage favorites', + 'user_favorites_hint_content' : 'Here you can view your favorite places. ' + + 'To add a place, open the page with the place and tap on the heart ' + + 'button in the top right corner. If you tap the button again, the ' + + 'place will be removed again.', + + 'state_title' : 'Region', + 'country_title' : 'Country', + + 'city_title' : 'Place', + 'city_info_title' : 'Current Information', + 'city_forecast_daily' : 'Day', + 'city_forecast_hourly' : 'Hour', + + 'station_title': 'Station', + 'station_latest_report' : 'Latest Measurement', + + 'search_field_label' : 'Retrieve weather', + 'search_field_placeholder' : 'Place name', + + 'label_city' : 'City', + 'label_country' : 'Country', + 'label_state' : 'Region', + 'label_city_type' : 'Type', + 'label_population' : 'Population', + 'label_timezone' : 'Time Zone', + 'label_local_time' : 'Local Time', + 'label_source' : 'Source', + + 'label_time' : 'Time', + 'label_date' : 'Date', + 'label_temperature' : 'Temperature', + 'label_wind_speed' : 'Wind Speed', + 'label_cloud_coverage' : 'Cloud Coverage', + 'label_pressure' : 'Pressure', + 'label_humidity' : 'Humidity', + 'label_snow_depth' : 'Snow Depth', + 'label_precipitation' : 'Precipitation', + 'label_longitude' : 'Longitude', + 'label_latitude' : 'Latitude', + 'label_altitude' : 'Altitude', + 'label_name' : 'Name', + 'label_operator' : 'Operator', + 'label_video_type' : 'Video Type', + 'label_video_source' : 'Video Source', + + + // end new stuff + + 'user_account_title': 'Settings', 'user_account_change_title' : 'Change information', 'user_account_change_subtitle' : 'Here you can change your contact information.', @@ -703,9 +795,25 @@ export class ResourceService { this.language.next('de'); } } + this.checkConsistency(); this.updateLanguages(); } + private checkConsistency() { + const vde = Object.getOwnPropertyNames(this.values_de); + const ven = Object.getOwnPropertyNames(this.values_en); + vde.forEach((v) => { + if (ven.indexOf(v) < 0) { + console.log(`Warning: en misses ${v}`); + } + }); + ven.forEach((v) => { + if (vde.indexOf(v) < 0) { + console.log(`Warning: de misses ${v}`); + } + }); + } + public strings(key: string): string { const result = this.values[key]; if (!result) { console.log('Failed to load string for: ' + key); } diff --git a/web-angular/src/app/services/settings.service.ts b/web-angular/src/app/services/settings.service.ts new file mode 100644 index 00000000..4bb28c93 --- /dev/null +++ b/web-angular/src/app/services/settings.service.ts @@ -0,0 +1,95 @@ +import { Injectable } from '@angular/core'; +import { BehaviorSubject } from 'rxjs'; +import { DefaultService, Settings, LocationReference } from '../api'; +import { UserService } from './user.service'; + +/** + * A service that manages the user's settings. + */ +@Injectable() +export class SettingsService { + + public settings = new BehaviorSubject(null); + public loading = new BehaviorSubject(false); + + constructor(private userService: UserService, private apiClientService: DefaultService) { + userService.user.subscribe((user) => { + this.reloadSettings(); + }); + } + + public reloadSettings(): void { + const user = this.userService.user.value; + if (user == null) { + this.settings.next(null); + this.loading.next(false); + } else { + this.loading.next(true); + this.apiClientService.getCurrentUserSettings('body').subscribe((settings) => { + if (this.userService.user.value === user) { + this.settings.next(settings); + this.loading.next(false); + } + }, (error) => { + if (this.userService.user.value === user) { + this.loading.next(false); + } + }); + } + } + + public isFavorite(location: LocationReference): boolean { + const s = this.settings.value; + if (s == null) { + return false; + } else { + return s.locations.reduce((found, loc) => { + return found || (location.id === loc.id && location.type === loc.type); + }, false); + } + } + + public removeFavorite(location: LocationReference) { + const u = this.userService.user.value; + const s = this.settings.value; + if (s != null && this.isFavorite(location)) { + let deleted = false; + for (let i = s.locations.length - 1; i >= 0; i--) { + const loc = s.locations[i]; + if (loc.id === location.id && loc.type === location.type) { + s.locations.splice(i, 1); + deleted = true; + } + } + if (deleted) { + this.saveSettings(); + } + } + } + + public addFavorite(location: LocationReference) { + const u = this.userService.user.value; + const s = this.settings.value; + if (s != null && !this.isFavorite(location)) { + s.locations.push(location); + this.saveSettings(); + } + } + + public saveSettings(): void { + const u = this.userService.user.value; + const s = this.settings.value; + if (u != null && s != null) { + this.loading.next(true); + this.apiClientService.setCurrentUserSettings(s).subscribe((settings) => { + if (this.userService.user.value === u) { + this.settings.next(settings); + this.loading.next(false); + } + }, (error) => { + this.reloadSettings(); + }); + } + } + +} diff --git a/web-angular/src/app/services/stations.service.ts b/web-angular/src/app/services/stations.service.ts index 873a87d0..669f35b5 100644 --- a/web-angular/src/app/services/stations.service.ts +++ b/web-angular/src/app/services/stations.service.ts @@ -10,7 +10,7 @@ import { HttpResponse } from '@angular/common/http'; @Injectable() export class StationsService extends AbstractPageService { - term: string = ''; + term = ''; constructor(apiClientService: DefaultService) { super(apiClientService); diff --git a/web-angular/src/app/utils/pagination.ts b/web-angular/src/app/utils/pagination.ts index ea62d61b..af71be96 100644 --- a/web-angular/src/app/utils/pagination.ts +++ b/web-angular/src/app/utils/pagination.ts @@ -41,9 +41,10 @@ export class PaginationHandler> { export abstract class AbstractPageService> extends DataSource { private elements = new BehaviorSubject([]); - readonly page = new BehaviorSubject

({ offset: 0, size: 20, total: 0, elements: []} as P); + readonly page = new BehaviorSubject

({ offset: 0, size: 10, total: 0, elements: []} as P); private subscriptions = 0; readonly loading = new BehaviorSubject(false); + protected requestCode = 0; constructor(protected apiClientService: DefaultService) { super(); @@ -53,20 +54,24 @@ export abstract class AbstractPageService> extends DataSour } getPage(offset: number, size: number) { - if (this.loading.getValue()) { return; } + this.requestCode += 1; + const code = this.requestCode; this.loading.next(true); + this.page.next(this.emptyPage()); this.loadPage(offset, size).subscribe((result) => { - this.pageLoaded(result.body); + this.pageLoaded(code, result.body); }, (error) => { - this.pageLoaded(null); + this.pageLoaded(code, null); }); } protected abstract loadPage(offset: number, size: number): Observable>; - protected pageLoaded(page: P): void { - this.page.next(page); - this.loading.next(false); + protected pageLoaded(code: number, page: P): void { + if (code === this.requestCode) { + this.page.next(page); + this.loading.next(false); + } } reload(): void { @@ -101,22 +106,29 @@ export abstract class AbstractReferencePageService, R> exte protected abstract loadReference(id: number): Observable>; - protected pageLoaded(page: P): void { - this.page.next(page); - if (page != null) { - for (const id of this.getReferences(page)) { - if (this.getReference(id) == null) { - this.referenceRequests += 1; - this.loadReference(id).subscribe(result => { - this.referenceLoaded(id, result.body); - }, error => { - this.referenceLoaded(id, null); - }); + protected pageLoaded(code: number, page: P): void { + if (code === this.requestCode) { + this.page.next(page); + if (page != null) { + this.referenceRequests = 0; + for (const id of this.getReferences(page)) { + if (this.getReference(id) == null) { + this.referenceRequests += 1; + this.loadReference(id).subscribe(result => { + if (code === this.requestCode) { + this.referenceLoaded(id, result.body); + } + }, error => { + if (code === this.requestCode) { + this.referenceLoaded(id, null); + } + }); + } } } - } - if (this.referenceRequests === 0) { - this.loading.next(false); + if (this.referenceRequests === 0) { + this.loading.next(false); + } } } diff --git a/web-angular/src/app/views-common/activate.component.ts b/web-angular/src/app/views-common/activate.component.ts index 0033fdbf..90bb7c8b 100644 --- a/web-angular/src/app/views-common/activate.component.ts +++ b/web-angular/src/app/views-common/activate.component.ts @@ -25,7 +25,7 @@ import { ResourceService } from '../services'; ngOnInit(): void { const token = this.route.snapshot.paramMap.get('token'); if (!token) { - this.router.navigate(['/']); + this.router.navigateByUrl('/' + this.res.getLanguage() + '/'); } else { this.apiClientService.verifyUserEmail(token, 'response').subscribe((result) => { this.showMessage = false; @@ -33,8 +33,8 @@ import { ResourceService } from '../services'; title: this.res.strings('activate_success_title'), message: this.res.strings('activate_success_message'), button: this.res.strings('button_gotit')}).subscribe((close) => { - this.router.navigate(['/']); - }); + this.router.navigateByUrl('/' + this.res.getLanguage() + '/'); + }); }, (error) => { this.showMessage = false; let message: string = this.res.strings('activate_error_message'); @@ -54,8 +54,8 @@ import { ResourceService } from '../services'; title: this.res.strings('activate_error_title'), message: message, button: this.res.strings('button_gotit') }).subscribe((close) => { - this.router.navigate(['/']); - }); + this.router.navigateByUrl('/' + this.res.getLanguage() + '/'); + }); }); } } diff --git a/web-angular/src/app/views-common/change.component.ts b/web-angular/src/app/views-common/change.component.ts index 445ac0fe..5c99db12 100644 --- a/web-angular/src/app/views-common/change.component.ts +++ b/web-angular/src/app/views-common/change.component.ts @@ -49,7 +49,7 @@ export class ChangeComponent implements OnInit, OnDestroy { title: this.res.strings('change_reset_success_title'), message: this.res.strings('change_reset_success_message'), button: this.res.strings('button_gotit') }).subscribe((close) => { - this.router.navigate(['/']); + this.router.navigateByUrl('/' + this.res.getLanguage() + '/'); }); }, (error) => { this.setIdle(true); @@ -70,8 +70,8 @@ export class ChangeComponent implements OnInit, OnDestroy { title: this.res.strings('change_reset_error_title'), message: message, button: this.res.strings('button_gotit') }).subscribe((close) => { - this.router.navigate(['/']); - }); + this.router.navigateByUrl('/' + this.res.getLanguage() + '/'); + }); }); } diff --git a/web-angular/src/app/views-common/index.ts b/web-angular/src/app/views-common/index.ts index accb085e..5867d497 100644 --- a/web-angular/src/app/views-common/index.ts +++ b/web-angular/src/app/views-common/index.ts @@ -1,5 +1,6 @@ export * from './activate.component'; export * from './change.component'; +export * from './loading.component'; export * from './login.component'; export * from './register.component'; export * from './reset.component'; diff --git a/web-angular/src/app/views-common/loading.component.html b/web-angular/src/app/views-common/loading.component.html new file mode 100644 index 00000000..7ba800ed --- /dev/null +++ b/web-angular/src/app/views-common/loading.component.html @@ -0,0 +1,5 @@ +

+
+ +
+
\ No newline at end of file diff --git a/web-angular/src/app/views-common/loading.component.ts b/web-angular/src/app/views-common/loading.component.ts new file mode 100644 index 00000000..bb532cb5 --- /dev/null +++ b/web-angular/src/app/views-common/loading.component.ts @@ -0,0 +1,10 @@ +import { Component } from '@angular/core'; + +@Component({ + selector: 'app-loading', + templateUrl: './loading.component.html' + }) +export class LoadingComponent { + +} + diff --git a/web-angular/src/app/views-common/login.component.html b/web-angular/src/app/views-common/login.component.html index 4b98374a..2229a252 100644 --- a/web-angular/src/app/views-common/login.component.html +++ b/web-angular/src/app/views-common/login.component.html @@ -15,14 +15,14 @@
- {{res.strings('login_login_reset')}} + {{res.strings('login_login_reset')}}
@@ -34,7 +34,7 @@

{{res.strings('login_register_paragraph')}}

- diff --git a/web-angular/src/app/views-common/login.component.ts b/web-angular/src/app/views-common/login.component.ts index 936bd64e..282b70fa 100644 --- a/web-angular/src/app/views-common/login.component.ts +++ b/web-angular/src/app/views-common/login.component.ts @@ -1,7 +1,7 @@ import { Component, OnInit, OnDestroy, ViewChild, HostListener } from '@angular/core'; import { DatePipe } from '@angular/common'; import { BehaviorSubject, Subscription } from 'rxjs'; -import { Router } from '@angular/router'; +import { Router, ActivatedRoute } from '@angular/router'; import { MatSnackBar } from '@angular/material/snack-bar'; import { NgForm } from '@angular/forms'; import { UserState, UserService, VersionService, ResourceService } from '../services'; @@ -38,7 +38,8 @@ export class LoginComponent implements OnInit, OnDestroy { private datePipe: DatePipe, private versionService: VersionService, private snackbar: MatSnackBar, - private router: Router) { + private router: Router, + private route: ActivatedRoute) { this.login = userService.getLogin(); } @@ -61,7 +62,7 @@ export class LoginComponent implements OnInit, OnDestroy { this.stateSubscription = this.userService.state.subscribe((state) => { if (state === UserState.Available) { this.idle.next(false); - let url = '/user/favorites'; + let url = '/' + this.res.getLanguage() + '/user/favorites'; if (this.userService.redirectUrl != null) { url = this.userService.redirectUrl; this.userService.redirectUrl = null; diff --git a/web-angular/src/app/views-common/register.component.html b/web-angular/src/app/views-common/register.component.html index eb517d02..81b9f2b8 100644 --- a/web-angular/src/app/views-common/register.component.html +++ b/web-angular/src/app/views-common/register.component.html @@ -46,8 +46,8 @@

{{ res.strings('register_already_paragraph') }}

- diff --git a/web-angular/src/app/views-common/register.component.ts b/web-angular/src/app/views-common/register.component.ts index 98a32ee5..f964c3e7 100644 --- a/web-angular/src/app/views-common/register.component.ts +++ b/web-angular/src/app/views-common/register.component.ts @@ -84,7 +84,7 @@ export class RegisterComponent implements OnInit, OnDestroy { title: this.res.strings('register_success_title'), message: this.res.strings('register_success_message'), button: this.res.strings('button_gotit') }).subscribe((e) => { - this.router.navigate(['/']); + this.router.navigateByUrl( '/' + this.res.getLanguage() + '/'); }); this.registrationSubscription = null; }, (error) => { diff --git a/web-angular/src/app/views-common/reset.component.ts b/web-angular/src/app/views-common/reset.component.ts index 7e137d54..cf8f84b5 100644 --- a/web-angular/src/app/views-common/reset.component.ts +++ b/web-angular/src/app/views-common/reset.component.ts @@ -44,8 +44,8 @@ export class ResetComponent implements OnInit, OnDestroy { title: this.res.strings('reset_confirm_title'), message: this.res.strings('reset_confirm_message'), button: this.res.strings('button_gotit') }).subscribe((close) => { - this.router.navigate(['/']); - }); + this.router.navigateByUrl( '/' + this.res.getLanguage() + '/'); + }); }, (error) => { this.setIdle(true); if (error instanceof HttpErrorResponse) { diff --git a/web-angular/src/app/views-user/index.ts b/web-angular/src/app/views-user/index.ts index bed47542..d5b6af20 100644 --- a/web-angular/src/app/views-user/index.ts +++ b/web-angular/src/app/views-user/index.ts @@ -1,2 +1,3 @@ export * from './user-account.component'; export * from './user-devices.component'; +export * from './user-favorites.component'; diff --git a/web-angular/src/app/views-user/user-account.component.html b/web-angular/src/app/views-user/user-account.component.html index edf0ddb2..c7eaa2c5 100644 --- a/web-angular/src/app/views-user/user-account.component.html +++ b/web-angular/src/app/views-user/user-account.component.html @@ -5,8 +5,12 @@ {{ res.strings('user_account_title') }} - -
+ + + + edit + +

{{ res.strings('user_account_change_title') }}

{{ res.strings('user_account_change_subtitle') }}

@@ -30,10 +34,13 @@ {{ res.strings('button_save') }}
-
- - -
+
+ + + + security + +

{{ res.strings('user_account_password_title') }}

{{ res.strings('user_account_password_subtitle') }}

@@ -46,57 +53,65 @@ {{ res.strings('button_change') }}
- - - - -
-

{{ res.strings('user_account_add_email_title') }}

-

{{ res.strings('user_account_add_email_subtitle') }}

- - - -
- +
+ + + + email + +
+

{{ res.strings('user_account_add_email_title') }}

+

{{ res.strings('user_account_add_email_subtitle') }}

+
+ +
+
+ +
-
- - -
-

{{ res.strings('user_account_del_email_title') }}

-

{{ res.strings('user_account_del_email_subtitle') }}

- - - - - {{ e.address }} + + + + delete + +
+

{{ res.strings('user_account_del_email_title') }}

+

{{ res.strings('user_account_del_email_subtitle') }}

+ + + + + {{ e.address }} + - - -
- - - -
-

{{ res.strings('user_account_delete_title') }}

-

{{ res.strings('user_account_delete_subtitle') }}

-
- -
-
- +
-
- -
+ + + + delete_forever + +
+

{{ res.strings('user_account_delete_title') }}

+

{{ res.strings('user_account_delete_subtitle') }}

+
+ +
+
+ +
+
+
+ +
diff --git a/web-angular/src/app/views-user/user-account.component.ts b/web-angular/src/app/views-user/user-account.component.ts index 38db250b..84b5c0c4 100644 --- a/web-angular/src/app/views-user/user-account.component.ts +++ b/web-angular/src/app/views-user/user-account.component.ts @@ -82,7 +82,7 @@ export class UserAccountComponent implements OnInit, OnDestroy { message: this.res.strings('user_account_password_wrong_message')}); } else { Snackbars.showMessage(this.snackbar, this.res.strings('user_account_delete_success'), Snackbars.DURATION_LONG); - this.router.navigate(['/']); + this.router.navigateByUrl( '/' + this.res.getLanguage() + '/'); } }); } diff --git a/web-angular/src/app/views-user/user-favorites.component.html b/web-angular/src/app/views-user/user-favorites.component.html new file mode 100644 index 00000000..9a8cd83f --- /dev/null +++ b/web-angular/src/app/views-user/user-favorites.component.html @@ -0,0 +1,46 @@ +
+ + favorites + {{ res.strings('user_favorites_title') }} + + +
+ + + {{ location.type | locationIcon}} + {{ location.names | localName }} + + {{ location.parent.names | localName:true }}, {{ location.parent.parent.names | localName:true }} + + + + + + + +
+
+ +
+ +
+
+ +
+
+
+
+ + + help_outline + {{ res.strings('user_favorites_hint_title') }} + {{ res.strings('user_favorites_hint_subtitle') }} + + + +

{{ res.strings('user_favorites_hint_content') }}

+
+
+
+
+
diff --git a/web-angular/src/app/views-user/user-favorites.component.ts b/web-angular/src/app/views-user/user-favorites.component.ts new file mode 100644 index 00000000..348aad9a --- /dev/null +++ b/web-angular/src/app/views-user/user-favorites.component.ts @@ -0,0 +1,67 @@ +import { Component, OnInit, OnDestroy } from '@angular/core'; +import { Subscription } from 'rxjs'; +import { Router } from '@angular/router'; +import { ResourceService, SettingsService } from '../services'; +import {DefaultService, LocationHierarchy} from '../api'; + +@Component({ + selector: 'app-user-favorites', + templateUrl: './user-favorites.component.html' +}) +export class UserFavoritesComponent implements OnInit, OnDestroy { + + loading = false; + locations: LocationHierarchy[] = []; + error = false; + private settingsSubscription: Subscription; + private requestCode = 0; + + constructor(public res: ResourceService, private settingsService: SettingsService, + private apiClientService: DefaultService, private router: Router) { } + + ngOnInit(): void { + this.reload(); + this.settingsSubscription = this.settingsService.loading.subscribe((loading) => { + if (!loading) { + this.reload(); + } + }); + } + + ngOnDestroy(): void { + this.settingsSubscription.unsubscribe(); + } + + private reload() { + this.loading = true; + this.error = false; + const code = ++this.requestCode; + this.apiClientService.getCurrentUserLocations().subscribe((locations) => { + if (this.requestCode === code) { + this.locations = locations; + this.loading = false; + } + }, (error) => { + if (this.requestCode === code) { + this.error = true; + this.loading = false; + } + }); + } + + onClick(hierarchy: LocationHierarchy) { + let url = '/' + this.res.getLanguage() + '/weather/'; + switch (hierarchy.type) { + case LocationHierarchy.TypeEnum.CITY: + url += 'cities'; break; + case LocationHierarchy.TypeEnum.COUNTRY: + url += 'countries'; break; + case LocationHierarchy.TypeEnum.STATE: + url += 'states'; break; + } + url += '/' + hierarchy.id; + console.log(url); + this.router.navigateByUrl(url); + } + +} diff --git a/web-angular/src/app/views-weather/cities.component.html b/web-angular/src/app/views-weather/cities.component.html index f1e78680..2c721e7f 100644 --- a/web-angular/src/app/views-weather/cities.component.html +++ b/web-angular/src/app/views-weather/cities.component.html @@ -3,9 +3,18 @@ location_city {{ res.strings( 'cities_title') }} - -
- + +
+
+ +
- +
+ + + + + +
+
diff --git a/web-angular/src/app/views-weather/cities.component.ts b/web-angular/src/app/views-weather/cities.component.ts index 7a05fd22..7a545d4b 100644 --- a/web-angular/src/app/views-weather/cities.component.ts +++ b/web-angular/src/app/views-weather/cities.component.ts @@ -1,13 +1,45 @@ -import { Component } from '@angular/core'; +import { Component, OnInit, OnDestroy } from '@angular/core'; -import { ResourceService } from '../services'; +import { ResourceService, CitiesService } from '../services'; +import { Subscription } from 'rxjs'; +import { MapComponentMarker } from '../widgets-common'; +import { Coordinate } from '../api'; +import { LocalNamePipe } from '../pipes'; +import { Router } from '@angular/router'; @Component({ selector: 'app-cities', templateUrl: 'cities.component.html' }) -export class CitiesComponent { +export class CitiesComponent implements OnInit, OnDestroy { + + citiesSubscription: Subscription; + markers: MapComponentMarker[] = []; + bounds: Coordinate[] = []; + + constructor(public res: ResourceService, public router: Router, + public citiesService: CitiesService, public localName: LocalNamePipe) { } + + ngOnInit() { + this.citiesService.setReference(null); + this.citiesSubscription = this.citiesService.page.subscribe((p) => { + this.markers = []; + this.bounds = []; + if (p != null) { + p.elements.forEach((e) => { + this.bounds.push(e.coordinate); + this.markers.splice(0, 0, { coordinate: e.coordinate, label: this.localName.transform(e.names), clicked: () => { + this.router.navigateByUrl(`/${this.res.getLanguage()}/weather/cities/${e.id}`); + } }); + }); + } + }); + } + + ngOnDestroy() { + this.citiesSubscription.unsubscribe(); + } + - constructor(public res: ResourceService) { } } diff --git a/web-angular/src/app/views-weather/city.component.html b/web-angular/src/app/views-weather/city.component.html index 6b347ce4..53f3cea7 100644 --- a/web-angular/src/app/views-weather/city.component.html +++ b/web-angular/src/app/views-weather/city.component.html @@ -2,19 +2,26 @@ place {{ res.strings('city_title') }} +
+
+ + + + +
-
place
+
place
{{ city.names | localName }} - + {{ city.state.names | localName }}, - + {{ city.country.names | localName }}
@@ -23,22 +30,27 @@
- - - - - - - - -
Ortszeit{{ date | localTime:city.timezone }} {{ date | localDate:city.timezone }}
Ortstyp{{ city | cityType }}
Einwohner{{ city.population }}
Zeitzone{{ city.timezone }}
Beschreibung - Wikipedia - Nicht verfügbar -
Karte - Google Bing -
-
+ + + + + The First Content + + + + +
+ +
+
+
+
+ + +
+ +
+ + +
+ {{ res.strings('city_info_title') }} + {{ c.type | weather }} +
+ + +
+
+
+
+
{{ c.temperature | temperature }}
+
+
+
+
{{ c.precipitation | precipitation }}
+
+
+
+
{{ c.windSpeed | speed }}
+
+
+
+
{{ c.cloudCoverage | cloud }}
+
+
+
+
{{ c.snowDepth | snow }}
+
+
+
+
{{ c.pressure | pressure }}
+
+
+
+
+
+
{{ res.strings('label_local_time') }}
+
{{ date | localTime:city.timezone }} {{ date | localDate:city.timezone }}
+
+
+
{{ res.strings('label_timezone') }}
+
{{ city.timezone }}
+
+
+
{{ res.strings('label_city_type') }}
+
{{ city | cityType }}
+
+
+
{{ res.strings('label_population') }}
+
{{ city.population }}
+
+
+
{{ res.strings('station_title') }}
+ +
+
+
+
+ +
+
+
{{ res.strings('label_source') }}
+
{{ c.source | source }}
+
+
+
+
diff --git a/web-angular/src/app/views-weather/city.component.ts b/web-angular/src/app/views-weather/city.component.ts index 19150a26..029fabe0 100644 --- a/web-angular/src/app/views-weather/city.component.ts +++ b/web-angular/src/app/views-weather/city.component.ts @@ -3,7 +3,7 @@ import { Router, ActivatedRoute } from '@angular/router'; import { Subscription, BehaviorSubject } from 'rxjs'; import { ResourceService } from '../services'; -import { DefaultService, City, Geometry, WeatherCondition, WeatherForecast, WeatherVideo } from '../api'; +import { DefaultService, City, Geometry, WeatherCondition, WeatherForecast, WeatherVideo, WeatherStation } from '../api'; @Component({ selector: 'app-city', @@ -16,6 +16,7 @@ export class CityComponent implements OnInit, OnDestroy { condition = new BehaviorSubject(null); forecast = new BehaviorSubject(null); videos = new BehaviorSubject(null); + station = new BehaviorSubject(null); routeSubscription: Subscription; date: Date; @@ -32,6 +33,7 @@ export class CityComponent implements OnInit, OnDestroy { this.condition.next(null); this.forecast.next(null); this.videos.next(null); + this.station.next(null); const cityId = this.city.id; this.apiClientService.getCityBoundary(cityId).subscribe((boundary) => { if (this.city.id === cityId) { @@ -53,6 +55,11 @@ export class CityComponent implements OnInit, OnDestroy { this.videos.next(videos); } }); + this.apiClientService.getCityStation(cityId).subscribe((station)=> { + if (this.city.id === cityId) { + this.station.next(station); + } + }) }); } diff --git a/web-angular/src/app/views-weather/country.component.html b/web-angular/src/app/views-weather/country.component.html index 029690ee..6c6d2d28 100644 --- a/web-angular/src/app/views-weather/country.component.html +++ b/web-angular/src/app/views-weather/country.component.html @@ -2,12 +2,18 @@ map {{ res.strings('country_title') }} +
+
+ + + +
-
public
+
public
{{ country.names | localName }}
diff --git a/web-angular/src/app/views-weather/state.component.html b/web-angular/src/app/views-weather/state.component.html index de883268..1fd74116 100644 --- a/web-angular/src/app/views-weather/state.component.html +++ b/web-angular/src/app/views-weather/state.component.html @@ -2,15 +2,22 @@ map {{ res.strings('state_title') }} +
+
+ + + + +
-
map
+
map
{{ state.names | localName }} - + {{ state.country.names | localName }} diff --git a/web-angular/src/app/views-weather/station.component.html b/web-angular/src/app/views-weather/station.component.html index 57d27a3e..f3de7afe 100644 --- a/web-angular/src/app/views-weather/station.component.html +++ b/web-angular/src/app/views-weather/station.component.html @@ -2,19 +2,24 @@ toys {{ res.strings('station_title') }} +
+
+ + +
-
toys
+
toys
{{ station.name }} {{ station.operator }}
- +
@@ -24,16 +29,46 @@
+
{{ res.strings('station_latest_report') }} {{ r.time | localDate }} {{ r.time | localTime }}
- +
+
+
+
+
{{ r.temperature | temperature }}
+
+
+
+
{{ r.pressure | pressure }}
+
+
+
+
{{ r.humidity | humidity }}
+
+
+
+
+
+
{{ res.strings('label_longitude') }}
+
{{ station.coordinate.longitude }}
+
+
+
{{ res.strings('label_latitude') }}
+
{{ station.coordinate.latitude }}
+
+
+
{{ res.strings('label_altitude') }}
+
{{ station.altitude }} m
+
+
+
-
\ No newline at end of file diff --git a/web-angular/src/app/views-weather/station.component.ts b/web-angular/src/app/views-weather/station.component.ts index 88620374..48be7cfe 100644 --- a/web-angular/src/app/views-weather/station.component.ts +++ b/web-angular/src/app/views-weather/station.component.ts @@ -1,9 +1,10 @@ import { Component, OnInit, OnDestroy } from '@angular/core'; -import { Router, ActivatedRoute } from '@angular/router'; +import { ActivatedRoute } from '@angular/router'; import { Subscription, BehaviorSubject } from 'rxjs'; import { ResourceService } from '../services'; import { DefaultService, WeatherStation, WeatherReport } from '../api'; +import { MapComponentMarker } from '../widgets-common'; @Component({ selector: 'app-station', @@ -12,22 +13,21 @@ import { DefaultService, WeatherStation, WeatherReport } from '../api'; export class StationComponent implements OnInit, OnDestroy { station: WeatherStation; + markers: MapComponentMarker[]; report = new BehaviorSubject(null); routeSubscription: Subscription; - constructor( - public res: ResourceService, - private apiClientService: DefaultService, - private router: Router, private route: ActivatedRoute) { } + constructor(public res: ResourceService, private apiClientService: DefaultService, private route: ActivatedRoute) { } ngOnInit(): void { this.routeSubscription = this.route.params.subscribe((res) => { this.station = this.route.snapshot.data['station']; + this.markers = [ { label: this.station.name, coordinate: this.station.coordinate } ]; const stationId = this.station.id; this.apiClientService.getLatestStationReport(stationId).subscribe((report) => { if (this.station.id === stationId) { - this.report.next(report); + this.report.next(report); } }); }); diff --git a/web-angular/src/app/views-weather/stations.component.html b/web-angular/src/app/views-weather/stations.component.html index 483d8b01..0208e128 100644 --- a/web-angular/src/app/views-weather/stations.component.html +++ b/web-angular/src/app/views-weather/stations.component.html @@ -2,10 +2,28 @@ toys {{ res.strings( 'stations_title') }} - - -
- +
+
+ + {{ res.strings('stations_search_label')}} + + filter_list + +
- + + +
+
+ +
+
+
+ + + + + +
+
diff --git a/web-angular/src/app/views-weather/stations.component.ts b/web-angular/src/app/views-weather/stations.component.ts index bfefb69c..e6afaaa8 100644 --- a/web-angular/src/app/views-weather/stations.component.ts +++ b/web-angular/src/app/views-weather/stations.component.ts @@ -1,13 +1,62 @@ -import { Component } from '@angular/core'; +import { Component, OnInit, OnDestroy } from '@angular/core'; -import { ResourceService } from '../services'; +import { ResourceService, StationsService } from '../services'; +import { FormControl } from '@angular/forms'; +import { Subscription } from 'rxjs'; +import { MapComponentMarker } from '../widgets-common'; +import { Coordinate } from '../api'; +import { Router } from '@angular/router'; @Component({ selector: 'app-stations', templateUrl: 'stations.component.html' }) -export class StationsComponent { +export class StationsComponent implements OnInit, OnDestroy { - constructor(public res: ResourceService) { } + term = new FormControl(); + termSubscription: Subscription; + stationSubscription: Subscription; + markers: MapComponentMarker[] = []; + bounds: Coordinate[] = []; + requestId = 0; + + constructor(public res: ResourceService, private router: Router, private stationService: StationsService) { } + + ngOnInit() { + this.term.setValue(this.stationService.getTerm()); + this.termSubscription = this.term.valueChanges.subscribe(() => { + const value = this.term.value; + const id = ++this.requestId; + setTimeout(() => { + if (this.requestId === id) { + this.stationService.setTerm(value); + } + }, 250); + }); + this.stationSubscription = this.stationService.page.subscribe((p) => { + this.markers = []; + this.bounds = []; + if (p != null) { + p.elements.forEach((e) => { + this.bounds.push(e.coordinate); + this.markers.splice(0, 0, { coordinate: e.coordinate, label: e.name, clicked: () => { + this.router.navigateByUrl(`/${this.res.getLanguage()}/weather/stations/${e.id}`); + } }); + }); + } + }); + + } + + clearTerm() { + if (this.term.value !== '') { + this.term.setValue(''); + } + } + + ngOnDestroy() { + this.termSubscription.unsubscribe(); + this.stationSubscription.unsubscribe(); + } } diff --git a/web-angular/src/app/views-weather/videos.component.html b/web-angular/src/app/views-weather/videos.component.html index 36559efe..e41e5e8a 100644 --- a/web-angular/src/app/views-weather/videos.component.html +++ b/web-angular/src/app/views-weather/videos.component.html @@ -9,7 +9,7 @@
- +

{{ video.source | videoSource }} - {{ video.type | videoType }}

diff --git a/web-angular/src/app/widgets-common/favorite-button.component.html b/web-angular/src/app/widgets-common/favorite-button.component.html new file mode 100644 index 00000000..08af8fe5 --- /dev/null +++ b/web-angular/src/app/widgets-common/favorite-button.component.html @@ -0,0 +1,15 @@ + + +
+ +
+
+ + + + + + + \ No newline at end of file diff --git a/web-angular/src/app/widgets-common/favorite-button.component.ts b/web-angular/src/app/widgets-common/favorite-button.component.ts new file mode 100644 index 00000000..1dfce2aa --- /dev/null +++ b/web-angular/src/app/widgets-common/favorite-button.component.ts @@ -0,0 +1,73 @@ +import { Component, Input, OnInit, OnDestroy, OnChanges } from '@angular/core'; +import { Subscription } from 'rxjs'; +import { LocationReference } from '../api'; +import { SettingsService, ResourceService } from '../services'; + +/** + * Implements a button that enables the user to add + * and remove favorites. + */ +@Component({ + selector: 'app-favorite-button', + templateUrl: './favorite-button.component.html' +}) +export class FavoriteButtonComponent implements OnInit, OnDestroy, OnChanges { + + /** + * The id of the location. + */ + @Input() id: number = null; + /** + * The type of the location. + */ + @Input() type: LocationReference.TypeEnum = null; + + tooltip = ''; + icon = ''; + visible = true; + + private settingsSubscription: Subscription; + + /** + * Creates a new button. + */ + constructor(private res: ResourceService, public settingsService: SettingsService) { } + + ngOnInit() { + this.settingsSubscription = this.settingsService.settings.subscribe(() => { + this.updateState(); + }); + } + + ngOnChanges() { + this.updateState(); + } + + ngOnDestroy() { + this.settingsSubscription.unsubscribe(); + } + + updateState() { + if (this.settingsService.settings.value != null && this.id != null && this.type != null) { + this.visible = true; + const isFavorite = this.settingsService.isFavorite({ id: this.id, type: this.type }); + this.icon = isFavorite ? 'favorite' : 'favorite_border'; + this.tooltip = isFavorite ? this.res.strings('button_favorite_remove') : this.res.strings('button_favorite_add'); + } else { + this.visible = false; + } + } + + onClick() { + if (this.settingsService.settings.value != null && this.id != null && this.type != null) { + const reference = { id: this.id, type: this.type }; + if (this.settingsService.isFavorite(reference)) { + this.settingsService.removeFavorite(reference); + } else { + this.settingsService.addFavorite(reference); + } + } + } + + +} diff --git a/web-angular/src/app/widgets-common/index.ts b/web-angular/src/app/widgets-common/index.ts index 5e5add87..e4e9074a 100644 --- a/web-angular/src/app/widgets-common/index.ts +++ b/web-angular/src/app/widgets-common/index.ts @@ -9,3 +9,4 @@ export * from './password-field.component'; export * from './profile-button.component'; export * from './search-field.component'; export * from './toolbar-button.component'; +export * from './favorite-button.component'; diff --git a/web-angular/src/app/widgets-common/map.component.ts b/web-angular/src/app/widgets-common/map.component.ts index fbd2fb14..26a54ee4 100644 --- a/web-angular/src/app/widgets-common/map.component.ts +++ b/web-angular/src/app/widgets-common/map.component.ts @@ -1,4 +1,4 @@ -import { Component, OnInit, DoCheck, ElementRef, ViewChild, Input } from '@angular/core'; +import { Component, OnInit, DoCheck, ElementRef, ViewChild, Input, OnChanges, SimpleChange, SimpleChanges } from '@angular/core'; import { ResourceService } from '../services'; import { Coordinate, Geometry } from '../api'; import * as L from 'leaflet'; @@ -9,7 +9,8 @@ import * as L from 'leaflet'; */ @Component({ selector: 'app-map', - templateUrl: './map.component.html' + templateUrl: './map.component.html', + styles: ['.leaflet-container { background-color: #aadaff;' ] }) export class MapComponent implements OnInit, DoCheck { @@ -21,14 +22,21 @@ export class MapComponent implements OnInit, DoCheck { @Input() coordinate: Coordinate; @Input() zoom: number; + @Input() bounds: Coordinate[]; @Input() boundary: Geometry; + @Input() markers: MapComponentMarker[]; + map: L.Map; layer: L.TileLayer; geojson: L.GeoJSON; attribution: L.Control; + elements: L.CircleMarker[] = []; + lastCenter: Coordinate; + lastBounds: Coordinate[]; lastBoundary: Geometry; + lastMarkers: MapComponentMarker[]; constructor(public res: ResourceService) { } @@ -38,6 +46,7 @@ export class MapComponent implements OnInit, DoCheck { this.map.addControl(this.attribution); this.map.invalidateSize(); this.updateCenter(); + this.updateMarkers(); } updateCenter() { @@ -51,12 +60,47 @@ export class MapComponent implements OnInit, DoCheck { this.map.setView([this.coordinate.latitude, this.coordinate.longitude], this.zoom); } } + if (this.lastBounds !== this.bounds) { + this.lastBounds = this.bounds; + if (this.bounds) { + const latLng: L.LatLngTuple[] = []; + this.bounds.forEach(c => { + latLng.push([ c.latitude, c.longitude ]); + }); + if (latLng.length > 0) { + this.map.fitBounds(L.latLngBounds(latLng), { animate: false, padding: [10, 10]}); + } + } + } if (this.lastBoundary !== this.boundary) { this.lastBoundary = this.boundary; this.geojson.clearLayers(); if (this.boundary) { this.geojson.addData({ type: 'Feature', geometry: this.boundary } as any); - this.map.fitBounds(this.geojson.getBounds(), { animate: false }); + this.map.fitBounds(this.geojson.getBounds(), { animate: false, padding: [10, 10] }); + } + } + } + + updateMarkers() { + if (this.lastMarkers !== this.markers) { + this.elements.forEach((e) => e.remove()); + this.elements = []; + this.lastMarkers = this.markers; + if (this.markers) { + this.markers.forEach((marker) => { + const circleMarker = L.circleMarker( + [marker.coordinate.latitude, marker.coordinate.longitude], + { color: '#00695c' , fillColor: '#f9a825'}); + if (marker.label) { + circleMarker.bindTooltip(marker.label, { permanent: true}); + } + if (marker.clicked) { + circleMarker.addEventListener('click', (e) => { marker.clicked(); }); + } + this.elements.push(circleMarker); + circleMarker.addTo(this.map); + }); } } } @@ -71,10 +115,17 @@ export class MapComponent implements OnInit, DoCheck { this.layer = new L.TileLayer(MapComponent.DEFAULT_TILE_URL, { maxZoom: 18 }).addTo(this.map); - this.geojson = new L.GeoJSON().addTo(this.map); + this.geojson = new L.GeoJSON(null, { style: { color: '#00695c' , fillColor: '#f9a825'} }).addTo(this.map); this.layer.getAttribution = function(): string { return object.res.strings('map_attribution'); }; } +} + +/** A marker that shall be added to the map. */ +export interface MapComponentMarker { + coordinate: Coordinate; + label?: string; + clicked?: () => void; } \ No newline at end of file diff --git a/web-angular/src/app/widgets-common/profile-button.component.html b/web-angular/src/app/widgets-common/profile-button.component.html index a786da34..7884a71f 100644 --- a/web-angular/src/app/widgets-common/profile-button.component.html +++ b/web-angular/src/app/widgets-common/profile-button.component.html @@ -1,4 +1,4 @@ - -
- - - + + + + + + \ No newline at end of file diff --git a/web-angular/src/app/widgets-common/toolbar-button.component.ts b/web-angular/src/app/widgets-common/toolbar-button.component.ts index 85c635d7..58523ec4 100644 --- a/web-angular/src/app/widgets-common/toolbar-button.component.ts +++ b/web-angular/src/app/widgets-common/toolbar-button.component.ts @@ -3,76 +3,26 @@ import { Router, NavigationEnd } from '@angular/router'; import { Subscription } from 'rxjs'; /** - * Implements a responsive button for the toolbar - * that consists of an icon, text and a link. - * Optionally, it can be disabled and it is possible - * to set a color. If a color is used, the button - * will raise as well. If no color is provided, the - * button will be flat. + * Implements a button for the toolbar that uses a + * regular icon. */ @Component({ selector: 'app-toolbar-button', templateUrl: './toolbar-button.component.html' }) -export class ToolbarButtonComponent implements OnInit, OnDestroy { +export class ToolbarButtonComponent { /** - * The title of the button. + * The tooltip of the button. */ - @Input() title: string; + @Input() tooltip: string; /** - * The icon of the button which should - * be a character or ligature of the material - * icon font. + * The icon classes of the button. */ @Input() icon: string; /** - * The router link that is activated by the - * button. + * The link that is activated when the button is pressed. */ @Input() link: string; - /** - * Enables or disables the button. - */ - @Input() disabled: boolean; - /** - * The color (e.g. "accent") which will also - * raise the button, if set. - */ - @Input() color: string; - - /** - * Determines whether the button is shown. - */ - visible: boolean; - - /** - * The subscription to the router. - */ - private routerSubscription: Subscription; - - /** - * Creates a new button. - * - * @param router The router. - */ - constructor(private router: Router) { } - - ngOnInit() { - this.routerSubscription = this.router.events.subscribe((event) => { - if (event instanceof NavigationEnd) { - this.updateVisibility(); - } - }); - this.updateVisibility(); - } - - private updateVisibility(): void { - this.visible = (this.router.url !== this.link); - } - - ngOnDestroy() { - this.routerSubscription.unsubscribe(); - } } diff --git a/web-angular/src/app/widgets-weather/cities-list.component.html b/web-angular/src/app/widgets-weather/cities-list.component.html index 4082998a..22fb9143 100644 --- a/web-angular/src/app/widgets-weather/cities-list.component.html +++ b/web-angular/src/app/widgets-weather/cities-list.component.html @@ -6,25 +6,25 @@ - {{ res.strings('cities_list_city') }} + {{ res.strings('label_city') }} {{ element.names | localName }} - {{ res.strings('cities_list_state') }} + {{ res.strings('label_state') }} {{ (element.state)?(element.state.names | localName):'' }} - {{ res.strings('cities_list_country') }} + {{ res.strings('label_country') }} {{ element.country.names | localName }} - {{ res.strings('cities_list_type') }} + {{ res.strings('label_city_type') }} {{ element | cityType }} - {{ res.strings('cities_list_population') }} + {{ res.strings('label_population') }} {{ element.population }} diff --git a/web-angular/src/app/widgets-weather/cities-list.component.ts b/web-angular/src/app/widgets-weather/cities-list.component.ts index 9f13c424..861661dd 100644 --- a/web-angular/src/app/widgets-weather/cities-list.component.ts +++ b/web-angular/src/app/widgets-weather/cities-list.component.ts @@ -18,11 +18,11 @@ import { Router } from '@angular/router'; export class CitiesListComponent implements OnChanges, OnInit, OnDestroy, DoCheck { private static COLUMNS: TableColumn[] = [ - { name: 'name', dropPriority: 0, width: 200, fixedWidth: false }, - { name: 'country', dropPriority: 1, width: 200, fixedWidth: false }, - { name: 'state', dropPriority: 2, width: 200, fixedWidth: false }, - { name: 'type', dropPriority: 3, width: 120, fixedWidth: true }, - { name: 'population', dropPriority: 3, width: 120, fixedWidth: true}, + { name: 'name', dropPriority: 0, width: 120, fixedWidth: false }, + { name: 'country', dropPriority: 1, width: 120, fixedWidth: false }, + { name: 'state', dropPriority: 4, width: 120, fixedWidth: false }, + { name: 'type', dropPriority: 2, width: 100, fixedWidth: true }, + { name: 'population', dropPriority: 3, width: 100, fixedWidth: true}, ]; @Input() location: LocationReference = null; @@ -38,7 +38,6 @@ export class CitiesListComponent implements OnChanges, OnInit, OnDestroy, DoChec ngOnInit() { this.tableHandler = new TableHandler(this.table, CitiesListComponent.COLUMNS); this.pageHandler = new PaginationHandler(this.paginator, this.citiesService); - this.citiesService.setReference(this.location); this.citiesService.reload(); } @@ -65,7 +64,7 @@ export class CitiesListComponent implements OnChanges, OnInit, OnDestroy, DoChec } onClick(city: City) { - this.router.navigateByUrl(`/weather/cities/${city.id}`); + this.router.navigateByUrl(`/${this.res.getLanguage()}/weather/cities/${city.id}`); } } \ No newline at end of file diff --git a/web-angular/src/app/widgets-weather/weather-condition.component.html b/web-angular/src/app/widgets-weather/weather-condition.component.html index 122e53b6..65b9f6f8 100644 --- a/web-angular/src/app/widgets-weather/weather-condition.component.html +++ b/web-angular/src/app/widgets-weather/weather-condition.component.html @@ -1,3 +1,40 @@ + +
+
+
+
+
{{ condition.time | localDate:timezone }}
+
{{ condition.time | localTime:timezone }}
+
+
+
{{ condition.type | weather }}
+
+
+
{{ condition.temperature | temperature }}
+
+
+
+
{{ condition.precipitation | precipitation }}
+
+
+
+
{{ condition.windSpeed | speed }}
+
+
+
+
{{ condition.cloudCoverage | cloud }}
+
+
+
+
{{ condition.snowDepth | snow }}
+
+
+
+
{{ condition.pressure | pressure }}
+
+
+
+ \ No newline at end of file diff --git a/web-angular/src/app/widgets-weather/weather-condition.component.ts b/web-angular/src/app/widgets-weather/weather-condition.component.ts index 2f84f989..be8f9acf 100644 --- a/web-angular/src/app/widgets-weather/weather-condition.component.ts +++ b/web-angular/src/app/widgets-weather/weather-condition.component.ts @@ -14,6 +14,8 @@ export class WeatherConditionComponent { @Input() condition: WeatherCondition; + @Input() timezone: string; + constructor(public res: ResourceService) { } hasCondition() { diff --git a/web-angular/src/app/widgets-weather/weather-forecast.component.html b/web-angular/src/app/widgets-weather/weather-forecast.component.html index 7a0fc5fa..952c698c 100644 --- a/web-angular/src/app/widgets-weather/weather-forecast.component.html +++ b/web-angular/src/app/widgets-weather/weather-forecast.component.html @@ -1,4 +1,4 @@ -
+
diff --git a/web-angular/src/app/widgets-weather/weather-report.component.html b/web-angular/src/app/widgets-weather/weather-report.component.html index ba922bb0..3b972330 100644 --- a/web-angular/src/app/widgets-weather/weather-report.component.html +++ b/web-angular/src/app/widgets-weather/weather-report.component.html @@ -1,12 +1,15 @@
-
- {{ report.temperature | temperature }} +
+
+
{{ report.temperature | temperature }}
-
- {{ report.pressure | pressure }} +
+
+
{{ report.pressure | pressure }}
-
- {{ report.humidity | humidity }} +
+
+
{{ report.humidity | humidity }}
diff --git a/web-angular/src/app/widgets-weather/weather-reports-list.component.html b/web-angular/src/app/widgets-weather/weather-reports-list.component.html index ce3b6993..906fd25c 100644 --- a/web-angular/src/app/widgets-weather/weather-reports-list.component.html +++ b/web-angular/src/app/widgets-weather/weather-reports-list.component.html @@ -6,25 +6,25 @@ - {{ res.strings('weather_reports_list_time') }} + {{ res.strings('label_time') }} {{ element.time | localTime }} - {{ res.strings('weather_reports_list_date') }} + {{ res.strings('label_date') }} {{ element.time | localDate }} - {{ res.strings('weather_reports_list_temperature') }} + {{ res.strings('label_temperature') }} {{ element.temperature | temperature }} - {{ res.strings('weather_reports_list_pressure') }} + {{ res.strings('label_pressure') }} {{ element.pressure | pressure }} - {{ res.strings('weather_reports_list_humidity') }} + {{ res.strings('label_humidity') }} {{ element.humidity | humidity }} diff --git a/web-angular/src/app/widgets-weather/weather-reports-list.component.ts b/web-angular/src/app/widgets-weather/weather-reports-list.component.ts index bc6f123b..7f0167e4 100644 --- a/web-angular/src/app/widgets-weather/weather-reports-list.component.ts +++ b/web-angular/src/app/widgets-weather/weather-reports-list.component.ts @@ -37,8 +37,7 @@ export class WeatherReportsListComponent implements OnChanges, OnInit, OnDestroy ngOnInit() { this.tableHandler = new TableHandler(this.table, WeatherReportsListComponent.COLUMNS); this.pageHandler = new PaginationHandler(this.paginator, this.reportsService); - this.reportsService.setStation(this.station); - this.reportsService.reload(); + this.ngOnChanges(); } ngOnDestroy() { diff --git a/web-angular/src/app/widgets-weather/weather-stations-list.component.html b/web-angular/src/app/widgets-weather/weather-stations-list.component.html index 721e5b43..679895d6 100644 --- a/web-angular/src/app/widgets-weather/weather-stations-list.component.html +++ b/web-angular/src/app/widgets-weather/weather-stations-list.component.html @@ -6,27 +6,27 @@ - {{ res.strings('stations_list_name') }} + {{ res.strings('label_name') }} {{ element.name }} - {{ res.strings('stations_list_longitude') }} + {{ res.strings('label_longitude') }} {{ element.coordinate.longitude }} - {{ res.strings('stations_list_latitude') }} + {{ res.strings('label_latitude') }} {{ element.coordinate.latitude }} - {{ res.strings('stations_list_altitude') }} + {{ res.strings('label_altitude') }} {{ element.altitude }} - {{ res.strings('stations_list_operator') }} + {{ res.strings('label_operator') }} {{ element.operator }} diff --git a/web-angular/src/app/widgets-weather/weather-stations-list.component.ts b/web-angular/src/app/widgets-weather/weather-stations-list.component.ts index c27f9948..d7ec31f0 100644 --- a/web-angular/src/app/widgets-weather/weather-stations-list.component.ts +++ b/web-angular/src/app/widgets-weather/weather-stations-list.component.ts @@ -56,7 +56,7 @@ export class WeatherStationsListComponent implements OnInit, OnDestroy, DoCheck } onClick(station: WeatherStation) { - this.router.navigateByUrl(`/weather/stations/${station.id}`); + this.router.navigateByUrl(`/${this.res.getLanguage()}/weather/stations/${station.id}`); } } \ No newline at end of file diff --git a/web-angular/src/app/widgets-weather/weather-video-bar.component.html b/web-angular/src/app/widgets-weather/weather-video-bar.component.html index 8c415cb1..7c10a7b5 100644 --- a/web-angular/src/app/widgets-weather/weather-video-bar.component.html +++ b/web-angular/src/app/widgets-weather/weather-video-bar.component.html @@ -3,23 +3,30 @@
- + + +

{{ v.type | videoType }}

+
- + + +

{{ v.type | videoType }}

+
- + + +

{{ v.type | videoType }}

+
diff --git a/web-angular/src/app/widgets-weather/weather-video-list.component.html b/web-angular/src/app/widgets-weather/weather-video-list.component.html index d49d88ba..2d7b2bf3 100644 --- a/web-angular/src/app/widgets-weather/weather-video-list.component.html +++ b/web-angular/src/app/widgets-weather/weather-video-list.component.html @@ -6,23 +6,23 @@ - {{ res.strings('weather_video_list_source') }} + {{ res.strings('label_video_source') }} {{ element.source | videoSource }} - {{ res.strings('weather_video_list_type') }} + {{ res.strings('label_video_type') }} {{ element.type | videoType }} - {{ res.strings('weather_video_list_date') }} + {{ res.strings('label_date') }} {{ element.time | localDate }} - {{ res.strings('weather_video_list_time') }} + {{ res.strings('label_time') }} {{ element.time | localTime }} diff --git a/web-angular/src/app/widgets-weather/weather-video-list.component.ts b/web-angular/src/app/widgets-weather/weather-video-list.component.ts index 06dc0f30..8dd1bf14 100644 --- a/web-angular/src/app/widgets-weather/weather-video-list.component.ts +++ b/web-angular/src/app/widgets-weather/weather-video-list.component.ts @@ -18,9 +18,9 @@ export class WeatherVideoListComponent implements OnInit, OnDestroy, DoCheck { private static COLUMNS: TableColumn[] = [ { name: 'source', dropPriority: 0, width: 250, fixedWidth: false }, - { name: 'type', dropPriority: 0, width: 200, fixedWidth: false }, - { name: 'time', dropPriority: 0, width: 120, fixedWidth: true }, - { name: 'date', dropPriority: 0, width: 120, fixedWidth: true }, + { name: 'type', dropPriority: 0, width: 240, fixedWidth: false }, + { name: 'time', dropPriority: 0, width: 90, fixedWidth: true }, + { name: 'date', dropPriority: 0, width: 100, fixedWidth: true }, ]; @ViewChild(MatTable, { read: ElementRef, static: true }) table: ElementRef; diff --git a/web-angular/src/assets/fonts/jam-icons.eot b/web-angular/src/assets/fonts/jam-icons.eot new file mode 100644 index 00000000..0a65a2a9 Binary files /dev/null and b/web-angular/src/assets/fonts/jam-icons.eot differ diff --git a/web-angular/src/assets/fonts/jam-icons.svg b/web-angular/src/assets/fonts/jam-icons.svg new file mode 100644 index 00000000..b5a1a545 --- /dev/null +++ b/web-angular/src/assets/fonts/jam-icons.svg @@ -0,0 +1,928 @@ + + + + + + +{ + "fontFamily": "Jam-icons", + "majorVersion": 2, + "minorVersion": 0, + "fontURL": "https://jam-icons.com", + "copyright": "©Jam Icons", + "designer": "Michael Amprimo <@michaelampr>", + "designerURL": "https://michaelamprimo.com", + "license": "MIT", + "licenseURL": "https://opensource.org/licenses/mit-license.php", + "version": "Version 2.0", + "fontId": "Jam-icons", + "psName": "Jam-icons", + "subFamily": "Regular", + "fullName": "Jam-icons", + "description": "Font generated by IcoMoon." +} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/web-angular/src/assets/fonts/jam-icons.ttf b/web-angular/src/assets/fonts/jam-icons.ttf new file mode 100644 index 00000000..bf013e8f Binary files /dev/null and b/web-angular/src/assets/fonts/jam-icons.ttf differ diff --git a/web-angular/src/assets/fonts/jam-icons.woff b/web-angular/src/assets/fonts/jam-icons.woff new file mode 100644 index 00000000..aac278a3 Binary files /dev/null and b/web-angular/src/assets/fonts/jam-icons.woff differ diff --git a/web-angular/src/fonts.scss b/web-angular/src/fonts.scss index c17877f7..e27a7787 100644 --- a/web-angular/src/fonts.scss +++ b/web-angular/src/fonts.scss @@ -96,3 +96,16 @@ font-weight: normal; font-style: normal; } + +/* JAM icons font - https://github.com/michaelampr/jam */ + +@font-face{ + font-family:'jam-icons'; + src:url("assets/fonts/jam-icons.eot?osflwm"); + src:url("assets/fonts/jam-icons.eot?osflwm#iefix") format("embedded-opentype"), + url("assets/fonts/jam-icons.ttf?osflwm") format("truetype"), + url("assets/fonts/jam-icons.woff?osflwm") format("woff"), + url("assets/fonts/jam-icons.svg?osflwm#Jam-icons") format("svg"); + font-weight:normal; + font-style:normal +} \ No newline at end of file diff --git a/web-angular/src/jam.scss b/web-angular/src/jam.scss new file mode 100644 index 00000000..76fd9703 --- /dev/null +++ b/web-angular/src/jam.scss @@ -0,0 +1,5 @@ +/* + Copyright (c) 2018 Michael Amprimo <@michaelampr>. + Licensed under the MIT License (MIT), https://jam-icons.com +*/ +.jam{font-family:'jam-icons' !important;speak:none;font-style:normal;font-weight:normal;font-variant:normal;text-transform:none;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.jam-five-hundred-px:before{content:"\e900"}.jam-activity:before{content:"\e901"}.jam-airbnb:before{content:"\e902"}.jam-alarm-clock-f:before{content:"\e903"}.jam-alarm-clock:before{content:"\e904"}.jam-alert-f:before{content:"\e905"}.jam-alert:before{content:"\e906"}.jam-alien-f:before{content:"\e907"}.jam-alien:before{content:"\e908"}.jam-align-center:before{content:"\e909"}.jam-align-justify:before{content:"\e90a"}.jam-align-left:before{content:"\e90b"}.jam-align-right:before{content:"\e90c"}.jam-amazon:before{content:"\e90d"}.jam-anchor:before{content:"\e90e"}.jam-android-circle:before{content:"\e90f"}.jam-android-square:before{content:"\e910"}.jam-android:before{content:"\e911"}.jam-aperture:before{content:"\e912"}.jam-apple-circle:before{content:"\e913"}.jam-apple-square:before{content:"\e914"}.jam-apple:before{content:"\e915"}.jam-archive-f:before{content:"\e916"}.jam-archive:before{content:"\e917"}.jam-arrow-circle-down-f:before{content:"\e918"}.jam-arrow-circle-down-left-f:before{content:"\e919"}.jam-arrow-circle-down-left:before{content:"\e91a"}.jam-arrow-circle-down-right-f:before{content:"\e91b"}.jam-arrow-circle-down-right:before{content:"\e91c"}.jam-arrow-circle-down:before{content:"\e91d"}.jam-arrow-circle-left-f:before{content:"\e91e"}.jam-arrow-circle-left:before{content:"\e91f"}.jam-arrow-circle-right-f:before{content:"\e920"}.jam-arrow-circle-right:before{content:"\e921"}.jam-arrow-circle-up-f:before{content:"\e922"}.jam-arrow-circle-up-left-f:before{content:"\e923"}.jam-arrow-circle-up-left:before{content:"\e924"}.jam-arrow-circle-up-right-f:before{content:"\e925"}.jam-arrow-circle-up-right:before{content:"\e926"}.jam-arrow-circle-up:before{content:"\e927"}.jam-arrow-down-left:before{content:"\e928"}.jam-arrow-down-right:before{content:"\e929"}.jam-arrow-down:before{content:"\e92a"}.jam-arrow-left:before{content:"\e92b"}.jam-arrow-right:before{content:"\e92c"}.jam-arrow-square-down-f:before{content:"\e92d"}.jam-arrow-square-down-left-f:before{content:"\e92e"}.jam-arrow-square-down-left:before{content:"\e92f"}.jam-arrow-square-down-right-f:before{content:"\e930"}.jam-arrow-square-down-right:before{content:"\e931"}.jam-arrow-square-down:before{content:"\e932"}.jam-arrow-square-left-f:before{content:"\e933"}.jam-arrow-square-left:before{content:"\e934"}.jam-arrow-square-right-f:before{content:"\e935"}.jam-arrow-square-right:before{content:"\e936"}.jam-arrow-square-up-f:before{content:"\e937"}.jam-arrow-square-up-left-f:before{content:"\e938"}.jam-arrow-square-up-left:before{content:"\e939"}.jam-arrow-square-up-right-f:before{content:"\e93a"}.jam-arrow-square-up-right:before{content:"\e93b"}.jam-arrow-square-up:before{content:"\e93c"}.jam-arrow-up-left:before{content:"\e93d"}.jam-arrow-up-right:before{content:"\e93e"}.jam-arrow-up:before{content:"\e93f"}.jam-arrows-corners:before{content:"\e940"}.jam-arrows-fullscreen:before{content:"\e941"}.jam-arrows-h:before{content:"\e942"}.jam-arrows-v:before{content:"\e943"}.jam-attachment:before{content:"\e944"}.jam-background-color:before{content:"\e945"}.jam-backpack-f:before{content:"\e946"}.jam-backpack:before{content:"\e947"}.jam-backward-circle-f:before{content:"\e948"}.jam-backward-circle:before{content:"\e949"}.jam-backward-square-f:before{content:"\e94a"}.jam-backward-square:before{content:"\e94b"}.jam-backward:before{content:"\e94c"}.jam-baidu-circle:before{content:"\e94d"}.jam-baidu-square:before{content:"\e94e"}.jam-baidu:before{content:"\e94f"}.jam-bandage-f:before{content:"\e950"}.jam-bandage:before{content:"\e951"}.jam-bar-chart:before{content:"\e952"}.jam-baseball:before{content:"\e953"}.jam-basketball:before{content:"\e954"}.jam-bathtub-f:before{content:"\e955"}.jam-bathtub:before{content:"\e956"}.jam-battery-charging-f:before{content:"\e957"}.jam-battery-charging:before{content:"\e958"}.jam-battery-f:before{content:"\e959"}.jam-battery-half-f:before{content:"\e95a"}.jam-battery-half:before{content:"\e95b"}.jam-battery-one-quarter-f:before{content:"\e95c"}.jam-battery-one-quarter:before{content:"\e95d"}.jam-battery-three-quarters-f:before{content:"\e95e"}.jam-battery-three-quarters:before{content:"\e95f"}.jam-battery:before{content:"\e960"}.jam-beatport-circle:before{content:"\e961"}.jam-beatport-square:before{content:"\e962"}.jam-beatport:before{content:"\e963"}.jam-beer-f:before{content:"\e964"}.jam-beer:before{content:"\e965"}.jam-behance-circle:before{content:"\e966"}.jam-behance-square:before{content:"\e967"}.jam-behance:before{content:"\e968"}.jam-bell-f:before{content:"\e969"}.jam-bell-off-f:before{content:"\e96a"}.jam-bell-off:before{content:"\e96b"}.jam-bell:before{content:"\e96c"}.jam-bing-circle:before{content:"\e96d"}.jam-bing-square:before{content:"\e96e"}.jam-bing:before{content:"\e96f"}.jam-birthday-cake-f:before{content:"\e970"}.jam-birthday-cake:before{content:"\e971"}.jam-blogger-circle:before{content:"\e972"}.jam-blogger-square:before{content:"\e973"}.jam-blogger:before{content:"\e974"}.jam-bluetooth:before{content:"\e975"}.jam-bold:before{content:"\e976"}.jam-book-f:before{content:"\e977"}.jam-book:before{content:"\e978"}.jam-bookmark-f:before{content:"\e979"}.jam-bookmark-minus-f:before{content:"\e97a"}.jam-bookmark-minus:before{content:"\e97b"}.jam-bookmark-plus-f:before{content:"\e97c"}.jam-bookmark-plus:before{content:"\e97d"}.jam-bookmark-remove-f:before{content:"\e97e"}.jam-bookmark-remove:before{content:"\e97f"}.jam-bookmark:before{content:"\e980"}.jam-bottle-f:before{content:"\e981"}.jam-bottle:before{content:"\e982"}.jam-box-f:before{content:"\e983"}.jam-box:before{content:"\e984"}.jam-branch-f:before{content:"\e985"}.jam-branch:before{content:"\e986"}.jam-brightness-down-f:before{content:"\e987"}.jam-brightness-down:before{content:"\e988"}.jam-brightness-up-f:before{content:"\e989"}.jam-brightness-up:before{content:"\e98a"}.jam-brightness:before{content:"\e98b"}.jam-brush-f:before{content:"\e98c"}.jam-brush:before{content:"\e98d"}.jam-bug-f:before{content:"\e98e"}.jam-bug:before{content:"\e98f"}.jam-building-f:before{content:"\e990"}.jam-building:before{content:"\e991"}.jam-bus-f:before{content:"\e992"}.jam-bus:before{content:"\e993"}.jam-cactus-f:before{content:"\e994"}.jam-cactus:before{content:"\e995"}.jam-calculator:before{content:"\e996"}.jam-calendar-alt-f:before{content:"\e997"}.jam-calendar-alt:before{content:"\e998"}.jam-calendar-f:before{content:"\e999"}.jam-calendar:before{content:"\e99a"}.jam-camera-alt-f:before{content:"\e99b"}.jam-camera-alt:before{content:"\e99c"}.jam-camera-f:before{content:"\e99d"}.jam-camera:before{content:"\e99e"}.jam-candle-f:before{content:"\e99f"}.jam-candle:before{content:"\e9a0"}.jam-capsule-f:before{content:"\e9a1"}.jam-capsule:before{content:"\e9a2"}.jam-car-f:before{content:"\e9a3"}.jam-car:before{content:"\e9a4"}.jam-castle-f:before{content:"\e9a5"}.jam-castle:before{content:"\e9a6"}.jam-check:before{content:"\e9a7"}.jam-chevron-circle-down-f:before{content:"\e9a8"}.jam-chevron-circle-down-left-f:before{content:"\e9a9"}.jam-chevron-circle-down-left:before{content:"\e9aa"}.jam-chevron-circle-down-right-f:before{content:"\e9ab"}.jam-chevron-circle-down-right:before{content:"\e9ac"}.jam-chevron-circle-down:before{content:"\e9ad"}.jam-chevron-circle-left-f:before{content:"\e9ae"}.jam-chevron-circle-left:before{content:"\e9af"}.jam-chevron-circle-right-f:before{content:"\e9b0"}.jam-chevron-circle-right:before{content:"\e9b1"}.jam-chevron-circle-up-f:before{content:"\e9b2"}.jam-chevron-circle-up-left-f:before{content:"\e9b3"}.jam-chevron-circle-up-left:before{content:"\e9b4"}.jam-chevron-circle-up-right-f:before{content:"\e9b5"}.jam-chevron-circle-up-right:before{content:"\e9b6"}.jam-chevron-circle-up:before{content:"\e9b7"}.jam-chevron-down-left:before{content:"\e9b8"}.jam-chevron-down-right:before{content:"\e9b9"}.jam-chevron-down:before{content:"\e9ba"}.jam-chevron-left:before{content:"\e9bb"}.jam-chevron-right:before{content:"\e9bc"}.jam-chevron-square-down-f:before{content:"\e9bd"}.jam-chevron-square-down-left-f:before{content:"\e9be"}.jam-chevron-square-down-left:before{content:"\e9bf"}.jam-chevron-square-down-right-f:before{content:"\e9c0"}.jam-chevron-square-down-right:before{content:"\e9c1"}.jam-chevron-square-down:before{content:"\e9c2"}.jam-chevron-square-left-f:before{content:"\e9c3"}.jam-chevron-square-left:before{content:"\e9c4"}.jam-chevron-square-right-f:before{content:"\e9c5"}.jam-chevron-square-right:before{content:"\e9c6"}.jam-chevron-square-up-f:before{content:"\e9c7"}.jam-chevron-square-up-left-f:before{content:"\e9c8"}.jam-chevron-square-up-left:before{content:"\e9c9"}.jam-chevron-square-up-right-f:before{content:"\e9ca"}.jam-chevron-square-up-right:before{content:"\e9cb"}.jam-chevron-square-up:before{content:"\e9cc"}.jam-chevron-up-left:before{content:"\e9cd"}.jam-chevron-up-right:before{content:"\e9ce"}.jam-chevron-up:before{content:"\e9cf"}.jam-chevrons-circle-down-f:before{content:"\e9d0"}.jam-chevrons-circle-down-left-f:before{content:"\e9d1"}.jam-chevrons-circle-down-left:before{content:"\e9d2"}.jam-chevrons-circle-down-right-f:before{content:"\e9d3"}.jam-chevrons-circle-down-right:before{content:"\e9d4"}.jam-chevrons-circle-down:before{content:"\e9d5"}.jam-chevrons-circle-left-f:before{content:"\e9d6"}.jam-chevrons-circle-left:before{content:"\e9d7"}.jam-chevrons-circle-right-f:before{content:"\e9d8"}.jam-chevrons-circle-right:before{content:"\e9d9"}.jam-chevrons-circle-up-f:before{content:"\e9da"}.jam-chevrons-circle-up-left-f:before{content:"\e9db"}.jam-chevrons-circle-up-left:before{content:"\e9dc"}.jam-chevrons-circle-up-right-f:before{content:"\e9dd"}.jam-chevrons-circle-up-right:before{content:"\e9de"}.jam-chevrons-circle-up:before{content:"\e9df"}.jam-chevrons-down-left:before{content:"\e9e0"}.jam-chevrons-down-right:before{content:"\e9e1"}.jam-chevrons-down:before{content:"\e9e2"}.jam-chevrons-left:before{content:"\e9e3"}.jam-chevrons-right:before{content:"\e9e4"}.jam-chevrons-square-down-f:before{content:"\e9e5"}.jam-chevrons-square-down-left-f:before{content:"\e9e6"}.jam-chevrons-square-down-left:before{content:"\e9e7"}.jam-chevrons-square-down-right-f:before{content:"\e9e8"}.jam-chevrons-square-down-right:before{content:"\e9e9"}.jam-chevrons-square-down:before{content:"\e9ea"}.jam-chevrons-square-left-f:before{content:"\e9eb"}.jam-chevrons-square-left:before{content:"\e9ec"}.jam-chevrons-square-right-f:before{content:"\e9ed"}.jam-chevrons-square-right:before{content:"\e9ee"}.jam-chevrons-square-up-f:before{content:"\e9ef"}.jam-chevrons-square-up-left-f:before{content:"\e9f0"}.jam-chevrons-square-up-left:before{content:"\e9f1"}.jam-chevrons-square-up-right-f:before{content:"\e9f2"}.jam-chevrons-square-up-right:before{content:"\e9f3"}.jam-chevrons-square-up:before{content:"\e9f4"}.jam-chevrons-up-left:before{content:"\e9f5"}.jam-chevrons-up-right:before{content:"\e9f6"}.jam-chevrons-up:before{content:"\e9f7"}.jam-chronometer-f:before{content:"\e9f8"}.jam-chronometer:before{content:"\e9f9"}.jam-circle-f:before{content:"\e9fa"}.jam-circle:before{content:"\e9fb"}.jam-clear-format:before{content:"\e9fc"}.jam-clipboard-f:before{content:"\e9fd"}.jam-clipboard:before{content:"\e9fe"}.jam-clock-f:before{content:"\e9ff"}.jam-clock:before{content:"\ea00"}.jam-close-circle-f:before{content:"\ea01"}.jam-close-circle:before{content:"\ea02"}.jam-close-rectangle-f:before{content:"\ea03"}.jam-close-rectangle:before{content:"\ea04"}.jam-close:before{content:"\ea05"}.jam-cloud-f:before{content:"\ea06"}.jam-cloud-rain-f:before{content:"\ea07"}.jam-cloud-rain:before{content:"\ea08"}.jam-cloud-snow-f:before{content:"\ea09"}.jam-cloud-snow:before{content:"\ea0a"}.jam-cloud-thunder-f:before{content:"\ea0b"}.jam-cloud-thunder:before{content:"\ea0c"}.jam-cloud:before{content:"\ea0d"}.jam-codepen-circle:before{content:"\ea0e"}.jam-codepen-square:before{content:"\ea0f"}.jam-codepen:before{content:"\ea10"}.jam-coffee-cup-f:before{content:"\ea11"}.jam-coffee-cup:before{content:"\ea12"}.jam-coffee:before{content:"\ea13"}.jam-cog-f:before{content:"\ea14"}.jam-cog:before{content:"\ea15"}.jam-cogs-f:before{content:"\ea16"}.jam-cogs:before{content:"\ea17"}.jam-coin-f:before{content:"\ea18"}.jam-coin:before{content:"\ea19"}.jam-color:before{content:"\ea1a"}.jam-compass-f:before{content:"\ea1b"}.jam-compass:before{content:"\ea1c"}.jam-computer-alt-f:before{content:"\ea1d"}.jam-computer-alt:before{content:"\ea1e"}.jam-computer-f:before{content:"\ea1f"}.jam-computer:before{content:"\ea20"}.jam-credit-card-f:before{content:"\ea21"}.jam-credit-card:before{content:"\ea22"}.jam-crop:before{content:"\ea23"}.jam-crown-f:before{content:"\ea24"}.jam-crown:before{content:"\ea25"}.jam-cutlery-f:before{content:"\ea26"}.jam-cutlery:before{content:"\ea27"}.jam-cutter-f:before{content:"\ea28"}.jam-cutter:before{content:"\ea29"}.jam-dashboard-f:before{content:"\ea2a"}.jam-dashboard:before{content:"\ea2b"}.jam-database-f:before{content:"\ea2c"}.jam-database:before{content:"\ea2d"}.jam-deezer-circle:before{content:"\ea2e"}.jam-deezer-square:before{content:"\ea2f"}.jam-deezer:before{content:"\ea30"}.jam-delete-f:before{content:"\ea31"}.jam-delete:before{content:"\ea32"}.jam-deviantart-circle:before{content:"\ea33"}.jam-deviantart-square:before{content:"\ea34"}.jam-deviantart:before{content:"\ea35"}.jam-digg:before{content:"\ea36"}.jam-direction-f:before{content:"\ea37"}.jam-direction:before{content:"\ea38"}.jam-directions-f:before{content:"\ea39"}.jam-directions:before{content:"\ea3a"}.jam-disc-f:before{content:"\ea3b"}.jam-disc:before{content:"\ea3c"}.jam-disqus-circle:before{content:"\ea3d"}.jam-disqus-square:before{content:"\ea3e"}.jam-disqus:before{content:"\ea3f"}.jam-dj-f:before{content:"\ea40"}.jam-dj:before{content:"\ea41"}.jam-dna:before{content:"\ea42"}.jam-document-f:before{content:"\ea43"}.jam-document:before{content:"\ea44"}.jam-door:before{content:"\ea45"}.jam-download:before{content:"\ea46"}.jam-drupal-circle:before{content:"\ea47"}.jam-drupal-square:before{content:"\ea48"}.jam-drupal:before{content:"\ea49"}.jam-ebay:before{content:"\ea4a"}.jam-egg-f:before{content:"\ea4b"}.jam-egg:before{content:"\ea4c"}.jam-eggs-f:before{content:"\ea4d"}.jam-eggs:before{content:"\ea4e"}.jam-eject-circle-f:before{content:"\ea4f"}.jam-eject-circle:before{content:"\ea50"}.jam-eject-square-f:before{content:"\ea51"}.jam-eject-square:before{content:"\ea52"}.jam-eject:before{content:"\ea53"}.jam-envelope-f:before{content:"\ea54"}.jam-envelope-open-f:before{content:"\ea55"}.jam-envelope-open:before{content:"\ea56"}.jam-envelope:before{content:"\ea57"}.jam-extinguisher-f:before{content:"\ea58"}.jam-extinguisher:before{content:"\ea59"}.jam-eye-close-f:before{content:"\ea5a"}.jam-eye-close:before{content:"\ea5b"}.jam-eye-f:before{content:"\ea5c"}.jam-eye:before{content:"\ea5d"}.jam-eyedropper-f:before{content:"\ea5e"}.jam-eyedropper:before{content:"\ea5f"}.jam-facebook-circle:before{content:"\ea60"}.jam-facebook-square:before{content:"\ea61"}.jam-facebook:before{content:"\ea62"}.jam-fast-backward-circle-f:before{content:"\ea63"}.jam-fast-backward-circle:before{content:"\ea64"}.jam-fast-backward-square-f:before{content:"\ea65"}.jam-fast-backward-square:before{content:"\ea66"}.jam-fast-backward:before{content:"\ea67"}.jam-fast-forward-circle-f:before{content:"\ea68"}.jam-fast-forward-circle:before{content:"\ea69"}.jam-fast-forward-square-f:before{content:"\ea6a"}.jam-fast-forward-square:before{content:"\ea6b"}.jam-fast-forward:before{content:"\ea6c"}.jam-feather-f:before{content:"\ea6d"}.jam-feather:before{content:"\ea6e"}.jam-female:before{content:"\ea6f"}.jam-file-f:before{content:"\ea70"}.jam-file:before{content:"\ea71"}.jam-files-f:before{content:"\ea72"}.jam-files:before{content:"\ea73"}.jam-filter-f:before{content:"\ea74"}.jam-filter:before{content:"\ea75"}.jam-fingerprint:before{content:"\ea76"}.jam-first-aid-f:before{content:"\ea77"}.jam-first-aid:before{content:"\ea78"}.jam-fish:before{content:"\ea79"}.jam-fiverr-circle:before{content:"\ea7a"}.jam-fiverr-square:before{content:"\ea7b"}.jam-fiverr:before{content:"\ea7c"}.jam-flag-f:before{content:"\ea7d"}.jam-flag:before{content:"\ea7e"}.jam-flame-f:before{content:"\ea7f"}.jam-flame:before{content:"\ea80"}.jam-flashlight-off-f:before{content:"\ea81"}.jam-flashlight-off:before{content:"\ea82"}.jam-flashlight-on-f:before{content:"\ea83"}.jam-flashlight-on:before{content:"\ea84"}.jam-flask:before{content:"\ea85"}.jam-flickr-circle:before{content:"\ea86"}.jam-flickr-square:before{content:"\ea87"}.jam-flickr:before{content:"\ea88"}.jam-flower:before{content:"\ea89"}.jam-folder-f:before{content:"\ea8a"}.jam-folder-open-f:before{content:"\ea8b"}.jam-folder-open:before{content:"\ea8c"}.jam-folder-zip-f:before{content:"\ea8d"}.jam-folder-zip:before{content:"\ea8e"}.jam-folder:before{content:"\ea8f"}.jam-football:before{content:"\ea90"}.jam-fork-f:before{content:"\ea91"}.jam-fork:before{content:"\ea92"}.jam-forward-circle-f:before{content:"\ea93"}.jam-forward-circle:before{content:"\ea94"}.jam-forward-square-f:before{content:"\ea95"}.jam-forward-square:before{content:"\ea96"}.jam-forward:before{content:"\ea97"}.jam-foursquare:before{content:"\ea98"}.jam-gamepad-f:before{content:"\ea99"}.jam-gamepad-retro-f:before{content:"\ea9a"}.jam-gamepad-retro:before{content:"\ea9b"}.jam-gamepad:before{content:"\ea9c"}.jam-ghost-f:before{content:"\ea9d"}.jam-ghost-org-circle:before{content:"\ea9e"}.jam-ghost-org-square:before{content:"\ea9f"}.jam-ghost-org:before{content:"\eaa0"}.jam-ghost:before{content:"\eaa1"}.jam-gift-f:before{content:"\eaa2"}.jam-gift:before{content:"\eaa3"}.jam-github-circle:before{content:"\eaa4"}.jam-github-square:before{content:"\eaa5"}.jam-github:before{content:"\eaa6"}.jam-gitlab-circle:before{content:"\eaa7"}.jam-gitlab-square:before{content:"\eaa8"}.jam-gitlab:before{content:"\eaa9"}.jam-glass-empty:before{content:"\eaaa"}.jam-glass-filled-f:before{content:"\eaab"}.jam-glass-filled:before{content:"\eaac"}.jam-glue-f:before{content:"\eaad"}.jam-glue:before{content:"\eaae"}.jam-google-circle:before{content:"\eaaf"}.jam-google-play-circle:before{content:"\eab0"}.jam-google-play-square:before{content:"\eab1"}.jam-google-play:before{content:"\eab2"}.jam-google-plus-circle:before{content:"\eab3"}.jam-google-plus-square:before{content:"\eab4"}.jam-google-plus:before{content:"\eab5"}.jam-google-square:before{content:"\eab6"}.jam-google:before{content:"\eab7"}.jam-gps-f:before{content:"\eab8"}.jam-gps:before{content:"\eab9"}.jam-grid-f:before{content:"\eaba"}.jam-grid:before{content:"\eabb"}.jam-hairdryer-f:before{content:"\eabc"}.jam-hairdryer:before{content:"\eabd"}.jam-hammer-f:before{content:"\eabe"}.jam-hammer:before{content:"\eabf"}.jam-hashtag:before{content:"\eac0"}.jam-header-1:before{content:"\eac1"}.jam-header-2:before{content:"\eac2"}.jam-header-3:before{content:"\eac3"}.jam-header-4:before{content:"\eac4"}.jam-header-5:before{content:"\eac5"}.jam-header-6:before{content:"\eac6"}.jam-header:before{content:"\eac7"}.jam-headset-f:before{content:"\eac8"}.jam-headset:before{content:"\eac9"}.jam-heart-f:before{content:"\eaca"}.jam-heart:before{content:"\eacb"}.jam-helmet-f:before{content:"\eacc"}.jam-helmet:before{content:"\eacd"}.jam-help-f:before{content:"\eace"}.jam-help:before{content:"\eacf"}.jam-highlighter-f:before{content:"\ead0"}.jam-highlighter:before{content:"\ead1"}.jam-history:before{content:"\ead2"}.jam-home-f:before{content:"\ead3"}.jam-home:before{content:"\ead4"}.jam-hourglass-f:before{content:"\ead5"}.jam-hourglass:before{content:"\ead6"}.jam-ice-cream-f:before{content:"\ead7"}.jam-ice-cream:before{content:"\ead8"}.jam-id-card-f:before{content:"\ead9"}.jam-id-card:before{content:"\eada"}.jam-inbox-f:before{content:"\eadb"}.jam-inbox:before{content:"\eadc"}.jam-inboxes-f:before{content:"\eadd"}.jam-inboxes:before{content:"\eade"}.jam-indent:before{content:"\eadf"}.jam-infinite:before{content:"\eae0"}.jam-info-f:before{content:"\eae1"}.jam-info:before{content:"\eae2"}.jam-instagram:before{content:"\eae3"}.jam-instant-picture-f:before{content:"\eae4"}.jam-instant-picture:before{content:"\eae5"}.jam-italic:before{content:"\eae6"}.jam-joystick-f:before{content:"\eae7"}.jam-joystick:before{content:"\eae8"}.jam-key-f:before{content:"\eae9"}.jam-key:before{content:"\eaea"}.jam-keyboard-f:before{content:"\eaeb"}.jam-keyboard:before{content:"\eaec"}.jam-language:before{content:"\eaed"}.jam-layers-f:before{content:"\eaee"}.jam-layers:before{content:"\eaef"}.jam-layout-f:before{content:"\eaf0"}.jam-layout:before{content:"\eaf1"}.jam-leaf-f:before{content:"\eaf2"}.jam-leaf:before{content:"\eaf3"}.jam-lifebuoy-f:before{content:"\eaf4"}.jam-lifebuoy:before{content:"\eaf5"}.jam-lightbulb-f:before{content:"\eaf6"}.jam-lightbulb:before{content:"\eaf7"}.jam-line:before{content:"\eaf8"}.jam-link:before{content:"\eaf9"}.jam-linkedin-circle:before{content:"\eafa"}.jam-linkedin-square:before{content:"\eafb"}.jam-linkedin:before{content:"\eafc"}.jam-log-in:before{content:"\eafd"}.jam-log-out:before{content:"\eafe"}.jam-luggage-f:before{content:"\eaff"}.jam-luggage:before{content:"\eb00"}.jam-magic-f:before{content:"\eb01"}.jam-magic:before{content:"\eb02"}.jam-magnet-f:before{content:"\eb03"}.jam-magnet:before{content:"\eb04"}.jam-male:before{content:"\eb05"}.jam-map-f:before{content:"\eb06"}.jam-map-marker-f:before{content:"\eb07"}.jam-map-marker:before{content:"\eb08"}.jam-map:before{content:"\eb09"}.jam-mask-f:before{content:"\eb0a"}.jam-mask:before{content:"\eb0b"}.jam-medal-f:before{content:"\eb0c"}.jam-medal:before{content:"\eb0d"}.jam-medical:before{content:"\eb0e"}.jam-medium-circle:before{content:"\eb0f"}.jam-medium-square:before{content:"\eb10"}.jam-medium:before{content:"\eb11"}.jam-menu:before{content:"\eb12"}.jam-merge-f:before{content:"\eb13"}.jam-merge:before{content:"\eb14"}.jam-message-alt-f:before{content:"\eb15"}.jam-message-alt-writing-f:before{content:"\eb16"}.jam-message-alt-writing:before{content:"\eb17"}.jam-message-alt:before{content:"\eb18"}.jam-message-f:before{content:"\eb19"}.jam-message-writing-f:before{content:"\eb1a"}.jam-message-writing:before{content:"\eb1b"}.jam-message:before{content:"\eb1c"}.jam-messages-alt-f:before{content:"\eb1d"}.jam-messages-alt:before{content:"\eb1e"}.jam-messages-f:before{content:"\eb1f"}.jam-messages:before{content:"\eb20"}.jam-messenger:before{content:"\eb21"}.jam-mic-alt:before{content:"\eb22"}.jam-mic-circle-f:before{content:"\eb23"}.jam-mic-circle:before{content:"\eb24"}.jam-mic-f:before{content:"\eb25"}.jam-mic-square-f:before{content:"\eb26"}.jam-mic-square:before{content:"\eb27"}.jam-mic:before{content:"\eb28"}.jam-microchip-f:before{content:"\eb29"}.jam-microchip:before{content:"\eb2a"}.jam-minus-circle-f:before{content:"\eb2b"}.jam-minus-circle:before{content:"\eb2c"}.jam-minus-rectangle-f:before{content:"\eb2d"}.jam-minus-rectangle:before{content:"\eb2e"}.jam-minus:before{content:"\eb2f"}.jam-moon-f:before{content:"\eb30"}.jam-moon:before{content:"\eb31"}.jam-more-horizontal-f:before{content:"\eb32"}.jam-more-horizontal:before{content:"\eb33"}.jam-more-vertical-f:before{content:"\eb34"}.jam-more-vertical:before{content:"\eb35"}.jam-mountain-f:before{content:"\eb36"}.jam-mountain:before{content:"\eb37"}.jam-move-alt:before{content:"\eb38"}.jam-move:before{content:"\eb39"}.jam-movie:before{content:"\eb3a"}.jam-mug-f:before{content:"\eb3b"}.jam-mug:before{content:"\eb3c"}.jam-music-f:before{content:"\eb3d"}.jam-music:before{content:"\eb3e"}.jam-myspace-circle:before{content:"\eb3f"}.jam-myspace-square:before{content:"\eb40"}.jam-myspace:before{content:"\eb41"}.jam-napster-circle:before{content:"\eb42"}.jam-napster-square:before{content:"\eb43"}.jam-napster:before{content:"\eb44"}.jam-newsletter-f:before{content:"\eb45"}.jam-newsletter:before{content:"\eb46"}.jam-newspaper-f:before{content:"\eb47"}.jam-newspaper:before{content:"\eb48"}.jam-npm:before{content:"\eb49"}.jam-odnoklassniki-circle:before{content:"\eb4a"}.jam-odnoklassniki-square:before{content:"\eb4b"}.jam-odnoklassniki:before{content:"\eb4c"}.jam-opera-circle:before{content:"\eb4d"}.jam-opera-square:before{content:"\eb4e"}.jam-opera:before{content:"\eb4f"}.jam-ordered-list:before{content:"\eb50"}.jam-padlock-alt-f:before{content:"\eb51"}.jam-padlock-alt-open-f:before{content:"\eb52"}.jam-padlock-alt-open:before{content:"\eb53"}.jam-padlock-alt:before{content:"\eb54"}.jam-padlock-f:before{content:"\eb55"}.jam-padlock-open-f:before{content:"\eb56"}.jam-padlock-open:before{content:"\eb57"}.jam-padlock:before{content:"\eb58"}.jam-paper-plane-f:before{content:"\eb59"}.jam-paper-plane:before{content:"\eb5a"}.jam-patreon-circle:before{content:"\eb5b"}.jam-patreon-square:before{content:"\eb5c"}.jam-patreon:before{content:"\eb5d"}.jam-pause:before{content:"\eb5e"}.jam-paypal-circle:before{content:"\eb5f"}.jam-paypal-square:before{content:"\eb60"}.jam-paypal:before{content:"\eb61"}.jam-pen-f:before{content:"\eb62"}.jam-pen:before{content:"\eb63"}.jam-pencil-f:before{content:"\eb64"}.jam-pencil:before{content:"\eb65"}.jam-periscope-circle:before{content:"\eb66"}.jam-periscope-square:before{content:"\eb67"}.jam-periscope:before{content:"\eb68"}.jam-phone-f:before{content:"\eb69"}.jam-phone:before{content:"\eb6a"}.jam-picture-f:before{content:"\eb6b"}.jam-picture:before{content:"\eb6c"}.jam-pictures-f:before{content:"\eb6d"}.jam-pictures:before{content:"\eb6e"}.jam-pie-chart-alt:before{content:"\eb6f"}.jam-pie-chart-f:before{content:"\eb70"}.jam-pie-chart:before{content:"\eb71"}.jam-pin-alt-f:before{content:"\eb72"}.jam-pin-alt:before{content:"\eb73"}.jam-pin-f:before{content:"\eb74"}.jam-pin:before{content:"\eb75"}.jam-pinterest-circle:before{content:"\eb76"}.jam-pinterest-square:before{content:"\eb77"}.jam-pinterest:before{content:"\eb78"}.jam-pizza-slice:before{content:"\eb79"}.jam-plane-f:before{content:"\eb7a"}.jam-plane:before{content:"\eb7b"}.jam-play-circle-f:before{content:"\eb7c"}.jam-play-circle:before{content:"\eb7d"}.jam-play-square-f:before{content:"\eb7e"}.jam-play-square:before{content:"\eb7f"}.jam-play:before{content:"\eb80"}.jam-plug-f:before{content:"\eb81"}.jam-plug:before{content:"\eb82"}.jam-plus-circle-f:before{content:"\eb83"}.jam-plus-circle:before{content:"\eb84"}.jam-plus-rectangle-f:before{content:"\eb85"}.jam-plus-rectangle:before{content:"\eb86"}.jam-plus:before{content:"\eb87"}.jam-pocket-watch-f:before{content:"\eb88"}.jam-pocket-watch:before{content:"\eb89"}.jam-podcast:before{content:"\eb8a"}.jam-power:before{content:"\eb8b"}.jam-printer-f:before{content:"\eb8c"}.jam-printer:before{content:"\eb8d"}.jam-qr-code:before{content:"\eb8e"}.jam-quora-circle:before{content:"\eb8f"}.jam-quora-square:before{content:"\eb90"}.jam-quora:before{content:"\eb91"}.jam-rainbow:before{content:"\eb92"}.jam-rec:before{content:"\eb93"}.jam-rectangle-f:before{content:"\eb94"}.jam-rectangle:before{content:"\eb95"}.jam-reddit:before{content:"\eb96"}.jam-redo:before{content:"\eb97"}.jam-refresh-reverse:before{content:"\eb98"}.jam-refresh:before{content:"\eb99"}.jam-repeat:before{content:"\eb9a"}.jam-rocket-f:before{content:"\eb9b"}.jam-rocket:before{content:"\eb9c"}.jam-rss-feed:before{content:"\eb9d"}.jam-rubber:before{content:"\eb9e"}.jam-ruler-f:before{content:"\eb9f"}.jam-ruler:before{content:"\eba0"}.jam-save-f:before{content:"\eba1"}.jam-save:before{content:"\eba2"}.jam-scissors:before{content:"\eba3"}.jam-screen-f:before{content:"\eba4"}.jam-screen:before{content:"\eba5"}.jam-screwdriver-f:before{content:"\eba6"}.jam-screwdriver:before{content:"\eba7"}.jam-search-folder:before{content:"\eba8"}.jam-search-minus:before{content:"\eba9"}.jam-search-plus:before{content:"\ebaa"}.jam-search:before{content:"\ebab"}.jam-set-backward-circle-f:before{content:"\ebac"}.jam-set-backward-circle:before{content:"\ebad"}.jam-set-backward-square-f:before{content:"\ebae"}.jam-set-backward-square:before{content:"\ebaf"}.jam-set-backward:before{content:"\ebb0"}.jam-set-forward-circle-f:before{content:"\ebb1"}.jam-set-forward-circle:before{content:"\ebb2"}.jam-set-forward-square-f:before{content:"\ebb3"}.jam-set-forward-square:before{content:"\ebb4"}.jam-set-forward:before{content:"\ebb5"}.jam-set-square-f:before{content:"\ebb6"}.jam-set-square:before{content:"\ebb7"}.jam-settings-alt:before{content:"\ebb8"}.jam-share-alt-f:before{content:"\ebb9"}.jam-share-alt:before{content:"\ebba"}.jam-share:before{content:"\ebbb"}.jam-shield-check-f:before{content:"\ebbc"}.jam-shield-check:before{content:"\ebbd"}.jam-shield-close-f:before{content:"\ebbe"}.jam-shield-close:before{content:"\ebbf"}.jam-shield-f:before{content:"\ebc0"}.jam-shield-half:before{content:"\ebc1"}.jam-shield-minus-f:before{content:"\ebc2"}.jam-shield-minus:before{content:"\ebc3"}.jam-shield-plus-f:before{content:"\ebc4"}.jam-shield-plus:before{content:"\ebc5"}.jam-shield:before{content:"\ebc6"}.jam-shopify-circle:before{content:"\ebc7"}.jam-shopify-square:before{content:"\ebc8"}.jam-shopify:before{content:"\ebc9"}.jam-shopping-bag-alt-f:before{content:"\ebca"}.jam-shopping-bag-alt:before{content:"\ebcb"}.jam-shopping-bag-f:before{content:"\ebcc"}.jam-shopping-bag:before{content:"\ebcd"}.jam-shopping-cart:before{content:"\ebce"}.jam-shuffle:before{content:"\ebcf"}.jam-signal:before{content:"\ebd0"}.jam-sitemap-f:before{content:"\ebd1"}.jam-sitemap:before{content:"\ebd2"}.jam-skull-f:before{content:"\ebd3"}.jam-skull:before{content:"\ebd4"}.jam-skype-circle:before{content:"\ebd5"}.jam-skype-square:before{content:"\ebd6"}.jam-skype:before{content:"\ebd7"}.jam-slack-circle:before{content:"\ebd8"}.jam-slack-square:before{content:"\ebd9"}.jam-slack:before{content:"\ebda"}.jam-smiley-f:before{content:"\ebdb"}.jam-smiley:before{content:"\ebdc"}.jam-snapchat-circle:before{content:"\ebdd"}.jam-snapchat-square:before{content:"\ebde"}.jam-snapchat:before{content:"\ebdf"}.jam-snowboard-f:before{content:"\ebe0"}.jam-snowboard:before{content:"\ebe1"}.jam-snowflake:before{content:"\ebe2"}.jam-soundcloud:before{content:"\ebe3"}.jam-speaker-f:before{content:"\ebe4"}.jam-speaker:before{content:"\ebe5"}.jam-spotify:before{content:"\ebe6"}.jam-square-f:before{content:"\ebe7"}.jam-square:before{content:"\ebe8"}.jam-squarespace-circle:before{content:"\ebe9"}.jam-squarespace-square:before{content:"\ebea"}.jam-squarespace:before{content:"\ebeb"}.jam-stackoverflow-circle:before{content:"\ebec"}.jam-stackoverflow-square:before{content:"\ebed"}.jam-stackoverflow:before{content:"\ebee"}.jam-stamp-f:before{content:"\ebef"}.jam-stamp:before{content:"\ebf0"}.jam-star-f:before{content:"\ebf1"}.jam-star-full:before{content:"\ebf2"}.jam-star-half:before{content:"\ebf3"}.jam-star:before{content:"\ebf4"}.jam-station:before{content:"\ebf5"}.jam-stop-sign:before{content:"\ebf6"}.jam-stop:before{content:"\ebf7"}.jam-store:before{content:"\ebf8"}.jam-strikethrough:before{content:"\ebf9"}.jam-stumbleupon-circle:before{content:"\ebfa"}.jam-stumbleupon-square:before{content:"\ebfb"}.jam-stumbleupon:before{content:"\ebfc"}.jam-sun-f:before{content:"\ebfd"}.jam-sun:before{content:"\ebfe"}.jam-switch-left-f:before{content:"\ebff"}.jam-switch-left:before{content:"\ec00"}.jam-switch-right-f:before{content:"\ec01"}.jam-switch-right:before{content:"\ec02"}.jam-sword-f:before{content:"\ec03"}.jam-sword:before{content:"\ec04"}.jam-tablet-f:before{content:"\ec05"}.jam-tablet:before{content:"\ec06"}.jam-tag-f:before{content:"\ec07"}.jam-tag:before{content:"\ec08"}.jam-tags-f:before{content:"\ec09"}.jam-tags:before{content:"\ec0a"}.jam-target:before{content:"\ec0b"}.jam-task-list-f:before{content:"\ec0c"}.jam-task-list:before{content:"\ec0d"}.jam-temperature:before{content:"\ec0e"}.jam-terminal:before{content:"\ec0f"}.jam-thunder-f:before{content:"\ec10"}.jam-thunder:before{content:"\ec11"}.jam-ticket-f:before{content:"\ec12"}.jam-ticket:before{content:"\ec13"}.jam-tools-f:before{content:"\ec14"}.jam-tools:before{content:"\ec15"}.jam-torch-f:before{content:"\ec16"}.jam-torch:before{content:"\ec17"}.jam-totem:before{content:"\ec18"}.jam-train-f:before{content:"\ec19"}.jam-train:before{content:"\ec1a"}.jam-transgender:before{content:"\ec1b"}.jam-trash-alt-f:before{content:"\ec1c"}.jam-trash-alt:before{content:"\ec1d"}.jam-trash-f:before{content:"\ec1e"}.jam-trash:before{content:"\ec1f"}.jam-tree-alt-f:before{content:"\ec20"}.jam-tree-alt:before{content:"\ec21"}.jam-tree-f:before{content:"\ec22"}.jam-tree:before{content:"\ec23"}.jam-trello:before{content:"\ec24"}.jam-triangle-danger-f:before{content:"\ec25"}.jam-triangle-danger:before{content:"\ec26"}.jam-triangle-f:before{content:"\ec27"}.jam-triangle:before{content:"\ec28"}.jam-trophy-f:before{content:"\ec29"}.jam-trophy:before{content:"\ec2a"}.jam-tube:before{content:"\ec2b"}.jam-tumblr-circle:before{content:"\ec2c"}.jam-tumblr-square:before{content:"\ec2d"}.jam-tumblr:before{content:"\ec2e"}.jam-twitch:before{content:"\ec2f"}.jam-twitter-circle:before{content:"\ec30"}.jam-twitter-square:before{content:"\ec31"}.jam-twitter:before{content:"\ec32"}.jam-umbrella-closed-f:before{content:"\ec33"}.jam-umbrella-closed:before{content:"\ec34"}.jam-umbrella-f:before{content:"\ec35"}.jam-umbrella:before{content:"\ec36"}.jam-underline:before{content:"\ec37"}.jam-undo:before{content:"\ec38"}.jam-unindent:before{content:"\ec39"}.jam-universe:before{content:"\ec3a"}.jam-unordered-list:before{content:"\ec3b"}.jam-unsplash-circle:before{content:"\ec3c"}.jam-unsplash-square:before{content:"\ec3d"}.jam-unsplash:before{content:"\ec3e"}.jam-upload:before{content:"\ec3f"}.jam-user-circle:before{content:"\ec40"}.jam-user-minus:before{content:"\ec41"}.jam-user-plus:before{content:"\ec42"}.jam-user-remove:before{content:"\ec43"}.jam-user-square:before{content:"\ec44"}.jam-user:before{content:"\ec45"}.jam-users:before{content:"\ec46"}.jam-viadeo:before{content:"\ec47"}.jam-viber-circle:before{content:"\ec48"}.jam-viber-square:before{content:"\ec49"}.jam-viber:before{content:"\ec4a"}.jam-video-camera-f:before{content:"\ec4b"}.jam-video-camera-vintage-f:before{content:"\ec4c"}.jam-video-camera-vintage:before{content:"\ec4d"}.jam-video-camera:before{content:"\ec4e"}.jam-vimeo-circle:before{content:"\ec4f"}.jam-vimeo-square:before{content:"\ec50"}.jam-vimeo:before{content:"\ec51"}.jam-vine-circle:before{content:"\ec52"}.jam-vine-square:before{content:"\ec53"}.jam-vine:before{content:"\ec54"}.jam-voicemail:before{content:"\ec55"}.jam-volume-circle-f:before{content:"\ec56"}.jam-volume-circle:before{content:"\ec57"}.jam-volume-down-circle-f:before{content:"\ec58"}.jam-volume-down-circle:before{content:"\ec59"}.jam-volume-down-square-f:before{content:"\ec5a"}.jam-volume-down-square:before{content:"\ec5b"}.jam-volume-down:before{content:"\ec5c"}.jam-volume-mute-circle-f:before{content:"\ec5d"}.jam-volume-mute-circle:before{content:"\ec5e"}.jam-volume-mute-square-f:before{content:"\ec5f"}.jam-volume-mute-square:before{content:"\ec60"}.jam-volume-mute:before{content:"\ec61"}.jam-volume-square-f:before{content:"\ec62"}.jam-volume-square:before{content:"\ec63"}.jam-volume-up-circle-f:before{content:"\ec64"}.jam-volume-up-circle:before{content:"\ec65"}.jam-volume-up-square-f:before{content:"\ec66"}.jam-volume-up-square:before{content:"\ec67"}.jam-volume-up:before{content:"\ec68"}.jam-volume:before{content:"\ec69"}.jam-watch-f:before{content:"\ec6a"}.jam-watch:before{content:"\ec6b"}.jam-water-drop-f:before{content:"\ec6c"}.jam-water-drop:before{content:"\ec6d"}.jam-whatsapp:before{content:"\ec6e"}.jam-wifi:before{content:"\ec6f"}.jam-wikipedia:before{content:"\ec70"}.jam-wordpress:before{content:"\ec71"}.jam-world:before{content:"\ec72"}.jam-wrench-f:before{content:"\ec73"}.jam-wrench:before{content:"\ec74"}.jam-write-f:before{content:"\ec75"}.jam-write:before{content:"\ec76"}.jam-yahoo-circle:before{content:"\ec77"}.jam-yahoo-square:before{content:"\ec78"}.jam-yahoo:before{content:"\ec79"}.jam-yelp-circle:before{content:"\ec7a"}.jam-yelp-square:before{content:"\ec7b"}.jam-yelp:before{content:"\ec7c"}.jam-youtube-circle:before{content:"\ec7d"}.jam-youtube-square:before{content:"\ec7e"}.jam-youtube:before{content:"\ec7f"} diff --git a/web-angular/src/styles.scss b/web-angular/src/styles.scss index 2ee047b5..847de832 100644 --- a/web-angular/src/styles.scss +++ b/web-angular/src/styles.scss @@ -3,12 +3,9 @@ @import 'theme.scss'; @import 'fonts.scss'; @import 'weather.scss'; +@import 'jam.scss'; @import '~leaflet/dist/leaflet.css'; -// fix bug in paginator rendering on MS Edge -.mat-paginator-container .mat-icon-button { - height: auto !important; -} // sizes for paddings and margins $size-z: 0px; @@ -45,7 +42,20 @@ a { color: inherit; } -// layout configuration +/* font sizes, alignment and style */ +.fs-avatar { font-size: 48px; } +.fs-sm { font-size: 12px; } +.fs-md { font-size: 16px; } +.fs-lg { font-size: 18px; } + + +.fw-b { font-weight: bold;} + +.ta-c { text-align: center; } +.ta-l { text-align: left; } +.ta-r { text-align: right; } + +/* flexbox layouts */ .fx-fill { flex: 1 1 100%; justify-self: stretch; align-self: stretch; } .fx-h100 { height: 100%; } .fx-w100 { width: 100%; } @@ -53,21 +63,23 @@ a { .fx-content { flex: 0 1 $size-content; justify-self: stretch; @include mat-elevation(2); z-index: 10; } .fx-main { flex: 0 1 $size-main; @include mat-elevation(2); z-index: 10;} .fx-side { flex: 0 1 $size-side; } -.fx-compact { flex: 0 1 auto; } +.fx-compact { flex: 1 1 100%; align-self: stretch; justify-self: stretch;} .fx-auto { flex: 1 1 auto; } .fx-row { display: flex; flex-flow: row nowrap; } .fx-wrap { flex-wrap: wrap; } .fx-column { display: flex; flex-flow: column nowrap; } .fx-stretch { justify-content: stretch; align-items: stretch; } +.fx-even { justify-content: space-evenly; } +/* padding styling */ .p-z { padding: $size-z; } .p-sm { padding: $size-sm; } .p-md { padding: $size-md; } .p-lg { padding: $size-lg; } -.pl-sm { padding-left: $size-md; } -.pr-sm { padding-right: $size-md; } -.pt-sm { padding-top: $size-md; } -.pb-sm { padding-bottom: $size-md; } +.pl-sm { padding-left: $size-sm; } +.pr-sm { padding-right: $size-sm; } +.pt-sm { padding-top: $size-sm; } +.pb-sm { padding-bottom: $size-sm; } .pl-md { padding-left: $size-md; } .pr-md { padding-right: $size-md; } .pt-md { padding-top: $size-md; } @@ -77,14 +89,15 @@ a { .pt-lg { padding-top: $size-lg; } .pb-lg { padding-bottom: $size-lg; } +/* margin styling */ .m-z { margin: $size-z; } .m-sm { margin: $size-sm; } .m-md { margin: $size-md; } .m-lg { margin: $size-lg; } -.ml-sm { margin-left: $size-md; } -.mr-sm { margin-right: $size-md; } -.mt-sm { margin-top: $size-md; } -.mb-sm { margin-bottom: $size-md; } +.ml-sm { margin-left: $size-sm; } +.mr-sm { margin-right: $size-sm; } +.mt-sm { margin-top: $size-sm; } +.mb-sm { margin-bottom: $size-sm; } .ml-md { margin-left: $size-md; } .mr-md { margin-right: $size-md; } .mt-md { margin-top: $size-md; } @@ -94,33 +107,50 @@ a { .mt-lg { margin-top: $size-lg; } .mb-lg { margin-bottom: $size-lg; } +/* background colors */ +.bg-default { background-color: $app-background-default; } +.bg-white { background-color: white; } +.bg-lighter { background:rgba(255,255,255,0.1); } +.bg-accent { background-color: mat-color($app-accent); } +.bg-primary { background-color: mat-color($app-primary); } +/* foreground colors */ +.fg-white { color: white; } +.fg-accent { color: mat-color($app-accent); } +.fg-primary { color: mat-color($app-primary); } + +/* rotation for wind direction icons */ +.rotate-45 { transform: rotate(45deg); } +.rotate-90 { transform: rotate(90deg); } +.rotate-135 { transform: rotate(135deg); } +.rotate-180 { transform: rotate(180deg); } +.rotate-225 { transform: rotate(225deg); } +.rotate-270 { transform: rotate(270deg); } +.rotate-315 { transform: rotate(315deg); } + +/* gradient in column layouts on the right */ .gradient-right { background-image: radial-gradient(circle at top left, mat-color($app-primary) 10%, mat-color($app-primary-light) 75%, mat-color($app-primary) 100%); align-self: stretch; } +/* gradient in column layouts on the left */ .gradient-left { background-image: radial-gradient(circle at bottom right, mat-color($app-primary) 10%, mat-color($app-primary-light) 75%, mat-color($app-primary) 100%); align-self: stretch; } -.bg-default { - background-color: $app-background-default; -} +/* sets the cursor to indicate something clickable */ +.clickable { cursor: pointer; } -.bg-white { - background-color: white; -} - -.primary { - background-color: mat-color($app-primary); -} - -.accent { - background-color: mat-color($app-accent); + /* cuts of the text, for this to work, you need to set the width */ +.ellipsis { + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; } +/** green toolbar at the top */ .app-bar { @include mat-elevation(4); z-index: 100; @@ -128,12 +158,7 @@ a { min-height: 64px; } -.view-bar > mat-icon { - margin-left: $size-sm; - margin-right: $size-md; -} - - +/* yellow toolbar at the top */ .view-bar { @include mat-elevation(1); z-index: 50; @@ -143,39 +168,22 @@ a { } +/* the icon in the yellow toolbar */ +.view-bar > mat-icon { + margin-left: $size-sm; + margin-right: $size-md; +} +/* fix mat-icon size in buttons */ +.icon-button { font-size: 18px; height: auto !important; vertical-align: text-bottom !important; } -// mat icon is too large for toolbar buttons -.icon-button { - font-size: 18px; +/* bugfix for paginator in edge */ +.mat-paginator-container .mat-icon-button { height: auto !important; - vertical-align: text-bottom !important; -} - -// removes the visited, etc. colors of links -.link-white { - color: white; -} - -.link-primary { - color: mat-color($app-primary); - text-decoration: none; -} - -.spinner-small { - width: 36px; - height: 36px; } -// applies a match parent size styling -.match-parent { - flex: 1 1 100%; - min-width: 100%; - max-width: 100%; - min-height: 100%; - max-height: 100%; -} + .snackbar-accent { background-color: mat-color($app-accent); @@ -194,6 +202,10 @@ a { justify-content: space-around; } + + +/** unused ? */ + .detail-row { flex: 1; display: flex; @@ -285,4 +297,5 @@ a { padding: 10px; border-radius: round(5px); color: black; -} \ No newline at end of file +} +
Wetter