{#
/**
 * Copyright © 2003-2024 The Galette Team
 *
 * This file is part of Galette (https://galette.eu).
 *
 * Galette is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * Galette is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with Galette. If not, see <http://www.gnu.org/licenses/>.
 */
#}
{% if tabbed ?? false == true %}
<div id="social" class="ui{{ tab == 'social' ? ' active' }} tab segment" data-tab="social">
    <div class="ui stackable two column grid">
        <div class="ten wide column">
    {% block social_edit %}
        {% for social in socials %}
            <div class="inline field stored">
                <label for="social_{{ social.id }}">{{ social.getSystemType(social.type) }}</label>
                <div class="ui right action input">
                    <input type="text" name="social_{{ social.id }}" id="social_{{ social.id }}" value="{{ social.url }}" class="large"/>
                    <a href="#" class="ui icon red button delete delsocial" title="{{ _T("Remove %type")|replace({"%type": social.getSystemType(social.type)})|e() }}">
                        <i class="trash icon" aria-hidden="true"></i>
                        <span class="visually-hidden">{{ _T("Remove %type")|replace({"%type": social.getSystemType(social.type)})|e() }}</span>
                    </a>
                </div>
            </div>
        {% endfor %}
            {% if socials|length() > 0 %}<div class="ui divider"></div>{% endif %}
            <div class="field addsocial">
                <label>{{ _T("Add new social network") }}</label>
                <div class="combo-social fields">
                    <div class="field">
                        <div id="social_new_type_1" class="jsonly search-dropdown socials-dropdown ui input">
                            <input id="social_new_type_input_1" type="hidden" name="social_new_type_1" value="">
                            <i class="jsonly displaynone dropdown icon" aria-hidden="true"></i>
                            <div class="jsonly displaynone default text">{{ _T("Choose or enter your own...") }}</div>
                            <div class="jsonly displaynone menu">
                            {% for social_type in osocials.getSystemTypes(false) %}
                                <div class="item" data-value="{{ social_type }}">{{ osocials.getSystemType(social_type) }}</div>
                            {% endfor %}
                            </div>
                        </div>
                    </div>
                    <div class="field">
                        <input type="text" name="social_new_value_1" id="social_new_value_1" value="" size="50" class="value"/>
                    </div>
                </div>
                <a href="#" class="ui tiny green labeled icon button action addsocial">
                    <i class="plus icon" aria-hidden="true"></i>
                    {{ _T("Add") }}
                </a>
            </div>
    {% endblock %}
        </div>
        <div class="six wide column">
            <div class="field inline">
                <div class="ui right aligned toggle checkbox">
                    <input type="checkbox" name="pref_disable_members_socials" id="pref_disable_members_socials" value="1" {% if preferences.pref_disable_members_socials %} checked="checked"{% endif %}/>
                    <label for="pref_disable_members_socials">{{ _T("Disable social networks on member form") }}</label>
                </div>
            </div>
        </div>
    </div>
</div>
{% else %}
    <div id="social" class="ui styled fluid accordion field">
        <div class="active title">
            <i class="jsonly displaynone icon dropdown" aria-hidden="true"></i>
            {{ _T("Social networks") }}
        </div>
        <div class="active content field">
            {{ block('social_edit') }}
        </div>
    </div>
{% endif %}
