Display report reason in multiple lines (#957)
authorFelix Ableitner <me@nutomic.com>
Tue, 28 Aug 2018 07:06:00 +0000 (02:06 -0500)
committerChocobozzz <me@florianbigard.com>
Tue, 28 Aug 2018 07:06:00 +0000 (09:06 +0200)
* Display report reason in multiple lines

* more adjustments:

- move report reason into dropdown
- allow line wrap in dropdown (also in video blacklist)
- fix colspan in blacklist dropdown
- merge css rules into moderation.component.scss

* use min-width for labels

client/src/app/+admin/moderation/moderation.component.scss
client/src/app/+admin/moderation/video-abuse-list/video-abuse-list.component.html
client/src/app/+admin/moderation/video-abuse-list/video-abuse-list.component.scss [deleted file]
client/src/app/+admin/moderation/video-abuse-list/video-abuse-list.component.ts
client/src/app/+admin/moderation/video-blacklist-list/video-blacklist-list.component.html
client/src/app/+admin/moderation/video-blacklist-list/video-blacklist-list.component.scss [deleted file]
client/src/app/+admin/moderation/video-blacklist-list/video-blacklist-list.component.ts

index 766d7853b49e7a01c291854abd3d3f990682ca8f..5bb2c50a7431bb5a43c7a5a35bef532399986794 100644 (file)
@@ -1,4 +1,24 @@
+@import 'variables';
+@import 'mixins';
+
 .form-sub-title {
   flex-grow: 0;
   margin-right: 30px;
 }
+
+.moderation-expanded-label {
+  font-weight: $font-semibold;
+  min-width: 200px;
+  display: inline-block;
+}
+
+.moderation-expanded-text {
+  display: inline-block;
+}
+
+.moderation-expanded {
+    word-wrap: break-word;
+    overflow: visible !important;
+    text-overflow: unset !important;
+    white-space: unset !important;
+}
index 722ff79063788352463b54f774cb845ce552d6f1..0d0f644dc95c96e435caa75c01244bda21766586 100644 (file)
@@ -6,7 +6,6 @@
     <tr>
       <th style="width: 40px"></th>
       <th i18n pSortableColumn="state" style="width: 80px;">State <p-sortIcon field="state"></p-sortIcon></th>
-      <th i18n>Reason</th>
       <th i18n>Reporter</th>
       <th i18n pSortableColumn="createdAt">Created <p-sortIcon field="createdAt"></p-sortIcon></th>
       <th i18n>Video</th>
@@ -17,7 +16,7 @@
   <ng-template pTemplate="body" let-expanded="expanded" let-videoAbuse>
     <tr>
       <td>
-        <span *ngIf="videoAbuse.moderationComment" class="expander" [pRowToggler]="videoAbuse">
+        <span class="expander" [pRowToggler]="videoAbuse">
           <i [ngClass]="expanded ? 'glyphicon glyphicon-menu-down' : 'glyphicon glyphicon-menu-right'"></i>
         </span>
       </td>
@@ -27,8 +26,6 @@
         <span *ngIf="isVideoAbuseRejected(videoAbuse)" [title]="videoAbuse.state.label" class="glyphicon glyphicon-remove"></span>
       </td>
 
-      <td>{{ videoAbuse.reason }}</td>
-
       <td>
         <a [href]="videoAbuse.reporterAccount.url" i18n-title title="Go to the account" target="_blank" rel="noopener noreferrer">
           {{ createByString(videoAbuse.reporterAccount) }}
   </ng-template>
 
   <ng-template pTemplate="rowexpansion" let-videoAbuse>
-    <tr class="moderation-comment">
-      <td colspan="7">
-        <span i18n class="moderation-comment-label">Moderation comment:</span>
-        {{ videoAbuse.moderationComment }}
-      </td>
-    </tr>
+      <tr>
+        <td class="moderation-expanded" colspan="6">
+          <div>
+            <span i18n class="moderation-expanded-label">Reason:</span>
+            <span class="moderation-expanded-text">{{ videoAbuse.reason }}</span>
+          </div>
+          <div *ngIf="videoAbuse.moderationComment">
+            <span i18n class="moderation-expanded-label">Moderation comment:</span>
+            <span class="moderation-expanded-text">{{ videoAbuse.moderationComment }}</span>
+          </div>
+        </td>
+      </tr>
   </ng-template>
 </p-table>
 
diff --git a/client/src/app/+admin/moderation/video-abuse-list/video-abuse-list.component.scss b/client/src/app/+admin/moderation/video-abuse-list/video-abuse-list.component.scss
deleted file mode 100644 (file)
index 2391fef..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-@import 'variables';
-@import 'mixins';
-
-.moderation-comment-label {
-  font-weight: $font-semibold;
-}
\ No newline at end of file
index b17278b941bf38ab8c9fa14d82d10a83132f4b84..681db743441a65d58ae5c5ecd9a918a0fa96052e 100644 (file)
@@ -13,7 +13,7 @@ import { Video } from '../../../shared/video/video.model'
 @Component({
   selector: 'my-video-abuse-list',
   templateUrl: './video-abuse-list.component.html',
-  styleUrls: [ './video-abuse-list.component.scss']
+  styleUrls: [ '../moderation.component.scss']
 })
 export class VideoAbuseListComponent extends RestTable implements OnInit {
   @ViewChild('moderationCommentModal') moderationCommentModal: ModerationCommentModalComponent
index dafaeb1e2fd112be8063a52d6f264c7e45f49dc4..0585e0490ce20b2dd9292229f2c9518f941f279c 100644 (file)
   </ng-template>
 
   <ng-template pTemplate="rowexpansion" let-videoBlacklist>
-    <tr class="blacklist-reason">
-      <td colspan="7">
-        <span i18n class="blacklist-reason-label">Blacklist reason:</span>
-        {{ videoBlacklist.reason }}
+    <tr>
+      <td class="moderation-expanded" colspan="5">
+        <span i18n class="moderation-expanded-label">Blacklist reason:</span>
+        <span class="moderation-expanded-text">{{ videoBlacklist.reason }}</span>
       </td>
     </tr>
   </ng-template>
diff --git a/client/src/app/+admin/moderation/video-blacklist-list/video-blacklist-list.component.scss b/client/src/app/+admin/moderation/video-blacklist-list/video-blacklist-list.component.scss
deleted file mode 100644 (file)
index 063f632..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-@import 'variables';
-@import 'mixins';
-
-.blacklist-reason-label {
-  font-weight: $font-semibold;
-}
\ No newline at end of file
index 9890d1f90928228fe9dc83e27b2d6c1f3a548e7c..bb051d00fb009d5aa35d3426a2736f119aea0c08 100644 (file)
@@ -11,7 +11,7 @@ import { Video } from '../../../shared/video/video.model'
 @Component({
   selector: 'my-video-blacklist-list',
   templateUrl: './video-blacklist-list.component.html',
-  styleUrls: [ './video-blacklist-list.component.scss' ]
+  styleUrls: [ '../moderation.component.scss' ]
 })
 export class VideoBlacklistListComponent extends RestTable implements OnInit {
   blacklist: VideoBlacklist[] = []