Skip to content
This repository was archived by the owner on Nov 21, 2023. It is now read-only.

Commit 000bb90

Browse files
committed
Better ux for realestates
1 parent d895397 commit 000bb90

File tree

7 files changed

+80
-11
lines changed

7 files changed

+80
-11
lines changed

admin/app.css

Lines changed: 43 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,12 @@ input[id*="color"] {
5858
padding-left: 0;
5959
text-transform: initial;
6060
}
61+
[class*=TopBarContainer] + div label {
62+
font-size: 12px;
63+
}
64+
[class*="ControlContainer"] > label::after {
65+
content: none;
66+
}
6167
[class*="ControlContainer"] > div {
6268
/* border: 1px dashed var(--grey); */
6369
background: transparent;
@@ -82,6 +88,10 @@ label + [class*="-DateTimeControl"] {
8288
font-weight: 600;
8389
text-transform: uppercase;
8490
}
91+
[class*="-ControlHint"] a {
92+
font-size: 12px;
93+
}
94+
8595

8696

8797
[class*="ListItem-listControlItem-listControlItemCollapsed-ListControl"],
@@ -176,6 +186,16 @@ div > div[id*="blocks-field-"] > div:last-child:not(:empty) {
176186
}
177187

178188

189+
/* TOGGLE FIELD */
190+
[class*=-ControlContainer]:has(> div > [class*=-ToggleContainer]) {
191+
display: flex;
192+
white-space: nowrap;
193+
}
194+
div:has(> [class*=-ToggleContainer]) {
195+
padding-top: 5px;
196+
}
197+
198+
179199
/* IMAGE FIELD */
180200
[class*="-ImageWrapper-checkerboard"] {
181201
float: left;
@@ -237,7 +257,7 @@ div[id^=documents-field] {
237257
justify-content: space-between;
238258
}
239259
[id^=address-field] > div + div > div {
240-
flex-basis: 33%;
260+
flex-basis: 32%;
241261
}
242262
[id^=coordinates-field] > div + div > div {
243263
flex-basis: 49%;
@@ -258,25 +278,42 @@ div[id^=documents-field] {
258278
justify-content: space-between;
259279
}
260280
[id^=informations-field] > div + div > div {
261-
flex-basis: 33%;
281+
flex-basis: 32%;
262282
}
263283

264284

265285
/* OFFER */
266286
[id^=offer-field] {
267287
background-color: var(--lightgrey) !important;
268288
}
269-
289+
[id^=offer-field] > div {
290+
overflow: hidden;
291+
}
292+
[id^=offer-field] [class*=-ControlContainer]:has(> [id^=price-field]) {
293+
float: left;
294+
width: 49%;
295+
}
296+
[id^=offer-field] [class*=-ControlContainer]:has(> [id^=status-field]) {
297+
clear: none;
298+
float: right;
299+
width: 49%;
300+
}
270301

271302
/* TAXONOMIES */
272-
[class*=-ControlContainer]:has([id^=realestates_persons]) {
303+
[class*=-ControlContainer]:has([id^=reference]) {
273304
float: left;
274-
width: 49%;
305+
margin-right: 2%;
306+
width: 30%;
275307
}
276308
[class*=-ControlContainer]:has([id^=realestates_types]) {
309+
clear: none;
310+
float: left;
311+
width: 30%;
312+
}
313+
[class*=-ControlContainer]:has([id^=realestates_persons]) {
277314
clear: none;
278315
float: right;
279-
width: 49%;
316+
width: 36%;
280317
}
281318

282319

admin/app/content/realestates.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@ const realestates = {
3737
isNotIndex,
3838
draft,
3939
date,
40-
reference,
4140
title,
4241
description,
43-
realestates_persons,
42+
reference,
4443
realestates_types,
44+
realestates_persons,
4545
offer,
4646
informations,
4747
address,

admin/app/fields/hide_price.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import {t} from "../i18n/translater.js";
2+
3+
export const hide_price = {
4+
name: 'hide_price',
5+
label: t.fields.price.hide,
6+
widget: 'boolean',
7+
required: false,
8+
i18n: 'duplicate'
9+
}

admin/app/fields/offer.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import { sold } from './sold.js'
22
import { price } from './price.js'
3+
import { hide_price } from './hide_price.js'
4+
import { status } from './realestates-status.js'
35
import {t} from "../i18n/translater.js";
46

57
export const offer = {
@@ -11,6 +13,8 @@ export const offer = {
1113
collapsed: false,
1214
fields: [
1315
sold,
14-
price
16+
hide_price,
17+
price,
18+
status
1519
]
1620
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import {t} from "../i18n/translater.js";
2+
3+
export const status = {
4+
name: 'status',
5+
label: t.fields.realestates_status.label,
6+
hint: t.fields.realestates_status.hint,
7+
widget: 'string',
8+
required: false,
9+
i18n: true
10+
}

admin/app/i18n/en/fields.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,9 +194,9 @@ export const fields = {
194194
prefix: "Prefix",
195195
press: "Article source",
196196
price: {
197+
hide: "Hide price",
197198
label: "Price",
198-
hint: "ex: 300000 (for 300 000 €)",
199-
sold: "Sold price"
199+
hint: "ex: 300000 (for 300 000 €)"
200200
},
201201
projects: "Projects",
202202
projects_tags: "Tags",
@@ -213,6 +213,10 @@ export const fields = {
213213
},
214214
realestates_sellers: "Seller",
215215
realestates_types: "Type of property",
216+
realestates_status: {
217+
label: "Status",
218+
hint: "ex: Consult us",
219+
},
216220
reference: "Reference",
217221
section: "Type of section",
218222
show_color: {

admin/app/i18n/fr/fields.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,7 @@ export const fields = {
193193
prefix: "Préfixe",
194194
press: "Source de l’article",
195195
price: {
196+
hide: "Cacher le prix",
196197
label: "Prix",
197198
hint: "ex: 300000 (pour 300 000 €)",
198199
},
@@ -210,6 +211,10 @@ export const fields = {
210211
hint: "Plusieurs personnes possible"
211212
},
212213
realestates_sellers: "Vendeur du bien",
214+
realestates_status: {
215+
label: "Statut",
216+
hint: "ex: Nous consulter",
217+
},
213218
realestates_types: "Type de bien",
214219
reference: "Référence",
215220
section: "Type de section",

0 commit comments

Comments
 (0)