123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340 |
- {% extends "misago/admin/generic/form.html" %}
- {% load i18n misago_admin_form misago_avatars %}
- {% block title %}
- {{ target }} | {{ active_link.name }} | {{ block.super }}
- {% endblock title %}
- {% block page-header %}
- {{ block.super }}
- <small>
- {{ target }}
- </small>
- {% endblock page-header %}
- {% block form-header %}
- {% trans "Edit user" %}
- {% endblock form-header %}
- {% block form-body %}
- <div class="media py-1">
- <a href="{{ target.get_absolute_url }}" class="mr-3">
- <img src="{{ target|avatar:56 }}" class="rounded" alt="{% trans 'Avatar' %}" width="56" height="56">
- </a>
- <div class="media-body">
- <h5 class="mt-0">
- {{ target }}
- {% if target.is_superuser %}
- <span class="badge badge-danger" data-tooltip="top" title="{% trans 'Can use admin control panel and manage other administrators' %}">
- {% trans "Super Admin" %}
- </span>
- {% elif target.is_staff %}
- <span class="badge badge-danger" data-tooltip="top" title="{% trans 'Can use admin control panel' %}">
- {% trans "Admin" %}
- </span>
- {% endif %}
- {% if target.requires_activation_by_admin %}
- <span class="badge badge-primary" data-tooltip="top" title="{% trans 'Requires activation by administrator' %}">
- {% trans "Inactive" %}
- </span>
- {% elif target.requires_activation_by_user %}
- <span class="badge badge-primary" data-tooltip="top" title="{% trans 'Has to activate their account' %}">
- {% trans "Inactive" %}
- </span>
- {% endif %}
- {% if target.is_deleting_account %}
- <span class="badge badge-warning" data-tooltip="top" title="{% trans 'Account scheduled for deletion' %}">
- {% trans "Deleted" %}
- </span>
- {% elif not target.is_active %}
- <span class="badge badge-dark" data-tooltip="top" title="{% trans 'Account disabled' %}">
- {% trans "Disabled" %}
- </span>
- {% endif %}
- </h5>
- <ul class="list-inline">
- <li class="list-inline-item">
- <a href="mailto:{{ target.email }}">
- {{ target.email }}
- </a>
- </li>
- <li class="list-inline-item">
- <span class="">
- {{ target.rank }}
- </li>
- <li class="list-inline-item">
- <span data-timestamp="{{ target.joined_on.isoformat }}" data-format="LL">
- {{ target.joined_on }}
- </span>
- </li>
- {% if item.joined_from_ip %}
- <li class="list-inline-item">
- {{ item.joined_from_ip }}
- </li>
- {% endif %}
- <li class="list-inline-item">
- {% blocktrans trimmed count posts=target.posts %}
- {{ posts }} post
- {% plural %}
- {{ posts }} posts
- {% endblocktrans %}
- </li>
- <li class="list-inline-item">
- {% blocktrans trimmed count threads=target.threads %}
- {{ threads }} thread
- {% plural %}
- {{ threads }} threads
- {% endblocktrans %}
- </li>
- </ul>
- </div>
- </div>
- <div class="fieldset-border">
- <fieldset>
- <legend>{% trans "Basic account settings" %}</legend>
- {% form_row form.username %}
- {% if 'rank' in form.fields %}
- {% form_row form.rank %}
- {% endif %}
- {% form_row form.title %}
- {% form_row form.roles %}
- {% if 'staff_level' in form.fields %}
- {% form_row form.staff_level %}
- {% endif %}
- </fieldset>
- </div>
- <div class="fieldset-border">
- <fieldset>
- <legend>{% trans "Administrator status" %}</legend>
- {% if 'is_staff' in form.fields %}
- {% form_row form.is_staff %}
- {% form_row form.is_superuser %}
- {% else %}
- <div id="div_id_is_staff" class="form-group">
- <label for="id_is_staff_0" class="control-label {{ label_class }}">
- {{ form.IS_STAFF_LABEL }}:
- </label>
- <div class="{{ field_class }}">
- <p class="form-control-static">
- {% if target.is_staff %}
- <strong class="text-primary">{% trans "Yes" %}</strong>
- {% else %}
- <strong class="text-muted">{% trans "No" %}</strong>
- {% endif %}
- </p>
- <small class="form-text text-muted" id="hint_id_is_staff">
- {{ form.IS_STAFF_HELP_TEXT }}
- </small>
- </div>
- </div>
- <div id="div_id_is_superuser" class="form-group">
- <label for="id_is_superuser_0" class="control-label {{ label_class }}">
- {{ form.IS_SUPERUSER_LABEL }}:
- </label>
- <div class="{{ field_class }}">
- <p class="form-control-static">
- {% if target.is_superuser %}
- <strong class="text-primary">{% trans "Yes" %}</strong>
- {% else %}
- <strong class="text-muted">{% trans "No" %}</strong>
- {% endif %}
- </p>
- <small class="form-text text-muted" id="hint_id_is_superuser">
- {{ form.IS_SUPERUSER_HELP_TEXT }}
- </small>
- </div>
- </div>
- <p class="text-center">
- <strong>{% trans "Note" %}:</strong>
- {% trans "Only superusers can change other users administrator status." %}
- </p>
- {% endif %}
- </fieldset>
- </div>
- <div class="fieldset-border">
- <fieldset>
- <legend>{% trans "Sign-in credentials" %}</legend>
- {% form_row form.email %}
- {% form_row form.new_password %}
- {% if not target.has_usable_password %}
- <div id="div_id_has_usable_password" class="form-group">
- <div class="{{ field_class }} col-md-offset-3">
- <p class="form-control-static">
- {% trans "This user has not set account password and uses other service to authenticate." %}
- </p>
- </div>
- </div>
- {% endif %}
- </fieldset>
- </div>
- <div class="fieldset-border">
- <fieldset>
- <legend>{% trans "Avatar" %}</legend>
- {% form_row form.is_avatar_locked %}
- {% form_row form.avatar_lock_user_message %}
- {% form_row form.avatar_lock_staff_message %}
- </fieldset>
- </div>
- <div class="fieldset-border">
- <fieldset>
- <legend>{% trans "Signature" %}</legend>
- {% form_row form.signature %}
- {% form_row form.is_signature_locked %}
- {% form_row form.signature_lock_user_message %}
- {% form_row form.signature_lock_staff_message %}
- </fieldset>
- </div>
- {% for group in form.get_profile_fields_groups %}
- <div class="fieldset-border">
- <fieldset>
- <legend>{% trans group.name %}</legend>
- {% for field in group.fields %}
- {% form_row field %}
- {% endfor %}
- </fieldset>
- </div>
- {% endfor %}
- <div class="fieldset-border">
- <fieldset>
- <legend>{% trans "Forum options" %}</legend>
- {% form_row form.is_hiding_presence %}
- {% form_row form.limits_private_thread_invites_to %}
- </fieldset>
- </div>
- <div class="fieldset-border">
- <fieldset>
- <legend>{% trans "Automatic subscription preferences" %}</legend>
- {% form_row form.subscribe_to_started_threads %}
- {% form_row form.subscribe_to_replied_threads %}
- </fieldset>
- </div>
- <div class="fieldset-border">
- <fieldset>
- <legend>{% trans "Account status" %}</legend>
- {% if target.is_deleting_account %}
- <div id="div_id_is_deleting_account" class="form-group">
- <label for="id_is_ais_deleting_account_0" class="control-label {{ label_class }}">
- {{ form.IS_ACTIVE_LABEL }}:
- </label>
- <div class="{{ field_class }}">
- <p class="form-control-static">
- <strong class="text-danger">
- {% trans "This user is deleting their account. It has been deactivated for the duration of the process." %}
- </strong>
- </p>
- <small class="form-text text-muted" id="div_id_is_deleting_account">
- {% trans "No additional action is required. This account will be deleted automatically." %}
- </small>
- </div>
- </div>
- {% else %}
- {% if 'is_active' in form.fields %}
- {% form_row form.is_active %}
- {% form_row form.is_active_staff_message %}
- {% else %}
- <div id="div_id_is_active" class="form-group">
- <label for="id_is_active_0" class="control-label {{ label_class }}">
- {{ form.IS_ACTIVE_LABEL }}:
- </label>
- <div class="{{ field_class }}">
- <p class="form-control-static">
- {% if target.is_active %}
- <strong class="text-success">{% trans "Yes" %}</strong>
- {% else %}
- <strong class="text-danger">{% trans "No" %}</strong>
- {% endif %}
- </p>
- <small class="form-text text-muted" id="hint_id_is_active">
- {{ form.IS_ACTIVE_HELP_TEXT }}
- </small>
- </div>
- </div>
- <div id="div_id_is_superuser" class="form-group">
- <label for="id_is_superuser_0" class="control-label {{ label_class }}">
- {{ form.IS_ACTIVE_STAFF_MESSAGE_LABEL }}:
- </label>
- <div class="{{ field_class }}">
- <div class="form-control-static">
- {% if target.is_active_staff_message %}
- {{ target.is_active_staff_message|force_escape|urlize|linebreaks }}
- {% else %}
- <em>{% trans "No staff message is available." %}</em>
- {% endif %}
- </div>
- <small class="form-text text-muted" id="hint_id_is_superuser">
- {{ form.IS_ACTIVE_STAFF_MESSAGE_HELP_TEXT }}
- </small>
- </div>
- </div>
- {% endif %}
- {% endif %}
- </fieldset>
- </div>
- <div class="fieldset-border">
- <fieldset>
- <legend>{% trans "Agreements" %}</legend>
- <div class="card card-admin-table">
- <table class="table">
- <thead>
- <tr>
- <th>{% trans "Agreement" %}</th>
- <th style="width: 250px;">{% trans "Type" %}</th>
- <th style="width: 250px;">{% trans "Accepted on" %}</th>
- </tr>
- </thead>
- <tbody>
- {% for agreement in target.useragreement_set.select_related.iterator %}
- <tr>
- <td class="small">
- <a href="{% url 'misago:admin:users:agreements:edit' pk=agreement.agreement_id %}" class="item-name">
- {{ agreement.agreement.get_final_title }}
- </a>
- </td>
- <td class="small">
- {{ agreement.agreement.get_type_display }}
- </td>
- <td class="small">
- <abbr data-timestamp="{{ agreement.accepted_on.isoformat }}" data-format="LL">
- {{ agreement.accepted_on }}
- </abbr>
- </td>
- </tr>
- {% empty %}
- <tr>
- <td colspan="3">
- {% trans "This user didn't accept any agreements." %}
- </td>
- </tr>
- {% endfor %}
- </tbody>
- </table>
- </div>
- </fieldset>
- </div>
- {% endblock form-body %}
|