{% extends "base.html" %} {% comment %}This view is used to sort a list of ``mtp.apps.surveys.Pool`` instances. Pool authors are only displayed if the user is a superuser. It includes ``cms/includes/orderable-head.html`` for the sortable logic in javascript, with the table listing pools having the ``orderable`` class, and displaying the ``sort_order_display`` attribute of the pools. New order is saved via ajax after each change. Context ------- user : instance of ``mtp.apps.accounts.MTPUser`` The user is expected to be a superuser or a trainer. pool_list : queryset of ``mtp.apps.surveys.models.Pool`` It contains all the pools to display. {% endcomment %} {% load i18n %} {% block body_class %}{{ block.super }} page-cms-surveys page-cms-surveys-pools{% endblock %} {% block subtitle %} {% if user.is_superuser %} {% trans 'Sort the global pools of questions' %} {% else %} {% trans 'Sort your pools of questions' %} {% endif %} {% endblock %} {% block actions %} {% trans 'Back to the list of pools' %} {% endblock %} {% block head %} {{ block.super }} {% include "cms/includes/orderable-head.html" %} {% endblock %} {% block main %} {% csrf_token %} {# Only superusers can see pools from many users #} {% if user.is_superuser %} {% endif %} {% for pool in pool_list %} {# Only superusers can see pools from many users #} {% if user.is_superuser %} {% endif %} {% endfor %}
{% trans 'Name'%}{% trans 'Author'%}{% trans 'Order' %}
{{ pool.name }}{{ pool.author }}{{ pool.sort_order_display|safe }}
{% endblock %}