<?xml version="1.0" encoding="UTF-8"?>

<?import com.andrewlalis.perfin.view.component.FileSelectionArea?>
<?import com.andrewlalis.perfin.view.component.PropertiesPane?>
<?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?>
<?import javafx.scene.text.Text?>
<?import javafx.scene.text.TextFlow?>
<BorderPane xmlns="http://javafx.com/javafx"
            xmlns:fx="http://javafx.com/fxml"
            fx:controller="com.andrewlalis.perfin.control.CreateBalanceRecordController"
>
    <top>
        <Label text="Create New Balance Record" styleClass="large-font,bold-text,std-padding"/>
    </top>
    <center>
        <VBox styleClass="std-padding,std-spacing" style="-fx-max-width: 500px;" BorderPane.alignment="TOP_LEFT">
            <VBox styleClass="padding-extra,spacing-extra,small-font">
                <TextFlow>
                    <Text styleClass="secondary-color-fill">
                        Create a new recording of the current balance of your
                        account. This will serve as a sort of key-frame; a true,
                        known balance that Perfin will use to derive your account's
                        current balance by applying recent transactions to it.
                    </Text>
                </TextFlow>
                <TextFlow>
                    <Text styleClass="secondary-color-fill">
                        Therefore, it's important to make balance records
                        periodically so that Perfin's calculations are accurate, and
                        it serves as a nice sanity-check to make sure all your
                        transactions add up.
                    </Text>
                </TextFlow>
            </VBox>

            <PropertiesPane vgap="5" hgap="5" fx:id="propertiesPane">
                <Label text="Timestamp" labelFor="${timestampField}" styleClass="bold-text"/>
                <TextField fx:id="timestampField" styleClass="mono-font"/>

                <Label text="Balance" labelFor="${balanceField}" styleClass="bold-text"/>
                <VBox>
                    <TextField fx:id="balanceField" styleClass="mono-font"/>
                    <Label
                            fx:id="balanceWarningLabel"
                            styleClass="warning-color-text-fill,small-font"
                            wrapText="true"
                            text="Balance isn't what Perfin expects, according to your transactions."
                    />
                </VBox>


                <Label text="Attachments" styleClass="bold-text"/>
                <FileSelectionArea fx:id="attachmentSelectionArea" allowMultiple="true"/>
            </PropertiesPane>

            <Separator/>
            <HBox styleClass="std-padding,std-spacing" alignment="CENTER_RIGHT">
                <Button text="Save" fx:id="saveButton" onAction="#save"/>
                <Button text="Cancel" onAction="#cancel"/>
            </HBox>
        </VBox>
    </center>
</BorderPane>
