<div class="assign-thread-form">
    <div class="row">
        {% set thread_assigned_user_id = thread.admin_id %}

        <select id="assignedAdmin" name="assignedAdmin" class="chosen assigned">

            {% if not thread_assigned_user_id %}
                <option value="" selected>Unassigned</option>
            {% endif %}

            {% for admin in admins %}
                {% if admin.id %}
                    <option value="{{ admin.id }}"
                            {% if thread_assigned_user_id is defined and admin.id == thread_assigned_user_id %}selected{% endif %}>
                        {{ admin.name }}
                    </option>
                {% endif %}
            {% endfor %}
        </select>
    </div>

    <input type="hidden" name="threadUrl" class="thread-url" value="{{ thread.url }}"/>
    <button type="button" class="submit-assign-thread btn">Assign</button>
</div>
