{% extends 'admin/baseAdmin.html.twig' %}
{% block page_title %}Ajouter sous categorie {% endblock %}
{% block breadcump_main %}Categorie{% endblock %}
{% block breadcump_subtitle %}Nouvelle sous category{% endblock %}
{% block menu_left_sidebar %}
{% include 'include/menu/menuAdmin.html.twig' with { menu_active_event : '2'} %}
{% endblock %}
{% block stylesheets %}
<link href="{{ asset('admin/libs/select2/css/select2.min.css') }}" rel="stylesheet" type="text/css">
<link href="{{ asset('admin/css/tailwind.min.css') }}" rel="stylesheet" type="text/css">
<link href="{{ asset('admin/css/tailwind2.css') }}" rel="stylesheet" type="text/css">
{% endblock %}
{% block title %}{{"Ajouter sous categorie"|trans }}{% endblock %}
{% block content %}
<div class="container-fluid">
<div class="row">
<div class="col-xl-12 px-0">
<div class="card">
<div class="card-body">
<form class="p-1 " method="post" action="{{ path('add_subcategory') }}" enctype="multipart/form-data" >
<div class="row">
<h5 class="text-base col-md-2 col-sm-12 px-0 ">Image du souscategorie </h5>
<div class="m-auto my-1 relative col-10">
<label for="avatar-upload" class="relative flex justify-center" style="cursor: pointer;">
<img class="w-full h-72 rounded-lg m-auto object-cover" src="{{ asset('admin/images/juliane-lieberman.jpg') }}" alt="category image" id="avatar-img">
<div class="h-10 w-10 bg-orange rounded-full flex items-center justify-center" style="position: absolute;right: 43%;bottom: 4px;font-size: 43px;">
<i class="bx bxs-image-alt text-xl text-white"></i>
</div>
<input type="file" id="avatar-upload" name='image' style="display: none;" accept="image/*" onchange="changeAvatar(event)">
</label>
</div>
</div>
<h5 class="text-base sm:text-lg font-semibold mt-5 ">Information General du sous categorie</h5>
<p class="pb-4 text-gray-700 text-xs sm:text-sm">Decrivez la sous categorie par ses caracteristiques. </p>
<div class="row mb-4">
<div class="form-floating col-md-12 col-sm-12 ">
<input type="text" name="name"
class="form-control sm:text-sm rounded-lg focus:ring-primary-600 focus:border-primary-600 block w-full p-2.5 ps-5"
id="nom" placeholder="">
<label class="mb-2 ms-2 ps-5 text-sm font-medium text-gray-900 " for="nom">Nom du sous Categorie</label>
<div class="absolute" style="top: 11px;left: 17px;color: #a1a1a1;">
<i class="bx bx-grid-small" style="font-size: 36px;"></i>
</div>
</div>
</div>
<div class="row mb-4">
<div class="form-floating">
<textarea class="form-control px-5" placeholder="Messager nous" id="floatingTextarea2" name='description' style="height: 100px"></textarea>
<label class="mb-2 ms-2 ps-5 text-sm font-medium text-gray-900 " for="floatingTextarea2">Description du sousategorie</label>
<div class="absolute" style="top: 15px;left: 23px;color: #a1a1a1;">
<i class="bx bx-notepad text-2xl"></i>
</div>
</div>
<div class="mb-3 col-md-6">
<p for="" class="form-label font-semibold ">Categorie</p>
<select id="country" name="category" class=" select border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-3.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 py-3">
{% for category in categories %}
<option value="{{ category.id }}" >{{ category.name }}</option>
{% endfor %}
</select>
</div>
</div>
<div class="flex gap-20 mt-4">
<label for="example-text-input" class="block font-medium text-gray-700 mr-2 dark:text-zink-200 text-13">Visibilite du produit dans le menu:</label>
<div class="mx-2 flex gap-2">
<!-- "Afficher" button -->
<input type="checkbox" name="visibility" id="switch3" switch="bool" checked />
<label for="switch3" data-on-label="Oui" data-off-label="Non"></label>
<!-- "Masquer" button -->
</div>
</div>
<div class="divider mt-16"></div>
<div class="flex mt-4 row">
<div class="col-md-6">
<p class="text-xs text-gray-900 mb-2">En cliquant sur le bouton de Enregistrer, vous mettez à jours les informations envoyé dans ce formulaire </p>
</div>
<div class="col-md flex justify-end">
<button type="reset" style=" color: #ffaa00; border: 1px solid;" class="font-medium h-10 py-2.5 rounded-lg text-center text-sm w-40 me-2">
Annuler</button>
<button type="submit" style=" background: #ffaa00;" class="font-medium hover:bg-primary-700 h-10 py-2.5 rounded-lg text-center text-sm text-white w-40">Enregistrer</button>
</div>
</div>
</form>
</div>
<!-- end card body -->
</div>
<!-- end card -->
</div>
<!-- end col -->
<!-- end col -->
</div>
</div> <!-- container-fluid -->
<!-- End main -->
{% endblock %}
{% block javascripts %}
<!-- apexcharts -->
<script src="{{ asset('admin/libs/parsleyjs/parsley.min.js')}}"></script>
<script src="{{ asset('admin/libs/select2/js/select2.min.js')}}"></script>
<script src="{{ asset('admin/libs/bootstrap-maxlength/bootstrap-maxlength.min.js')}}"></script>
<script src="{{ asset('admin/js/pages/form-validation.init.js')}}"></script>
<script src="{{ asset('admin/js/app.js')}}"></script>
<script>
/*
Template Name: Skote - Admin & Dashboard Template
Author: Themesbrand
Website: https://themesbrand.com/
Contact: themesbrand@gmail.com
File: Form Advanced Js File
*/
!function ($) {
"use strict";
var AdvancedForm = function () { };
AdvancedForm.prototype.init = function () {
// Select2
if ($('.select2').length > 0) {
$(".select2").select2();
}
if ($('.select2-tags').length > 0) {
$(".select2-tags").select2({
tags: true
});
}
if ($('.select2-limiting-3').length > 0) {
$(".select2-limiting-3").select2({
maximumSelectionLength: 3
});
}
//Bootstrap-MaxLength
$('input#defaultconfig').maxlength({
warningClass: "badge bg-info",
limitReachedClass: "badge bg-warning"
});
$('input#thresholdconfig').maxlength({
threshold: 20,
warningClass: "badge bg-info",
limitReachedClass: "badge bg-warning"
});
$('input#moreoptions').maxlength({
alwaysShow: true,
warningClass: "badge bg-success",
limitReachedClass: "badge bg-danger"
});
$('input#alloptions').maxlength({
alwaysShow: true,
warningClass: "badge bg-success",
limitReachedClass: "badge bg-danger",
separator: ' out of ',
preText: 'You typed ',
postText: ' chars available.',
validate: true
});
$('textarea#textarea').maxlength({
alwaysShow: true,
warningClass: "badge bg-info",
limitReachedClass: "badge bg-warning"
});
$('input#placement').maxlength({
alwaysShow: true,
placement: 'top-left',
warningClass: "badge bg-info",
limitReachedClass: "badge bg-warning"
});
},
//init
$.AdvancedForm = new AdvancedForm, $.AdvancedForm.Constructor = AdvancedForm
}(window.jQuery),
//Datepicker
function ($) {
"use strict";
$.AdvancedForm.init();
}(window.jQuery);
</script>
{% endblock %}