{% load i18n %}

<div>
    <div class="card mt-4 pt-2 ps-lg-2">
        <h5 class="card-header">{% trans "Property" %} [[ this.$route.params.id ]]</h5>
        <div class="card-body">

            <v-container fluid v-if="object">
                <template v-for="field in headers">
                    <v-row v-if="field.details">
                        <v-col cols="4">
                            <v-subheader>[[ field.text ]]</v-subheader>
                        </v-col>
                        <v-col cols="8">
                            <v-text-field :value="object[field.value]" readonly dense></v-text-field>
                        </v-col>
                    </v-row>
                </template>
            </v-container>

        </div>
    </div>

    <div class="card mt-4 pt-2 ps-lg-2">
        <h5 class="card-header">{% trans "Item Properties" %}</h5>
        <div class="card-body">
            <LinkedPropertyList
                :items="linked_properties"
                :items_headers="linked_properties_headers"
                :items_relations="{'item': all_items, 'property': [object]}"
                :hidden_fields="['name', 'description', 'custom_identifier']"
                :non_editable_fields="[]"
                show_item="item"
                show_url="ItemDetail"
                group-by="property__name"
                @deleteItem="deleteLinkedProperty"
                @createItem="createLinkedProperty"
                @editItem="editLinkedProperty"
            ></LinkedPropertyList>
        </div>
    </div>

    <div class="card mt-4 pt-2 ps-lg-2">
        <h5 class="card-header">{% trans "Relation Properties" %}</h5>
        <div class="card-body">
            <LinkedPropertyList
                :items="relation_properties"
                :items_headers="relation_properties_headers"
                :items_relations="{'item': all_items, 'property': [object]}"
                :hidden_fields="['name', 'description', 'custom_identifier']"
                :non_editable_fields="[]"
                show_item="relation"
                show_url="ItemRelationDetail"
                group-by="property__name"
                @deleteItem="deleteRelationProperty"
                @createItem="createRelationProperty"
                @editItem="editRelationProperty"
            ></LinkedPropertyList>
        </div>
    </div>
</div>
