| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163 |
- {% extends 'generic/object.html' %}
- {% load helpers %}
- {% load plugins %}
- {% load i18n %}
- {% block content %}
- <div class="row mb-3">
- <div class="col col-md-6">
- <div class="card">
- <h2 class="card-header">{% trans "Custom Field" %}</h2>
- <table class="table table-hover attr-table">
- <tr>
- <th scope="row">{% trans "Name" %}</th>
- <td>{{ object.name }}</td>
- </tr>
- <tr>
- <th scope="row">Type</th>
- <td>
- {{ object.get_type_display }}
- {% if object.related_object_type %}
- ({{ object.related_object_type.model|bettertitle }})
- {% endif %}
- </td>
- </tr>
- <tr>
- <th scope="row">{% trans "Label" %}</th>
- <td>{{ object.label|placeholder }}</td>
- </tr>
- <tr>
- <th scope="row">{% trans "Group Name" %}</th>
- <td>{{ object.group_name|placeholder }}</td>
- </tr>
- <tr>
- <th scope="row">{% trans "Description" %}</th>
- <td>{{ object.description|markdown|placeholder }}</td>
- </tr>
- <tr>
- <th scope="row">{% trans "Required" %}</th>
- <td>{% checkmark object.required %}</td>
- </tr>
- <tr>
- <th scope="row">{% trans "Must be Unique" %}</th>
- <td>{% checkmark object.unique %}</td>
- </tr>
- <tr>
- <th scope="row">{% trans "Cloneable" %}</th>
- <td>{% checkmark object.is_cloneable %}</td>
- </tr>
- {% if object.choice_set %}
- <tr>
- <th scope="row">{% trans "Choice Set" %}</th>
- <td>{{ object.choice_set|linkify }} ({{ object.choice_set.choices|length }} choices)</td>
- </tr>
- {% endif %}
- <tr>
- <th scope="row">{% trans "Default Value" %}</th>
- <td>{{ object.default }}</td>
- </tr>
- <tr>
- <th scope="row">{% trans "Related object filter" %}</th>
- {% if object.related_object_filter %}
- <td><pre>{{ object.related_object_filter|json }}</pre></td>
- {% else %}
- <td>{{ ''|placeholder }}</td>
- {% endif %}
- </tr>
- </table>
- </div>
- <div class="card">
- <h2 class="card-header">{% trans "Behavior" %}</h2>
- <table class="table table-hover attr-table">
- <tr>
- <th scope="row">{% trans "Search Weight" %}</th>
- <td>
- {% if object.search_weight %}
- {{ object.search_weight }}
- {% else %}
- <span class="text-muted">{% trans "Disabled" %}</span>
- {% endif %}
- </td>
- </tr>
- <tr>
- <th scope="row">{% trans "Filter Logic" %}</th>
- <td>{{ object.get_filter_logic_display }}</td>
- </tr>
- <tr>
- <th scope="row">{% trans "Display Weight" %}</th>
- <td>{{ object.weight }}</td>
- </tr>
- <tr>
- <th scope="row">{% trans "UI Visible" %}</th>
- <td>{{ object.get_ui_visible_display }}</td>
- </tr>
- <tr>
- <th scope="row">{% trans "UI Editable" %}</th>
- <td>{{ object.get_ui_editable_display }}</td>
- </tr>
- </table>
- </div>
- {% include 'inc/panels/comments.html' %}
- {% plugin_left_page object %}
- </div>
- <div class="col col-md-6">
- <div class="card">
- <h2 class="card-header">{% trans "Object Types" %}</h2>
- <table class="table table-hover attr-table">
- {% for ct in object.object_types.all %}
- <tr>
- <td>{{ ct }}</td>
- </tr>
- {% endfor %}
- </table>
- </div>
- <div class="card">
- <h2 class="card-header">{% trans "Validation Rules" %}</h2>
- <table class="table table-hover attr-table">
- <tr>
- <th scope="row">{% trans "Minimum Value" %}</th>
- <td>{{ object.validation_minimum|placeholder }}</td>
- </tr>
- <tr>
- <th scope="row">{% trans "Maximum Value" %}</th>
- <td>{{ object.validation_maximum|placeholder }}</td>
- </tr>
- <tr>
- <th scope="row">{% trans "Regular Expression" %}</th>
- <td>
- {% if object.validation_regex %}
- <code>{{ object.validation_regex }}</code>
- {% else %}
- {{ ''|placeholder }}
- {% endif %}
- </td>
- </tr>
- </table>
- </div>
- <div class="card">
- <h2 class="card-header">Related Objects</h2>
- <ul class="list-group list-group-flush" role="presentation">
- {% for qs in related_models %}
- <a class="list-group-item list-group-item-action d-flex justify-content-between">
- {{ qs.model|meta:"verbose_name_plural"|bettertitle }}
- {% with count=qs.count %}
- {% if count %}
- <span class="badge text-bg-primary rounded-pill">{{ count }}</span>
- {% else %}
- <span class="badge text-bg-light rounded-pill">—</span>
- {% endif %}
- {% endwith %}
- </a>
- {% endfor %}
- </ul>
- </div>
- {% plugin_right_page object %}
- </div>
- </div>
- <div class="row">
- <div class="col col-md-12">
- {% plugin_full_width_page object %}
- </div>
- </div>
- {% endblock %}
|