{% extends 'layout.twig' %}

{% import 'messagesysteme.twig' as msgSyst %}
{% import 'champs.twig' as form %}

{% block css %}
	<link rel="stylesheet" href="../vendor/almasaeed2010/adminlte/plugins/summernote/summernote-bs5.min.css">
	<link rel="stylesheet" href="../vendor/almasaeed2010/adminlte/plugins/toastr/toastr.min.css">
{% endblock %}

{% block content %}
	<div class="row">
        <div class="col col-xs-12">
			<div class="nav-tabs-custom">

            <div class="tab-content">
              <!-- Font Awesome Icons -->
              <div class="tab-pane active" id="fa-icons">
				<form action="?p=admin_cgu" id="nom_formulaire" method="post">
					<section id="message">
						<h4 class="page-header">{{ trad.cgu_titre }}</h4>
						<p>{{ trad.cgu_grr }}</p>
						{{ form.input('titre', 'Titre', pages.cgu[0], {classGroup: 'col-sm-12', classLabel: 'col-sm-2', classInput: 'col-sm-10 control-label'}) }}
						<textarea id="summernote" name="CGU" rows="60" cols="80">{{ pages.cgu[1] }}</textarea>
					</section>

					<div style="text-align:center;">
						<input class="btn btn-primary" type="submit" name="ok" value="{{ trad.save }}" />
					</div>
				</form>
            </div>
            <!-- /.tab-content -->
          </div>
          <!-- /.nav-tabs-custom -->
        </div>
        <!-- /.col -->
      </div>

{% endblock %}

{% block javascript %}
	<script src="../vendor/almasaeed2010/adminlte/plugins/summernote/summernote-bs5.min.js"></script>
	<script src="../vendor/almasaeed2010/adminlte/plugins/toastr/toastr.min.js"></script>
	<script>
		$(function () {
			// Summernote
			$('#summernote').summernote({
				toolbar: [
					// [groupName, [list of button]]
					['style', ['style']],
					['style', ['bold', 'italic', 'underline', 'clear']],
					['font', ['strikethrough', 'superscript', 'subscript']],
					['fontsize', ['fontsize']],
					['color', ['color']],
					['para', ['ul', 'ol', 'paragraph']],
					['height', ['height']],
					['fontname', ['fontname']],
					['table', ['table']],
					['insert', ['link', 'picture', 'video']],
					['view', ['fullscreen', 'codeview', 'help']]
					]
				});

			{%if d.enregistrement%}
				{%if d.enregistrement == 1 %}
					toastr.success("{{trad.message_records}}")
				{% else %}
					toastr.warning("{{d.enregistrement|raw}}")
				{%endif%}
			{%endif%}

		}); 
	</script>
{% endblock %}