From f8584e28d7bb0201227d9c89b7c7229194ffc274 Mon Sep 17 00:00:00 2001 From: Neil Lalonde Date: Wed, 24 May 2017 15:52:18 -0400 Subject: [PATCH] UX: improved layout of flag handling UI on mobile --- .../admin/templates/flags-list.hbs | 60 +++++++++++-------- .../stylesheets/common/admin/admin_base.scss | 27 ++++++++- .../stylesheets/common/base/discourse.scss | 5 ++ 3 files changed, 65 insertions(+), 27 deletions(-) diff --git a/app/assets/javascripts/admin/templates/flags-list.hbs b/app/assets/javascripts/admin/templates/flags-list.hbs index e315ce0b9e0..7edc1b30f2d 100644 --- a/app/assets/javascripts/admin/templates/flags-list.hbs +++ b/app/assets/javascripts/admin/templates/flags-list.hbs @@ -3,7 +3,6 @@ - @@ -13,30 +12,42 @@ {{#each content as |flaggedPost|}} - - @@ -104,7 +115,6 @@ {{#each flaggedPost.conversations as |c|}} - -
{{i18n 'admin.flags.flagged_by'}} {{#if adminOldFlagsView}}{{i18n 'admin.flags.resolved_by'}}{{/if}}
- {{#if flaggedPost.postAuthorFlagged}} - {{#if flaggedPost.user}} - {{#link-to 'adminUser' flaggedPost.user}}{{avatar flaggedPost.user imageSize="large"}}{{/link-to}} - {{#if flaggedPost.wasEdited}}{{/if}} - {{/if}} - {{/if}} - {{#if adminActiveFlagsView}} - {{#if flaggedPost.previous_flags_count}} - {{flaggedPost.previous_flags_count}} - {{/if}} - {{/if}} - -

- {{#if flaggedPost.topic.isPrivateMessage}} - {{fa-icon "envelope"}} + +
+
+ {{#if flaggedPost.postAuthorFlagged}} + {{#if flaggedPost.user}} + {{#link-to 'adminUser' flaggedPost.user}}{{avatar flaggedPost.user imageSize="large"}}{{/link-to}} + {{#if flaggedPost.wasEdited}}{{/if}} + {{/if}} + {{/if}} + {{#if adminActiveFlagsView}} + {{#if flaggedPost.previous_flags_count}} + {{flaggedPost.previous_flags_count}} + {{/if}} + {{/if}} +
+
+

+ {{#if flaggedPost.topic.isPrivateMessage}} + {{fa-icon "envelope"}} + {{/if}} + {{topic-status topic=flaggedPost.topic}} + {{{unbound flaggedPost.topic.fancyTitle}}} +

+ {{#unless site.mobileView}} + {{#if flaggedPost.postAuthorFlagged}} +

{{{flaggedPost.excerpt}}}

+ {{/if}} + {{/unless}} +
+
+ + {{#if site.mobileView}} + {{#if flaggedPost.postAuthorFlagged}} +

{{{flaggedPost.excerpt}}}

{{/if}} - {{topic-status topic=flaggedPost.topic}} - {{{unbound flaggedPost.topic.fancyTitle}}} -

- {{#if flaggedPost.postAuthorFlagged}} -

{{{flaggedPost.excerpt}}}

{{/if}}
{{#if c.response}} @@ -130,7 +140,7 @@ {{#unless adminOldFlagsView}}
+ {{#if adminActiveFlagsView}} {{#if flaggedPost.postHidden}} diff --git a/app/assets/stylesheets/common/admin/admin_base.scss b/app/assets/stylesheets/common/admin/admin_base.scss index 93878dadb69..5e9a29358a4 100644 --- a/app/assets/stylesheets/common/admin/admin_base.scss +++ b/app/assets/stylesheets/common/admin/admin_base.scss @@ -746,16 +746,25 @@ section.details { .message { background-color: dark-light-diff($highlight, $secondary, 50%, -70%); } .message:hover { background-color: dark-light-diff($highlight, $secondary, 60%, -60%); } + .flagged-post-avatar { + margin-right: 10px; + } + .excerpt { padding: 8px; word-wrap: break-word; .fa { display: inline-block; } h3 { - max-height: 1.2em; - overflow: hidden; margin-top: 0; margin-bottom: 5px; } + p:last-child { + margin-bottom: 0; + } + } + + tr.message td { + padding-left: 60px; } .flagged-posts { background: $danger; } @@ -1828,6 +1837,20 @@ table#user-badges { left: -100%; } +.mobile-view .admin-flags { + .flaggers { + padding: 2px; + .avatar { + padding: 0; + } + } + tr.message td { + padding-left: 8px; + } +} + + + .cboxcontainer { display: inline-block; padding: 8px; diff --git a/app/assets/stylesheets/common/base/discourse.scss b/app/assets/stylesheets/common/base/discourse.scss index b9885750ae7..1aeaf7cfe3a 100644 --- a/app/assets/stylesheets/common/base/discourse.scss +++ b/app/assets/stylesheets/common/base/discourse.scss @@ -193,6 +193,11 @@ body { } } +.flex-center-align { + display: flex; + align-items: center; +} + .unread-private-messages { color: $secondary; background: $success;