{% load i18n cosinnus_tags %}

{% captureas label %}

	<p>{% blocktrans %}Check the projects/groups where you wish to show this item in. It will be shown in all lists, but will still remain in this group.{% endblocktrans %}</p>
	{% if reflect_is_forum %}
        <p>{% blocktrans %}Items from the Forum can be shown in any of your projects/groups.{% endblocktrans %}</p>
    {% else %}
        <p>{% blocktrans %}Items from this group can be shown in any of the group's subprojects.{% endblocktrans %}</p>
    {% endif %}
    <br/>
	
    <div style="overflow-y: scroll; height: 300px;" class="app-main-force">
        {% for select_group, selected in group_select_tuples %}
                <div class="app-main">
			        <div class="btn btn-{% if selected %}extra-{% endif %}emphasized w100">
			            <ul class="media-list large-space">
			                <li class="media">
		                        <a id="checkbox_{{ select_group.id }}" class="pull-left">
	                                <i class="fa {% if selected %}fa-check-square-o{% else %}fa-square-o{% endif %}"></i>
	                                <input type="checkbox" style="display: none;" name="group_checked" value="{{ select_group.id }}">
                                </a>		                            
			                    <a class="clicktransfer" data-transfertarget="#checkbox_{{ select_group.id }}" href="#">
				                    <span class="pull-left">
				                        {% include "cosinnus/group/group_avatar_image.html" with group=select_group %}
				                    </span>
				                    <div class="media-body">
		                                {{ select_group.name }}
    			                    </div>
		                        </a>
			                </li>
			            </ul>
			        </div>
			    </div>
        {% endfor %}
    </div>
    
    <input type="hidden" name="reflecting_object_id" value="{{ reflecting_object_id }}">
    <input type="hidden" name="reflecting_object_content_type" value={{ reflecting_object_content_type }}>
    
    <script type="text/javascript">
        $('a.clicktransfer').on('click', function(e, f) {
            $($(this).data('transfertarget')).click();
        });
    </script>
    
{% endcaptureas %}



{% captureas title %}{% trans "Show in other projects/groups" %}{% endcaptureas %}
{% captureas submit_button_label %}{% trans "Apply" %}{% endcaptureas %}
{% captureas action %}{% group_url post_url group=group %}{% endcaptureas %}
{% include "cosinnus/modal_box.html" with id=button_id label=label title=title form_action=action title_icon="fa-share" %}
