From a2b817d322ef4074bdaaf2589ada567f338323f4 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 6 Dec 2017 09:19:25 +0100 Subject: [PATCH] Better error messages --- .../account-change-password.component.html | 8 ++++---- .../account-change-password.component.scss | 7 ++++++- .../account-details/account-details.component.html | 2 +- .../account-details/account-details.component.scss | 1 + .../account-videos/account-videos.component.html | 2 ++ .../account-videos/account-videos.component.scss | 7 +++++-- client/src/app/login/login.component.html | 8 ++++---- client/src/app/shared/video/abstract-video-list.ts | 8 ++++++++ client/src/app/signup/signup.component.html | 12 ++++++------ client/src/sass/_variables.scss | 1 + client/src/sass/application.scss | 10 ++++++++++ 11 files changed, 48 insertions(+), 18 deletions(-) diff --git a/client/src/app/account/account-settings/account-change-password/account-change-password.component.html b/client/src/app/account/account-settings/account-change-password/account-change-password.component.html index c57e705f9..b0e3cada4 100644 --- a/client/src/app/account/account-settings/account-change-password/account-change-password.component.html +++ b/client/src/app/account/account-settings/account-change-password/account-change-password.component.html @@ -4,15 +4,15 @@ -
+
{{ formErrors['new-password'] }}
diff --git a/client/src/app/account/account-settings/account-change-password/account-change-password.component.scss b/client/src/app/account/account-settings/account-change-password/account-change-password.component.scss index 593355b70..75827abbf 100644 --- a/client/src/app/account/account-settings/account-change-password/account-change-password.component.scss +++ b/client/src/app/account/account-settings/account-change-password/account-change-password.component.scss @@ -1,9 +1,14 @@ input[type=password] { @include peertube-input-text(340px); display: block; - margin-bottom: 10px; + + &#new-confirmed-password { + margin-top: 15px; + } } input[type=submit] { @include peertube-button; + margin-top: 15px; } + diff --git a/client/src/app/account/account-settings/account-details/account-details.component.html b/client/src/app/account/account-settings/account-details/account-details.component.html index c3cf6b629..bc18b39b4 100644 --- a/client/src/app/account/account-settings/account-details/account-details.component.html +++ b/client/src/app/account/account-settings/account-details/account-details.component.html @@ -10,5 +10,5 @@ {{ formErrors['displayNSFW'] }}
- + diff --git a/client/src/app/account/account-settings/account-details/account-details.component.scss b/client/src/app/account/account-settings/account-details/account-details.component.scss index b1810d4f9..687166d9e 100644 --- a/client/src/app/account/account-settings/account-details/account-details.component.scss +++ b/client/src/app/account/account-settings/account-details/account-details.component.scss @@ -8,4 +8,5 @@ input[type=submit] { @include peertube-button; display: block; + margin-top: 15px; } diff --git a/client/src/app/account/account-videos/account-videos.component.html b/client/src/app/account/account-videos/account-videos.component.html index eb0a32fd3..81bda9477 100644 --- a/client/src/app/account/account-videos/account-videos.component.html +++ b/client/src/app/account/account-videos/account-videos.component.html @@ -1,7 +1,9 @@
diff --git a/client/src/app/account/account-videos/account-videos.component.scss b/client/src/app/account/account-videos/account-videos.component.scss index b26933d22..c31497350 100644 --- a/client/src/app/account/account-videos/account-videos.component.scss +++ b/client/src/app/account/account-videos/account-videos.component.scss @@ -2,8 +2,11 @@ display: flex; height: 130px; padding-bottom: 20px; - margin-bottom: 20px; - border-bottom: 1px solid #C6C6C6; + + &:not(:last-child) { + margin-bottom: 20px; + border-bottom: 1px solid #C6C6C6; + } my-video-thumbnail { margin-right: 10px; diff --git a/client/src/app/login/login.component.html b/client/src/app/login/login.component.html index 82b70c98c..24807987c 100644 --- a/client/src/app/login/login.component.html +++ b/client/src/app/login/login.component.html @@ -10,9 +10,9 @@ -
+
{{ formErrors.username }}
@@ -21,9 +21,9 @@ -
+
{{ formErrors.password }}
diff --git a/client/src/app/shared/video/abstract-video-list.ts b/client/src/app/shared/video/abstract-video-list.ts index 84ca5cbe4..ee1ed2cb2 100644 --- a/client/src/app/shared/video/abstract-video-list.ts +++ b/client/src/app/shared/video/abstract-video-list.ts @@ -32,6 +32,7 @@ export abstract class AbstractVideoList implements OnInit { // Subscribe to route changes const routeParams = this.route.snapshot.params this.loadRouteParams(routeParams) + if (this.loadOnInit === true) this.loadMoreVideos('after') } @@ -60,6 +61,13 @@ export abstract class AbstractVideoList implements OnInit { observable.subscribe( ({ 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.pagination.totalItems = totalVideos diff --git a/client/src/app/signup/signup.component.html b/client/src/app/signup/signup.component.html index 8a30ab512..eb36b29f6 100644 --- a/client/src/app/signup/signup.component.html +++ b/client/src/app/signup/signup.component.html @@ -11,9 +11,9 @@ -
+
{{ formErrors.username }}
@@ -22,9 +22,9 @@ -
+
{{ formErrors.email }}
@@ -33,9 +33,9 @@ -
+
{{ formErrors.password }}
diff --git a/client/src/sass/_variables.scss b/client/src/sass/_variables.scss index 0d655e85c..81dafdc19 100644 --- a/client/src/sass/_variables.scss +++ b/client/src/sass/_variables.scss @@ -7,6 +7,7 @@ $orange-color: #F1680D; $black-background: #000; $grey-background: #f6f2f2; +$red-error: #FF0000; $expanded-horizontal-margins: 150px; $not-expanded-horizontal-margins: 30px; diff --git a/client/src/sass/application.scss b/client/src/sass/application.scss index 4c5c0202c..b860e1bf2 100644 --- a/client/src/sass/application.scss +++ b/client/src/sass/application.scss @@ -25,6 +25,16 @@ label { font-size: 15px; } +.form-error { + display: block; + color: $red-error; + margin-top: 5px; +} + +.input-error { + border-color: $red-error !important; +} + .glyphicon-black { color: black; } -- 2.41.0