{% extends 'generic/object.html' %}
{% load static %}
{% load custom_object_buttons %}
{% load custom_links %}
{% load helpers %}
{% load perms %}
{% load plugins %}
{% load render_table from django_tables2 %}
{% load tabs %}
{% load i18n %}
{% load custom_object_utils %}
{% load custom_object_tab_tags %}
{% block breadcrumbs %}
{% plugin_buttons object %}
{% block control-buttons %}
{% block extra_controls %}{% endblock %}
{# Default buttons #}
{% if perms.extras.add_bookmark and object.bookmarks %}
{% custom_object_bookmark_button object %}
{% endif %}
{% if perms.extras.add_subscription and object.subscriptions %}
{% custom_object_subscribe_button object %}
{% endif %}
{% if request.user|can_add:object %}
{% custom_object_clone_button object %}
{% endif %}
{% if request.user|can_change:object %}
{% custom_object_edit_button object %}
{% endif %}
{% if request.user|can_delete:object %}
{% custom_object_delete_button object %}
{% endif %}
{% endblock %}
{# Custom links #}
{% block custom-links %}
{% custom_links object %}
{% endblock custom-links %}
{% endblock controls %}
{% block tabs %}
| {% trans "Type" %} |
{{ object.custom_object_type|linkify:"display_name" }} |
{% for group_name, group_fields in field_groups.items %}
{% if group_name %}
{% endif %}
{% for field in group_fields %}
{% with is_visible_in_ui=object|get_field_is_ui_visible:field %}
{% if field.is_single_value and is_visible_in_ui %}
|
{{ field }}
{% if field.description %}
{% endif %}
|
{% if field.type == 'coordinates' %}
{% with coords=object|get_field_value:field %}
{% if coords %}
{{ coords }}
{% with map_url=object|get_coordinate_map_url:field %}
{% if map_url %}
{% trans "Map" %}
{% endif %}
{% endwith %}
{% else %}
{{ ''|placeholder }}
{% endif %}
{% endwith %}
{% elif field.type == 'color' %}
{% with color=object|get_field_value:field %}
{% if color %}
{% include 'ui/attrs/color.html' with value=color %}
{% else %}
{{ ''|placeholder }}
{% endif %}
{% endwith %}
{% elif field.type == 'url' %}
{% with url_html=object|get_url_field_html:field %}
{% if url_html %}
{{ url_html }}
{% else %}
{{ ''|placeholder }}
{% endif %}
{% endwith %}
{% else %}
{% customfield_value field object|get_field_value:field %}
{% endif %}
|
{% endif %}
{% endwith %}
{% endfor %}
{% endfor %}
{% plugin_left_page object %}
{% include 'inc/panels/tags.html' %}
{% plugin_right_page object %}
{% for group_name, group_fields in field_groups.items %}
{% for field in group_fields %}
{% if field.many %}
{% with field_values=object|get_child_relations:field is_visible_in_ui=object|get_field_is_ui_visible:field %}
{% if is_visible_in_ui %}
{% if field.is_polymorphic %}
| {% trans "Type" %} |
{% trans "Object" %} |
{% endif %}
{% for relation in field_values.all %}
{% if field.is_polymorphic %}| {{ relation|meta:"verbose_name" }} | {% endif %}
{{ relation|linkify }} |
{% endfor %}
{% endif %}
{% endwith %}
{% endif %}
{% endfor %}
{% endfor %}