Browse Source

[Backend] nombre éléments listes + sauvegardes attributs

develop
Fab 3 years ago
parent
commit
37e659edbc
13 changed files with 273 additions and 93 deletions
  1. +45
    -2
      ShopBundle/Controller/Backend/AdminController.php
  2. +4
    -3
      ShopBundle/Controller/Backend/DocumentController.php
  3. +5
    -6
      ShopBundle/Controller/Backend/NewsController.php
  4. +3
    -2
      ShopBundle/Controller/Backend/OrderController.php
  5. +3
    -4
      ShopBundle/Controller/Backend/ProductFamilyController.php
  6. +3
    -3
      ShopBundle/Controller/Backend/TicketController.php
  7. +4
    -2
      ShopBundle/Controller/Backend/UserMerchantController.php
  8. +81
    -64
      ShopBundle/Resources/public/css/backend/custom.css
  9. +6
    -0
      ShopBundle/Resources/public/sass/backend/custom.scss
  10. +2
    -2
      ShopBundle/Resources/views/backend/default/block/list_tickets.html.twig
  11. +103
    -0
      ShopBundle/Resources/views/backend/default/block/paginator.html.twig
  12. +1
    -3
      ShopBundle/Resources/views/backend/default/field/supplier.html.twig
  13. +13
    -2
      ShopBundle/Resources/views/backend/default/list.html.twig

+ 45
- 2
ShopBundle/Controller/Backend/AdminController.php View File

@@ -29,6 +29,7 @@ use Symfony\Component\Form\FormEvent;
use Symfony\Component\Form\FormEvents;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpFoundation\Session\SessionInterface;
use Symfony\Component\Security\Core\Security;
use Symfony\Contracts\Translation\TranslatorInterface;

@@ -44,10 +45,11 @@ class AdminController extends EasyAdminController
protected $mailUtils ;
protected $translator;
protected $utilsProcess;
protected $session;
protected $filtersForm = null;

public function __construct(Security $security, UserManagerInterface $userManager, EntityManagerInterface $em,
MailjetTransport $mailjetTransport, UtilsManager $utilsManager, TranslatorInterface $translator)
MailjetTransport $mailjetTransport, UtilsManager $utilsManager, TranslatorInterface $translator, SessionInterface $session)
{
$this->security = $security;
$this->userManager = $userManager;
@@ -59,6 +61,7 @@ class AdminController extends EasyAdminController
$this->mailUtils = $utilsManager->getMailUtils() ;
$this->utilsProcess = $utilsManager->getUtilsProcess() ;
$this->translator = $translator;
$this->session = $session;
}

public function createCustomForm($class, $action, $parameters, $data = true, $options = array())
@@ -176,7 +179,7 @@ class AdminController extends EasyAdminController

if ($this->filtersForm->isSubmitted() && $this->filtersForm->isValid()) {
foreach ($listFields as $field) {
if ($this->filtersForm->has($field['property'])) {
if ($this->filtersForm->has($field['property'])) {
switch ($field['dataType']) {
case 'option':
case 'integer':
@@ -302,6 +305,46 @@ class AdminController extends EasyAdminController
return $this->executeDynamicMethod('render<EntityName>Template', ['list', $this->entity['templates']['list'], $parameters]);
}

protected function getListParam($param, $default =null){
$entityName = $this->entity['name'];
$sessionParam = $entityName.$param;
//CUSTOM
if($param == 'maxResults'){
$val = $this->entity['list']['max_results'];
}else{
$val = $this->request->query->get($param, $default);
}

if(isset($_GET[$param])){
$val = $this->request->query->get($param);
$this->session->set($sessionParam, $val);
}else if($this->session->get($sessionParam)){
$val = $this->session->get($sessionParam);
$this->request->query->set($param, $val);
}

return $val;
}

protected function listAction()
{
$this->dispatch(EasyAdminEvents::PRE_LIST);

$fields = $this->entity['list']['fields'];

$paginator = $this->findAll($this->entity['class'], $this->getListParam('page', 1), $this->getListParam('maxResults'), $this->getListParam('sortField'), $this->getListParam('sortDirection'), $this->entity['list']['dql_filter']);

$this->dispatch(EasyAdminEvents::POST_LIST, ['paginator' => $paginator]);

$parameters = [
'paginator' => $paginator,
'fields' => $fields,
'batch_form' => $this->createBatchForm($this->entity['name'])->createView(),
'delete_form_template' => $this->createDeleteForm($this->entity['name'], '__id__')->createView(),
];

return $this->executeDynamicMethod('render<EntityName>Template', ['list', $this->entity['templates']['list'], $parameters]);
}

public function sortAction()
{

+ 4
- 3
ShopBundle/Controller/Backend/DocumentController.php View File

@@ -11,6 +11,7 @@ use Lc\ShopBundle\Services\Utils;
use Lc\ShopBundle\Services\UtilsManager;
use Mailjet\MailjetSwiftMailer\SwiftMailer\MailjetTransport;
use Symfony\Component\HttpFoundation\BinaryFileResponse;
use Symfony\Component\HttpFoundation\Session\SessionInterface;
use Symfony\Component\HttpFoundation\StreamedResponse;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
use Symfony\Component\Security\Core\Security;
@@ -20,9 +21,9 @@ class DocumentController extends AdminController
{
protected $documentRepository ;

public function __construct(Security $security, UserManagerInterface $userManager, EntityManagerInterface $em, MailjetTransport $mailjetTransport, UtilsManager $utilsManager, TranslatorInterface $translator)
public function __construct(Security $security, UserManagerInterface $userManager, EntityManagerInterface $em, MailjetTransport $mailjetTransport, UtilsManager $utilsManager, TranslatorInterface $translator, SessionInterface $session)
{
parent::__construct($security, $userManager, $em, $mailjetTransport, $utilsManager, $translator);
parent::__construct($security, $userManager, $em, $mailjetTransport, $utilsManager, $translator, $session);
$this->documentRepository = $this->em->getRepository($this->em->getClassMetadata(DocumentInterface::class)->getName()) ;
}

@@ -47,4 +48,4 @@ class DocumentController extends AdminController
}
}

}
}

+ 5
- 6
ShopBundle/Controller/Backend/NewsController.php View File

@@ -11,6 +11,7 @@ use Lc\ShopBundle\Services\MailUtils;
use Lc\ShopBundle\Services\UtilsManager;
use Mailjet\MailjetSwiftMailer\SwiftMailer\MailjetTransport;
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface;
use Symfony\Component\HttpFoundation\Session\SessionInterface;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
use Symfony\Component\Security\Core\Security;
@@ -21,12 +22,10 @@ class NewsController extends AdminController
{
protected $parameterBag ;

public function __construct(Security $security, UserManagerInterface $userManager, EntityManagerInterface $em,
MailjetTransport $mailjetTransport, UtilsManager $utilsManager, TranslatorInterface $translator,
ParameterBagInterface $parameterBag)
public function __construct(Security $security, UserManagerInterface $userManager, EntityManagerInterface $em, MailjetTransport $mailjetTransport, UtilsManager $utilsManager, TranslatorInterface $translator, SessionInterface $session, ParameterBagInterface $parameterBag)
{
parent::__construct($security, $userManager, $em, $mailjetTransport, $utilsManager, $translator, $session);
$this->parameterBag = $parameterBag ;
parent::__construct($security, $userManager, $em, $mailjetTransport, $utilsManager, $translator);
}

public function sendTestAction()
@@ -68,7 +67,7 @@ class NewsController extends AdminController
$newsletter = $this->getNewsletter() ;
$news = $this->getNews() ;
$users = $this->em->getRepository($this->em->getClassMetadata(UserInterface::class)->getName())->findAllByNewsletter($newsletter) ;
$countUsers = count($users) ;

$packageMessagesArray = [];
@@ -167,4 +166,4 @@ class NewsController extends AdminController
}
}

}
}

+ 3
- 2
ShopBundle/Controller/Backend/OrderController.php View File

@@ -33,6 +33,7 @@ use Mailjet\MailjetSwiftMailer\SwiftMailer\MailjetTransport;
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpFoundation\Session\SessionInterface;
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
use Symfony\Component\Security\Core\Security;
use Symfony\Contracts\Translation\TranslatorInterface;
@@ -43,11 +44,11 @@ class OrderController extends AdminController
protected $creditUtils;
protected $mailUtils;

public function __construct(Security $security, UserManagerInterface $userManager, EntityManagerInterface $em, MailjetTransport $mailjetTransport, UtilsManager $utilsManager, TranslatorInterface $translator)
public function __construct(Security $security, UserManagerInterface $userManager, EntityManagerInterface $em, MailjetTransport $mailjetTransport, UtilsManager $utilsManager, TranslatorInterface $translator, SessionInterface $session)
{
parent::__construct($security, $userManager, $em, $mailjetTransport, $utilsManager, $translator, $session);
$this->creditUtils = $utilsManager->getCreditUtils();
$this->mailUtils = $utilsManager->getMailUtils();
parent::__construct($security, $userManager, $em, $mailjetTransport, $utilsManager, $translator);
}

protected function createListQueryBuilder($entityClass, $sortDirection, $sortField = null, $dqlFilter = null)

+ 3
- 4
ShopBundle/Controller/Backend/ProductFamilyController.php View File

@@ -25,6 +25,7 @@ use Symfony\Component\Form\Extension\Core\Type\HiddenType;
use Symfony\Component\Form\Extension\Core\Type\NumberType;
use Symfony\Component\Form\FormError;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpFoundation\Session\SessionInterface;
use Symfony\Component\Security\Core\Security;
use Symfony\Contracts\Translation\TranslatorInterface;
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface;
@@ -37,11 +38,9 @@ class ProductFamilyController extends AdminController
private $parameterBag ;
private $productFamilyUtils ;

public function __construct(Security $security, UserManagerInterface $userManager, EntityManagerInterface $em,
MailjetTransport $mailjetTransport, UtilsManager $utilsManager, TranslatorInterface $translator,
ParameterBagInterface $parameterBag)
public function __construct(Security $security, UserManagerInterface $userManager, EntityManagerInterface $em, MailjetTransport $mailjetTransport, UtilsManager $utilsManager, TranslatorInterface $translator, SessionInterface $session, ParameterBagInterface $parameterBag)
{
parent::__construct($security, $userManager, $em, $mailjetTransport, $utilsManager, $translator);
parent::__construct($security, $userManager, $em, $mailjetTransport, $utilsManager, $translator, $session);
$this->parameterBag = $parameterBag ;
$this->productFamilyUtils = $utilsManager->getProductFamilyUtils() ;
}

+ 3
- 3
ShopBundle/Controller/Backend/TicketController.php View File

@@ -13,6 +13,7 @@ use Lc\ShopBundle\Model\Ticket;
use Lc\ShopBundle\Services\UtilsManager;
use Mailjet\MailjetSwiftMailer\SwiftMailer\MailjetTransport;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpFoundation\Session\SessionInterface;
use Symfony\Component\Security\Core\Security;
use Symfony\Contracts\Translation\TranslatorInterface;

@@ -21,12 +22,11 @@ class TicketController extends AdminController
protected $ticketUtils;
protected $userUtils;

public function __construct(Security $security, UserManagerInterface $userManager, EntityManagerInterface $em, MailjetTransport $mailjetTransport, UtilsManager $utilsManager, TranslatorInterface $translator)
public function __construct(Security $security, UserManagerInterface $userManager, EntityManagerInterface $em, MailjetTransport $mailjetTransport, UtilsManager $utilsManager, TranslatorInterface $translator, SessionInterface $session)
{
parent::__construct($security, $userManager, $em, $mailjetTransport, $utilsManager, $translator, $session);
$this->ticketUtils = $utilsManager->getTicketUtils();
$this->userUtils = $utilsManager->getUserUtils();
parent::__construct($security, $userManager, $em, $mailjetTransport, $utilsManager, $translator);

}

public function persistTicketEntity($entity, $form)

+ 4
- 2
ShopBundle/Controller/Backend/UserMerchantController.php View File

@@ -16,6 +16,7 @@ use Lc\ShopBundle\Services\UtilsManager;
use Mailjet\MailjetSwiftMailer\SwiftMailer\MailjetTransport;
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
use Symfony\Component\HttpFoundation\Session\SessionInterface;
use Symfony\Component\Security\Core\Security;
use Symfony\Contracts\Translation\TranslatorInterface;

@@ -23,10 +24,11 @@ class UserMerchantController extends AdminController
{
protected $creditUtils;

public function __construct(Security $security, UserManagerInterface $userManager, EntityManagerInterface $em, MailjetTransport $mailjetTransport, UtilsManager $utilsManager, TranslatorInterface $translator)
public function __construct(Security $security, UserManagerInterface $userManager, EntityManagerInterface $em, MailjetTransport $mailjetTransport, UtilsManager $utilsManager, TranslatorInterface $translator, SessionInterface $session)
{
parent::__construct($security, $userManager, $em, $mailjetTransport, $utilsManager, $translator);
parent::__construct($security, $userManager, $em, $mailjetTransport, $utilsManager, $translator, $session);
$this->creditUtils = $utilsManager->getCreditUtils();

}

public function addCreditHistoryAction(){

+ 81
- 64
ShopBundle/Resources/public/css/backend/custom.css View File

@@ -478,18 +478,35 @@ table th .select2-container--default .select2-selection--single {
min-width: 170px;
}

/* Sortable */
/*************************** PAGINATION *******************************/
/* line 152, ../../sass/backend/custom.scss */
.pagination {
justify-content: center;
}

/* line 153, ../../sass/backend/custom.scss */
.disabled .page-link {
color: #343a40;
}

/* line 154, ../../sass/backend/custom.scss */
.disabled .page-link:hover, .page-link.current:hover {
background-color: #fff;
cursor: default;
}

/* Sortable */
/* line 159, ../../sass/backend/custom.scss */
.ui-sortable-helper {
display: table;
}

/* line 155, ../../sass/backend/custom.scss */
/* line 160, ../../sass/backend/custom.scss */
.ui-state-highlight {
background: #eee;
}

/* line 156, ../../sass/backend/custom.scss */
/* line 161, ../../sass/backend/custom.scss */
.lc-sortable div:last-child {
display: none;
}
@@ -506,13 +523,13 @@ table th .select2-container--default .select2-selection--single {
.lc-ckfinder-wrap .lc-ckfinder-button{width: 100%; bottom: 0px; left: 0; position: absolute;}
*/
/* VUES JS */
/* line 171, ../../sass/backend/custom.scss */
/* line 176, ../../sass/backend/custom.scss */
.nav-item .btn {
padding-right: 15px;
position: relative;
}

/* line 172, ../../sass/backend/custom.scss */
/* line 177, ../../sass/backend/custom.scss */
.nav-item .btn .invalid-form {
display: none;
position: absolute;
@@ -524,67 +541,67 @@ table th .select2-container--default .select2-selection--single {
font-size: 1.2rem;
}

/* line 173, ../../sass/backend/custom.scss */
/* line 178, ../../sass/backend/custom.scss */
.nav-item.has-invalid .btn .invalid-form {
display: inline-block;
z-index: 2;
}

/* ProductFamily */
/* line 178, ../../sass/backend/custom.scss */
/* line 183, ../../sass/backend/custom.scss */
.field-unit-quantity {
border-bottom: 2px dotted #eee;
padding-bottom: 10px;
margin-bottom: 20px;
}

/* line 179, ../../sass/backend/custom.scss */
/* line 184, ../../sass/backend/custom.scss */
.field-reduction-apply {
border-top: 2px dotted #eee;
padding-top: 10px;
margin-top: 20px;
}

/* line 181, ../../sass/backend/custom.scss */
/* line 186, ../../sass/backend/custom.scss */
.new-productfamily #nav-params,
.edit-productfamily #nav-params {
margin-bottom: 30px;
}

/* line 186, ../../sass/backend/custom.scss */
/* line 191, ../../sass/backend/custom.scss */
.new-productfamily #nav-params .btn,
.edit-productfamily #nav-params .btn {
margin-left: 20px;
}

/* line 191, ../../sass/backend/custom.scss */
/* line 196, ../../sass/backend/custom.scss */
.new-productfamily #product-categories .row,
.edit-productfamily #product-categories .row {
padding: 10px;
}

/* line 196, ../../sass/backend/custom.scss */
/* line 201, ../../sass/backend/custom.scss */
.new-productfamily #product-categories .form-group,
.edit-productfamily #product-categories .form-group {
width: 100%;
padding: 4px;
}

/* line 202, ../../sass/backend/custom.scss */
/* line 207, ../../sass/backend/custom.scss */
.new-productfamily #product-categories .children,
.edit-productfamily #product-categories .children {
margin-left: 20px;
width: 100%;
}

/* line 208, ../../sass/backend/custom.scss */
/* line 213, ../../sass/backend/custom.scss */
.new-productfamily ul.products,
.edit-productfamily ul.products {
padding: 0px;
list-style-type: none;
}

/* line 214, ../../sass/backend/custom.scss */
/* line 219, ../../sass/backend/custom.scss */
.new-productfamily ul.products li.product,
.edit-productfamily ul.products li.product {
padding: 0px;
@@ -592,55 +609,55 @@ table th .select2-container--default .select2-selection--single {
position: relative;
}

/* line 221, ../../sass/backend/custom.scss */
/* line 226, ../../sass/backend/custom.scss */
.new-productfamily ul.products li.add,
.edit-productfamily ul.products li.add {
text-align: right;
}

/* line 226, ../../sass/backend/custom.scss */
/* line 231, ../../sass/backend/custom.scss */
.autoresize textarea {
height: auto;
min-height: 38px;
}

/* line 228, ../../sass/backend/custom.scss */
/* line 233, ../../sass/backend/custom.scss */
.field-price .input-group.buyingPrice input, .field-price .input-group.buyingPrice .input-group-text {
font-weight: bold;
border-color: #222;
}

/* line 229, ../../sass/backend/custom.scss */
/* line 234, ../../sass/backend/custom.scss */
.field-price .input-group.buyingPriceByRefUnit input, .field-price .input-group.buyingPriceByRefUnit .input-group-text {
font-weight: bold;
border-color: #222;
}

/* line 230, ../../sass/backend/custom.scss */
/* line 235, ../../sass/backend/custom.scss */
.field-price .input-group.priceWithTax input, .field-price .input-group.priceWithTax .input-group-text {
font-weight: bold;
border-color: #222;
}

/* line 231, ../../sass/backend/custom.scss */
/* line 236, ../../sass/backend/custom.scss */
.field-price .input-group.priceByRefUnitWithTax input, .field-price .input-group.priceByRefUnitWithTax .input-group-text {
font-weight: bold;
border-color: #222;
}

/* line 232, ../../sass/backend/custom.scss */
/* line 237, ../../sass/backend/custom.scss */
.input-group.multiplyingFactor input, .input-group.multiplyingFactor .input-group-text {
font-weight: bold;
border-color: #222;
}

/* ORDER */
/* line 238, ../../sass/backend/custom.scss */
/* line 243, ../../sass/backend/custom.scss */
.table-order-summary {
width: 100%;
}

/* line 241, ../../sass/backend/custom.scss */
/* line 246, ../../sass/backend/custom.scss */
.order-product-item.redelivery {
background: rgba(18, 104, 253, 0.38) !important;
}
@@ -648,36 +665,36 @@ table th .select2-container--default .select2-selection--single {
/*.select2-container--bootstrap .select2-selection{max-width: none;}*/
/*.order-product-item{margin: 15px 0; padding: 0;}*/
/* Product */
/* line 246, ../../sass/backend/custom.scss */
/* line 251, ../../sass/backend/custom.scss */
.product-form-modal {
display: none;
}

/* line 247, ../../sass/backend/custom.scss */
/* line 252, ../../sass/backend/custom.scss */
.product-form.modal .form-check-label {
font-style: italic;
color: #666;
text-align: left;
}

/* line 248, ../../sass/backend/custom.scss */
/* line 253, ../../sass/backend/custom.scss */
.products-collection-table .inherited {
color: #888;
font-style: italic;
font-weight: initial;
}

/* line 249, ../../sass/backend/custom.scss */
/* line 254, ../../sass/backend/custom.scss */
.products-collection-table td {
position: relative;
}

/* line 250, ../../sass/backend/custom.scss */
/* line 255, ../../sass/backend/custom.scss */
.card-body.p-0 .products-collection-table tbody > tr > td:first-of-type, .card-body.p-0 .products-collection-table tbody > tr > th:first-of-type, .card-body.p-0 .products-collection-table thead > tr > td:first-of-type, .card-body.p-0 .products-collection-table thead > tr > th:first-of-type {
padding-left: 0.35rem;
}

/* line 251, ../../sass/backend/custom.scss */
/* line 256, ../../sass/backend/custom.scss */
.products-collection-table .btn-empty-field {
position: absolute;
right: 3px;
@@ -686,14 +703,14 @@ table th .select2-container--default .select2-selection--single {
padding: 0px;
}

/* line 252, ../../sass/backend/custom.scss */
/* line 257, ../../sass/backend/custom.scss */
#lc-product-family-edit .products-collection-table {
table-layout: fixed;
/* background-clip: padding-box;*/
border-collapse: collapse;
}

/* line 253, ../../sass/backend/custom.scss */
/* line 258, ../../sass/backend/custom.scss */
#lc-product-family-edit .products-collection-table th {
font-size: 13px;
border-left: 1px solid #dee2e6;
@@ -703,22 +720,22 @@ table th .select2-container--default .select2-selection--single {
position: relative;
}

/* line 254, ../../sass/backend/custom.scss */
/* line 259, ../../sass/backend/custom.scss */
#lc-product-family-edit .products-collection-table tfoot th {
border-top: 2px solid #dee2e6;
}

/* line 255, ../../sass/backend/custom.scss */
/* line 260, ../../sass/backend/custom.scss */
#lc-product-family-edit .products-collection-table th span {
white-space: initial;
}

/* line 256, ../../sass/backend/custom.scss */
/* line 261, ../../sass/backend/custom.scss */
#lc-product-family-edit .products-collection-table th:last-child {
border-right: 1px solid #dee2e6;
}

/* line 257, ../../sass/backend/custom.scss */
/* line 262, ../../sass/backend/custom.scss */
#lc-product-family-edit .products-collection-table td {
border-left: 1px solid #dee2e6;
text-align: center;
@@ -726,26 +743,26 @@ table th .select2-container--default .select2-selection--single {
border-bottom: 1px solid #dee2e6;
}

/* line 258, ../../sass/backend/custom.scss */
/* line 263, ../../sass/backend/custom.scss */
#lc-product-family-edit .products-collection-table td:last-child {
border-right: 1px solid #dee2e6;
white-space: nowrap;
}

/* line 259, ../../sass/backend/custom.scss */
/* line 264, ../../sass/backend/custom.scss */
#lc-product-family-edit .btn-add-product {
margin: 20px 0;
float: right;
}

/* line 260, ../../sass/backend/custom.scss */
/* line 265, ../../sass/backend/custom.scss */
#lc-product-family-edit .inherited {
color: #888;
font-style: italic;
font-weight: initial;
}

/* line 261, ../../sass/backend/custom.scss */
/* line 266, ../../sass/backend/custom.scss */
#lc-product-family-edit .products-collection-table td .value {
min-width: 80%;
margin: auto;
@@ -753,79 +770,79 @@ table th .select2-container--default .select2-selection--single {
cursor: pointer;
}

/* line 262, ../../sass/backend/custom.scss */
/* line 267, ../../sass/backend/custom.scss */
#lc-product-family-edit .products-collection-table td .modal {
text-align: left;
}

/* line 263, ../../sass/backend/custom.scss */
/* line 268, ../../sass/backend/custom.scss */
table.products-collection-table th.main-info, td.buyingPrice, td.multiplyingFactor, td.priceWithTax {
background: #eeeeee;
background-clip: padding-box;
text-decoration: underline;
}

/* line 265, ../../sass/backend/custom.scss */
/* line 270, ../../sass/backend/custom.scss */
table.products-collection-table tr.disabled {
opacity: 0.5;
}

/* line 266, ../../sass/backend/custom.scss */
/* line 271, ../../sass/backend/custom.scss */
.table-striped tbody .tr-sep {
border-top: 2px solid #888;
}

/* DeliveryZone */
/* line 270, ../../sass/backend/custom.scss */
/* line 275, ../../sass/backend/custom.scss */
#autocomplete-cities {
position: relative;
}

/* line 274, ../../sass/backend/custom.scss */
/* line 279, ../../sass/backend/custom.scss */
#autocomplete-cities .ui-autocomplete {
left: 30%;
top: 41px;
margin-left: 18px;
}

/* line 280, ../../sass/backend/custom.scss */
/* line 285, ../../sass/backend/custom.scss */
.head-reminders {
margin-top: 15px;
}

/* TABLEAU DE BORD */
/* line 283, ../../sass/backend/custom.scss */
/* line 288, ../../sass/backend/custom.scss */
.todo-list > li {
position: relative;
}

/* line 284, ../../sass/backend/custom.scss */
/* line 289, ../../sass/backend/custom.scss */
.todo-list > li .text {
margin-left: 30px;
}

/* line 285, ../../sass/backend/custom.scss */
/* line 290, ../../sass/backend/custom.scss */
.todo-list > li .tools {
position: absolute;
top: 4px;
right: 15px;
}

/* line 287, ../../sass/backend/custom.scss */
/* line 292, ../../sass/backend/custom.scss */
#addTicketMessageForm {
margin-top: 30px;
border-top: 2px dotted #eee;
padding-top: 30px;
}

/* line 289, ../../sass/backend/custom.scss */
/* line 294, ../../sass/backend/custom.scss */
#dashboard .list-btn-statistic {
display: flex;
flex-wrap: wrap;
justify-content: center;
}

/* line 290, ../../sass/backend/custom.scss */
/* line 295, ../../sass/backend/custom.scss */
#dashboard .btn-statistic {
width: 120px;
height: 70px;
@@ -834,62 +851,62 @@ table.products-collection-table tr.disabled {
line-height: 1rem;
}

/* line 291, ../../sass/backend/custom.scss */
/* line 296, ../../sass/backend/custom.scss */
#dashboard .btn-statistic small {
margin-bottom: 10px;
display: block;
}

/* line 292, ../../sass/backend/custom.scss */
/* line 297, ../../sass/backend/custom.scss */
#dashboard .btn-statistic .value {
display: block;
}

/* line 294, ../../sass/backend/custom.scss */
/* line 299, ../../sass/backend/custom.scss */
#dashboard #range_date_interval {
margin-bottom: 20px;
}

/* line 295, ../../sass/backend/custom.scss */
/* line 300, ../../sass/backend/custom.scss */
#dashboard #range_date_interval label {
float: left;
margin-right: 20px;
}

/* line 296, ../../sass/backend/custom.scss */
/* line 301, ../../sass/backend/custom.scss */
#dashboard #range_date_interval .form-check {
float: left;
margin-right: 10px;
}

/* line 297, ../../sass/backend/custom.scss */
/* line 302, ../../sass/backend/custom.scss */
#dashboard .table-condensed .btn, #dashboard .table-condensed .btn-sm {
white-space: nowrap;
}

/* Tickets */
/* line 303, ../../sass/backend/custom.scss */
/* line 308, ../../sass/backend/custom.scss */
#ticket-list .btn-sm {
display: block;
}

/* line 309, ../../sass/backend/custom.scss */
/* line 314, ../../sass/backend/custom.scss */
#toast-container {
width: 350px;
}

/* line 310, ../../sass/backend/custom.scss */
/* line 315, ../../sass/backend/custom.scss */
.toast {
float: right;
}

/* line 312, ../../sass/backend/custom.scss */
/* line 317, ../../sass/backend/custom.scss */
#toast-container:before:hover {
opacity: 1;
cursor: pointer;
}

/* line 316, ../../sass/backend/custom.scss */
/* line 321, ../../sass/backend/custom.scss */
#toast-close-all {
border: 0;
position: absolute;

+ 6
- 0
ShopBundle/Resources/public/sass/backend/custom.scss View File

@@ -148,6 +148,11 @@ table th .select2-container--default .select2-selection--single{padding:0.3rem 0
#switch-merchant {
min-width: 170px ;
}
/*************************** PAGINATION *******************************/
.pagination{justify-content: center;}
.disabled .page-link{color: #343a40;}
.disabled .page-link:hover, .page-link.current:hover{background-color: #fff; cursor: default;}


/* Sortable */

@@ -334,3 +339,4 @@ color:#fff;
-webkit-box-shadow: 0 0 12px #999;
box-shadow: 0 0 12px #999;
}


+ 2
- 2
ShopBundle/Resources/views/backend/default/block/list_tickets.html.twig View File

@@ -13,11 +13,11 @@
<td>{{ ticket.subject }}</td>
<td>
{% set value = ticket.status %}
{% include '@LcShop/backend/default/list-fields/field_ticket_status.html.twig' %}
{% include '@LcShop/backend/default/field/ticket_status.html.twig' %}
</td>
<td>
{% set item = ticket %}
{% include '@LcShop/backend/default/list-fields/field_ticket_last_message.html.twig' %}
{% include '@LcShop/backend/default/field/ticket_last_message.html.twig' %}
</td>
<td>
<a class="btn-sm btn-success" href="{{ path('easyadmin', {id: ticket.id, entity: 'Ticket', action: 'show'}) }}">

+ 103
- 0
ShopBundle/Resources/views/backend/default/block/paginator.html.twig View File

@@ -0,0 +1,103 @@
{% trans_default_domain 'EasyAdminBundle' %}

{% set _paginator_request_parameters = _request_parameters|merge({'referer': null}) %}

{% if paginator.haveToPaginate %}
<div class="list-pagination">
<div class="row">
<div class="col-sm-3 hidden-xs list-pagination-counter">
{{ 'paginator.counter'|trans({ '%start%': paginator.currentPageOffsetStart, '%end%': paginator.currentPageOffsetEnd, '%results%': paginator.nbResults})|raw }}
</div>
<div class="col-xs-12 col-sm-9">
<ul class="pagination list-pagination-paginator {{ 1 == paginator.currentPage ? 'first-page' : '' }} {{ paginator.hasNextPage ? '' : 'last-page' }}">
{% if 1 == paginator.currentPage %}
<li class="disabled">
<span class="page-link ">
<i class="fa fa-angle-double-left"></i>
</span>
</li>
{% else %}
<li>
<a class="page-link"
href="{{ path('easyadmin', _paginator_request_parameters|merge({ page: 1 }) ) }}">
<i class="fa fa-angle-double-left"></i>
</a>
</li>
{% endif %}

{% if paginator.hasPreviousPage %}
<li>
<a class="page-link"
href="{{ path('easyadmin', _paginator_request_parameters|merge({ page: paginator.previousPage }) ) }}">
<i class="fa fa-angle-left"></i>
</a>
</li>
{% else %}
<li class="disabled">
<span class="page-link">
<i class="fa fa-angle-left"></i>
</span>
</li>
{% endif %}

{# BEGIN DISPLAYING PAGE NUMBERS #}

{# the number of pages that are displayed around the active page #}
{% set nearbyPagesLimit = 8 %}

{% if paginator.currentPage > 1 %}
{% for i in range(paginator.currentPage-nearbyPagesLimit, paginator.currentPage-1) if ( i > 0 ) %}
<li >
<a class="page-link"
href="{{ path('easyadmin', _paginator_request_parameters|merge({ page: i }) ) }}">{{ i }}</a>
</li>
{% endfor %}
{% endif %}
<li>
<a class="current page-link">{{ paginator.currentPage }}</a>
</li>
{% if paginator.currentPage < paginator.nbPages %}
{% for i in range(paginator.currentPage+1, paginator.currentPage + nearbyPagesLimit) if ( i <= paginator.nbPages ) %}
<li>
<a class="page-link"
href="{{ path('easyadmin', _paginator_request_parameters|merge({ page: i }) ) }}">{{ i }}</a>
</li>
{% endfor %}
{% endif %}

{# END DISPLAYING PAGE NUMBERS #}

{% if paginator.hasNextPage %}
<li>
<a class="page-link"
href="{{ path('easyadmin', _paginator_request_parameters|merge({ page: paginator.nextPage }) ) }}">
<i class="fa fa-angle-right"></i>
</a>
</li>
{% else %}
<li class="disabled">
<span class="page-link">
<i class="fa fa-angle-right"></i>
</span>
</li>
{% endif %}

{% if paginator.currentPage < paginator.nbPages %}
<li>
<a class="page-link"
href="{{ path('easyadmin', _paginator_request_parameters|merge({ page: paginator.nbPages }) ) }}">
<i class="fa fa-angle-double-right"></i>
</a>
</li>
{% else %}
<li class="disabled">
<span class="page-link">
<i class="fa fa-angle-double-right"></i>
</span>
</li>
{% endif %}
</ul>
</div>
</div>
</div>
{% endif %}

+ 1
- 3
ShopBundle/Resources/views/backend/default/field/supplier.html.twig View File

@@ -1,5 +1,3 @@

{% if link_parameters is defined %}

<a href="{{ path('easyadmin', link_parameters|merge({entity: 'Supplier', referer: '' })) }}">{{ value|easyadmin_truncate }}</a>
<a href="{{ path('easyadmin', link_parameters|merge({entity: 'Supplier', referer: '' })) }}">{{ value|easyadmin_truncate }}</a>
{% endif %}

+ 13
- 2
ShopBundle/Resources/views/backend/default/list.html.twig View File

@@ -12,6 +12,7 @@
sortField: app.request.get('sortField'),
sortDirection: app.request.get('sortDirection'),
page: app.request.get('page', 1),
maxResults: app.request.get('maxResults', _entity_config.list.max_results),
filters: app.request.get('filters', []),
referer: null
}) %}
@@ -93,6 +94,14 @@
{% block card_header %}

<h2 class="card-title text-lg ">
<div class="btn-group">
{% set itemsPerPage = [10,20,30,50,100,200] %}
{% for itemPerPage in itemsPerPage %}
<a href="{{ path('easyadmin', _request_parameters|merge({ maxResults: itemPerPage, page : "1" })) }}"
class="btn btn-sm {{ paginator.maxPerPage == itemPerPage ? 'btn-outline-secondary' : 'btn-secondary'}}">{{ itemPerPage }}</a>
{% endfor %}

</div>
{% block paginator_nb_results %}
{# {{ "list.title"|trans({'%label%' : _entity_config['label']|lower }) }} #}
{% if paginator.nbResultsTotal != paginator.nbResults %}
@@ -325,9 +334,9 @@
{{ easyadmin_render_field_for_list_view(_entity_config.name, item, metadata) }}
</a>
{% else %}
{# {% if metadatafieldName =="supplier" %}
{# {% if metadatafieldName =="supplier" %}
{{ dump(metadata) }}
{% endif %}#}
{% endif %} #}
{{ easyadmin_render_field_for_list_view(_entity_config.name, item, metadata) }}
{% endif %}
</td>
@@ -443,6 +452,8 @@


<script type="text/javascript">


$(document).ready(function () {
const toggles = document.querySelectorAll('.custom-switch input[type="checkbox"]');
for (i = 0; i < toggles.length; i++) {

Loading…
Cancel
Save