{% macro render_public_protection_message() -%}
    <div class="action-box for-form protection-message public-protection-message accept">
        <div class="section">
            <div class="icon icon-unlocked"></div>
            <div class="text">
                <div class="label">
                    {% trans %}Public{% endtrans %}
                </div>
                <div>
                    {% trans -%}
                        This object is publicly accessible since it is set as public.
                    {%- endtrans %}
                </div>
            </div>
        </div>
    </div>
{%- endmacro %}

{% macro render_protected_protection_message() -%}
    <div class="action-box for-form protection-message protected-protection-message danger">
        <div class="section">
            <div class="icon icon-lock"></div>
            <div class="text">
                <div class="label">
                    {% trans %}Protected{% endtrans %}
                </div>
                <div class="has-acl">
                    {% trans -%}
                        This object is <strong>only</strong> accessible by the <strong>users specified</strong> above and the <strong>managers</strong> of <strong>parent resources</strong>.
                    {%- endtrans %}
                </div>
                <div class="no-acl">
                    {% trans -%}
                        This object is <strong>only</strong> accessible by the <strong>managers</strong> of <strong>parent resources</strong>.
                    {%- endtrans %}
                </div>
            </div>
        </div>
    </div>
{%- endmacro %}

{% macro render_inherited_protection_message(parent, parent_type) -%}
    <div class="action-box for-form protection-message inheriting-protection-message {%- if parent.is_protected %} warning{% else %} accept{% endif %}">
        <div class="section">
            <div class="icon {%- if parent.is_protected %} icon-lock{% else %} icon-unlocked{% endif %}"></div>
            <div class="text">
                {% if parent.is_protected %}
                    <div class="label">
                        {% trans %}Protected{% endtrans %}
                    </div>
                    <div>
                        {% trans parent_type=parent_type, parent_title = parent.title -%}
                            This object is not publicly accessible since <strong>{{ parent_title }}</strong> ({{ parent_type }}) is protected.
                        {%- endtrans %}
                    </div>
                {% else %}
                    <div class="label">
                        {% trans %}Public{% endtrans %}
                    </div>
                    <div>
                        {% trans parent_type=parent_type, parent_title=parent.title -%}
                            This object is publicly accessible since <strong>{{ parent_title }}</strong> ({{ parent_type }}) is not protected.
                        {%- endtrans %}
                    </div>
                {% endif %}
            </div>
        </div>
    </div>
    <div class="inheriting-acl-message"></div>
{%- endmacro %}

{% macro render_unlisted_event_protection_message() -%}
    <div class="action-box for-form protection-message unlisted-event-protection-message danger">
        <div class="section">
            <div class="icon icon-lock"></div>
            <div class="text">
                <div class="label">
                    {% trans %}Unlisted event{% endtrans %}
                </div>
                <div>
                    {% trans -%}
                        This object is <strong>only</strong> accessible by the <strong>users specified</strong> above. The protection mode can be configured once the event has been published in a category.
                    {%- endtrans %}
                </div>
            </div>
        </div>
    </div>
{%- endmacro %}

{%- macro render_non_inheriting_children_message(protected_object, non_inheriting_objects) -%}
    {% if non_inheriting_objects %}
        <div class="action-box for-form highlight">
            <div class="section">
                <div class="icon icon-shield"></div>
                <div class="text">
                    <div class="label">
                        {% trans %}Children with different protection{% endtrans %}
                    </div>
                    <div>
                        {% trans -%}
                            Some elements inside this object have different protection settings.
                        {%- endtrans %}
                        <strong>
                            <a data-href="{{ url_for('event_management.show_non_inheriting', protected_object) }}"
                               data-title="{% trans %}Protection details{% endtrans %}"
                               data-ajax-dialog>
                                {%- trans %}Show them.{% endtrans -%}
                            </a>
                        </strong>
                    </div>
                </div>
            </div>
        </div>
    {% endif %}
{%- endmacro -%}
