<mvc:View
    xmlns:mvc="sap.ui.core.mvc"
    xmlns="sap.m"
    xmlns:core="sap.ui.core"
    xmlns:l="sap.ui.layout"
    xmlns:f="sap.ui.layout.form"
    controllerName="sap.mcsuite.controller.Settings"
    core:require="{
                        format: 'sap/mcsuite/model/Format',
                        utils: 'sap/mcsuite/model/Utils',
                        translate: 'sap/mcsuite/model/Translate'
                    }"
>
    <VBox
        class="sapUiSmallMargin"
        backgroundDesign="Solid"
        alignContent="SpaceAround"
    >
            <VBox class="sapUiSmallMargin" width="100%" alignItems="Center">
                <Title text="Einstellungen" level='H1'/>
                <f:Form editable="true" id="settingsForm" class="mc-form">  
                    <f:layout>
                        <f:ResponsiveGridLayout
                            labelSpanXL='2'
                            labelSpanL='2'
                            labelSpanM='2'
                            labelSpanS='2'
                            adjustLabelSpan='true'
                            emptySpanXL='0'
                            emptySpanL='4'
                            emptySpanM='0'
                            emptySpanS='0'
                            columnsXL='1'
                            columnsL='1'
                            columnsM='1'
                            singleContainerFullSize='true'
                            />
                    </f:layout>
                    <f:formContainers>
                        <f:FormContainer title="Personendaten">
                            <f:formElements>
                                <f:FormElement label="Name">
                                    <f:fields>
                                        <Input value="{name}"/>
                                    </f:fields>
                                </f:FormElement>
                                <f:FormElement label="Benutzername">
                                    <f:fields>
                                        <Input value="{uname}" editable="false"/>
                                    </f:fields>
                                </f:FormElement>
                                <f:FormElement label="Benutzergruppe">
                                    <f:fields>
                                        <Input value="{team}" editable="false"/>
                                    </f:fields>
                                </f:FormElement>
                                <f:FormElement label="E-Mail">
                                    <f:fields>
                                        <Input value="{email}"/>
                                    </f:fields>
                                </f:FormElement>
                                <f:FormElement label="Telefonnummer">
                                    <f:fields>
                                        <Input value="{phone}"/>
                                    </f:fields>
                                </f:FormElement>
                            </f:formElements>
                        </f:FormContainer>
                        <f:FormContainer title="Regionaleinstellungen">
                            <f:formElements>
                                <f:FormElement label="Sprache">
                                    <f:fields>
                                        <Select id='languageSelect' change="onLanguageChange" selectedKey="{lang}" forceSelection="false" >
                                            <items>
                                                <core:Item key="DE" text="Deutsch"/>
                                                <core:Item key="EN" text="Englisch"/>
                                                <core:Item key="ES" text="Spanisch"/>
                                            </items>
                                        </Select>   
                                    </f:fields>
                                </f:FormElement>
                            </f:formElements>
                        </f:FormContainer>
                    </f:formContainers>
                </f:Form>
                <Button
                    text="Speichern" 
                    press="onSavePress"
                    icon="sap-icon://fa-light/floppy-disk"
                ></Button>
                <Button 
                    text="Personalisierung zurücksetzen"
                    press="onResetPersonalizationPress"
                    icon="sap-icon://fa-light/trash"
                ></Button>
            </VBox>
    </VBox>
</mvc:View>
