Add wedding and divorce inputs
This commit is contained in:
@ -21,6 +21,9 @@ import { PropertiesBox } from "../../widgets/PropertiesBox";
|
||||
import { RouterLink } from "../../widgets/RouterLink";
|
||||
import { MemberInput } from "../../widgets/forms/MemberInput";
|
||||
import { UploadPhotoButton } from "../../widgets/forms/UploadPhotoButton";
|
||||
import { PropSelect } from "../../widgets/forms/SelectInput";
|
||||
import { ServerApi } from "../../api/ServerApi";
|
||||
import { DateInput } from "../../widgets/forms/DateInput";
|
||||
|
||||
/**
|
||||
* Create a new couple route
|
||||
@ -357,6 +360,48 @@ export function CouplePage(p: {
|
||||
filter={(m) => m.sex === "F" || m.sex === undefined}
|
||||
current={couple.wife}
|
||||
/>
|
||||
|
||||
{/* State */}
|
||||
<PropSelect
|
||||
editing={p.editing}
|
||||
label="Status"
|
||||
value={couple.state}
|
||||
onValueChange={(s) => {
|
||||
couple.state = s;
|
||||
updatedCouple();
|
||||
}}
|
||||
options={ServerApi.Config.couples_states.map((s) => {
|
||||
return { label: s.fr, value: s.code };
|
||||
})}
|
||||
/>
|
||||
|
||||
{/* Wedding day */}
|
||||
<DateInput
|
||||
label="Date du mariage"
|
||||
editable={p.editing}
|
||||
id="dow"
|
||||
value={couple.dateOfWedding}
|
||||
onValueChange={(d) => {
|
||||
couple.wedding_year = d.year;
|
||||
couple.wedding_month = d.month;
|
||||
couple.wedding_day = d.day;
|
||||
updatedCouple();
|
||||
}}
|
||||
/>
|
||||
|
||||
{/* Divorce day */}
|
||||
<DateInput
|
||||
label="Date du divorce"
|
||||
editable={p.editing}
|
||||
id="dod"
|
||||
value={couple.dateOfDivorce}
|
||||
onValueChange={(d) => {
|
||||
couple.divorce_year = d.year;
|
||||
couple.divorce_month = d.month;
|
||||
couple.divorce_day = d.day;
|
||||
updatedCouple();
|
||||
}}
|
||||
/>
|
||||
</PropertiesBox>
|
||||
</Grid>
|
||||
|
||||
|
Reference in New Issue
Block a user