{% load seahub_tags i18n %}
{% load url from future %}
<div id="discuss-to-group" class="hide">
    <form action="{% url 'group_recommend' %}" method="post" id="discuss-to-group-form">{% csrf_token %}
        <h3>{% trans "Post a discussion to group" %}</h3>
        <div class="groups">
            {% for group in groups %}
            <label for="{{ group.id }}" class="checkbox-label">
                <span class="checkbox{% if forloop.first and forloop.last %} checkbox-checked{% endif %}"><input type="checkbox" name="groups" value="{{ group.id }}" id="{{ group.id }}" {% if forloop.first and forloop.last %}checked="checked"{% endif %} class="checkbox-orig"></span>
                <span class="checkbox-option">{{ group.group_name }}</span>
            </label>
            {% endfor %}
        </div>
        <textarea name="message" placeholder="{% trans 'discussion' %}" class="input"></textarea>
        <input type="hidden" name="repo_id" value="{{ repo.id }}" />
        <input type="hidden" name="path" value="{{ path }}" />
        <input type="hidden" name="attach_type" value="{{ attach_type }}" />
        <p class="error hide"></p>
        <input type="submit" id="discuss-submit" class="submit" value="{% trans "Submit"%}" />
        <span class="attachment">
            {% if attach_type == 'dir' %}
            <img src="{{ MEDIA_URL }}img/folder-icon-24.png" alt="{% trans 'Directory icon' %}" height="20" class="vam" />
            {% endif %}

            {% for name,link in zipped %}
                {% if forloop.last %}
                    {% if attach_type == 'file' %}
                    <img src="{{ MEDIA_URL }}img/file/{{ name|file_icon_filter }}" alt="{% trans 'File' %}" height="18" class="vam" />
                    {% endif %}
                <span class="att-name vam">{{ name }}</span>
                {% endif %}
            {% endfor %}
        </span>
    </form>
    <ul id="discussions-to-grp" class="hide"></ul>
</div>
    <div id="discuss-to-group-caret" class="hide">
        <div class="outer-caret">
            <div class="inner-caret"></div>
        </div>
    </div>
