Skip to content

Commit

Permalink
Tweak the new site form texts
Browse files Browse the repository at this point in the history
  • Loading branch information
kazlauskis committed Nov 28, 2024
1 parent a98565e commit 8d02d7f
Show file tree
Hide file tree
Showing 2 changed files with 119 additions and 88 deletions.
7 changes: 3 additions & 4 deletions src/Survey/AreaCount/Area/NewLocationModal/config.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ export const habitatAttr = {
{ title: 'Lawn', data_name: '23581' },
{ title: 'Flowering strip', data_name: '23583' },
{ title: 'Built-up area', data_name: '23585' },
{ title: 'Fallow land, abandonned area (urban)', data_name: '23587' },
{ title: 'Fallow land, abandonned field  (rural)', data_name: '23589' },
{ title: 'Fallow land, abandoned area (urban)', data_name: '23587' },
{ title: 'Fallow land, abandoned field  (rural)', data_name: '23589' },
{ title: 'Field edge', data_name: '23591' },
{ title: 'Arable field', data_name: '23593' },
{ title: 'Grassland / Meadow / Pasture', data_name: '23595' },
Expand Down Expand Up @@ -260,8 +260,7 @@ export const landNumberAttr = {
export const landscapeFeaturesAttr = {
id: 'locAttr:364',
type: 'choice_input',
title:
'What landscape features are located in your observation location and/or within a radius of 50 meters?',
title: 'Landscape features',
multiple: true,
appearance: 'button',
choices: [
Expand Down
200 changes: 116 additions & 84 deletions src/Survey/AreaCount/Area/NewLocationModal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,14 @@ import clsx from 'clsx';
import { Trans as T, useTranslation } from 'react-i18next';
import { z } from 'zod';
import { Capacitor } from '@capacitor/core';
import { Block, Location, Main, PhotoPicker, captureImage } from '@flumens';
import {
Block,
InfoMessage,
Location,
Main,
PhotoPicker,
captureImage,
} from '@flumens';
import { isPlatform } from '@ionic/core';
import {
IonButton,
Expand Down Expand Up @@ -221,95 +228,120 @@ const NewLocationModal = (
</IonHeader>

<Main>
<div className="rounded-list m-3">
<Block {...getBlockAttrs(siteNameAttr)} />

{(isAgroecologyTRANSECT ||
isCAP4GI ||
isVielFalterGarten ||
isUNPplus) && <Block {...getBlockAttrs(siteAreaAttr)} />}

{(isVielFalterGarten || isUNPplus) && (
<Block {...getBlockAttrs(habitatAttr)} />
)}
</div>

{(isAgroecologyTRANSECT || isCAP4GI) && (
<div className="rounded-list m-3">
<Block {...getBlockAttrs(grainsNumberAttr)} />
<Block {...getBlockAttrs(vegetablesNumberAttr)} />
<Block {...getBlockAttrs(rapeseedNumberAttr)} />
<Block {...getBlockAttrs(cornNumberAttr)} />
<Block {...getBlockAttrs(legumesNumberAttr)} />
<Block {...getBlockAttrs(croppingNumberAttr)} />
<Block {...getBlockAttrs(fallowNumberAttr)} />
<Block {...getBlockAttrs(managedGrasslandNumberAttr)} />
<Block {...getBlockAttrs(grasslandNumberAttr)} />
<Block {...getBlockAttrs(orchardNumberAttr)} />
<Block {...getBlockAttrs(orchardManagedNumberAttr)} />
<Block {...getBlockAttrs(numberAttr)} />
<Block {...getBlockAttrs(wastelandNumberAttr)} />
<Block {...getBlockAttrs(woodlandNumberAttr)} />
<Block {...getBlockAttrs(forestNumberAttr)} />
<Block {...getBlockAttrs(plantationNumberAttr)} />
<Block {...getBlockAttrs(gardenNumberAttr)} />
<Block {...getBlockAttrs(gardensNumberAttr)} />
<Block {...getBlockAttrs(buildingsNumberAttr)} />
<Block {...getBlockAttrs(waterNumberAttr)} />
<Block {...getBlockAttrs(riverNumberAttr)} />
<Block {...getBlockAttrs(wetlandNumberAttr)} />
<Block {...getBlockAttrs(landNumberAttr)} />
<div className="m-3 flex flex-col gap-3">
<div className="rounded-list">
<Block {...getBlockAttrs(siteNameAttr)} />

{(isAgroecologyTRANSECT ||
isCAP4GI ||
isVielFalterGarten ||
isUNPplus) && (
<>
<Block {...getBlockAttrs(siteAreaAttr)} />
<InfoMessage inline>
Approximate size of your observation site.
</InfoMessage>
</>
)}

{(isVielFalterGarten || isUNPplus) && (
<Block {...getBlockAttrs(habitatAttr)} />
)}
</div>
)}

<div className="rounded-list m-3">
{(isAgroecologyTRANSECT || isCAP4GI) && (
<>
<Block {...getBlockAttrs(landscapeFeaturesAttr)} />
<Block
record={newLocation}
block={otherLandscapeFeaturesAttr}
/>
</>
)}

{(isVielFalterGarten || isUNPplus) && (
<>
<Block {...getBlockAttrs(treeNumberAttr)} />
<Block {...getBlockAttrs(grassProportionAttr)} />
</>
<div>
<h3 className="list-title">
<T>Habitats/land uses (total should be 100%)</T>
</h3>
<div className="rounded-list">
<Block {...getBlockAttrs(grainsNumberAttr)} />
<Block {...getBlockAttrs(vegetablesNumberAttr)} />
<Block {...getBlockAttrs(rapeseedNumberAttr)} />
<Block {...getBlockAttrs(cornNumberAttr)} />
<Block {...getBlockAttrs(legumesNumberAttr)} />
<Block {...getBlockAttrs(croppingNumberAttr)} />
<Block {...getBlockAttrs(fallowNumberAttr)} />
<Block {...getBlockAttrs(managedGrasslandNumberAttr)} />
<Block {...getBlockAttrs(grasslandNumberAttr)} />
<Block {...getBlockAttrs(orchardNumberAttr)} />
<Block {...getBlockAttrs(orchardManagedNumberAttr)} />
<Block {...getBlockAttrs(numberAttr)} />
<Block {...getBlockAttrs(wastelandNumberAttr)} />
<Block {...getBlockAttrs(woodlandNumberAttr)} />
<Block {...getBlockAttrs(forestNumberAttr)} />
<Block {...getBlockAttrs(plantationNumberAttr)} />
<Block {...getBlockAttrs(gardenNumberAttr)} />
<Block {...getBlockAttrs(gardensNumberAttr)} />
<Block {...getBlockAttrs(buildingsNumberAttr)} />
<Block {...getBlockAttrs(waterNumberAttr)} />
<Block {...getBlockAttrs(riverNumberAttr)} />
<Block {...getBlockAttrs(wetlandNumberAttr)} />
<Block {...getBlockAttrs(landNumberAttr)} />
</div>
</div>
)}

{(isAgroecologyTRANSECT ||
isCAP4GI ||
isVielFalterGarten ||
isUNPplus) && (
<>
<Block {...getBlockAttrs(grassMownAttr)} />
<Block {...getBlockAttrs(fertilizedAttr)} />
<Block {...getBlockAttrs(otherFertilizerAttr)} />
<Block {...getBlockAttrs(pesticidesAttr)} />
<Block {...getBlockAttrs(otherPesticideAttr)} />
</>
)}

{(isVielFalterGarten || isUNPplus) && (
<>
<Block {...getBlockAttrs(speciesAttr)} />
<Block {...getBlockAttrs(landOwnershipAttr)} />
<Block {...getBlockAttrs(responsibleAttr)} />
</>
)}

<Block {...getBlockAttrs(commentAttr)} />
</div>
<div className="rounded-list">
{(isAgroecologyTRANSECT || isCAP4GI) && (
<>
<Block {...getBlockAttrs(landscapeFeaturesAttr)} />
<InfoMessage inline>
Features located within a 50-meter radius.
</InfoMessage>
<Block
record={newLocation}
block={otherLandscapeFeaturesAttr}
/>
</>
)}

{(isVielFalterGarten || isUNPplus) && (
<>
<Block {...getBlockAttrs(treeNumberAttr)} />
<Block {...getBlockAttrs(grassProportionAttr)} />
</>
)}

{(isAgroecologyTRANSECT ||
isCAP4GI ||
isVielFalterGarten ||
isUNPplus) && (
<>
<Block {...getBlockAttrs(grassMownAttr)} />
<Block {...getBlockAttrs(fertilizedAttr)} />
<Block {...getBlockAttrs(otherFertilizerAttr)} />
<Block {...getBlockAttrs(pesticidesAttr)} />
<Block {...getBlockAttrs(otherPesticideAttr)} />
</>
)}

{(isVielFalterGarten || isUNPplus) && (
<>
<Block {...getBlockAttrs(speciesAttr)} />
<Block {...getBlockAttrs(landOwnershipAttr)} />
<Block {...getBlockAttrs(responsibleAttr)} />
</>
)}

<Block {...getBlockAttrs(commentAttr)} />
</div>

<div className="rounded-list m-3">
<PhotoPicker
onAdd={onAddPhoto}
onRemove={onRemovePhoto}
value={photos}
/>
<div>
<h3 className="list-title">
<T>Site photos</T>
</h3>
<div className="rounded-list">
<PhotoPicker
onAdd={onAddPhoto}
onRemove={onRemovePhoto}
value={photos}
/>
<InfoMessage inline>
Optimally in the direction to North, East, South and West.
</InfoMessage>
</div>
</div>
</div>
</Main>
</IonModal>
Expand Down

0 comments on commit 8d02d7f

Please sign in to comment.