mirror of
https://forge.chapril.org/tykayn/caisse-bliss
synced 2025-06-20 01:44:42 +02:00
up templates
This commit is contained in:
parent
71bce538af
commit
a39b6239b0
71 changed files with 1536 additions and 262 deletions
|
@ -5,6 +5,6 @@ import './bootstrap.js';
|
|||
* This file will be included onto the page via the importmap() Twig function,
|
||||
* which should already be in your base.html.twig.
|
||||
*/
|
||||
import './styles/app.css';
|
||||
import './styles/app.scss';
|
||||
|
||||
console.log('This log comes from assets/app.js - welcome to AssetMapper! 🎉');
|
||||
|
|
4
assets/styles/app.scss
Normal file
4
assets/styles/app.scss
Normal file
|
@ -0,0 +1,4 @@
|
|||
body{
|
||||
margin: 0 auto;
|
||||
padding: 4rem;
|
||||
}
|
81
src/Controller/CategoryController.php
Normal file
81
src/Controller/CategoryController.php
Normal file
|
@ -0,0 +1,81 @@
|
|||
<?php
|
||||
|
||||
namespace App\Controller;
|
||||
|
||||
use App\Entity\Category;
|
||||
use App\Form\CategoryType;
|
||||
use App\Repository\CategoryRepository;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\Routing\Attribute\Route;
|
||||
|
||||
#[Route('/category')]
|
||||
final class CategoryController extends AbstractController
|
||||
{
|
||||
#[Route(name: 'app_category_index', methods: ['GET'])]
|
||||
public function index(CategoryRepository $categoryRepository): Response
|
||||
{
|
||||
return $this->render('category/index.html.twig', [
|
||||
'categories' => $categoryRepository->findAll(),
|
||||
]);
|
||||
}
|
||||
|
||||
#[Route('/new', name: 'app_category_new', methods: ['GET', 'POST'])]
|
||||
public function new(Request $request, EntityManagerInterface $entityManager): Response
|
||||
{
|
||||
$category = new Category();
|
||||
$form = $this->createForm(CategoryType::class, $category);
|
||||
$form->handleRequest($request);
|
||||
|
||||
if ($form->isSubmitted() && $form->isValid()) {
|
||||
$entityManager->persist($category);
|
||||
$entityManager->flush();
|
||||
|
||||
return $this->redirectToRoute('app_category_index', [], Response::HTTP_SEE_OTHER);
|
||||
}
|
||||
|
||||
return $this->render('category/new.html.twig', [
|
||||
'category' => $category,
|
||||
'form' => $form,
|
||||
]);
|
||||
}
|
||||
|
||||
#[Route('/{id}', name: 'app_category_show', methods: ['GET'])]
|
||||
public function show(Category $category): Response
|
||||
{
|
||||
return $this->render('category/show.html.twig', [
|
||||
'category' => $category,
|
||||
]);
|
||||
}
|
||||
|
||||
#[Route('/{id}/edit', name: 'app_category_edit', methods: ['GET', 'POST'])]
|
||||
public function edit(Request $request, Category $category, EntityManagerInterface $entityManager): Response
|
||||
{
|
||||
$form = $this->createForm(CategoryType::class, $category);
|
||||
$form->handleRequest($request);
|
||||
|
||||
if ($form->isSubmitted() && $form->isValid()) {
|
||||
$entityManager->flush();
|
||||
|
||||
return $this->redirectToRoute('app_category_index', [], Response::HTTP_SEE_OTHER);
|
||||
}
|
||||
|
||||
return $this->render('category/edit.html.twig', [
|
||||
'category' => $category,
|
||||
'form' => $form,
|
||||
]);
|
||||
}
|
||||
|
||||
#[Route('/{id}', name: 'app_category_delete', methods: ['POST'])]
|
||||
public function delete(Request $request, Category $category, EntityManagerInterface $entityManager): Response
|
||||
{
|
||||
if ($this->isCsrfTokenValid('delete'.$category->getId(), $request->getPayload()->getString('_token'))) {
|
||||
$entityManager->remove($category);
|
||||
$entityManager->flush();
|
||||
}
|
||||
|
||||
return $this->redirectToRoute('app_category_index', [], Response::HTTP_SEE_OTHER);
|
||||
}
|
||||
}
|
81
src/Controller/ExpenseController.php
Normal file
81
src/Controller/ExpenseController.php
Normal file
|
@ -0,0 +1,81 @@
|
|||
<?php
|
||||
|
||||
namespace App\Controller;
|
||||
|
||||
use App\Entity\Expense;
|
||||
use App\Form\ExpenseType;
|
||||
use App\Repository\ExpenseRepository;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\Routing\Attribute\Route;
|
||||
|
||||
#[Route('/expense')]
|
||||
final class ExpenseController extends AbstractController
|
||||
{
|
||||
#[Route(name: 'app_expense_index', methods: ['GET'])]
|
||||
public function index(ExpenseRepository $expenseRepository): Response
|
||||
{
|
||||
return $this->render('expense/index.html.twig', [
|
||||
'expenses' => $expenseRepository->findAll(),
|
||||
]);
|
||||
}
|
||||
|
||||
#[Route('/new', name: 'app_expense_new', methods: ['GET', 'POST'])]
|
||||
public function new(Request $request, EntityManagerInterface $entityManager): Response
|
||||
{
|
||||
$expense = new Expense();
|
||||
$form = $this->createForm(ExpenseType::class, $expense);
|
||||
$form->handleRequest($request);
|
||||
|
||||
if ($form->isSubmitted() && $form->isValid()) {
|
||||
$entityManager->persist($expense);
|
||||
$entityManager->flush();
|
||||
|
||||
return $this->redirectToRoute('app_expense_index', [], Response::HTTP_SEE_OTHER);
|
||||
}
|
||||
|
||||
return $this->render('expense/new.html.twig', [
|
||||
'expense' => $expense,
|
||||
'form' => $form,
|
||||
]);
|
||||
}
|
||||
|
||||
#[Route('/{id}', name: 'app_expense_show', methods: ['GET'])]
|
||||
public function show(Expense $expense): Response
|
||||
{
|
||||
return $this->render('expense/show.html.twig', [
|
||||
'expense' => $expense,
|
||||
]);
|
||||
}
|
||||
|
||||
#[Route('/{id}/edit', name: 'app_expense_edit', methods: ['GET', 'POST'])]
|
||||
public function edit(Request $request, Expense $expense, EntityManagerInterface $entityManager): Response
|
||||
{
|
||||
$form = $this->createForm(ExpenseType::class, $expense);
|
||||
$form->handleRequest($request);
|
||||
|
||||
if ($form->isSubmitted() && $form->isValid()) {
|
||||
$entityManager->flush();
|
||||
|
||||
return $this->redirectToRoute('app_expense_index', [], Response::HTTP_SEE_OTHER);
|
||||
}
|
||||
|
||||
return $this->render('expense/edit.html.twig', [
|
||||
'expense' => $expense,
|
||||
'form' => $form,
|
||||
]);
|
||||
}
|
||||
|
||||
#[Route('/{id}', name: 'app_expense_delete', methods: ['POST'])]
|
||||
public function delete(Request $request, Expense $expense, EntityManagerInterface $entityManager): Response
|
||||
{
|
||||
if ($this->isCsrfTokenValid('delete'.$expense->getId(), $request->getPayload()->getString('_token'))) {
|
||||
$entityManager->remove($expense);
|
||||
$entityManager->flush();
|
||||
}
|
||||
|
||||
return $this->redirectToRoute('app_expense_index', [], Response::HTTP_SEE_OTHER);
|
||||
}
|
||||
}
|
81
src/Controller/FestivalController.php
Normal file
81
src/Controller/FestivalController.php
Normal file
|
@ -0,0 +1,81 @@
|
|||
<?php
|
||||
|
||||
namespace App\Controller;
|
||||
|
||||
use App\Entity\Festival;
|
||||
use App\Form\FestivalType;
|
||||
use App\Repository\FestivalRepository;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\Routing\Attribute\Route;
|
||||
|
||||
#[Route('/festival')]
|
||||
final class FestivalController extends AbstractController
|
||||
{
|
||||
#[Route(name: 'app_festival_index', methods: ['GET'])]
|
||||
public function index(FestivalRepository $festivalRepository): Response
|
||||
{
|
||||
return $this->render('festival/index.html.twig', [
|
||||
'festivals' => $festivalRepository->findAll(),
|
||||
]);
|
||||
}
|
||||
|
||||
#[Route('/new', name: 'app_festival_new', methods: ['GET', 'POST'])]
|
||||
public function new(Request $request, EntityManagerInterface $entityManager): Response
|
||||
{
|
||||
$festival = new Festival();
|
||||
$form = $this->createForm(FestivalType::class, $festival);
|
||||
$form->handleRequest($request);
|
||||
|
||||
if ($form->isSubmitted() && $form->isValid()) {
|
||||
$entityManager->persist($festival);
|
||||
$entityManager->flush();
|
||||
|
||||
return $this->redirectToRoute('app_festival_index', [], Response::HTTP_SEE_OTHER);
|
||||
}
|
||||
|
||||
return $this->render('festival/new.html.twig', [
|
||||
'festival' => $festival,
|
||||
'form' => $form,
|
||||
]);
|
||||
}
|
||||
|
||||
#[Route('/{id}', name: 'app_festival_show', methods: ['GET'])]
|
||||
public function show(Festival $festival): Response
|
||||
{
|
||||
return $this->render('festival/show.html.twig', [
|
||||
'festival' => $festival,
|
||||
]);
|
||||
}
|
||||
|
||||
#[Route('/{id}/edit', name: 'app_festival_edit', methods: ['GET', 'POST'])]
|
||||
public function edit(Request $request, Festival $festival, EntityManagerInterface $entityManager): Response
|
||||
{
|
||||
$form = $this->createForm(FestivalType::class, $festival);
|
||||
$form->handleRequest($request);
|
||||
|
||||
if ($form->isSubmitted() && $form->isValid()) {
|
||||
$entityManager->flush();
|
||||
|
||||
return $this->redirectToRoute('app_festival_index', [], Response::HTTP_SEE_OTHER);
|
||||
}
|
||||
|
||||
return $this->render('festival/edit.html.twig', [
|
||||
'festival' => $festival,
|
||||
'form' => $form,
|
||||
]);
|
||||
}
|
||||
|
||||
#[Route('/{id}', name: 'app_festival_delete', methods: ['POST'])]
|
||||
public function delete(Request $request, Festival $festival, EntityManagerInterface $entityManager): Response
|
||||
{
|
||||
if ($this->isCsrfTokenValid('delete'.$festival->getId(), $request->getPayload()->getString('_token'))) {
|
||||
$entityManager->remove($festival);
|
||||
$entityManager->flush();
|
||||
}
|
||||
|
||||
return $this->redirectToRoute('app_festival_index', [], Response::HTTP_SEE_OTHER);
|
||||
}
|
||||
}
|
81
src/Controller/GroupOfProductsController.php
Normal file
81
src/Controller/GroupOfProductsController.php
Normal file
|
@ -0,0 +1,81 @@
|
|||
<?php
|
||||
|
||||
namespace App\Controller;
|
||||
|
||||
use App\Entity\GroupOfProducts;
|
||||
use App\Form\GroupOfProductsType;
|
||||
use App\Repository\GroupOfProductsRepository;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\Routing\Attribute\Route;
|
||||
|
||||
#[Route('/group/of/products')]
|
||||
final class GroupOfProductsController extends AbstractController
|
||||
{
|
||||
#[Route(name: 'app_group_of_products_index', methods: ['GET'])]
|
||||
public function index(GroupOfProductsRepository $groupOfProductsRepository): Response
|
||||
{
|
||||
return $this->render('group_of_products/index.html.twig', [
|
||||
'group_of_products' => $groupOfProductsRepository->findAll(),
|
||||
]);
|
||||
}
|
||||
|
||||
#[Route('/new', name: 'app_group_of_products_new', methods: ['GET', 'POST'])]
|
||||
public function new(Request $request, EntityManagerInterface $entityManager): Response
|
||||
{
|
||||
$groupOfProduct = new GroupOfProducts();
|
||||
$form = $this->createForm(GroupOfProductsType::class, $groupOfProduct);
|
||||
$form->handleRequest($request);
|
||||
|
||||
if ($form->isSubmitted() && $form->isValid()) {
|
||||
$entityManager->persist($groupOfProduct);
|
||||
$entityManager->flush();
|
||||
|
||||
return $this->redirectToRoute('app_group_of_products_index', [], Response::HTTP_SEE_OTHER);
|
||||
}
|
||||
|
||||
return $this->render('group_of_products/new.html.twig', [
|
||||
'group_of_product' => $groupOfProduct,
|
||||
'form' => $form,
|
||||
]);
|
||||
}
|
||||
|
||||
#[Route('/{id}', name: 'app_group_of_products_show', methods: ['GET'])]
|
||||
public function show(GroupOfProducts $groupOfProduct): Response
|
||||
{
|
||||
return $this->render('group_of_products/show.html.twig', [
|
||||
'group_of_product' => $groupOfProduct,
|
||||
]);
|
||||
}
|
||||
|
||||
#[Route('/{id}/edit', name: 'app_group_of_products_edit', methods: ['GET', 'POST'])]
|
||||
public function edit(Request $request, GroupOfProducts $groupOfProduct, EntityManagerInterface $entityManager): Response
|
||||
{
|
||||
$form = $this->createForm(GroupOfProductsType::class, $groupOfProduct);
|
||||
$form->handleRequest($request);
|
||||
|
||||
if ($form->isSubmitted() && $form->isValid()) {
|
||||
$entityManager->flush();
|
||||
|
||||
return $this->redirectToRoute('app_group_of_products_index', [], Response::HTTP_SEE_OTHER);
|
||||
}
|
||||
|
||||
return $this->render('group_of_products/edit.html.twig', [
|
||||
'group_of_product' => $groupOfProduct,
|
||||
'form' => $form,
|
||||
]);
|
||||
}
|
||||
|
||||
#[Route('/{id}', name: 'app_group_of_products_delete', methods: ['POST'])]
|
||||
public function delete(Request $request, GroupOfProducts $groupOfProduct, EntityManagerInterface $entityManager): Response
|
||||
{
|
||||
if ($this->isCsrfTokenValid('delete'.$groupOfProduct->getId(), $request->getPayload()->getString('_token'))) {
|
||||
$entityManager->remove($groupOfProduct);
|
||||
$entityManager->flush();
|
||||
}
|
||||
|
||||
return $this->redirectToRoute('app_group_of_products_index', [], Response::HTTP_SEE_OTHER);
|
||||
}
|
||||
}
|
81
src/Controller/ProductController.php
Normal file
81
src/Controller/ProductController.php
Normal file
|
@ -0,0 +1,81 @@
|
|||
<?php
|
||||
|
||||
namespace App\Controller;
|
||||
|
||||
use App\Entity\Product;
|
||||
use App\Form\ProductType;
|
||||
use App\Repository\ProductRepository;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\Routing\Attribute\Route;
|
||||
|
||||
#[Route('/product')]
|
||||
final class ProductController extends AbstractController
|
||||
{
|
||||
#[Route(name: 'app_product_index', methods: ['GET'])]
|
||||
public function index(ProductRepository $productRepository): Response
|
||||
{
|
||||
return $this->render('product/index.html.twig', [
|
||||
'products' => $productRepository->findAll(),
|
||||
]);
|
||||
}
|
||||
|
||||
#[Route('/new', name: 'app_product_new', methods: ['GET', 'POST'])]
|
||||
public function new(Request $request, EntityManagerInterface $entityManager): Response
|
||||
{
|
||||
$product = new Product();
|
||||
$form = $this->createForm(ProductType::class, $product);
|
||||
$form->handleRequest($request);
|
||||
|
||||
if ($form->isSubmitted() && $form->isValid()) {
|
||||
$entityManager->persist($product);
|
||||
$entityManager->flush();
|
||||
|
||||
return $this->redirectToRoute('app_product_index', [], Response::HTTP_SEE_OTHER);
|
||||
}
|
||||
|
||||
return $this->render('product/new.html.twig', [
|
||||
'product' => $product,
|
||||
'form' => $form,
|
||||
]);
|
||||
}
|
||||
|
||||
#[Route('/{id}', name: 'app_product_show', methods: ['GET'])]
|
||||
public function show(Product $product): Response
|
||||
{
|
||||
return $this->render('product/show.html.twig', [
|
||||
'product' => $product,
|
||||
]);
|
||||
}
|
||||
|
||||
#[Route('/{id}/edit', name: 'app_product_edit', methods: ['GET', 'POST'])]
|
||||
public function edit(Request $request, Product $product, EntityManagerInterface $entityManager): Response
|
||||
{
|
||||
$form = $this->createForm(ProductType::class, $product);
|
||||
$form->handleRequest($request);
|
||||
|
||||
if ($form->isSubmitted() && $form->isValid()) {
|
||||
$entityManager->flush();
|
||||
|
||||
return $this->redirectToRoute('app_product_index', [], Response::HTTP_SEE_OTHER);
|
||||
}
|
||||
|
||||
return $this->render('product/edit.html.twig', [
|
||||
'product' => $product,
|
||||
'form' => $form,
|
||||
]);
|
||||
}
|
||||
|
||||
#[Route('/{id}', name: 'app_product_delete', methods: ['POST'])]
|
||||
public function delete(Request $request, Product $product, EntityManagerInterface $entityManager): Response
|
||||
{
|
||||
if ($this->isCsrfTokenValid('delete'.$product->getId(), $request->getPayload()->getString('_token'))) {
|
||||
$entityManager->remove($product);
|
||||
$entityManager->flush();
|
||||
}
|
||||
|
||||
return $this->redirectToRoute('app_product_index', [], Response::HTTP_SEE_OTHER);
|
||||
}
|
||||
}
|
81
src/Controller/SellingController.php
Normal file
81
src/Controller/SellingController.php
Normal file
|
@ -0,0 +1,81 @@
|
|||
<?php
|
||||
|
||||
namespace App\Controller;
|
||||
|
||||
use App\Entity\Selling;
|
||||
use App\Form\SellingType;
|
||||
use App\Repository\SellingRepository;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\Routing\Attribute\Route;
|
||||
|
||||
#[Route('/selling')]
|
||||
final class SellingController extends AbstractController
|
||||
{
|
||||
#[Route(name: 'app_selling_index', methods: ['GET'])]
|
||||
public function index(SellingRepository $sellingRepository): Response
|
||||
{
|
||||
return $this->render('selling/index.html.twig', [
|
||||
'sellings' => $sellingRepository->findAll(),
|
||||
]);
|
||||
}
|
||||
|
||||
#[Route('/new', name: 'app_selling_new', methods: ['GET', 'POST'])]
|
||||
public function new(Request $request, EntityManagerInterface $entityManager): Response
|
||||
{
|
||||
$selling = new Selling();
|
||||
$form = $this->createForm(SellingType::class, $selling);
|
||||
$form->handleRequest($request);
|
||||
|
||||
if ($form->isSubmitted() && $form->isValid()) {
|
||||
$entityManager->persist($selling);
|
||||
$entityManager->flush();
|
||||
|
||||
return $this->redirectToRoute('app_selling_index', [], Response::HTTP_SEE_OTHER);
|
||||
}
|
||||
|
||||
return $this->render('selling/new.html.twig', [
|
||||
'selling' => $selling,
|
||||
'form' => $form,
|
||||
]);
|
||||
}
|
||||
|
||||
#[Route('/{id}', name: 'app_selling_show', methods: ['GET'])]
|
||||
public function show(Selling $selling): Response
|
||||
{
|
||||
return $this->render('selling/show.html.twig', [
|
||||
'selling' => $selling,
|
||||
]);
|
||||
}
|
||||
|
||||
#[Route('/{id}/edit', name: 'app_selling_edit', methods: ['GET', 'POST'])]
|
||||
public function edit(Request $request, Selling $selling, EntityManagerInterface $entityManager): Response
|
||||
{
|
||||
$form = $this->createForm(SellingType::class, $selling);
|
||||
$form->handleRequest($request);
|
||||
|
||||
if ($form->isSubmitted() && $form->isValid()) {
|
||||
$entityManager->flush();
|
||||
|
||||
return $this->redirectToRoute('app_selling_index', [], Response::HTTP_SEE_OTHER);
|
||||
}
|
||||
|
||||
return $this->render('selling/edit.html.twig', [
|
||||
'selling' => $selling,
|
||||
'form' => $form,
|
||||
]);
|
||||
}
|
||||
|
||||
#[Route('/{id}', name: 'app_selling_delete', methods: ['POST'])]
|
||||
public function delete(Request $request, Selling $selling, EntityManagerInterface $entityManager): Response
|
||||
{
|
||||
if ($this->isCsrfTokenValid('delete'.$selling->getId(), $request->getPayload()->getString('_token'))) {
|
||||
$entityManager->remove($selling);
|
||||
$entityManager->flush();
|
||||
}
|
||||
|
||||
return $this->redirectToRoute('app_selling_index', [], Response::HTTP_SEE_OTHER);
|
||||
}
|
||||
}
|
25
src/Form/CategoryType.php
Normal file
25
src/Form/CategoryType.php
Normal file
|
@ -0,0 +1,25 @@
|
|||
<?php
|
||||
|
||||
namespace App\Form;
|
||||
|
||||
use App\Entity\Category;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
|
||||
class CategoryType extends AbstractType
|
||||
{
|
||||
public function buildForm(FormBuilderInterface $builder, array $options): void
|
||||
{
|
||||
$builder
|
||||
->add('name')
|
||||
;
|
||||
}
|
||||
|
||||
public function configureOptions(OptionsResolver $resolver): void
|
||||
{
|
||||
$resolver->setDefaults([
|
||||
'data_class' => Category::class,
|
||||
]);
|
||||
}
|
||||
}
|
26
src/Form/ExpenseType.php
Normal file
26
src/Form/ExpenseType.php
Normal file
|
@ -0,0 +1,26 @@
|
|||
<?php
|
||||
|
||||
namespace App\Form;
|
||||
|
||||
use App\Entity\Expense;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
|
||||
class ExpenseType extends AbstractType
|
||||
{
|
||||
public function buildForm(FormBuilderInterface $builder, array $options): void
|
||||
{
|
||||
$builder
|
||||
->add('name')
|
||||
->add('price')
|
||||
;
|
||||
}
|
||||
|
||||
public function configureOptions(OptionsResolver $resolver): void
|
||||
{
|
||||
$resolver->setDefaults([
|
||||
'data_class' => Expense::class,
|
||||
]);
|
||||
}
|
||||
}
|
31
src/Form/FestivalType.php
Normal file
31
src/Form/FestivalType.php
Normal file
|
@ -0,0 +1,31 @@
|
|||
<?php
|
||||
|
||||
namespace App\Form;
|
||||
|
||||
use App\Entity\Festival;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
|
||||
class FestivalType extends AbstractType
|
||||
{
|
||||
public function buildForm(FormBuilderInterface $builder, array $options): void
|
||||
{
|
||||
$builder
|
||||
->add('name')
|
||||
->add('date_start', null, [
|
||||
'widget' => 'single_text',
|
||||
])
|
||||
->add('date_end', null, [
|
||||
'widget' => 'single_text',
|
||||
])
|
||||
;
|
||||
}
|
||||
|
||||
public function configureOptions(OptionsResolver $resolver): void
|
||||
{
|
||||
$resolver->setDefaults([
|
||||
'data_class' => Festival::class,
|
||||
]);
|
||||
}
|
||||
}
|
33
src/Form/GroupOfProductsType.php
Normal file
33
src/Form/GroupOfProductsType.php
Normal file
|
@ -0,0 +1,33 @@
|
|||
<?php
|
||||
|
||||
namespace App\Form;
|
||||
|
||||
use App\Entity\GroupOfProducts;
|
||||
use App\Entity\Product;
|
||||
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
|
||||
class GroupOfProductsType extends AbstractType
|
||||
{
|
||||
public function buildForm(FormBuilderInterface $builder, array $options): void
|
||||
{
|
||||
$builder
|
||||
->add('name')
|
||||
->add('products', EntityType::class, [
|
||||
'class' => Product::class,
|
||||
'choice_label' => 'id',
|
||||
'multiple' => true,
|
||||
'required' => false,
|
||||
])
|
||||
;
|
||||
}
|
||||
|
||||
public function configureOptions(OptionsResolver $resolver): void
|
||||
{
|
||||
$resolver->setDefaults([
|
||||
'data_class' => GroupOfProducts::class,
|
||||
]);
|
||||
}
|
||||
}
|
35
src/Form/ProductType.php
Normal file
35
src/Form/ProductType.php
Normal file
|
@ -0,0 +1,35 @@
|
|||
<?php
|
||||
|
||||
namespace App\Form;
|
||||
|
||||
use App\Entity\GroupOfProducts;
|
||||
use App\Entity\Product;
|
||||
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
|
||||
class ProductType extends AbstractType
|
||||
{
|
||||
public function buildForm(FormBuilderInterface $builder, array $options): void
|
||||
{
|
||||
$builder
|
||||
->add('name')
|
||||
->add('price')
|
||||
->add('stock')
|
||||
->add('groupOfProducts', EntityType::class, [
|
||||
'class' => GroupOfProducts::class,
|
||||
'choice_label' => 'id',
|
||||
'multiple' => true,
|
||||
'required' => false,
|
||||
])
|
||||
;
|
||||
}
|
||||
|
||||
public function configureOptions(OptionsResolver $resolver): void
|
||||
{
|
||||
$resolver->setDefaults([
|
||||
'data_class' => Product::class,
|
||||
]);
|
||||
}
|
||||
}
|
28
src/Form/SellingType.php
Normal file
28
src/Form/SellingType.php
Normal file
|
@ -0,0 +1,28 @@
|
|||
<?php
|
||||
|
||||
namespace App\Form;
|
||||
|
||||
use App\Entity\Selling;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
|
||||
class SellingType extends AbstractType
|
||||
{
|
||||
public function buildForm(FormBuilderInterface $builder, array $options): void
|
||||
{
|
||||
$builder
|
||||
->add('note')
|
||||
->add('products')
|
||||
->add('sum')
|
||||
->add('reduction')
|
||||
;
|
||||
}
|
||||
|
||||
public function configureOptions(OptionsResolver $resolver): void
|
||||
{
|
||||
$resolver->setDefaults([
|
||||
'data_class' => Selling::class,
|
||||
]);
|
||||
}
|
||||
}
|
4
templates/category/_delete_form.html.twig
Normal file
4
templates/category/_delete_form.html.twig
Normal file
|
@ -0,0 +1,4 @@
|
|||
<form method="post" action="{{ path('app_category_delete', {'id': category.id}) }}" onsubmit="return confirm('Are you sure you want to delete this item?');">
|
||||
<input type="hidden" name="_token" value="{{ csrf_token('delete' ~ category.id) }}">
|
||||
<button class="btn">Delete</button>
|
||||
</form>
|
4
templates/category/_form.html.twig
Normal file
4
templates/category/_form.html.twig
Normal file
|
@ -0,0 +1,4 @@
|
|||
{{ form_start(form) }}
|
||||
{{ form_widget(form) }}
|
||||
<button class="btn">{{ button_label|default('Save') }}</button>
|
||||
{{ form_end(form) }}
|
13
templates/category/edit.html.twig
Normal file
13
templates/category/edit.html.twig
Normal file
|
@ -0,0 +1,13 @@
|
|||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block title %}Edit Category{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<h1>Edit Category</h1>
|
||||
|
||||
{{ include('category/_form.html.twig', {'button_label': 'Update'}) }}
|
||||
|
||||
<a href="{{ path('app_category_index') }}">back to list</a>
|
||||
|
||||
{{ include('category/_delete_form.html.twig') }}
|
||||
{% endblock %}
|
35
templates/category/index.html.twig
Normal file
35
templates/category/index.html.twig
Normal file
|
@ -0,0 +1,35 @@
|
|||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block title %}Category index{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<h1>Category index</h1>
|
||||
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Id</th>
|
||||
<th>Name</th>
|
||||
<th>actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for category in categories %}
|
||||
<tr>
|
||||
<td>{{ category.id }}</td>
|
||||
<td>{{ category.name }}</td>
|
||||
<td>
|
||||
<a href="{{ path('app_category_show', {'id': category.id}) }}">show</a>
|
||||
<a href="{{ path('app_category_edit', {'id': category.id}) }}">edit</a>
|
||||
</td>
|
||||
</tr>
|
||||
{% else %}
|
||||
<tr>
|
||||
<td colspan="3">no records found</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<a href="{{ path('app_category_new') }}">Create new</a>
|
||||
{% endblock %}
|
11
templates/category/new.html.twig
Normal file
11
templates/category/new.html.twig
Normal file
|
@ -0,0 +1,11 @@
|
|||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block title %}New Category{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<h1>Create new Category</h1>
|
||||
|
||||
{{ include('category/_form.html.twig') }}
|
||||
|
||||
<a href="{{ path('app_category_index') }}">back to list</a>
|
||||
{% endblock %}
|
26
templates/category/show.html.twig
Normal file
26
templates/category/show.html.twig
Normal file
|
@ -0,0 +1,26 @@
|
|||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block title %}Category{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<h1>Category</h1>
|
||||
|
||||
<table class="table">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th>Id</th>
|
||||
<td>{{ category.id }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<td>{{ category.name }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<a href="{{ path('app_category_index') }}">back to list</a>
|
||||
|
||||
<a href="{{ path('app_category_edit', {'id': category.id}) }}">edit</a>
|
||||
|
||||
{{ include('category/_delete_form.html.twig') }}
|
||||
{% endblock %}
|
4
templates/expense/_delete_form.html.twig
Normal file
4
templates/expense/_delete_form.html.twig
Normal file
|
@ -0,0 +1,4 @@
|
|||
<form method="post" action="{{ path('app_expense_delete', {'id': expense.id}) }}" onsubmit="return confirm('Are you sure you want to delete this item?');">
|
||||
<input type="hidden" name="_token" value="{{ csrf_token('delete' ~ expense.id) }}">
|
||||
<button class="btn">Delete</button>
|
||||
</form>
|
4
templates/expense/_form.html.twig
Normal file
4
templates/expense/_form.html.twig
Normal file
|
@ -0,0 +1,4 @@
|
|||
{{ form_start(form) }}
|
||||
{{ form_widget(form) }}
|
||||
<button class="btn">{{ button_label|default('Save') }}</button>
|
||||
{{ form_end(form) }}
|
13
templates/expense/edit.html.twig
Normal file
13
templates/expense/edit.html.twig
Normal file
|
@ -0,0 +1,13 @@
|
|||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block title %}Edit Expense{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<h1>Edit Expense</h1>
|
||||
|
||||
{{ include('expense/_form.html.twig', {'button_label': 'Update'}) }}
|
||||
|
||||
<a href="{{ path('app_expense_index') }}">back to list</a>
|
||||
|
||||
{{ include('expense/_delete_form.html.twig') }}
|
||||
{% endblock %}
|
37
templates/expense/index.html.twig
Normal file
37
templates/expense/index.html.twig
Normal file
|
@ -0,0 +1,37 @@
|
|||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block title %}Expense index{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<h1>Expense index</h1>
|
||||
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Id</th>
|
||||
<th>Name</th>
|
||||
<th>Price</th>
|
||||
<th>actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for expense in expenses %}
|
||||
<tr>
|
||||
<td>{{ expense.id }}</td>
|
||||
<td>{{ expense.name }}</td>
|
||||
<td>{{ expense.price }}</td>
|
||||
<td>
|
||||
<a href="{{ path('app_expense_show', {'id': expense.id}) }}">show</a>
|
||||
<a href="{{ path('app_expense_edit', {'id': expense.id}) }}">edit</a>
|
||||
</td>
|
||||
</tr>
|
||||
{% else %}
|
||||
<tr>
|
||||
<td colspan="4">no records found</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<a href="{{ path('app_expense_new') }}">Create new</a>
|
||||
{% endblock %}
|
11
templates/expense/new.html.twig
Normal file
11
templates/expense/new.html.twig
Normal file
|
@ -0,0 +1,11 @@
|
|||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block title %}New Expense{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<h1>Create new Expense</h1>
|
||||
|
||||
{{ include('expense/_form.html.twig') }}
|
||||
|
||||
<a href="{{ path('app_expense_index') }}">back to list</a>
|
||||
{% endblock %}
|
30
templates/expense/show.html.twig
Normal file
30
templates/expense/show.html.twig
Normal file
|
@ -0,0 +1,30 @@
|
|||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block title %}Expense{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<h1>Expense</h1>
|
||||
|
||||
<table class="table">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th>Id</th>
|
||||
<td>{{ expense.id }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<td>{{ expense.name }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Price</th>
|
||||
<td>{{ expense.price }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<a href="{{ path('app_expense_index') }}">back to list</a>
|
||||
|
||||
<a href="{{ path('app_expense_edit', {'id': expense.id}) }}">edit</a>
|
||||
|
||||
{{ include('expense/_delete_form.html.twig') }}
|
||||
{% endblock %}
|
4
templates/festival/_delete_form.html.twig
Normal file
4
templates/festival/_delete_form.html.twig
Normal file
|
@ -0,0 +1,4 @@
|
|||
<form method="post" action="{{ path('app_festival_delete', {'id': festival.id}) }}" onsubmit="return confirm('Are you sure you want to delete this item?');">
|
||||
<input type="hidden" name="_token" value="{{ csrf_token('delete' ~ festival.id) }}">
|
||||
<button class="btn">Delete</button>
|
||||
</form>
|
4
templates/festival/_form.html.twig
Normal file
4
templates/festival/_form.html.twig
Normal file
|
@ -0,0 +1,4 @@
|
|||
{{ form_start(form) }}
|
||||
{{ form_widget(form) }}
|
||||
<button class="btn">{{ button_label|default('Save') }}</button>
|
||||
{{ form_end(form) }}
|
26
templates/festival/edit.html.twig
Executable file → Normal file
26
templates/festival/edit.html.twig
Executable file → Normal file
|
@ -1,25 +1,13 @@
|
|||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block title %}Edit Festival{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<h1>Festival edit</h1>
|
||||
<h1>Edit Festival</h1>
|
||||
|
||||
{{ form_start(edit_form) }}
|
||||
{{ form_widget(edit_form) }}
|
||||
<input type=submit value=" Envoyer
|
||||
"/>
|
||||
{{ form_end(edit_form) }}
|
||||
{{ include('festival/_form.html.twig', {'button_label': 'Update'}) }}
|
||||
|
||||
<ul>
|
||||
<li>
|
||||
<a class="btn btn-primary" href="{{ path('festival_index') }}">
|
||||
<i class="fa fa-arrow-left"></i>
|
||||
Retour à la liste
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
{{ form_start(delete_form) }}
|
||||
<input type="submit" value="Delete">
|
||||
{{ form_end(delete_form) }}
|
||||
</li>
|
||||
</ul>
|
||||
<a href="{{ path('app_festival_index') }}">back to list</a>
|
||||
|
||||
{{ include('festival/_delete_form.html.twig') }}
|
||||
{% endblock %}
|
||||
|
|
100
templates/festival/index.html.twig
Executable file → Normal file
100
templates/festival/index.html.twig
Executable file → Normal file
|
@ -1,95 +1,39 @@
|
|||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block title %}Festival index{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<div class="row heading-of-list">
|
||||
<div class="col-xs-6">
|
||||
<h1>Festivals</h1></div>
|
||||
<div class="col-xs-6">
|
||||
<a class="btn btn-primary" href="{{ path('festival_new') }}">Nouveau festival</a>
|
||||
</div>
|
||||
</div>
|
||||
<h1>Festival index</h1>
|
||||
|
||||
|
||||
<table class="table-responsive table-striped table table-bordered table-light">
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Id</th>
|
||||
<th>Name</th>
|
||||
<th>Datecreation</th>
|
||||
<th>Tous Frais</th>
|
||||
<th>Clients</th>
|
||||
<th>fond caisse avant</th>
|
||||
<th>fond caisse apres</th>
|
||||
<th>chiffre affaire</th>
|
||||
<th>fond caisse + CA</th>
|
||||
<th>diff</th>
|
||||
<th>bénefices CA - frais</th>
|
||||
<th>Actions</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Id</th>
|
||||
<th>Name</th>
|
||||
<th>Date_start</th>
|
||||
<th>Date_end</th>
|
||||
<th>actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
|
||||
{% for festival in festivals %}
|
||||
<tr
|
||||
{% if app.user.activeFestival and (app.user.activeFestival.id == festival.id) %}
|
||||
class="bg-success"
|
||||
{% endif %}
|
||||
>
|
||||
<td>
|
||||
<a class="btn btn-primary"
|
||||
href="{{ path('festival_show', { 'id': festival.id }) }}">{{ festival.id }}</a>
|
||||
</td>
|
||||
<tr>
|
||||
<td>{{ festival.id }}</td>
|
||||
<td>{{ festival.name }}</td>
|
||||
<td>{% if festival.dateCreation %}{{ festival.dateCreation|date('Y-m-d H:i:s') }}{% endif %}</td>
|
||||
<td>{{ festival.fraisInscription + festival.fraisTransport + festival.fraisRepas + festival.fraisHebergement }}
|
||||
€
|
||||
</td>
|
||||
|
||||
<td>{{ festival.sellRecords|length }}</td>
|
||||
<td>{{ festival.fondDeCaisseAvant }}€</td>
|
||||
<td>{{ festival.fondDeCaisseApres }}€</td>
|
||||
<td>{{ festival.chiffreAffaire }}€</td>
|
||||
<td>{{ festival.fondDeCaisseAvant + festival.chiffreAffaire }}€</td>
|
||||
<td
|
||||
class="{% if (festival.chiffreAffaire - festival.fondDeCaisseApres) != 0 %}
|
||||
bg-warning
|
||||
{% else %}
|
||||
bg-success
|
||||
{% endif %}"
|
||||
>{{ festival.chiffreAffaire - festival.fondDeCaisseApres }}€
|
||||
</td>
|
||||
<td>{{ festival.chiffreAffaire - (festival.fraisInscription + festival.fraisTransport + festival.fraisRepas + festival.fraisHebergement ) }}</td>
|
||||
<td>{{ festival.dateStart ? festival.dateStart|date('Y-m-d') : '' }}</td>
|
||||
<td>{{ festival.dateEnd ? festival.dateEnd|date('Y-m-d') : '' }}</td>
|
||||
<td>
|
||||
{% if app.user.activeFestival and (app.user.activeFestival.id == festival.id) %}
|
||||
<span class="badge badge-success">
|
||||
Actuel
|
||||
</span>
|
||||
{% else %}
|
||||
<a class="btn btn-success" href="{{ path('set_active_festival', { 'id': festival.id }) }}">
|
||||
choisir comme actuel
|
||||
</a>
|
||||
{% endif %}
|
||||
|
||||
{% if festival.user|length %}
|
||||
{% for u in festival.user %}
|
||||
<span class="badge badge-info">{{ u.username }}</span>
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
<div class="alert alert-info">
|
||||
|
||||
pas d'owner.
|
||||
</div>
|
||||
{% endif %}
|
||||
<a class="btn btn-primary" href="{{ path('festival_edit', { 'id': festival.id }) }}">
|
||||
<i class="fa fa-pencil"></i>
|
||||
Modifier
|
||||
</a>
|
||||
<a href="{{ path('app_festival_show', {'id': festival.id}) }}">show</a>
|
||||
<a href="{{ path('app_festival_edit', {'id': festival.id}) }}">edit</a>
|
||||
</td>
|
||||
</tr>
|
||||
{% else %}
|
||||
<tr>
|
||||
<td colspan="5">no records found</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<a class="btn btn-primary" href="{{ path('festival_new') }}">Nouveau festival</a>
|
||||
<a href="{{ path('app_festival_new') }}">Create new</a>
|
||||
{% endblock %}
|
||||
|
|
15
templates/festival/new.html.twig
Executable file → Normal file
15
templates/festival/new.html.twig
Executable file → Normal file
|
@ -1,16 +1,11 @@
|
|||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block title %}New Festival{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<h1>Festival creation</h1>
|
||||
<h1>Create new Festival</h1>
|
||||
|
||||
{{ form_start(form) }}
|
||||
{{ form_widget(form) }}
|
||||
<input class="btn btn-primary btn-block" type="submit" value="Créer" />
|
||||
{{ form_end(form) }}
|
||||
{{ include('festival/_form.html.twig') }}
|
||||
|
||||
<ul>
|
||||
<li>
|
||||
<a class="btn btn-primary" href="{{ path('festival_index') }}"> <i class="fa fa-arrow-left"></i>Retour à la liste</a>
|
||||
</li>
|
||||
</ul>
|
||||
<a href="{{ path('app_festival_index') }}">back to list</a>
|
||||
{% endblock %}
|
||||
|
|
53
templates/festival/show.html.twig
Executable file → Normal file
53
templates/festival/show.html.twig
Executable file → Normal file
|
@ -1,39 +1,34 @@
|
|||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block title %}Festival{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<h1>Festival</h1>
|
||||
|
||||
<table class="table-responsive table-striped table table-bordered table-light">
|
||||
<table class="table">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th>Id</th>
|
||||
<td>{{ festival.id }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<td>{{ festival.name }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Datecreation</th>
|
||||
<td>{% if festival.dateCreation %}{{ festival.dateCreation|date('Y-m-d H:i:s') }}{% endif %}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Id</th>
|
||||
<td>{{ festival.id }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<td>{{ festival.name }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Date_start</th>
|
||||
<td>{{ festival.dateStart ? festival.dateStart|date('Y-m-d') : '' }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Date_end</th>
|
||||
<td>{{ festival.dateEnd ? festival.dateEnd|date('Y-m-d') : '' }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<ul>
|
||||
<li>
|
||||
<a class="btn btn-primary" href="{{ path('festival_index') }}">
|
||||
<i class="fa fa-arrow-left"></i>
|
||||
Retour à la liste
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a class="btn btn-primary" href="{{ path('festival_edit', { 'id': festival.id }) }}">edit</a>
|
||||
</li>
|
||||
<li>
|
||||
{{ form_start(delete_form) }}
|
||||
<input type="submit" value="Delete">
|
||||
{{ form_end(delete_form) }}
|
||||
</li>
|
||||
</ul>
|
||||
<a href="{{ path('app_festival_index') }}">back to list</a>
|
||||
|
||||
<a href="{{ path('app_festival_edit', {'id': festival.id}) }}">edit</a>
|
||||
|
||||
{{ include('festival/_delete_form.html.twig') }}
|
||||
{% endblock %}
|
||||
|
|
4
templates/group_of_products/_delete_form.html.twig
Normal file
4
templates/group_of_products/_delete_form.html.twig
Normal file
|
@ -0,0 +1,4 @@
|
|||
<form method="post" action="{{ path('app_group_of_products_delete', {'id': group_of_product.id}) }}" onsubmit="return confirm('Are you sure you want to delete this item?');">
|
||||
<input type="hidden" name="_token" value="{{ csrf_token('delete' ~ group_of_product.id) }}">
|
||||
<button class="btn">Delete</button>
|
||||
</form>
|
4
templates/group_of_products/_form.html.twig
Normal file
4
templates/group_of_products/_form.html.twig
Normal file
|
@ -0,0 +1,4 @@
|
|||
{{ form_start(form) }}
|
||||
{{ form_widget(form) }}
|
||||
<button class="btn">{{ button_label|default('Save') }}</button>
|
||||
{{ form_end(form) }}
|
13
templates/group_of_products/edit.html.twig
Normal file
13
templates/group_of_products/edit.html.twig
Normal file
|
@ -0,0 +1,13 @@
|
|||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block title %}Edit GroupOfProducts{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<h1>Edit GroupOfProducts</h1>
|
||||
|
||||
{{ include('group_of_products/_form.html.twig', {'button_label': 'Update'}) }}
|
||||
|
||||
<a href="{{ path('app_group_of_products_index') }}">back to list</a>
|
||||
|
||||
{{ include('group_of_products/_delete_form.html.twig') }}
|
||||
{% endblock %}
|
35
templates/group_of_products/index.html.twig
Normal file
35
templates/group_of_products/index.html.twig
Normal file
|
@ -0,0 +1,35 @@
|
|||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block title %}GroupOfProducts index{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<h1>GroupOfProducts index</h1>
|
||||
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Id</th>
|
||||
<th>Name</th>
|
||||
<th>actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for group_of_product in group_of_products %}
|
||||
<tr>
|
||||
<td>{{ group_of_product.id }}</td>
|
||||
<td>{{ group_of_product.name }}</td>
|
||||
<td>
|
||||
<a href="{{ path('app_group_of_products_show', {'id': group_of_product.id}) }}">show</a>
|
||||
<a href="{{ path('app_group_of_products_edit', {'id': group_of_product.id}) }}">edit</a>
|
||||
</td>
|
||||
</tr>
|
||||
{% else %}
|
||||
<tr>
|
||||
<td colspan="3">no records found</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<a href="{{ path('app_group_of_products_new') }}">Create new</a>
|
||||
{% endblock %}
|
11
templates/group_of_products/new.html.twig
Normal file
11
templates/group_of_products/new.html.twig
Normal file
|
@ -0,0 +1,11 @@
|
|||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block title %}New GroupOfProducts{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<h1>Create new GroupOfProducts</h1>
|
||||
|
||||
{{ include('group_of_products/_form.html.twig') }}
|
||||
|
||||
<a href="{{ path('app_group_of_products_index') }}">back to list</a>
|
||||
{% endblock %}
|
26
templates/group_of_products/show.html.twig
Normal file
26
templates/group_of_products/show.html.twig
Normal file
|
@ -0,0 +1,26 @@
|
|||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block title %}GroupOfProducts{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<h1>GroupOfProducts</h1>
|
||||
|
||||
<table class="table">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th>Id</th>
|
||||
<td>{{ group_of_product.id }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<td>{{ group_of_product.name }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<a href="{{ path('app_group_of_products_index') }}">back to list</a>
|
||||
|
||||
<a href="{{ path('app_group_of_products_edit', {'id': group_of_product.id}) }}">edit</a>
|
||||
|
||||
{{ include('group_of_products/_delete_form.html.twig') }}
|
||||
{% endblock %}
|
4
templates/product/_delete_form.html.twig
Normal file
4
templates/product/_delete_form.html.twig
Normal file
|
@ -0,0 +1,4 @@
|
|||
<form method="post" action="{{ path('app_product_delete', {'id': product.id}) }}" onsubmit="return confirm('Are you sure you want to delete this item?');">
|
||||
<input type="hidden" name="_token" value="{{ csrf_token('delete' ~ product.id) }}">
|
||||
<button class="btn">Delete</button>
|
||||
</form>
|
4
templates/product/_form.html.twig
Normal file
4
templates/product/_form.html.twig
Normal file
|
@ -0,0 +1,4 @@
|
|||
{{ form_start(form) }}
|
||||
{{ form_widget(form) }}
|
||||
<button class="btn">{{ button_label|default('Save') }}</button>
|
||||
{{ form_end(form) }}
|
25
templates/product/edit.html.twig
Executable file → Normal file
25
templates/product/edit.html.twig
Executable file → Normal file
|
@ -1,24 +1,13 @@
|
|||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block title %}Edit Product{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<h1>Product edit</h1>
|
||||
<h1>Edit Product</h1>
|
||||
|
||||
{{ form_start(edit_form) }}
|
||||
{{ form_widget(edit_form) }}
|
||||
<input type="submit" value="Edit"/>
|
||||
{{ form_end(edit_form) }}
|
||||
{{ include('product/_form.html.twig', {'button_label': 'Update'}) }}
|
||||
|
||||
<ul>
|
||||
<li>
|
||||
<a class="btn btn-primary" href="{{ path('product_index') }}">
|
||||
<i class="fa fa-arrow-left"></i>
|
||||
Retour à la liste
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
{{ form_start(delete_form) }}
|
||||
<input type="submit" value="Delete">
|
||||
{{ form_end(delete_form) }}
|
||||
</li>
|
||||
</ul>
|
||||
<a href="{{ path('app_product_index') }}">back to list</a>
|
||||
|
||||
{{ include('product/_delete_form.html.twig') }}
|
||||
{% endblock %}
|
||||
|
|
79
templates/product/index.html.twig
Executable file → Normal file
79
templates/product/index.html.twig
Executable file → Normal file
|
@ -1,74 +1,39 @@
|
|||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block title %}Product index{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<div class="row heading-of-list">
|
||||
<div class="col-xs-6">
|
||||
<h1>Produits</h1></div>
|
||||
<div class="col-xs-6">
|
||||
<h1>Product index</h1>
|
||||
|
||||
<a class="btn btn-primary pull-right" href="{{ path('product_new') }}">Nouveau produit</a>
|
||||
<span class="hint alert alert-info pull-right">
|
||||
astuce: Utilisez
|
||||
<strong>
|
||||
|
||||
<a href="{{ path('import') }}">
|
||||
l'import de masse
|
||||
</a>
|
||||
</strong>
|
||||
pour créer plusieurs produits et catégories à la fois
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<table class="table-responsive table-striped table table-bordered table-light">
|
||||
<thead class="bg-dark">
|
||||
<tr>
|
||||
<th>Id</th>
|
||||
<th>Category</th>
|
||||
<th>Name</th>
|
||||
<th>Image</th>
|
||||
<th>Price</th>
|
||||
<th>Stocks</th>
|
||||
<th>Vendus</th>
|
||||
<th>Comment</th>
|
||||
<th>Actions</th>
|
||||
</tr>
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Id</th>
|
||||
<th>Name</th>
|
||||
<th>Price</th>
|
||||
<th>Stock</th>
|
||||
<th>actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for product in products %}
|
||||
<tr>
|
||||
<td>
|
||||
<a class="btn btn-primary btn-block"
|
||||
href="{{ path('product_show', { 'id': product.id }) }}">{{ product.id }}</a>
|
||||
</td>
|
||||
<td>
|
||||
<a class="btn btn-primary btn-block"
|
||||
href="{{ path('productcategory_edit', { 'id': product.category.id }) }}">
|
||||
{{ product.category.name }}
|
||||
</a>
|
||||
|
||||
|
||||
</td>
|
||||
<td>
|
||||
<a class="btn btn-default btn-block" href="{{ path('product_edit', { 'id': product.id }) }}">
|
||||
{{ product.name }}
|
||||
</a>
|
||||
</td>
|
||||
<td>{{ product.image }}</td>
|
||||
<td>{{ product.id }}</td>
|
||||
<td>{{ product.name }}</td>
|
||||
<td>{{ product.price }}</td>
|
||||
<td>{{ product.stockCount }}</td>
|
||||
<td>{{ product.productsSold | length }}</td>
|
||||
<td>{{ product.comment }}</td>
|
||||
<td>{{ product.stock }}</td>
|
||||
<td>
|
||||
<a class="btn btn-default" href="{{ path('product_edit', { 'id': product.id }) }}">
|
||||
<i class="fa fa-pencil"></i>
|
||||
</a>
|
||||
<a href="{{ path('app_product_show', {'id': product.id}) }}">show</a>
|
||||
<a href="{{ path('app_product_edit', {'id': product.id}) }}">edit</a>
|
||||
</td>
|
||||
</tr>
|
||||
{% else %}
|
||||
<tr>
|
||||
<td colspan="5">no records found</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<a class="btn btn-primary" href="{{ path('product_new') }}">Nouveau produit</a>
|
||||
<a href="{{ path('app_product_new') }}">Create new</a>
|
||||
{% endblock %}
|
||||
|
|
18
templates/product/new.html.twig
Executable file → Normal file
18
templates/product/new.html.twig
Executable file → Normal file
|
@ -1,19 +1,11 @@
|
|||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block title %}New Product{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<h1>Product creation</h1>
|
||||
<h1>Create new Product</h1>
|
||||
|
||||
{{ form_start(form) }}
|
||||
{{ form_widget(form) }}
|
||||
<input type="submit" class="btn btn-primary btn-block" value="Créer"/>
|
||||
{{ form_end(form) }}
|
||||
{{ include('product/_form.html.twig') }}
|
||||
|
||||
<ul>
|
||||
<li>
|
||||
<a class="btn btn-primary" href="{{ path('product_index') }}">
|
||||
<i class="fa fa-arrow-left"></i>
|
||||
Retour à la liste
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
<a href="{{ path('app_product_index') }}">back to list</a>
|
||||
{% endblock %}
|
||||
|
|
61
templates/product/show.html.twig
Executable file → Normal file
61
templates/product/show.html.twig
Executable file → Normal file
|
@ -1,47 +1,34 @@
|
|||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block title %}Product{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<h1>Product</h1>
|
||||
|
||||
<table class="table-responsive table-striped table table-bordered table-light">
|
||||
<table class="table">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th>Id</th>
|
||||
<td>{{ product.id }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<td>{{ product.name }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Image</th>
|
||||
<td>{{ product.image }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Price</th>
|
||||
<td>{{ product.price }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Comment</th>
|
||||
<td>{{ product.comment }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Id</th>
|
||||
<td>{{ product.id }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<td>{{ product.name }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Price</th>
|
||||
<td>{{ product.price }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Stock</th>
|
||||
<td>{{ product.stock }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<ul>
|
||||
<li>
|
||||
<a class="btn btn-primary" href="{{ path('product_index') }}">
|
||||
<i class="fa fa-arrow-left"></i>
|
||||
Retour à la liste
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a class="btn btn-primary" href="{{ path('product_edit', { 'id': product.id }) }}">edit</a>
|
||||
</li>
|
||||
<li>
|
||||
{{ form_start(delete_form) }}
|
||||
<input type="submit" value="Delete">
|
||||
{{ form_end(delete_form) }}
|
||||
</li>
|
||||
</ul>
|
||||
<a href="{{ path('app_product_index') }}">back to list</a>
|
||||
|
||||
<a href="{{ path('app_product_edit', {'id': product.id}) }}">edit</a>
|
||||
|
||||
{{ include('product/_delete_form.html.twig') }}
|
||||
{% endblock %}
|
||||
|
|
4
templates/selling/_delete_form.html.twig
Normal file
4
templates/selling/_delete_form.html.twig
Normal file
|
@ -0,0 +1,4 @@
|
|||
<form method="post" action="{{ path('app_selling_delete', {'id': selling.id}) }}" onsubmit="return confirm('Are you sure you want to delete this item?');">
|
||||
<input type="hidden" name="_token" value="{{ csrf_token('delete' ~ selling.id) }}">
|
||||
<button class="btn">Delete</button>
|
||||
</form>
|
4
templates/selling/_form.html.twig
Normal file
4
templates/selling/_form.html.twig
Normal file
|
@ -0,0 +1,4 @@
|
|||
{{ form_start(form) }}
|
||||
{{ form_widget(form) }}
|
||||
<button class="btn">{{ button_label|default('Save') }}</button>
|
||||
{{ form_end(form) }}
|
13
templates/selling/edit.html.twig
Normal file
13
templates/selling/edit.html.twig
Normal file
|
@ -0,0 +1,13 @@
|
|||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block title %}Edit Selling{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<h1>Edit Selling</h1>
|
||||
|
||||
{{ include('selling/_form.html.twig', {'button_label': 'Update'}) }}
|
||||
|
||||
<a href="{{ path('app_selling_index') }}">back to list</a>
|
||||
|
||||
{{ include('selling/_delete_form.html.twig') }}
|
||||
{% endblock %}
|
41
templates/selling/index.html.twig
Normal file
41
templates/selling/index.html.twig
Normal file
|
@ -0,0 +1,41 @@
|
|||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block title %}Selling index{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<h1>Selling index</h1>
|
||||
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Id</th>
|
||||
<th>Note</th>
|
||||
<th>Products</th>
|
||||
<th>Sum</th>
|
||||
<th>Reduction</th>
|
||||
<th>actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for selling in sellings %}
|
||||
<tr>
|
||||
<td>{{ selling.id }}</td>
|
||||
<td>{{ selling.note }}</td>
|
||||
<td>{{ selling.products }}</td>
|
||||
<td>{{ selling.sum }}</td>
|
||||
<td>{{ selling.reduction }}</td>
|
||||
<td>
|
||||
<a href="{{ path('app_selling_show', {'id': selling.id}) }}">show</a>
|
||||
<a href="{{ path('app_selling_edit', {'id': selling.id}) }}">edit</a>
|
||||
</td>
|
||||
</tr>
|
||||
{% else %}
|
||||
<tr>
|
||||
<td colspan="6">no records found</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<a href="{{ path('app_selling_new') }}">Create new</a>
|
||||
{% endblock %}
|
11
templates/selling/new.html.twig
Normal file
11
templates/selling/new.html.twig
Normal file
|
@ -0,0 +1,11 @@
|
|||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block title %}New Selling{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<h1>Create new Selling</h1>
|
||||
|
||||
{{ include('selling/_form.html.twig') }}
|
||||
|
||||
<a href="{{ path('app_selling_index') }}">back to list</a>
|
||||
{% endblock %}
|
38
templates/selling/show.html.twig
Normal file
38
templates/selling/show.html.twig
Normal file
|
@ -0,0 +1,38 @@
|
|||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block title %}Selling{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<h1>Selling</h1>
|
||||
|
||||
<table class="table">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th>Id</th>
|
||||
<td>{{ selling.id }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Note</th>
|
||||
<td>{{ selling.note }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Products</th>
|
||||
<td>{{ selling.products }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Sum</th>
|
||||
<td>{{ selling.sum }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Reduction</th>
|
||||
<td>{{ selling.reduction }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<a href="{{ path('app_selling_index') }}">back to list</a>
|
||||
|
||||
<a href="{{ path('app_selling_edit', {'id': selling.id}) }}">edit</a>
|
||||
|
||||
{{ include('selling/_delete_form.html.twig') }}
|
||||
{% endblock %}
|
25
templates/toMigrate/festival/edit.html.twig
Executable file
25
templates/toMigrate/festival/edit.html.twig
Executable file
|
@ -0,0 +1,25 @@
|
|||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block body %}
|
||||
<h1>Festival edit</h1>
|
||||
|
||||
{{ form_start(edit_form) }}
|
||||
{{ form_widget(edit_form) }}
|
||||
<input type=submit value=" Envoyer
|
||||
"/>
|
||||
{{ form_end(edit_form) }}
|
||||
|
||||
<ul>
|
||||
<li>
|
||||
<a class="btn btn-primary" href="{{ path('festival_index') }}">
|
||||
<i class="fa fa-arrow-left"></i>
|
||||
Retour à la liste
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
{{ form_start(delete_form) }}
|
||||
<input type="submit" value="Delete">
|
||||
{{ form_end(delete_form) }}
|
||||
</li>
|
||||
</ul>
|
||||
{% endblock %}
|
95
templates/toMigrate/festival/index.html.twig
Executable file
95
templates/toMigrate/festival/index.html.twig
Executable file
|
@ -0,0 +1,95 @@
|
|||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block body %}
|
||||
<div class="row heading-of-list">
|
||||
<div class="col-xs-6">
|
||||
<h1>Festivals</h1></div>
|
||||
<div class="col-xs-6">
|
||||
<a class="btn btn-primary" href="{{ path('festival_new') }}">Nouveau festival</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<table class="table-responsive table-striped table table-bordered table-light">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Id</th>
|
||||
<th>Name</th>
|
||||
<th>Datecreation</th>
|
||||
<th>Tous Frais</th>
|
||||
<th>Clients</th>
|
||||
<th>fond caisse avant</th>
|
||||
<th>fond caisse apres</th>
|
||||
<th>chiffre affaire</th>
|
||||
<th>fond caisse + CA</th>
|
||||
<th>diff</th>
|
||||
<th>bénefices CA - frais</th>
|
||||
<th>Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
|
||||
{% for festival in festivals %}
|
||||
<tr
|
||||
{% if app.user.activeFestival and (app.user.activeFestival.id == festival.id) %}
|
||||
class="bg-success"
|
||||
{% endif %}
|
||||
>
|
||||
<td>
|
||||
<a class="btn btn-primary"
|
||||
href="{{ path('festival_show', { 'id': festival.id }) }}">{{ festival.id }}</a>
|
||||
</td>
|
||||
<td>{{ festival.name }}</td>
|
||||
<td>{% if festival.dateCreation %}{{ festival.dateCreation|date('Y-m-d H:i:s') }}{% endif %}</td>
|
||||
<td>{{ festival.fraisInscription + festival.fraisTransport + festival.fraisRepas + festival.fraisHebergement }}
|
||||
€
|
||||
</td>
|
||||
|
||||
<td>{{ festival.sellRecords|length }}</td>
|
||||
<td>{{ festival.fondDeCaisseAvant }}€</td>
|
||||
<td>{{ festival.fondDeCaisseApres }}€</td>
|
||||
<td>{{ festival.chiffreAffaire }}€</td>
|
||||
<td>{{ festival.fondDeCaisseAvant + festival.chiffreAffaire }}€</td>
|
||||
<td
|
||||
class="{% if (festival.chiffreAffaire - festival.fondDeCaisseApres) != 0 %}
|
||||
bg-warning
|
||||
{% else %}
|
||||
bg-success
|
||||
{% endif %}"
|
||||
>{{ festival.chiffreAffaire - festival.fondDeCaisseApres }}€
|
||||
</td>
|
||||
<td>{{ festival.chiffreAffaire - (festival.fraisInscription + festival.fraisTransport + festival.fraisRepas + festival.fraisHebergement ) }}</td>
|
||||
<td>
|
||||
{% if app.user.activeFestival and (app.user.activeFestival.id == festival.id) %}
|
||||
<span class="badge badge-success">
|
||||
Actuel
|
||||
</span>
|
||||
{% else %}
|
||||
<a class="btn btn-success" href="{{ path('set_active_festival', { 'id': festival.id }) }}">
|
||||
choisir comme actuel
|
||||
</a>
|
||||
{% endif %}
|
||||
|
||||
{% if festival.user|length %}
|
||||
{% for u in festival.user %}
|
||||
<span class="badge badge-info">{{ u.username }}</span>
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
<div class="alert alert-info">
|
||||
|
||||
pas d'owner.
|
||||
</div>
|
||||
{% endif %}
|
||||
<a class="btn btn-primary" href="{{ path('festival_edit', { 'id': festival.id }) }}">
|
||||
<i class="fa fa-pencil"></i>
|
||||
Modifier
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<a class="btn btn-primary" href="{{ path('festival_new') }}">Nouveau festival</a>
|
||||
{% endblock %}
|
16
templates/toMigrate/festival/new.html.twig
Executable file
16
templates/toMigrate/festival/new.html.twig
Executable file
|
@ -0,0 +1,16 @@
|
|||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block body %}
|
||||
<h1>Festival creation</h1>
|
||||
|
||||
{{ form_start(form) }}
|
||||
{{ form_widget(form) }}
|
||||
<input class="btn btn-primary btn-block" type="submit" value="Créer" />
|
||||
{{ form_end(form) }}
|
||||
|
||||
<ul>
|
||||
<li>
|
||||
<a class="btn btn-primary" href="{{ path('festival_index') }}"> <i class="fa fa-arrow-left"></i>Retour à la liste</a>
|
||||
</li>
|
||||
</ul>
|
||||
{% endblock %}
|
39
templates/toMigrate/festival/show.html.twig
Executable file
39
templates/toMigrate/festival/show.html.twig
Executable file
|
@ -0,0 +1,39 @@
|
|||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block body %}
|
||||
<h1>Festival</h1>
|
||||
|
||||
<table class="table-responsive table-striped table table-bordered table-light">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th>Id</th>
|
||||
<td>{{ festival.id }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<td>{{ festival.name }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Datecreation</th>
|
||||
<td>{% if festival.dateCreation %}{{ festival.dateCreation|date('Y-m-d H:i:s') }}{% endif %}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<ul>
|
||||
<li>
|
||||
<a class="btn btn-primary" href="{{ path('festival_index') }}">
|
||||
<i class="fa fa-arrow-left"></i>
|
||||
Retour à la liste
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a class="btn btn-primary" href="{{ path('festival_edit', { 'id': festival.id }) }}">edit</a>
|
||||
</li>
|
||||
<li>
|
||||
{{ form_start(delete_form) }}
|
||||
<input type="submit" value="Delete">
|
||||
{{ form_end(delete_form) }}
|
||||
</li>
|
||||
</ul>
|
||||
{% endblock %}
|
24
templates/toMigrate/product/edit.html.twig
Executable file
24
templates/toMigrate/product/edit.html.twig
Executable file
|
@ -0,0 +1,24 @@
|
|||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block body %}
|
||||
<h1>Product edit</h1>
|
||||
|
||||
{{ form_start(edit_form) }}
|
||||
{{ form_widget(edit_form) }}
|
||||
<input type="submit" value="Edit"/>
|
||||
{{ form_end(edit_form) }}
|
||||
|
||||
<ul>
|
||||
<li>
|
||||
<a class="btn btn-primary" href="{{ path('product_index') }}">
|
||||
<i class="fa fa-arrow-left"></i>
|
||||
Retour à la liste
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
{{ form_start(delete_form) }}
|
||||
<input type="submit" value="Delete">
|
||||
{{ form_end(delete_form) }}
|
||||
</li>
|
||||
</ul>
|
||||
{% endblock %}
|
74
templates/toMigrate/product/index.html.twig
Executable file
74
templates/toMigrate/product/index.html.twig
Executable file
|
@ -0,0 +1,74 @@
|
|||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block body %}
|
||||
<div class="row heading-of-list">
|
||||
<div class="col-xs-6">
|
||||
<h1>Produits</h1></div>
|
||||
<div class="col-xs-6">
|
||||
|
||||
<a class="btn btn-primary pull-right" href="{{ path('product_new') }}">Nouveau produit</a>
|
||||
<span class="hint alert alert-info pull-right">
|
||||
astuce: Utilisez
|
||||
<strong>
|
||||
|
||||
<a href="{{ path('import') }}">
|
||||
l'import de masse
|
||||
</a>
|
||||
</strong>
|
||||
pour créer plusieurs produits et catégories à la fois
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<table class="table-responsive table-striped table table-bordered table-light">
|
||||
<thead class="bg-dark">
|
||||
<tr>
|
||||
<th>Id</th>
|
||||
<th>Category</th>
|
||||
<th>Name</th>
|
||||
<th>Image</th>
|
||||
<th>Price</th>
|
||||
<th>Stocks</th>
|
||||
<th>Vendus</th>
|
||||
<th>Comment</th>
|
||||
<th>Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for product in products %}
|
||||
<tr>
|
||||
<td>
|
||||
<a class="btn btn-primary btn-block"
|
||||
href="{{ path('product_show', { 'id': product.id }) }}">{{ product.id }}</a>
|
||||
</td>
|
||||
<td>
|
||||
<a class="btn btn-primary btn-block"
|
||||
href="{{ path('productcategory_edit', { 'id': product.category.id }) }}">
|
||||
{{ product.category.name }}
|
||||
</a>
|
||||
|
||||
|
||||
</td>
|
||||
<td>
|
||||
<a class="btn btn-default btn-block" href="{{ path('product_edit', { 'id': product.id }) }}">
|
||||
{{ product.name }}
|
||||
</a>
|
||||
</td>
|
||||
<td>{{ product.image }}</td>
|
||||
<td>{{ product.price }}</td>
|
||||
<td>{{ product.stockCount }}</td>
|
||||
<td>{{ product.productsSold | length }}</td>
|
||||
<td>{{ product.comment }}</td>
|
||||
<td>
|
||||
<a class="btn btn-default" href="{{ path('product_edit', { 'id': product.id }) }}">
|
||||
<i class="fa fa-pencil"></i>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<a class="btn btn-primary" href="{{ path('product_new') }}">Nouveau produit</a>
|
||||
{% endblock %}
|
19
templates/toMigrate/product/new.html.twig
Executable file
19
templates/toMigrate/product/new.html.twig
Executable file
|
@ -0,0 +1,19 @@
|
|||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block body %}
|
||||
<h1>Product creation</h1>
|
||||
|
||||
{{ form_start(form) }}
|
||||
{{ form_widget(form) }}
|
||||
<input type="submit" class="btn btn-primary btn-block" value="Créer"/>
|
||||
{{ form_end(form) }}
|
||||
|
||||
<ul>
|
||||
<li>
|
||||
<a class="btn btn-primary" href="{{ path('product_index') }}">
|
||||
<i class="fa fa-arrow-left"></i>
|
||||
Retour à la liste
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
{% endblock %}
|
47
templates/toMigrate/product/show.html.twig
Executable file
47
templates/toMigrate/product/show.html.twig
Executable file
|
@ -0,0 +1,47 @@
|
|||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block body %}
|
||||
<h1>Product</h1>
|
||||
|
||||
<table class="table-responsive table-striped table table-bordered table-light">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th>Id</th>
|
||||
<td>{{ product.id }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<td>{{ product.name }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Image</th>
|
||||
<td>{{ product.image }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Price</th>
|
||||
<td>{{ product.price }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Comment</th>
|
||||
<td>{{ product.comment }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<ul>
|
||||
<li>
|
||||
<a class="btn btn-primary" href="{{ path('product_index') }}">
|
||||
<i class="fa fa-arrow-left"></i>
|
||||
Retour à la liste
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a class="btn btn-primary" href="{{ path('product_edit', { 'id': product.id }) }}">edit</a>
|
||||
</li>
|
||||
<li>
|
||||
{{ form_start(delete_form) }}
|
||||
<input type="submit" value="Delete">
|
||||
{{ form_end(delete_form) }}
|
||||
</li>
|
||||
</ul>
|
||||
{% endblock %}
|
Loading…
Add table
Add a link
Reference in a new issue