Skip to content

Commit ff5c721

Browse files
authored
Merge pull request #280 from devforth/AdminForth/730
feat: add custom class for the bool icons. Fix darkForm styling
2 parents f325691 + af84a99 commit ff5c721

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

adminforth/spa/src/components/GroupsTable.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<template>
22
<div class="rounded-lg shadow-resourseFormShadow dark:shadow-darkResourseFormShadow dark:shadow-2xl">
3-
<div v-if="group.groupName && !group.noTitle" class="text-md font-semibold px-6 py-3 flex flex-1 items-center dark:border-gray-600 text-gray-700 bg-lightFormHeading dark:bg-gray-700 dark:text-gray-400 rounded-t-lg">
3+
<div v-if="group.groupName && !group.noTitle" class="text-md font-semibold px-6 py-3 flex flex-1 items-center dark:border-darkFormBorder text-gray-700 bg-lightFormHeading dark:bg-darkFormHeading dark:text-gray-400 rounded-t-lg">
44
{{ group.groupName }}
55
</div>
66
<table class="w-full text-sm text-left rtl:text-right text-gray-500 dark:text-gray-400">
7-
<thead v-if="!allColumnsHaveCustomComponent" class="text-xs text-gray-700 uppercase dark:text-gray-400 bg-lightFormHeading dark:bg-gray-700 block md:table-row-group ">
7+
<thead v-if="!allColumnsHaveCustomComponent" class="text-xs text-gray-700 uppercase dark:text-gray-400 bg-lightFormHeading dark:bg-darkFormHeading block md:table-row-group ">
88
<tr>
99
<th scope="col" :class="{'rounded-tl-lg': !group.groupName}" class="px-6 py-3 hidden md:w-52 md:table-cell">
1010
{{ $t('Field') }}
@@ -19,7 +19,7 @@
1919
v-for="(column, i) in group.columns"
2020
:key="column.name"
2121
v-if="currentValues !== null"
22-
class="bg-lightForm dark:bg-gray-800 dark:border-gray-700 block md:table-row"
22+
class="bg-lightForm dark:bg-darkForm dark:border-darkFormBorder block md:table-row"
2323
:class="{ 'border-b': i !== group.columns.length - 1}"
2424
>
2525
<td class="px-6 py-4 flex items-center block md:table-cell pb-0 md:pb-4"

adminforth/spa/src/components/ShowTable.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<template>
22
<div :class="`overflow-x-auto ${isRounded ? 'rounded-default' : ''} shadow-resourseFormShadow dark:shadow-darkResourseFormShadow`">
3-
<div v-if="groupName && !noTitle" class="text-md font-semibold px-6 py-3 flex flex-1 items-center dark:border-gray-600 text-gray-700 bg-lightFormHeading dark:bg-gray-700 dark:text-gray-400 rounded-t-lg">
3+
<div v-if="groupName && !noTitle" class="text-md font-semibold px-6 py-3 flex flex-1 items-center text-gray-700 bg-lightFormHeading dark:bg-darkFormHeading dark:text-gray-400 rounded-t-lg">
44
{{ groupName }}
55
</div>
66
<table class="w-full text-sm text-left rtl:text-right text-gray-500 dark:text-gray-400 table-fixed">
7-
<thead v-if="!allColumnsHaveCustomComponent" class="text-gray-700 dark:text-gray-400 bg-lightFormHeading dark:bg-gray-700 block md:table-row-group">
7+
<thead v-if="!allColumnsHaveCustomComponent" class="text-gray-700 dark:text-gray-400 bg-lightFormHeading dark:bg-darkFormHeading dark:border-darkFormBorder block md:table-row-group">
88
<tr>
99
<th scope="col" class="px-6 py-3 text-xs uppercase hidden md:w-52 md:table-cell">
1010
{{ $t('Field') }}
@@ -19,7 +19,7 @@
1919
v-for="column in columns"
2020
:key="column.name"
2121
class="bg-lightForm border-t border-gray-100
22-
dark:bg-gray-800 dark:border-gray-700 block md:table-row"
22+
dark:bg-darkForm dark:border-darkFormBorder block md:table-row"
2323
>
2424
<component
2525
v-if="column.components?.showRow"

adminforth/spa/src/components/ValueRenderer.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@
2727
</span>
2828

2929
<span v-else-if="column.type === 'boolean'">
30-
<span v-if="record[column.name] === true" class="bg-green-100 whitespace-nowrap text-green-800 text-xs font-medium me-2 px-2.5 py-0.5 rounded dark:bg-gray-700 dark:text-green-400 border border-green-400">{{ $t('Yes') }}</span>
31-
<span v-else-if="record[column.name] === false" class="bg-red-100 whitespace-nowrap text-red-800 text-xs font-medium me-2 px-2.5 py-0.5 rounded dark:bg-gray-700 dark:text-red-400 border border-red-400">{{ $t('No') }}</span>
30+
<span v-if="record[column.name] === true" class="af-true-value-icon bg-green-100 whitespace-nowrap text-green-800 text-xs font-medium me-2 px-2.5 py-0.5 rounded dark:bg-gray-700 dark:text-green-400 border border-green-400">{{ $t('Yes') }}</span>
31+
<span v-else-if="record[column.name] === false" class="af-false-value-icon bg-red-100 whitespace-nowrap text-red-800 text-xs font-medium me-2 px-2.5 py-0.5 rounded dark:bg-gray-700 dark:text-red-400 border border-red-400">{{ $t('No') }}</span>
3232
<span v-else class="bg-gray-100 whitespace-nowrap text-gray-800 text-xs font-medium me-2 px-2.5 py-0.5 rounded dark:bg-gray-700 dark:text-gray-400 border border-gray-400">{{ $t('Unset') }}</span>
3333
</span>
3434
<span
@@ -39,13 +39,13 @@
3939
<span
4040
v-if="column.isArray.itemType === 'boolean' && arrayItem"
4141
:key="`${column.name}-${arrayItemIndex}`"
42-
class="bg-green-100 whitespace-nowrap text-green-800 text-xs font-medium me-2 px-2.5 py-0.5 rounded dark:bg-gray-700 dark:text-green-400 border border-green-400">
42+
class="af-true-value-icon bg-green-100 whitespace-nowrap text-green-800 text-xs font-medium me-2 px-2.5 py-0.5 rounded dark:bg-gray-700 dark:text-green-400 border border-green-400">
4343
{{ $t('Yes') }}
4444
</span>
4545
<span
4646
v-else-if="column.isArray.itemType === 'boolean'"
4747
:key="`${column.name}-${arrayItemIndex}`"
48-
class="bg-red-100 whitespace-nowrap text-red-800 text-xs font-medium me-2 px-2.5 py-0.5 rounded dark:bg-gray-700 dark:text-red-400 border border-red-400">
48+
class="af-false-value-icon bg-red-100 whitespace-nowrap text-red-800 text-xs font-medium me-2 px-2.5 py-0.5 rounded dark:bg-gray-700 dark:text-red-400 border border-red-400">
4949
{{ $t('No') }}
5050
</span>
5151
<span

0 commit comments

Comments
 (0)