{% comment %} This window loads the list of inactive widgets in the template and does not need to update from the server, hence it's loaded in the template to simplify html generation and cut the unnecessary network traffic that a dynamically-loaded list of widgets would create. There are essentially two sections: widgets which belong to a product and widgets that don't. There's potentially a rendering bug in the code as a result of the many-to-many relationship between products and jobs. A job can belong to multiple products, but the logic for manipulating widgets with this window wasn't *designed* with this in consideration. I've run out of time to investigate and test this, but it's something to look out for. Try activating an inactive job which belongs to multiple products and check that the resulting behavior makes sense. {% endcomment %}
{% for product in products %} {% if product.jobs %}
{{ product.productname }}
    {% for widget in product.jobs %}
  • {{ widget.displayname}}
    Activate
    Delete
  • {% endfor %}
{% endif %} {% endfor %} {% for widget in productless_widgets %}
{{ widget.displayname}}
Activate
Delete
{% endfor %}