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

Commit 1bfb22f

Browse files
committed
Add offer to realestates
1 parent bea81eb commit 1bfb22f

File tree

10 files changed

+97
-5
lines changed

10 files changed

+97
-5
lines changed

admin/app.css

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,7 @@ div > div[id*="blocks-field-"] > div:last-child:not(:empty) {
167167
[class*="-TopBarContainer"]{
168168
background: var(--grey) !important;
169169
padding: 5px !important;
170+
position: relative;
170171
}
171172
[class*="TopBar-StyledListItemTopBar-StyledListItemTopBar"] button,
172173
[class*="TopBar-StyledListItemTopBar-StyledListItemTopBar"] > span {
@@ -200,6 +201,16 @@ div > div[id*="blocks-field-"] > div:last-child:not(:empty) {
200201
[id^=images-field] > div:last-child > div:nth-child(3) {
201202
clear: left;
202203
}
204+
[id^=gallery-field] [class*="-ControlContainer"]:nth-child(2) + div:not(:last-child) {
205+
float: left;
206+
width: 49%;
207+
}
208+
[id^=gallery-field] [class*="-ControlContainer"]:nth-child(4) {
209+
clear: none;
210+
float: right;
211+
width: 49%;
212+
}
213+
203214
[id^=gallery-field] input[type="text"],
204215
[id^=image-field] input[type="text"],
205216
[id^=images-field] input[type="text"] {
@@ -237,6 +248,13 @@ div[id^=documents-field] {
237248
}
238249

239250

251+
/* OFFER */
252+
[id^=offer-field] {
253+
background-color: var(--lightgrey) !important;
254+
}
255+
256+
257+
240258

241259
/* TOOLBAR */
242260
[class*="-ToolbarContainer"] {

admin/app/content/realestates.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { isNotIndex } from '../fields/is-not-index.js'
22
import { draft } from '../fields/draft.js'
33
import { date } from '../fields/date.js'
4+
import { reference } from '../fields/reference.js'
45
import { title } from '../fields/title.js'
56
import { description } from '../fields/description.js'
67
import { realestates_persons } from '../fields/realestates_persons.js'
@@ -9,6 +10,7 @@ import { realestates_sellers } from '../fields/realestates_sellers.js'
910
import { featured_image } from '../fields/featured-image.js'
1011
import { address } from '../fields/address.js'
1112
import { gallery } from '../fields/gallery.js'
13+
import { offer } from '../fields/offer.js'
1214
import { documents } from '../fields/documents.js'
1315
import { body } from '../fields/body.js'
1416
import {t} from "../i18n/translater.js";
@@ -35,11 +37,13 @@ const realestates = {
3537
isNotIndex,
3638
draft,
3739
date,
40+
reference,
3841
title,
3942
description,
4043
realestates_persons,
4144
realestates_sellers,
4245
realestates_types,
46+
offer,
4347
featured_image,
4448
address,
4549
documents,

admin/app/fields/date.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import {t} from "../i18n/translater.js";
22

33
export const date = {
44
name: 'date',
5-
label: t.fields.date,
5+
label: t.fields.date.title,
66
widget: 'datetime',
77
i18n: 'duplicate'
88
}

admin/app/fields/gallery.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export const gallery = {
1212
fields: [
1313
image_src,
1414
image_alt,
15-
credit,
16-
legend
15+
legend,
16+
credit
1717
]
1818
};

admin/app/fields/offer.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { sold } from './sold.js'
2+
import { price } from './price.js'
3+
import {t} from "../i18n/translater.js";
4+
5+
export const offer = {
6+
name: 'offer',
7+
label: t.fields.offer,
8+
widget: 'object',
9+
required: false,
10+
i18n: true,
11+
collapsed: false,
12+
fields: [
13+
sold,
14+
price
15+
]
16+
}

admin/app/fields/price.js

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 price = {
4+
name: 'price',
5+
label: t.fields.price.label,
6+
hint: t.fields.price.hint,
7+
widget: 'number',
8+
required: false,
9+
i18n: 'duplicate'
10+
}

admin/app/fields/reference.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 reference = {
4+
name: 'reference',
5+
label: t.fields.reference,
6+
widget: 'string',
7+
required: false,
8+
i18n: 'duplicate'
9+
}

admin/app/fields/sold.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 sold = {
4+
name: 'sold',
5+
label: t.fields.sold,
6+
widget: 'boolean',
7+
required: false,
8+
i18n: 'duplicate'
9+
}

admin/app/i18n/en/fields.js

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,12 @@ export const fields = {
6464
cta_second: "Secondary button",
6565
darken: "Darken image",
6666
datas: "Datas",
67-
date: "Publication date",
67+
date: {
68+
from: "From",
69+
publish: "Publication date",
70+
title: "Date",
71+
to: "To"
72+
},
6873
description: "Description",
6974
direction: {
7075
label: "Direction",
@@ -80,6 +85,7 @@ export const fields = {
8085
expertises_items: "Expertises",
8186
featured_image: "Featured image",
8287
figure: "Image with legend",
88+
files: "Files",
8389
gallery: "Image gallery",
8490
grid: {
8591
label: "Width on grid",
@@ -145,6 +151,7 @@ export const fields = {
145151
label: "Icon",
146152
hint: "Name of the icon, doc : https://fonts.google.com/icons?icon.set=Material+Icons"
147153
},
154+
offer: "Offer",
148155
offset: {
149156
label: "Offset",
150157
options: {
@@ -166,6 +173,11 @@ export const fields = {
166173
posts: "News",
167174
prefix: "Prefix",
168175
press: "Article source",
176+
price: {
177+
label: "Price",
178+
hint: "ex: 300000 (for 300 000 €)",
179+
sold: "Sold price"
180+
},
169181
projects: "Projects",
170182
projects_tags: "Tags",
171183
projects_types: "Types",
@@ -181,13 +193,15 @@ export const fields = {
181193
},
182194
realestates_sellers: "Seller",
183195
realestates_types: "Type of property",
196+
reference: "Reference",
184197
section: "Type of section",
185198
show_color: {
186199
label: "Display colors on gauge?",
187200
hint: "Color in red, yellow or green in function of value (if gauge checked)"
188201
},
189202
show_gauge: "Display a progress gauge?",
190203
show_more: "Display a button to discover more elements?",
204+
sold: "Sold?",
191205
state: {
192206
label: "State",
193207
options: {

admin/app/i18n/fr/fields.js

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,12 @@ export const fields = {
6464
cta_second: "Second bouton",
6565
darken: "Assombrir l’image",
6666
datas: "Données",
67-
date: "Date de publication",
67+
date: {
68+
from: "De",
69+
publish: "Date de publication",
70+
title: "Date",
71+
to: "à"
72+
},
6873
description: "Description",
6974
direction: {
7075
label: "Direction",
@@ -145,6 +150,7 @@ export const fields = {
145150
label: "Icône",
146151
hint: "Le nom de l’icon, doc : https://fonts.google.com/icons?icon.set=Material+Icons"
147152
},
153+
offer: "Offre",
148154
offset: {
149155
label: "Alignement",
150156
options: {
@@ -166,6 +172,10 @@ export const fields = {
166172
posts: "Actualités",
167173
prefix: "Préfixe",
168174
press: "Source de l’article",
175+
price: {
176+
label: "Prix",
177+
hint: "ex: 300000 (pour 300 000 €)",
178+
},
169179
projects: "Projets",
170180
projects_tags: "Tags",
171181
projects_types: "Types",
@@ -181,13 +191,15 @@ export const fields = {
181191
},
182192
realestates_sellers: "Vendeur du bien",
183193
realestates_types: "Type de bien",
194+
reference: "Référence",
184195
section: "Type de section",
185196
show_color: {
186197
label: "Afficher des couleurs sur les jauges ?",
187198
hint: "Colore en rouge, jaune ou vert en fonction de la valeur (si jauge coché)"
188199
},
189200
show_gauge: "Afficher une jaune de progression ?",
190201
show_more: "Afficher un bouton pour découvrir plus d’éléments ?",
202+
sold: "Vendu ?",
191203
state: {
192204
label: "État",
193205
options: {

0 commit comments

Comments
 (0)