From 7a03209d28f3f31d706dee08ae487d2ca1926893 Mon Sep 17 00:00:00 2001 From: Kim <1877318+kimsible@users.noreply.github.com> Date: Fri, 1 May 2020 00:51:09 +0200 Subject: Make admin sub-navs, selects, buttons responsive (#2702) --- .../src/app/+admin/plugins/plugins.component.scss | 26 ++++++++++++++++ .../src/app/+admin/system/jobs/jobs.component.scss | 1 + .../src/app/+admin/system/logs/logs.component.scss | 35 ++++++++++++++++++++++ client/src/sass/application.scss | 14 +++++++++ client/src/sass/include/_mixins.scss | 23 ++++++++++++++ 5 files changed, 99 insertions(+) diff --git a/client/src/app/+admin/plugins/plugins.component.scss b/client/src/app/+admin/plugins/plugins.component.scss index 9f61bcf7a..04ca8126a 100644 --- a/client/src/app/+admin/plugins/plugins.component.scss +++ b/client/src/app/+admin/plugins/plugins.component.scss @@ -5,3 +5,29 @@ flex-grow: 0; margin-right: 30px; } + +@media screen and (max-width: $small-view) { + ::ng-deep .plugins .plugin .first-row { + flex-wrap: wrap; + + .plugin-name, + .plugin-version, + .plugin-icon { + margin-bottom: 10px; + } + + .buttons { + my-edit-button, + my-delete-button, + my-button { + .action-button { + padding: 0 13px; + } + + .button-label { + display: none; + } + } + } + } +} diff --git a/client/src/app/+admin/system/jobs/jobs.component.scss b/client/src/app/+admin/system/jobs/jobs.component.scss index 4a3de9274..c33e14292 100644 --- a/client/src/app/+admin/system/jobs/jobs.component.scss +++ b/client/src/app/+admin/system/jobs/jobs.component.scss @@ -18,6 +18,7 @@ } .admin-sub-header { + flex-direction: row !important; justify-content: flex-end; .select-filter-block { diff --git a/client/src/app/+admin/system/logs/logs.component.scss b/client/src/app/+admin/system/logs/logs.component.scss index c4690ac9e..087155254 100644 --- a/client/src/app/+admin/system/logs/logs.component.scss +++ b/client/src/app/+admin/system/logs/logs.component.scss @@ -57,3 +57,38 @@ } } +@media screen and (max-width: $small-view) { + .header { + flex-direction: column; + + .peertube-select-container, + my-button { + width: 100% !important; + margin-left: 0px !important; + margin-bottom: 10px !important; + } + + my-button { + text-align: center; + } + } +} + +@media screen and (max-width: #{$small-view + $menu-width}) { + :host-context(.main-col:not(.expanded)) { + .header { + flex-direction: column; + + .peertube-select-container, + my-button { + width: 100% !important; + margin-left: 0px !important; + margin-bottom: 10px !important; + } + + my-button { + text-align: center; + } + } + } +} diff --git a/client/src/sass/application.scss b/client/src/sass/application.scss index b62c91384..ab0bf0a08 100644 --- a/client/src/sass/application.scss +++ b/client/src/sass/application.scss @@ -322,6 +322,10 @@ table { margin-bottom: $sub-menu-margin-bottom-small-view; } + .admin-sub-header { + @include admin-sub-header-responsive(15px*2); + } + my-markdown-textarea { .root { max-width: 100% !important; @@ -338,3 +342,13 @@ table { } } } + +@media screen and (min-width: $small-view) and (max-width: #{$small-view + $menu-width}) { + .main-col { + &:not(.expanded) { + .admin-sub-header { + @include admin-sub-header-responsive($menu-width/2 + $expanded-horizontal-margins/3); + } + } + } +} diff --git a/client/src/sass/include/_mixins.scss b/client/src/sass/include/_mixins.scss index 75046798c..cfb14ef65 100644 --- a/client/src/sass/include/_mixins.scss +++ b/client/src/sass/include/_mixins.scss @@ -875,3 +875,26 @@ } } } + +@mixin admin-sub-header-responsive ($horizontal-margins) { + flex-direction: column; + + .form-sub-title { + margin-right: 0px !important; + margin-bottom: 10px; + text-align: center; + } + + .admin-sub-nav { + display: block; + overflow-x: auto; + white-space: nowrap; + height: 50px; + padding: 10px 0; + width: calc(100vw - #{$horizontal-margins*2}); + + a { + margin-left: 5px; + } + } +} -- cgit v1.2.3