UX: Hide email columns when `Hide Emails` is selected (#13502)

UX: Hide email columns when Hide Emails is selected (#13502)

  • UX: Scroll user list container when emails are present
diff --git a/app/assets/javascripts/admin/addon/templates/users-list-show.hbs b/app/assets/javascripts/admin/addon/templates/users-list-show.hbs
index ff66a92..a570009 100644
--- a/app/assets/javascripts/admin/addon/templates/users-list-show.hbs
+++ b/app/assets/javascripts/admin/addon/templates/users-list-show.hbs
@@ -19,12 +19,12 @@
   {{text-field value=listFilter placeholder=searchHint}}
 </div>
 
-{{#load-more selector=".users-list tr" action=(action "loadMore")}}
+{{#load-more class="users-list-container" selector=".users-list tr" action=(action "loadMore")}}
   {{#if model}}
     <table class="table users-list grid">
       <thead>
         {{table-header-toggle field="username" labelKey="username" order=order asc=asc}}
-        {{table-header-toggle field="email" labelKey="email" order=order asc=asc}}
+        {{table-header-toggle  class=(if showEmails "" "hidden") field="email" labelKey="email" order=order asc=asc}}
         {{table-header-toggle field="last_emailed" labelKey="admin.users.last_emailed" order=order asc=asc}}
         {{table-header-toggle field="seen" labelKey="last_seen" order=order asc=asc}}
         {{table-header-toggle field="topics_viewed" labelKey="admin.user.topics_entered" order=order asc=asc}}
@@ -48,7 +48,7 @@
                 {{d-icon "far-envelope" title="user.staged" }}
               {{/if}}
             </td>
-            <td class="email">
+            <td class="email {{if showEmails "" "hidden"}}">
               {{~user.email~}}
             </td>
             <td class="last-emailed">
@@ -98,7 +98,6 @@
       </tbody>
     </table>
     {{conditional-loading-spinner condition=refreshing}}
-
   {{else}}
     <p>{{i18n "search.no_results"}}</p>
   {{/if}}
diff --git a/app/assets/stylesheets/common/admin/admin_base.scss b/app/assets/stylesheets/common/admin/admin_base.scss
index 98e7411..f9e6186 100644
--- a/app/assets/stylesheets/common/admin/admin_base.scss
+++ b/app/assets/stylesheets/common/admin/admin_base.scss
@@ -425,6 +425,9 @@ $mobile-breakpoint: 700px;
   .controls {
     @include clearfix;
   }
+  .users-list-container {
+    overflow-x: auto;
+  }
 }
 
 .admin-title {

GitHub sha: 385535f421f9567f703463823ad865161cde0057

This commit appears in #13502 which was approved by eviltrout. It was merged by jordanvidrine.