Commit 37445876 authored by Sebastian's avatar Sebastian

updates für miriam

parent 8bfb0412
<ng-container *ngIf="oauth">
<div class="modal-header">
<span *ngIf="authService.loggedIn" class="">Sie wurden per OAuth angemeldet.</span>
<span *ngIf="!authService.loggedIn" class="">Sie werden per OAuth über OSM angemeldet...</span>
<button *ngIf="authService.getCurrentUser() != undefined" type="button" class="close" aria-label="Close" (click)="this.close()"><span aria-hidden="true">&times;</span></button>
<ng-container *ngIf="oauth">
<div class="modal-header">
<span *ngIf="authService.loggedIn" class="">Sie wurden per OAuth angemeldet.</span>
<span *ngIf="!authService.loggedIn" class="">Sie werden per OAuth über OSM angemeldet...</span>
<button *ngIf="authService.getCurrentUser() != undefined" type="button" class="close" aria-label="Close" (click)="this.close()"><span aria-hidden="true">&times;</span></button>
</div>
<div class="modal-body">
<div class="modal-wrap modaltest">
<div class="modal-wrap">
<div class="container">
<div markdown [src]="'assets/markdown/modal-content/osm-anmeldung.md'" class="">
</div>
<div class="modal-body">
<div class="modal-wrap modaltest">
<div class="modal-wrap">
<div class="container">
<div markdown [src]="'assets/markdown/modal-content/osm-anmeldung.md'" class="">
</div>
In deinem Benutzerprofil in Openstreetmap kannst du jederzeit die Berechtigungen widerrufen. Benutze dazu das Menü in deinen Benutzereinstellungen unter <span *ngIf="authService.getCurrentUser() == undefined">oAuth-Einstellungen</span><a *ngIf="authService.getCurrentUser() != undefined" href="https://www.openstreetmap.org/user/{{authService.getCurrentUser().getDescription()}}/oauth_clients">oAuth-Einstellungen</a> und klicke dort auf "Widerrufen!" neben dem Eintrag zum Geoportal.
</div>
In deinem Benutzerprofil in Openstreetmap kannst du jederzeit die Berechtigungen widerrufen. Benutze dazu das Menü in deinen Benutzereinstellungen unter <span *ngIf="authService.getCurrentUser() == undefined">oAuth-Einstellungen</span><a *ngIf="authService.getCurrentUser() != undefined" href="https://www.openstreetmap.org/user/{{authService.getCurrentUser().getDescription()}}/oauth_clients">oAuth-Einstellungen</a> und klicke dort auf "Widerrufen!" neben dem Eintrag zum Geoportal.
</div>
</div>
</div>
</div>
</ng-container>
<ng-container *ngIf="!oauth">
<div class="modal-header">
<h4 class="modal-title">Anmelden</h4>
<button type="button" class="close" aria-label="Close"
(click)="this.close()">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<div class="modal-wrap modaltest">
<div class="modal-wrap">
<div class="container">
</ng-container>
<ng-container *ngIf="!oauth">
<div class="modal-header">
<h4 class="modal-title">Anmelden</h4>
<button type="button" class="close" aria-label="Close"
(click)="this.close()">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<div class="modal-wrap modaltest">
<div class="modal-wrap">
<div class="container">
<div *ngIf="!authService.loggedIn" class="">
<div *ngIf="!authService.loggedIn" class="">
<div class="login_ex exclamation">
<i class="fa_ fa-exclamation-triangle_ fa-lg_ gp_warning icon_big" aria-hidden="true">&nbsp;</i>
<p>Nur angemeldete Nutzer*innen können Orte des Guten Lebens
anlegen und bearbeiten.</p>
</div>
<form [formGroup]="loginForm" (ngSubmit)="login()">
<div class="login_ex exclamation">
<i class="fa_ fa-exclamation-triangle_ fa-lg_ gp_warning icon_big" aria-hidden="true">&nbsp;</i>
<p>Nur angemeldete Nutzer*innen können Orte des Guten Lebens
anlegen und bearbeiten.</p>
</div>
<form *ngIf="adminAnmeldungEnabled" [formGroup]="loginForm" (ngSubmit)="login()">
<div class="form-group">
<label for="username">Benutzername</label> <input type="text"
formControlName="username" class="form-control"
[ngClass]="{ 'is-invalid': submitted && f.username.errors }" />
<div *ngIf="submitted && f.username.errors"
class="invalid-feedback">
<div *ngIf="f.username.errors.required">Username is
required</div>
</div>
</div>
<div class="form-group">
<label for="username">Benutzername</label> <input type="text"
formControlName="username" class="form-control"
[ngClass]="{ 'is-invalid': submitted && f.username.errors }" />
<div *ngIf="submitted && f.username.errors"
<label for="password">Passwort</label> <input type="password"
formControlName="password" class="form-control"
[ngClass]="{ 'is-invalid': submitted && f.password.errors }" />
<div *ngIf="submitted && f.password.errors"
class="invalid-feedback">
<div *ngIf="f.username.errors.required">Username is
<div *ngIf="f.password.errors.required">Password is
required</div>
<div *ngIf="f.password.errors.minlength">Password must be
at least 6 characters</div>
</div>
</div>
<div class="form-group">
<label for="password">Passwort</label> <input type="password"
formControlName="password" class="form-control"
[ngClass]="{ 'is-invalid': submitted && f.password.errors }" />
<div *ngIf="submitted && f.password.errors"
class="invalid-feedback">
<div *ngIf="f.password.errors.required">Password is
required</div>
<div *ngIf="f.password.errors.minlength">Password must be
at least 6 characters</div>
<div class="form-check">
<input type="checkbox" formControlName="savelogin"
class="form-check-input"
[ngClass]="{ 'is-invalid': submitted && f.savelogin.errors }" />
<label class="form-check-label" for="savelogin">Eingeloggt
bleiben</label>
</div>
</div>
<div class="form-check">
<input type="checkbox" formControlName="savelogin"
class="form-check-input"
[ngClass]="{ 'is-invalid': submitted && f.savelogin.errors }" />
<label class="form-check-label" for="savelogin">Eingeloggt
bleiben</label>
</div>
<br>
<span>&nbsp;</span><button [disabled]="sending && ! authService.loginFailed"
class="btn btn-primary">Als Admin anmelden</button>
<span>&nbsp;</span>
<div *ngIf="authService.loginFailed">Anmeldung fehlgeschlagen.</div>
<div class="divider"></div>
<div class="d-none">
Neu beim Geoportal des Guten Lebens? <br /> <br />
<div *ngIf="!apiService.registrationAvailable()">
Die Registrierung steht zur Zeit nicht zur Verfügung.
</div>
<button [disabled]="!apiService.registrationAvailable()" class="btn btn-secondary" routerLink="/register" (click)="this.close()">Registrieren</button>
</div>
</form>
<br>
<button type="button" [disabled]="" (click)="apiService.getRequestToken()" class="btn btn-primary">Mit OpenStreetMap Anmelden</button>
<span>&nbsp;</span><button [disabled]="sending && ! authService.loginFailed"
class="btn btn-primary">Admin-Anmeldung</button>
<span>&nbsp;</span>
<div *ngIf="authService.loginFailed">Anmeldung fehlgeschlagen.</div>
<button type="button" [disabled]="" (click)="apiService.getRequestToken()" class="btn btn-primary">Mit OpenStreetMap anmelden</button>
<div class="divider"></div>
<div class="d-none">
Neu beim Geoportal des Guten Lebens? <br /> <br />
<div *ngIf="!apiService.registrationAvailable()">
Die Registrierung steht zur Zeit nicht zur Verfügung.
</div>
<button [disabled]="!apiService.registrationAvailable()" class="btn btn-secondary" routerLink="/register" (click)="this.close()">Registrieren</button>
</div>
</form>
<br><br>
<div markdown [src]="'assets/markdown/modal-content/Anmelden.md'" class=""></div>
</div>
<br>
<div markdown [src]="'assets/markdown/modal-content/Anmelden.md'" class=""></div>
<a href="https://www.openstreetmap.org/user/new" target="_blank"><button
type="button" class="btn btn-primary" ngbAutofocus>Bei
OpenStreetMap registrieren</button></a>
<div class="divider"></div>
<span>&nbsp;</span><button *ngIf="!adminAnmeldungEnabled" type="button" class="btn btn-primary" (click)="adminAnmeldungClicked($evt)">Als Admin anmelden</button>
<div *ngIf="authService.loggedIn" class="">
<div>Sie sind eingeloggt.</div>
</div>
<div *ngIf="authService.loggedIn" class="">
<div>Sie sind eingeloggt.</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div *ngIf="!authService.loggedIn" class="modal-footer">
<a href="https://www.openstreetmap.org/user/new" target="_blank"><button
type="button" class="btn btn-primary" ngbAutofocus>Bei
Openstreetmap registrieren</button></a>
</div>
</ng-container>
\ No newline at end of file
</div>
</div>
<div *ngIf="!authService.loggedIn" class="modal-footer">
</div>
</ng-container>
\ No newline at end of file
......@@ -23,6 +23,7 @@ export class AuthComponent implements OnInit {
private sending: boolean;
private loginForm: FormGroup;
public oauth = false;
public adminAnmeldungEnabled:boolean=false;
constructor(
private logger: LogService,
private authService: AuthService,
......@@ -55,7 +56,15 @@ export class AuthComponent implements OnInit {
get f() {
return this.loginForm.controls;
}
adminAnmeldungClicked($event:MouseEvent){
if(!this.adminAnmeldungEnabled){
this.adminAnmeldungEnabled = true;
if($event != undefined){
$event.preventDefault();
$event.stopImmediatePropagation();
}
}
}
login() {
this.sending = true;
this.logger.debug('authComponent: ' + this.loginForm.value.username);
......
......@@ -308,7 +308,7 @@
<div *ngIf="nodeService.detailView.getOsmTagValue('website')">
<span class="form-control-plaintext" id="elementKey" >{{nodeService.detailView.getOsmTagValue('website')}}</span>
</div>
<div *ngIf="!nodeService.detailView.getOsmTagValue('contact:websit')">
<div *ngIf="!nodeService.detailView.getOsmTagValue('website')">
<span class="form-control-plaintext text-muted" id="elementKey" >Keine Angabe bisher.</span>
</div>
</div>
......
......@@ -21,7 +21,7 @@ export class AuthService {
loginFailed: boolean = false;
bearer: string;
public onLoggedIn: Subject<boolean>;
public onOauthLoggedIn: Subject<boolean>;
constructor(private apiService: GeoportalApiService, private logger: LogService, private router: Router, private cache: CacheService) {
this.logger.debug("auth.service: Trying to load currentUser.");
this.onLoggedIn = new Subject<boolean>();
......
......@@ -70,7 +70,6 @@ export class GeoportalApiService {
}
loadBearer() {
if (this.cache.has('bearer')) {
this.setBearer(this.cache.get('bearer'));
this.logger.debug("GeoportalApiService: bearer loaded from cache.");
......
......@@ -15,5 +15,5 @@
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-primary" (click)="activeModal.close()" ngbAutofocus>Alles klar!</button>
<button type="button" class="btn btn-primary" (click)="buttonClick()" ngbAutofocus>Alles klar!</button>
</div>
import { Component, OnInit, Input } from '@angular/core';
import { MarkdownService } from 'ngx-markdown';
import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
import { Router } from '@angular/router';
@Component({
selector: 'app-addsomething',
......@@ -11,10 +12,17 @@ export class AddsomethingComponent implements OnInit {
@Input() asModal: boolean;
constructor(private activeModal: NgbActiveModal ) {
constructor(private activeModal: NgbActiveModal , private router: Router) {
}
buttonClick(){
if(!this.router.url.replace('/','').startsWith('search')){
this.router.getCurrentNavigation()
this.router.navigate(['search']);
}
this.activeModal.close();
}
ngOnInit() {
}
......
## Warum?
## Warum mit OpenStreetMap-Account anmelden?
Wir verbinden alle relevanten Angaben auf der Karte direkt mit der OpenStreetMap-Datenbank. So sind deine Angaben gesichert und nichts wird doppelt gepflegt.
Du hast noch keinen? Dann jetzt [registrieren][OSMRegisterLink]!
[OSMRegisterLink]: https://www.openstreetmap.org/user/new/ "Bei OpenStreetMap registrieren."
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment