Skip to content

A platform for community discussion. Free, open, simple.

4.2 KB
Raw Blame
.admin-report-table {
  &.two-columns {
    .table .admin-report-table-cell:first-child,
    .table .admin-report-table-header:first-child {
      text-align: left;
      width: 80%;
      overflow-wrap: break-word;
    }

    .table .admin-report-table-cell:last-child,
    .table .admin-report-table-header:last-child {
      text-align: right;
    }
  }

  .table {
    margin: 0;
    border: 1px solid var(--content-border-color);
    table-layout: fixed;

    tbody {
      border-top: 0;
    }
  }

  .table .admin-report-table-header {
    --header-caret-offset: calc(var(--space-4) * -1);
    overflow-wrap: break-word;

    &.date {
      width: 6em;
    }

    .sort-btn {
      padding: 0;
      flex-direction: row-reverse;
      gap: var(--space-1);
      position: relative;

      .d-icon {
        // avoiding the appearance of the icon affecting alignment
        position: absolute;
        margin: 0;
        right: var(--header-caret-offset);
      }
    }

    &:last-child {
      .sort-btn {
        .d-icon {
          left: var(--header-caret-offset);
        }
      }
    }

    &.is-current-sort {
      .d-icon {
        color: var(--tertiary);
      }
    }

    &:not(.is-current-sort) .sort-btn {
      .d-icon {
        // avoiding the appearance of the icon changing column size
        visibility: hidden;
      }
    }
  }

  .admin-report-table-cell {
    &.user .username {
      margin-left: 0.25em;
    }
  }

  .total-row {
    background: var(--primary-very-low);

    td {
      font-weight: 700;
      text-align: left;
    }
  }

  .pagination {
    display: flex;
    justify-content: flex-end;
    margin-top: 0.25em;

    button {
      margin-left: 0.5em;

      &.is-current {
        color: var(--tertiary);
      }
    }
  }
}

.admin-report.top-referred-topics {
  .admin-report-table-header.topic_title {
    width: 80%;
  }

  .admin-report-table-cell.number {
    width: 6ch;
  }
}

.admin-report.trending-search {
  .admin-report-table-header.ctr,
  .admin-report-table-header.unique_searches,
  .admin-report-table-cell.ctr,
  .admin-report-table-cell.unique_searches {
    text-align: center;
    width: 20%;
  }

  .admin-report-table-cell.term {
    @include ellipsis;
  }

  .admin-report-table-cell.percent {
    width: 5ch;
    text-align: right;
  }

  .admin-report-table-cell.number.searches {
    width: 6ch;
    text-align: right;
  }
}

.admin-report.moderators-activity {
  .admin-report-table-header.seconds,
  .admin-report-table-header.number,
  .admin-report-table-cell.seconds,
  .admin-report-table-cell.number {
    text-align: center;
  }

  .admin-report-table-header.user {
    width: 20%;
  }
}

.admin-report.post-edits {
  .admin-report-table-header.user {
    width: 20%;
  }

  .admin-report-table-cell.post,
  .admin-report-table-cell.edit_reason {
    @include ellipsis;
  }
}

.admin-report.flags-status {
  .admin-report-table-header.response_time,
  .admin-report-table-cell.response_time {
    text-align: center;
  }
}

.rtl {
  .admin-report-table {
    &.two-columns {
      .table .admin-report-table-cell:first-child,
      .table .admin-report-table-header:first-child {
        text-align: right;
      }

      .table .admin-report-table-cell:last-child,
      .table .admin-report-table-header:last-child {
        text-align: left;
      }
    }
  }

  .admin-report-table-cell {
    &.user .username {
      margin-left: 0;
      margin-right: 0.25em;
    }
  }

  .admin-report.trending-search {
    .admin-report-table-header.term,
    .admin-report-table-cell.term {
      text-align: right;
    }
  }

  .pagination {
    button {
      margin-left: 0;
      margin-right: 0.5em;
    }
  }

  .admin-report.moderators-activity {
    .admin-report-table-header.user,
    .admin-report-table-cell.user {
      text-align: right;
    }
  }
}

.mobile-view .admin-report-table {
  .table {
    font-size: var(--font-down-1);
  }

  .table .admin-report-table-header {
    font-weight: 500;
    border-right: 1px solid var(--content-border-color);
    padding: auto;

    .title {
      writing-mode: vertical-rl;
      text-orientation: mixed;
      text-align: right;
    }
  }

  .table tbody tr td {
    &.user .username {
      display: none;
    }
  }
}