{% extends "spider_base/base.html" %} {# inherits NOT from nouc_base #} {% load i18n static spider_rdf spider_base %} {% block title %}{% if object %}{% if object.is_index %}{% blocktrans trimmed %} Change Login Protection{% endblocktrans %}{% else %}{% blocktrans trimmed %} Change Component {% endblocktrans %}{% endif %}{% else %}{% blocktrans trimmed %} Create Component {% endblocktrans %}{% endif %}{% endblock %} {% block extrahead %} {{block.super}} {{form.media|safe}} {% endblock %} {# public_meta not required because it will never be used #} {% block main_classes %}{{block.super}} {% if not object %}w3-sand{% else %}w3-card-4 color-front-{{object.strength}}{% endif %} spkc-content{% endblock %} {% block body_class %}{{block.super}} {% if not object %}w3-light-grey{% else %}color-back-{{object.strength}}{% endif %}{% endblock %} {% block content %}
{% if object %} {% trans "Contents" %} {% endif %} {% trans 'Own' %} {% if object %} {% trans 'Share' %} {% if not object.is_index %}
{% trans 'Delete' %}
{% endif %}
{% trans "Strength" %}: {{object.strength}}
{% endif %}

{% if object and form.instance.is_index %} {% trans 'Change Login Protection' %} {% elif object %} {% blocktrans trimmed %} Change Component {% endblocktrans %}: {{form.instance}} {% else %} {% trans 'Create new Component' %} {% endif %}

{% if object %} {% endif %} {% include "spider_base/partials/form_errors.html" with form=form %}
{% csrf_token %} {% if object %}

{% trans 'Add new content' %}

{% include "spider_base/partials/content_variants_box.html" with open=True uc=object %}
{% endif %}

{% if form.instance.id and form.instance.is_index %} {% trans 'Login Protection' %} {% else %} {% trans 'User Component' %} {% endif %}

{% if object %}
{% for token in object.authtokens.all %} {% token_expires object token as expire_date %} {% endfor %}

{% trans 'Active Tokens' %}

{% trans 'Token' %} {% trans 'Valid till / Referrer' %} {% trans 'Delete' %}
{{token}} {% if token.persist >= 0 %}
{{token.referrer}} {% else %} {{expire_date|date:"D, d/m/Y"}}{% if token.referrer %}
{{token.referrer}}{% endif %} {% endif %}
{# onchange would be also triggered by reset, so use click instead #}
{% endif %} {% include "spider_base/partials/base_form.html" with form=form %}
{% if form.instance.id %} {% endif %}

{% trans 'Protections' %}

{% for prot in form.protections %}

{{prot}}

{% include "spider_base/partials/base_form.html" with form=prot %}
{% empty%}
{% trans 'No protections: create component first' %}
{% endfor %}
{% if object %} {% trans "Contents" %} {% endif %}
{% endblock %} {% block outercontent %} {% if object %} {% include "spider_base/partials/modalpresenter.html" with uc=object %} {% endif %} {% endblock %}