Better error messages
This commit is contained in:
parent
a06a31c75c
commit
a2b817d322
|
@ -4,15 +4,15 @@
|
||||||
|
|
||||||
<label for="new-password">Change password</label>
|
<label for="new-password">Change password</label>
|
||||||
<input
|
<input
|
||||||
type="password" class="form-control" id="new-password" placeholder="Old password"
|
type="password" id="new-password" placeholder="New password"
|
||||||
formControlName="new-password"
|
formControlName="new-password" [ngClass]="{ 'input-error': formErrors['new-password'] }"
|
||||||
>
|
>
|
||||||
<div *ngIf="formErrors['new-password']" class="alert alert-danger">
|
<div *ngIf="formErrors['new-password']" class="form-error">
|
||||||
{{ formErrors['new-password'] }}
|
{{ formErrors['new-password'] }}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<input
|
<input
|
||||||
type="password" id="new-confirmed-password" placeholder="New password"
|
type="password" id="new-confirmed-password" placeholder="Confirm new password"
|
||||||
formControlName="new-confirmed-password"
|
formControlName="new-confirmed-password"
|
||||||
>
|
>
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,14 @@
|
||||||
input[type=password] {
|
input[type=password] {
|
||||||
@include peertube-input-text(340px);
|
@include peertube-input-text(340px);
|
||||||
display: block;
|
display: block;
|
||||||
margin-bottom: 10px;
|
|
||||||
|
&#new-confirmed-password {
|
||||||
|
margin-top: 15px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
input[type=submit] {
|
input[type=submit] {
|
||||||
@include peertube-button;
|
@include peertube-button;
|
||||||
|
margin-top: 15px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -10,5 +10,5 @@
|
||||||
{{ formErrors['displayNSFW'] }}
|
{{ formErrors['displayNSFW'] }}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<input type="submit" value="Update" [disabled]="!form.valid">
|
<input type="submit" value="Save" [disabled]="!form.valid">
|
||||||
</form>
|
</form>
|
||||||
|
|
|
@ -8,4 +8,5 @@ input[type=submit] {
|
||||||
@include peertube-button;
|
@include peertube-button;
|
||||||
|
|
||||||
display: block;
|
display: block;
|
||||||
|
margin-top: 15px;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,9 @@
|
||||||
<div
|
<div
|
||||||
infiniteScroll
|
infiniteScroll
|
||||||
[infiniteScrollDistance]="0.5"
|
[infiniteScrollDistance]="0.5"
|
||||||
|
[infiniteScrollUpDistance]="1.5"
|
||||||
(scrolled)="onNearOfBottom()"
|
(scrolled)="onNearOfBottom()"
|
||||||
|
(scrolledUp)="onNearOfTop()"
|
||||||
>
|
>
|
||||||
<div class="video" *ngFor="let video of videos">
|
<div class="video" *ngFor="let video of videos">
|
||||||
<my-video-thumbnail [video]="video"></my-video-thumbnail>
|
<my-video-thumbnail [video]="video"></my-video-thumbnail>
|
||||||
|
|
|
@ -2,8 +2,11 @@
|
||||||
display: flex;
|
display: flex;
|
||||||
height: 130px;
|
height: 130px;
|
||||||
padding-bottom: 20px;
|
padding-bottom: 20px;
|
||||||
|
|
||||||
|
&:not(:last-child) {
|
||||||
margin-bottom: 20px;
|
margin-bottom: 20px;
|
||||||
border-bottom: 1px solid #C6C6C6;
|
border-bottom: 1px solid #C6C6C6;
|
||||||
|
}
|
||||||
|
|
||||||
my-video-thumbnail {
|
my-video-thumbnail {
|
||||||
margin-right: 10px;
|
margin-right: 10px;
|
||||||
|
|
|
@ -10,9 +10,9 @@
|
||||||
<label for="username">Username</label>
|
<label for="username">Username</label>
|
||||||
<input
|
<input
|
||||||
type="text" id="username" placeholder="Username" required
|
type="text" id="username" placeholder="Username" required
|
||||||
formControlName="username"
|
formControlName="username" [ngClass]="{ 'input-error': formErrors['username'] }"
|
||||||
>
|
>
|
||||||
<div *ngIf="formErrors.username" class="alert alert-danger">
|
<div *ngIf="formErrors.username" class="form-error">
|
||||||
{{ formErrors.username }}
|
{{ formErrors.username }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -21,9 +21,9 @@
|
||||||
<label for="password">Password</label>
|
<label for="password">Password</label>
|
||||||
<input
|
<input
|
||||||
type="password" name="password" id="password" placeholder="Password" required
|
type="password" name="password" id="password" placeholder="Password" required
|
||||||
formControlName="password"
|
formControlName="password" [ngClass]="{ 'input-error': formErrors['password'] }"
|
||||||
>
|
>
|
||||||
<div *ngIf="formErrors.password" class="alert alert-danger">
|
<div *ngIf="formErrors.password" class="form-error">
|
||||||
{{ formErrors.password }}
|
{{ formErrors.password }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -32,6 +32,7 @@ export abstract class AbstractVideoList implements OnInit {
|
||||||
// Subscribe to route changes
|
// Subscribe to route changes
|
||||||
const routeParams = this.route.snapshot.params
|
const routeParams = this.route.snapshot.params
|
||||||
this.loadRouteParams(routeParams)
|
this.loadRouteParams(routeParams)
|
||||||
|
|
||||||
if (this.loadOnInit === true) this.loadMoreVideos('after')
|
if (this.loadOnInit === true) this.loadMoreVideos('after')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -60,6 +61,13 @@ export abstract class AbstractVideoList implements OnInit {
|
||||||
|
|
||||||
observable.subscribe(
|
observable.subscribe(
|
||||||
({ videos, totalVideos }) => {
|
({ videos, totalVideos }) => {
|
||||||
|
// Paging is too high, return to the first one
|
||||||
|
if (totalVideos <= ((this.pagination.currentPage - 1) * this.pagination.itemsPerPage)) {
|
||||||
|
this.pagination.currentPage = 1
|
||||||
|
this.setNewRouteParams()
|
||||||
|
return this.reloadVideos()
|
||||||
|
}
|
||||||
|
|
||||||
this.loadedPages[this.pagination.currentPage] = true
|
this.loadedPages[this.pagination.currentPage] = true
|
||||||
this.pagination.totalItems = totalVideos
|
this.pagination.totalItems = totalVideos
|
||||||
|
|
||||||
|
|
|
@ -11,9 +11,9 @@
|
||||||
<label for="username">Username</label>
|
<label for="username">Username</label>
|
||||||
<input
|
<input
|
||||||
type="text" class="form-control" id="username" placeholder="Username"
|
type="text" class="form-control" id="username" placeholder="Username"
|
||||||
formControlName="username"
|
formControlName="username" [ngClass]="{ 'input-error': formErrors['username'] }"
|
||||||
>
|
>
|
||||||
<div *ngIf="formErrors.username" class="alert alert-danger">
|
<div *ngIf="formErrors.username" class="form-error">
|
||||||
{{ formErrors.username }}
|
{{ formErrors.username }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -22,9 +22,9 @@
|
||||||
<label for="email">Email</label>
|
<label for="email">Email</label>
|
||||||
<input
|
<input
|
||||||
type="text" class="form-control" id="email" placeholder="Email"
|
type="text" class="form-control" id="email" placeholder="Email"
|
||||||
formControlName="email"
|
formControlName="email" [ngClass]="{ 'input-error': formErrors['email'] }"
|
||||||
>
|
>
|
||||||
<div *ngIf="formErrors.email" class="alert alert-danger">
|
<div *ngIf="formErrors.email" class="form-error">
|
||||||
{{ formErrors.email }}
|
{{ formErrors.email }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -33,9 +33,9 @@
|
||||||
<label for="password">Password</label>
|
<label for="password">Password</label>
|
||||||
<input
|
<input
|
||||||
type="password" class="form-control" id="password" placeholder="Password"
|
type="password" class="form-control" id="password" placeholder="Password"
|
||||||
formControlName="password"
|
formControlName="password" [ngClass]="{ 'input-error': formErrors['password'] }"
|
||||||
>
|
>
|
||||||
<div *ngIf="formErrors.password" class="alert alert-danger">
|
<div *ngIf="formErrors.password" class="form-error">
|
||||||
{{ formErrors.password }}
|
{{ formErrors.password }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -7,6 +7,7 @@ $orange-color: #F1680D;
|
||||||
|
|
||||||
$black-background: #000;
|
$black-background: #000;
|
||||||
$grey-background: #f6f2f2;
|
$grey-background: #f6f2f2;
|
||||||
|
$red-error: #FF0000;
|
||||||
|
|
||||||
$expanded-horizontal-margins: 150px;
|
$expanded-horizontal-margins: 150px;
|
||||||
$not-expanded-horizontal-margins: 30px;
|
$not-expanded-horizontal-margins: 30px;
|
||||||
|
|
|
@ -25,6 +25,16 @@ label {
|
||||||
font-size: 15px;
|
font-size: 15px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.form-error {
|
||||||
|
display: block;
|
||||||
|
color: $red-error;
|
||||||
|
margin-top: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.input-error {
|
||||||
|
border-color: $red-error !important;
|
||||||
|
}
|
||||||
|
|
||||||
.glyphicon-black {
|
.glyphicon-black {
|
||||||
color: black;
|
color: black;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue