{% extends 'base_frontend.html.twig' %}

{% block title %} Newslettre {% endblock %}

{% block content %}
<!-- ============================================== HEADER : END ============================================== -->
<div class="breadcrumb">
	<div class="breadcrumb-inner">
		<ul class="list-inline list-unstyled">
			<li><a href="#">Newslettre</a></li>
			<li class='active'>Configuration</li>
		</ul>
	</div><!-- /.breadcrumb-inner -->
</div><!-- /.breadcrumb -->

<div class="body-content ">
	
	<div class="sign-in-page">

        <h3>Gestion des Newslettres</h3>
        <br>
		<div class="row">
			
            <div class="col-md-3 ">
                
                <div class="form-group">
                    <div class="checkbox checbox-switch switch-warning">
                        <label>
                            <input type="checkbox" class="check-groupe" data-related="0" {% if 0 in selectNews %} checked {% endif %} />
                            <span></span>
                            Newslettre par semaine
                        </label>
                    </div>
                </div>

                <br>
              
                <div class="form-group">
                    <div class="checkbox checbox-switch switch-warning">
                        <label>
                            <input type="checkbox" class="check-groupe" data-related="-1"  {% if -1 in selectNews %} checked {% endif %} />
                            <span></span>
                            Autres newsletters
                        </label>
                    </div>
                </div>

            </div>
                                                 
            <div class="col-md-7 col-md-offset-1">
                 <fieldset>
                     <legend>
                        Newslettre par catégories 
                     </legend>
                     <div class="row">
                        {% for groupe in groupes %}
                            <div class="col-sm-3">
                                <div class="form-group">
                                    <div class="checkbox checbox-switch switch-warning">
                                        <label>
                                            <input type="checkbox" class="check-groupe" data-related="{{ groupe.id }}" {% if groupe.id in selectNews %} checked {% endif %} />
                                            <span></span>
                                            {{ groupe.nom }}
                                        </label>
                                    </div>
                                </div>
                            </div>
                        {% endfor %}
                     </div>
                 </fieldset>
            </div>     
            	
        </div>
	</div>
    <br><br><br><br>
    
</div>
{% endblock %}

{% block javascripts %}
    <script>
        var pathAjaxUpdate = "{{ path('frontend_newslettre_update') }}";
    </script>

    {{ parent() }}
  
{% endblock %}