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

<?import com.andrewlalis.perfin.view.component.AttachmentsViewPane?>
<?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?>
<?import javafx.scene.shape.Circle?>
<BorderPane xmlns="http://javafx.com/javafx"
            xmlns:fx="http://javafx.com/fxml"
            fx:controller="com.andrewlalis.perfin.control.TransactionViewController"
>
    <top>
        <HBox styleClass="std-padding,std-spacing">
            <Label fx:id="titleLabel" styleClass="large-font,bold-text"/>
        </HBox>
    </top>
    <center>
        <ScrollPane fitToHeight="true" fitToWidth="true">
            <VBox styleClass="std-padding,std-spacing">
                <PropertiesPane vgap="5" hgap="5">
                    <columnConstraints>
                        <ColumnConstraints minWidth="100" halignment="LEFT" hgrow="NEVER"/>
                        <ColumnConstraints hgrow="ALWAYS" halignment="LEFT"/>
                    </columnConstraints>
                    <Label text="Amount" styleClass="bold-text"/>
                    <Label fx:id="amountLabel" styleClass="mono-font"/>

                    <Label text="Timestamp" styleClass="bold-text"/>
                    <Label fx:id="timestampLabel" styleClass="mono-font"/>

                    <Label text="Description" styleClass="bold-text"/>
                    <Label fx:id="descriptionLabel" wrapText="true" style="-fx-min-height: 100px;" alignment="TOP_LEFT"/>
                </PropertiesPane>

                <PropertiesPane vgap="5" hgap="5">
                    <columnConstraints>
                        <ColumnConstraints minWidth="100" halignment="LEFT" hgrow="NEVER"/>
                        <ColumnConstraints hgrow="ALWAYS" halignment="LEFT"/>
                    </columnConstraints>
                    <Label text="Vendor" styleClass="bold-text"/>
                    <Label fx:id="vendorLabel"/>
                </PropertiesPane>

                <PropertiesPane vgap="5" hgap="5">
                    <columnConstraints>
                        <ColumnConstraints minWidth="100" halignment="LEFT" hgrow="NEVER"/>
                        <ColumnConstraints hgrow="ALWAYS" halignment="LEFT"/>
                    </columnConstraints>
                    <Label text="Category" styleClass="bold-text"/>
                    <HBox styleClass="std-spacing">
                        <Circle radius="8" fx:id="categoryColorIndicator"/>
                        <Label fx:id="categoryLabel"/>
                    </HBox>
                </PropertiesPane>

                <PropertiesPane vgap="5" hgap="5">
                    <columnConstraints>
                        <ColumnConstraints minWidth="100" halignment="LEFT" hgrow="NEVER"/>
                        <ColumnConstraints hgrow="ALWAYS" halignment="LEFT"/>
                    </columnConstraints>
                    <Label text="Tags" styleClass="bold-text"/>
                    <Label fx:id="tagsLabel"/>
                </PropertiesPane>

                <VBox>
                    <TextFlow>
                        <Text text="Debited to"/>
                        <Hyperlink fx:id="debitAccountLink"/>
                    </TextFlow>
                    <TextFlow>
                        <Text text="Credited from"/>
                        <Hyperlink fx:id="creditAccountLink"/>
                    </TextFlow>
                </VBox>

                <VBox styleClass="std-spacing">
                    <Label text="Line Items" styleClass="bold-text"/>
                    <VBox fx:id="lineItemsVBox" styleClass="std-spacing"/>
                </VBox>

                <AttachmentsViewPane fx:id="attachmentsViewPane"/>
                <HBox styleClass="std-padding,std-spacing" alignment="CENTER_LEFT">
                    <Button text="Edit" onAction="#editTransaction"/>
                    <Button text="Delete" onAction="#deleteTransaction"/>
                </HBox>
            </VBox>
        </ScrollPane>
    </center>
</BorderPane>
