{% extends 'generic/object_detail.html' %}
{% load buttons %}
{% load helpers %}

{% block content_left_page %}
            <div class="panel panel-default">
                <div class="panel-heading">
                    <strong>Custom Field</strong>
                </div>
                <table class="table table-hover panel-body attr-table">
                    <tr>
                        <td>Label</td>
                        <td><span>{{ object.label }}</span></td>
                    </tr>
                    <tr>
                        <td>Key</td>
                        <td><span>{{ object.key }}</span></td>
                    </tr>
                    <tr>
                        <td>Type</td>
                        <td><span>{{ object.type | capfirst }}</span></td>
                    </tr>
                    <tr>
                        <td>Weight</td>
                        <td><span>{{ object.weight }}</span></td>
                    </tr>
                    <tr>
                        <td>Grouping</td>
                        <td><span>{{ object.grouping | placeholder }}</span></td>
                    </tr>
                    <tr>
                        <td>Description</td>
                        <td><span>{{ object.description | render_markdown | placeholder }}</span></td>
                    </tr>
                    <tr>
                        <td>Required</td>
                        <td>{{ object.required | render_boolean }}</td>
                    </tr>
                    <tr>
                        <td>Default</td>
                        <td><span>{{ object.default }}</span></td>
                    </tr>
                    <tr>
                        <td>Filter Logic</td>
                        <td><span>{{ object.filter_logic | capfirst }}</span></td>
                    </tr>
                    <tr>
                        <td>Move to Advanced Tab</td>
                        <td><span>{{ object.advanced_ui | render_boolean }}</span></td>
                    </tr>
                </table>
            </div>
            {% if object.custom_field_choices.exists %}
            <div class="panel panel-default">
                <div class="panel-heading">
                    <strong>Custom Field Choices</strong>
                </div>
                <table class="table table-hover panel-body attr-table">
                    <thead>
                        <tr>
                            <th>Value</th>
                            <th>Weight</th>
                        </tr>
                    </thead>
                    <tbody>
                    {% for choice in object.custom_field_choices.all %}
                        <tr>
                            <td>{{ choice.value }}</td>
                            <td>{{ choice.weight }}</td>
                        </tr>
                    {% endfor %}
                    </tbody>
                </table>
            </div>
            {% endif %}
{% endblock content_left_page %}

{% block content_right_page %}
            <div class="panel panel-default">
                <div class="panel-heading">
                    <strong>Assignment</strong>
                </div>
                <table class="table table-hover panel-body attr-table">
                    <tr>
                        <td>Content Types</td>
                        <td>
                            <ul>
                                {% for ct in object.content_types.all %}
                                    <li>{{ ct }}</li>
                                {% endfor %}
                            </ul>
                        </td>
                    </tr>
                </table>
            </div>
            <div class="panel panel-default">
                <div class="panel-heading">
                    <strong>Validation Rules</strong>
                </div>
                <table class="table table-hover panel-body attr-table">
                    <tr>
                        <td>Minimum Value</td>
                        <td><span>{{ object.validation_minimum | placeholder }}</span></td>
                    </tr>
                    <tr>
                        <td>Maximum Value Type</td>
                        <td><span>{{ object.validation_maximum | placeholder }}</span></td>
                    </tr>
                    <tr>
                        <td>Validation Regex</td>
                        <td>
                            {% if object.validation_regex %}
                                <code>{{ object.validation_regex | placeholder }}</code>
                            {% else %}
                                <span>{{ object.validation_regex | placeholder }}</span>
                            {% endif %}
                        </td>
                    </tr>
                </table>
            </div>
{% endblock content_right_page %}
