Update table styling

This commit is contained in:
mattwr18 2019-11-29 15:29:11 +01:00
parent a8a9abb4e4
commit 107f10edc9
4 changed files with 44 additions and 29 deletions

View File

@ -1,30 +1,31 @@
<template> <template>
<ds-table v-if="filed && filed.length" :data="filed" :fields="reportFields" condensed> <ds-space margin-bottom="base">
<template #submitter="scope"> <ds-table v-if="filed && filed.length" :data="filed" :fields="reportFields" condensed>
<ds-space margin-bottom="base"> <template #submitter="scope">
<hc-user <hc-user :user="scope.row.submitter" :showAvatar="false" :trunc="30" />
:user="scope.row.submitter" </template>
:showAvatar="false" <template #reportedOn="scope">
:trunc="30" <ds-text size="small">
:date-time="scope.row.createdAt" <hc-relative-date-time :date-time="scope.row.createdAt" />
:position-date-time="'below'" </ds-text>
/> </template>
</ds-space> <template #reasonCategory="scope">
</template> {{ $t('report.reason.category.options.' + scope.row.reasonCategory) }}
<template #reasonCategory="scope"> </template>
{{ $t('report.reason.category.options.' + scope.row.reasonCategory) }} <template #reasonDescription="scope">
</template> {{ scope.row.reasonDescription.length ? scope.row.reasonDescription : '—' }}
<template #reasonDescription="scope"> </template>
{{ scope.row.reasonDescription.length ? scope.row.reasonDescription : '—' }} </ds-table>
</template> </ds-space>
</ds-table>
</template> </template>
<script> <script>
import HcUser from '~/components/User/User' import HcUser from '~/components/User/User'
import HcRelativeDateTime from '~/components/RelativeDateTime'
export default { export default {
components: { components: {
HcUser, HcUser,
HcRelativeDateTime,
}, },
props: { props: {
filed: { type: Array, default: () => [] }, filed: { type: Array, default: () => [] },
@ -32,9 +33,22 @@ export default {
computed: { computed: {
reportFields() { reportFields() {
return { return {
submitter: this.$t('moderation.reports.submitter'), submitter: {
reasonCategory: this.$t('moderation.reports.reasonCategory'), label: this.$t('moderation.reports.submitter'),
reasonDescription: this.$t('moderation.reports.reasonDescription'), width: '15%',
},
reportedOn: {
label: this.$t('moderation.reports.reportedOn'),
width: '20%',
},
reasonCategory: {
label: this.$t('moderation.reports.reasonCategory'),
width: '30%',
},
reasonDescription: {
label: this.$t('moderation.reports.reasonDescription'),
width: '35%',
},
} }
}, },
}, },

View File

@ -133,8 +133,7 @@
</td> </td>
</tr> </tr>
<tr> <tr>
<td class="ds-table-col ds-table-head-col-border"></td> <td class="ds-table-col ds-table-head-col-border filed-table" colspan="4">
<td class="ds-table-col ds-table-head-col-border" colspan="3">
<ds-space margin-bottom="base" /> <ds-space margin-bottom="base" />
<filed-table :filed="report.filed" v-if="showFiledReports" /> <filed-table :filed="report.filed" v-if="showFiledReports" />
</td> </td>
@ -188,3 +187,8 @@ export default {
}, },
} }
</script> </script>
<style lang="scss">
.filed-table {
padding-left: $space-xx-large;
}
</style>

View File

@ -506,6 +506,7 @@
"reviewed": "Reviewed", "reviewed": "Reviewed",
"closed": "Closed" "closed": "Closed"
}, },
"reportedOn": "Date",
"moreDetails": "Report Details", "moreDetails": "Report Details",
"decideModal": { "decideModal": {
"submit": "Confirm decision", "submit": "Confirm decision",

View File

@ -6,11 +6,7 @@
</ds-flex-item> </ds-flex-item>
<ds-flex-item width="110px"> <ds-flex-item width="110px">
<client-only> <client-only>
<dropdown-filter <dropdown-filter @filter="filter" :filterOptions="filterOptions" :selected="selected" />
@filter="filter"
:filterOptions="filterOptions"
:selected="selected"
/>
</client-only> </client-only>
</ds-flex-item> </ds-flex-item>
</ds-flex> </ds-flex>