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

Commit 7beeb4e

Browse files
committed
Add diagnostic field to realestates
1 parent 9ae34a5 commit 7beeb4e

File tree

6 files changed

+44
-1
lines changed

6 files changed

+44
-1
lines changed

admin/app.css

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,19 @@ div[id^=documents-field] {
334334
width: 49%;
335335
}
336336

337+
/* Diagnostic */
338+
[id^=diagnostic-field] {
339+
background-color: var(--lightgrey) !important;
340+
}
341+
[id^=diagnostic-field] > div + div:not([class^=css]) {
342+
display: flex;
343+
flex-wrap: wrap;
344+
justify-content: space-between;
345+
}
346+
[id^=diagnostic-field] > div > div {
347+
width: 49%;
348+
}
349+
337350

338351
/* TAXONOMIES */
339352
[class*=-ControlContainer]:has([id^=reference]) {

admin/app/content/realestates.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import { offer } from '../fields/offer.js'
1010
import { informations } from '../fields/realestates-informations.js'
1111
import { address } from '../fields/address.js'
1212
import { keyfeatures } from '../fields/keyfeatures.js'
13+
import { diagnostic } from '../fields/diagnostic.js'
1314
import { documents } from '../fields/documents.js'
1415
import { featured_image } from '../fields/featured-image.js'
1516
import { gallery } from '../fields/gallery.js'
@@ -45,6 +46,7 @@ const realestates = {
4546
realestates_persons,
4647
offer,
4748
informations,
49+
diagnostic,
4850
keyfeatures,
4951
address,
5052
// documents,

admin/app/fields/diagnostic.js

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

admin/app/i18n/en/fields.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,13 @@ export const fields = {
109109
to: "To"
110110
},
111111
description: "Description",
112+
diagnostic: {
113+
label: "Diagnostic",
114+
fields: {
115+
dpe: "DPE: kWh/m2.year",
116+
ges: "GES: CO2/m2.year"
117+
}
118+
},
112119
direction: {
113120
label: "Direction",
114121
options: {

admin/app/i18n/fr/fields.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,13 @@ export const fields = {
109109
to: "à"
110110
},
111111
description: "Description",
112+
diagnostic: {
113+
label: "Diagnostic",
114+
fields: {
115+
dpe: "DPE: kWh/m2.an",
116+
ges: "GES: CO2/m2.an"
117+
}
118+
},
112119
direction: {
113120
label: "Direction",
114121
options: {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "hugolify-netlify-cms",
3-
"version": "1.6.0",
3+
"version": "1.6.1",
44
"homepage": "https://www.hugolify.io",
55
"repository": "https://github.com/hugolify/hugolify-netlify-cms",
66
"bugs": {

0 commit comments

Comments
 (0)