瀏覽代碼

ticket detail, ticket list

ideas
Charly 3 年之前
父節點
當前提交
9a9aedb542
共有 15 個檔案被更改,包括 374 行新增84 行删除
  1. +26
    -33
      Controller/AbstractAdminController.php
  2. +60
    -17
      Controller/Ticket/TicketAdminController.php
  3. +23
    -1
      Factory/Ticket/TicketFactory.php
  4. +23
    -0
      Factory/Ticket/TicketMessageFactory.php
  5. +96
    -0
      Form/Ticket/TicketFormType.php
  6. +6
    -18
      Form/Ticket/TicketMessageType.php
  7. +13
    -2
      Model/Ticket/TicketModel.php
  8. +3
    -1
      Resources/assets/app/adminlte/index/index.scss
  9. +1
    -1
      Resources/config/routes.yaml
  10. +8
    -6
      Resources/translations/admin.fr.yaml
  11. +83
    -0
      Resources/views/admin/ticket/detail.html.twig
  12. +3
    -3
      Resources/views/admin/ticket/index_status.html.twig
  13. +19
    -0
      Resources/views/admin/ticket/new.html.twig
  14. +8
    -0
      Resources/views/adminlte/embed/infobox.html.twig
  15. +2
    -2
      Resources/views/adminlte/macro/infobox.html.twig

+ 26
- 33
Controller/AbstractAdminController.php 查看文件

@@ -50,21 +50,14 @@ use Symfony\Component\HttpFoundation\Session\SessionInterface;

abstract class AbstractAdminController extends EaAbstractCrudController
{
protected $session;
protected $request;
protected $em;
protected $translatorAdmin;

public function __construct(
SessionInterface $session,
RequestStack $request,
EntityManagerInterface $em,
TranslatorAdmin $translatorAdmin
) {
$this->session = $session;
$this->request = $request;
$this->em = $em;
$this->translatorAdmin = $translatorAdmin;
public static function getSubscribedServices()
{
return array_merge(parent::getSubscribedServices(), [
'session' => SessionInterface::class,
'request' => RequestStack::class,
'em' => EntityManagerInterface::class,
'translator_admin' => TranslatorAdmin::class,
]);
}

public function configureActions(Actions $actions): Actions
@@ -86,7 +79,7 @@ abstract class AbstractAdminController extends EaAbstractCrudController
$actionsArray[Crud::PAGE_INDEX] = [
Action::NEW => [
'icon' => 'plus',
'label' => $this->translatorAdmin->transAction('create'),
'label' => $this->get('translator_admin')->transAction('create'),
'add_class' => 'btn-sm'
],
Action::EDIT => [
@@ -95,27 +88,27 @@ abstract class AbstractAdminController extends EaAbstractCrudController
'label' => false,
'html_attributes' => array(
'data-toggle' => 'tooltip',
'title' => $this->translatorAdmin->transAction('edit')
'title' => $this->get('translator_admin')->transAction('edit')
)
],
Action::DETAIL => [
'icon' => 'eye',
'add_class' => 'btn btn-success',
'add_class' => 'btn btn-sm btn-success',
'label' => false,
'html_attributes' => array(
'data-toggle' => 'tooltip',
'title' => $this->translatorAdmin->transAction('detail')
'title' => $this->get('translator_admin')->transAction('detail')
)
],
Action::DELETE => [
'icon' => 'trash',
'dropdown' => true,
'label' => $this->translatorAdmin->transAction('delete')
'label' => $this->get('translator_admin')->transAction('delete')
],
Action::BATCH_DELETE => [
'class' => 'btn btn-sm btn-danger',
'icon' => 'trash',
'label' => $this->translatorAdmin->transAction('delete')
'label' => $this->get('translator_admin')->transAction('delete')
],
];

@@ -123,23 +116,23 @@ abstract class AbstractAdminController extends EaAbstractCrudController
$actionSaveAndReturn = [
'add_class' => 'float-right',
'icon' => 'check',
'label' => $this->translatorAdmin->transAction('save_and_return')
'label' => $this->get('translator_admin')->transAction('save_and_return')
];
$actionIndex = [
'icon' => 'chevron-left',
'class' => 'btn btn-link',
'label' => $this->translatorAdmin->transAction('back_index')
'label' => $this->get('translator_admin')->transAction('back_index')
];

$actionsArray[Crud::PAGE_EDIT] = [
Action::SAVE_AND_CONTINUE => [
'class' => 'btn btn-info float-right',
'label' => $this->translatorAdmin->transAction('save_and_continue')
'label' => $this->get('translator_admin')->transAction('save_and_continue')
],
Action::DELETE => [
'icon' => 'trash',
'class' => 'btn btn-outline-danger action-delete',
'label' => $this->translatorAdmin->transAction('delete')
'label' => $this->get('translator_admin')->transAction('delete')
],
Action::SAVE_AND_RETURN => $actionSaveAndReturn,
Action::INDEX => $actionIndex,
@@ -148,7 +141,7 @@ abstract class AbstractAdminController extends EaAbstractCrudController
$actionsArray[Crud::PAGE_NEW] = [
Action::SAVE_AND_ADD_ANOTHER => [
'class' => 'btn btn-info float-right',
'label' => $this->translatorAdmin->transAction('save_and_add_another')
'label' => $this->get('translator_admin')->transAction('save_and_add_another')
],
Action::SAVE_AND_RETURN => $actionSaveAndReturn,
Action::INDEX => $actionIndex,
@@ -159,7 +152,7 @@ abstract class AbstractAdminController extends EaAbstractCrudController
$actions->add(Crud::PAGE_NEW, Action::INDEX);

if ($this->isInstanceOf(SortableInterface::class)) {
$sortAction = Action::new('sort', $this->translatorAdmin->transAction('sort'), 'fa fa-sort')
$sortAction = Action::new('sort', $this->get('translator_admin')->transAction('sort'), 'fa fa-sort')
->linkToCrudAction('sort')
->setCssClass('btn btn-sm btn-success')
->createAsGlobalAction();
@@ -171,7 +164,7 @@ abstract class AbstractAdminController extends EaAbstractCrudController
if ($this->isInstanceOf(TreeInterface::class)) {
$indexChildAction = Action::new(
'index_children',
$this->translatorAdmin->transAction('index_children'),
$this->get('translator_admin')->transAction('index_children'),
'fa fa-list'
)
->linkToCrudAction(Action::INDEX)
@@ -182,7 +175,7 @@ abstract class AbstractAdminController extends EaAbstractCrudController

$backParentAction = Action::new(
'index_parent',
$this->translatorAdmin->transAction('index_parent'),
$this->get('translator_admin')->transAction('index_parent'),
'fa fa-chevron-left'
)
->linkToCrudAction(Action::INDEX)
@@ -264,12 +257,12 @@ abstract class AbstractAdminController extends EaAbstractCrudController
$entityClass = $this->getEntityFqcn();
$paramListMaxResults = 'listMaxResults';
$paramSessionListMaxResults = $entityClass . '-' . $paramListMaxResults;
$requestListMaxResults = $this->request->getCurrentRequest()->get($paramListMaxResults);
$requestListMaxResults = $this->get('request')->getCurrentRequest()->get($paramListMaxResults);

if ($requestListMaxResults) {
$this->session->set($paramSessionListMaxResults, $requestListMaxResults);
$this->get('session')->set($paramSessionListMaxResults, $requestListMaxResults);
}
$maxResults = $this->session->get($paramSessionListMaxResults) ? $this->session->get(
$maxResults = $this->get('session')->get($paramSessionListMaxResults) ? $this->get('session')->get(
$paramSessionListMaxResults
) : 30;

@@ -443,7 +436,7 @@ abstract class AbstractAdminController extends EaAbstractCrudController

// on vide le flash bag si édition en ajax (notification déjà affichée en Javascript)
if ($context->getRequest()->isXmlHttpRequest()) {
$this->session->getFlashBag()->clear();
$this->get('session')->getFlashBag()->clear();
}

return $response;

+ 60
- 17
Controller/Ticket/TicketAdminController.php 查看文件

@@ -3,21 +3,44 @@
namespace Lc\SovBundle\Controller\Ticket;

use App\Entity\Ticket\Ticket;
use App\Entity\Ticket\TicketMessage;
use EasyCorp\Bundle\EasyAdminBundle\Collection\FieldCollection;
use EasyCorp\Bundle\EasyAdminBundle\Config\Action;
use EasyCorp\Bundle\EasyAdminBundle\Config\Actions;
use EasyCorp\Bundle\EasyAdminBundle\Config\Crud;
use EasyCorp\Bundle\EasyAdminBundle\Config\Filters;
use EasyCorp\Bundle\EasyAdminBundle\Config\KeyValueStore;
use EasyCorp\Bundle\EasyAdminBundle\Context\AdminContext;
use EasyCorp\Bundle\EasyAdminBundle\Event\AfterCrudActionEvent;
use EasyCorp\Bundle\EasyAdminBundle\Event\AfterEntityPersistedEvent;
use EasyCorp\Bundle\EasyAdminBundle\Event\BeforeCrudActionEvent;
use EasyCorp\Bundle\EasyAdminBundle\Event\BeforeEntityPersistedEvent;
use EasyCorp\Bundle\EasyAdminBundle\Exception\ForbiddenActionException;
use EasyCorp\Bundle\EasyAdminBundle\Exception\InsufficientEntityPermissionException;
use EasyCorp\Bundle\EasyAdminBundle\Factory\EntityFactory;
use EasyCorp\Bundle\EasyAdminBundle\Field\AssociationField;
use EasyCorp\Bundle\EasyAdminBundle\Field\ChoiceField;
use EasyCorp\Bundle\EasyAdminBundle\Field\DateField;
use EasyCorp\Bundle\EasyAdminBundle\Field\IntegerField;
use EasyCorp\Bundle\EasyAdminBundle\Field\TextField;
use EasyCorp\Bundle\EasyAdminBundle\Router\AdminUrlGenerator;
use EasyCorp\Bundle\EasyAdminBundle\Security\Permission;
use Lc\SovBundle\Factory\Ticket\TicketFactory;
use Lc\SovBundle\Field\StatusField;
use Lc\SovBundle\Form\Ticket\TicketFormType;
use Lc\SovBundle\Model\Ticket\TicketInterface;
use Lc\SovBundle\Controller\AbstractAdminController;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;

abstract class TicketAdminController extends AbstractAdminController
class TicketAdminController extends AbstractAdminController
{
protected $ticketFactory;

public function __construct(TicketFactory $ticketFactory)
{
$this->ticketFactory = $ticketFactory;
}

public static function getEntityFqcn(): string
{
@@ -65,26 +88,46 @@ abstract class TicketAdminController extends AbstractAdminController
];
}

// public function configureCrud(Crud $crud): Crud
// {
// $crud
// ->overrideTemplate('crud/detail', '@LcSov/admin/ticket/detail.html.twig');
//
// return parent::configureCrud($crud);
// }
public function configureCrud(Crud $crud): Crud
{
$crud
->overrideTemplate('crud/detail', '@LcSov/admin/ticket/detail.html.twig');
return parent::configureCrud($crud);
}

public function configureActions(Actions $actions): Actions
{
// $actions
// ->add(Crud::PAGE_INDEX, Action::DETAIL);
// $actions = parent::configureActions($actions);
// $actions
// ->remove(Crud::PAGE_INDEX, Action::EDIT);
// return $actions;

$actions
->add(Crud::PAGE_INDEX, Action::DETAIL);
// ->remove(Crud::PAGE_INDEX, Action::EDIT);
->add(Crud::PAGE_INDEX, Action::DETAIL)
->remove(Crud::PAGE_INDEX, Action::EDIT);
return parent::configureActions($actions);
}

public function new(AdminContext $context)
{
$ticket = $this->ticketFactory->create();
$form = $this->createForm(TicketFormType::class, $ticket);

$form->handleRequest($context->getRequest());
if ($form->isSubmitted() && $form->isValid()) {
$ticket = $form->getData();

foreach($ticket->getTicketMessages() as $ticketMessage){
$this->get('em')->persist($ticketMessage);
}

$this->get('em')->persist($ticket);
$this->get('em')->flush();

return $this->redirectToRoute('admin_dashboard');
}

return $this->render(
'@LcSov/admin/ticket/new.html.twig',
[
'form' => $form->createView(),
]
);
}
}

+ 23
- 1
Factory/Ticket/TicketFactory.php 查看文件

@@ -2,11 +2,22 @@

namespace Lc\SovBundle\Factory\Ticket;

use App\Entity\Ticket\Ticket;
use Doctrine\ORM\EntityManagerInterface;
use Lc\SovBundle\Factory\AbstractFactory;
use Lc\SovBundle\Model\Ticket\TicketInterface;

class TicketFactory extends AbstractFactory
{
protected $ticketMessageFactory;

public function __construct(EntityManagerInterface $em, TicketMessageFactory $ticketMessageFactory)
{
$this->ticketMessageFactory = $ticketMessageFactory;

parent::__construct($em);
}

public function getEntityClass()
{
return TicketInterface::class;
@@ -14,6 +25,17 @@ class TicketFactory extends AbstractFactory

public function create($params = array())
{
return parent::create($params);
if (!isset($params['status'])) {
$params['status'] = Ticket::TICKET_STATUS_OPEN;
}

$ticket = parent::create($params);

if (!isset($params['ticketMessages'])) {
$ticket->addTicketMessage($this->ticketMessageFactory->create());
}

return $ticket;
}

}

+ 23
- 0
Factory/Ticket/TicketMessageFactory.php 查看文件

@@ -0,0 +1,23 @@
<?php

namespace Lc\SovBundle\Factory\Ticket;

use Lc\SovBundle\Factory\AbstractFactory;
use Lc\SovBundle\Model\Ticket\TicketMessageInterface;

class TicketMessageFactory extends AbstractFactory
{
public function getEntityClass()
{
return TicketMessageInterface::class;
}

public function create($params = array())
{
if (!isset($params['status'])) {
$params['status'] = 1;
}

return parent::create($params);
}
}

+ 96
- 0
Form/Ticket/TicketFormType.php 查看文件

@@ -0,0 +1,96 @@
<?php

namespace Lc\SovBundle\Form\Ticket;

use EasyCorp\Bundle\EasyAdminBundle\Field\AssociationField;
use Lc\SovBundle\Doctrine\EntityManager;
use Lc\SovBundle\Model\Ticket\TicketInterface;
use Lc\SovBundle\Model\Ticket\TicketModel;
use Lc\SovBundle\Model\User\UserInterface;
use Lc\SovBundle\Translation\TranslatorAdmin;
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\Form\Extension\Core\Type\CollectionType;
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;

class TicketFormType extends AbstractType
{

protected $em;
protected $translatorAdmin;

public function __construct(EntityManager $em, TranslatorAdmin $translatorAdmin)
{
$this->em = $em;
$this->translatorAdmin = $translatorAdmin;
}

public function buildForm(FormBuilderInterface $builder, array $options)
{
$entityName = $this->em->getEntityName(TicketInterface::class);

$builder->add(
'user',
EntityType::class,
[
'class' => $this->em->getEntityName(UserInterface::class),
]
);

$builder->add(
'subject',
TextType::class
);

$builder->add(
'type',
ChoiceType::class,
[
'label' => 'Type',
'choices' => [
$this->translatorAdmin->transField(
'typeOptions.' . TicketModel::TYPE_TECHNICAL_PROBLEM,
$entityName
) => TicketModel::TYPE_TECHNICAL_PROBLEM,
$this->translatorAdmin->transField(
'typeOptions.' . TicketModel::TYPE_GENERAL_QUESTION,
$entityName
) => TicketModel::TYPE_TECHNICAL_PROBLEM,
],
]
);

$builder->add(
'ticketMessages',
CollectionType::class,
[
'entry_type' => TicketMessageType::class,
'allow_add' => false,
]
);

$builder->add(
'submit',
SubmitType::class,
[
'label' => $this->translatorAdmin->transAction('save')
]
);
}

/**
* {@inheritdoc}
*/
public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults(
[
'data_class' => $this->em->getEntityName(TicketInterface::class),
]
);
}
}

+ 6
- 18
Form/Ticket/TicketMessageType.php 查看文件

@@ -2,10 +2,9 @@

namespace Lc\SovBundle\Form\Ticket;

use Doctrine\ORM\EntityManagerInterface;
use Lc\SovBundle\Doctrine\EntityManager;
use Lc\SovBundle\Model\Ticket\TicketMessageInterface;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
@@ -14,7 +13,7 @@ class TicketMessageType extends AbstractType
{
protected $em;

public function __construct(EntityManagerInterface $em)
public function __construct(EntityManager $em)
{
$this->em = $em;
}
@@ -24,28 +23,17 @@ class TicketMessageType extends AbstractType
$builder->add(
'message',
TextareaType::class,
array(
[
'required' => true
)
)
->add(
'add',
SubmitType::class,
array(
'label' => 'action.send',
'attr' => array(
'class' => 'btn btn-primary float-right'
)
)
);
]
);
}

public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults(
[
'data_class' => $this->em->getClassMetadata(TicketMessageInterface::class)->getName(),
'translation_domain' => 'lcshop'
'data_class' => $this->em->getEntityName(TicketMessageInterface::class),
]
);
}

+ 13
- 2
Model/Ticket/TicketModel.php 查看文件

@@ -77,7 +77,7 @@ abstract class TicketModel extends AbstractLightEntity implements TicketInterfac
protected $visitorToken;

/**
* @ORM\OneToMany(targetEntity="Lc\SovBundle\Model\Ticket\TicketMessageInterface", mappedBy="ticket", orphanRemoval=true)
* @ORM\OneToMany(targetEntity="Lc\SovBundle\Model\Ticket\TicketMessageInterface", mappedBy="ticket", orphanRemoval=true, cascade={"persist", "remove"})
* @ORM\OrderBy({"id" = "ASC"})
*/
protected $ticketMessages;
@@ -101,6 +101,17 @@ abstract class TicketModel extends AbstractLightEntity implements TicketInterfac
}
}

public function getUserInfosTicket()
{
$user = $this->getUser();
if ($user) {
return '#' . $user->getId() . ' ' . $user->getName() . ' ' . $user->getEmail();
} else {
return strtoupper($this->getVisitorLastname()) . ' ' . $this->getVisitorFirstname(
) . ' ' . $this->getVisitorEmail();
}
}

public function getEmail()
{
if ($this->getUser()) {
@@ -135,7 +146,7 @@ abstract class TicketModel extends AbstractLightEntity implements TicketInterfac

public function getTypeLabel(): string
{
return 'field.Ticket.typeOptions.' . $this->getType();
return 'entity.Ticket.fields.typeOptions.' . $this->getType();
}

public function getStatus(): ?string

+ 3
- 1
Resources/assets/app/adminlte/index/index.scss 查看文件

@@ -1,6 +1,8 @@

table.table {
.dropdown-actions {
display: inline-block ;
}
.actions {
white-space: nowrap;
}
}

+ 1
- 1
Resources/config/routes.yaml 查看文件

@@ -28,5 +28,5 @@ sov_admin_setting_global:

sov_admin_create_ticket:
path: /admin/ticket/create
controller: Lc\SovBundle\Controller\Ticket\TicketAdminController::createTicket
controller: Lc\SovBundle\Controller\Ticket\TicketAdminController::create


+ 8
- 6
Resources/translations/admin.fr.yaml 查看文件

@@ -52,25 +52,27 @@ entity:
label: Page
label_plurial: Pages
Ticket:
status:
open: Ouvert
being-processed: En attente
closed: Fermé
label: Ticket
label_plurial: Tickets
fields:
visitorFirstName: Nom
visitorLastName: Prénom
visitorEmail: E-mail
subject: Sujet
type: Type
lastMessage: Dernier message
typeOptions:
general-question: Questions générales
technical-problem: Problème technique
lastMessage: Dernier message
statusOptions:
open: Ouvert
being-processed: En attente
closed: Fermé

default:
fields:
id: Id
createdAt: Created at
createdAt: Créé à
user: Utilisateur
firstname: Prénom
lastname: Nom

+ 83
- 0
Resources/views/admin/ticket/detail.html.twig 查看文件

@@ -0,0 +1,83 @@
{% extends '@LcSov/adminlte/layout.html.twig' %}
{% import '@LcSov/adminlte/macro/infobox.html.twig' as macro %}

{% block content_title %}
{{ 'detail'|lc_trans_admin_title(ea.getEntity().getFqcn(), {id: ea.getEntity().getInstance().getId()}) }}
{% endblock %}

{% block main %}
{{ dump() }}
<div class="row">
<div class="col-4">
{% embed '@LcSov/adminlte/embed/infobox.html.twig' %}
{% block color %}blue{% endblock %}
{% block icon %}fa fa-toggle-on{% endblock %}
{% block title %}Status{% endblock %}
{% block content %}
{{ entity.instance.status }}
{% endblock %}
{% endembed %}

{% embed '@LcSov/adminlte/embed/infobox.html.twig' %}
{% block color %}blue{% endblock %}
{% block icon %}fa fa-user{% endblock %}
{% block title %}Utilisateur{% endblock %}
{% block content %}
{{ entity.instance.getUserInfosTicket() }}
{% endblock %}
{% endembed %}

{{ macro.infobox('Date',entity.instance.createdAt|date('d/m/Y'), "yellow", "fa fa-calendar") }}
{{ macro.infobox('Catégorie',entity.instance.getTypeLabel()|trans({},'admin'), "green", "fa fa-archive") }}
</div>
<div class="col-8">
{% embed '@LcSov/adminlte/embed/card.html.twig' %}
{% block css %}card-primary{% endblock %}
{% block header %}
<h3 class="card-title">
Liste des messages
</h3>
{% endblock header %}

{% block body_wrapper %}
<div class="card-body row">
<div class="col-12 direct-chat-primary">
{% for message in entity.instance.ticketMessages %}
<div class="direct-chat-msg {{ message.answerByAdmin ? 'right' }}">
<div class="direct-chat-infos clearfix">
<div class="direct-chat-name {{ message.answerByAdmin ? 'float-right' : 'float-left' }}">
{{ message.createdBy }}
</div>
<div class="direct-chat-timestamp {{ message.answerByAdmin ? 'float-left' : 'float-right' }}">
{{ message.createdAt|date('d/m/Y H:i') }}
</div>
</div>
{% if message.answerByAdmin %}
<div class="direct-chat-img align-items-center">
<i class="fa fa-user-circle" style="font-size: 2rem; color: red"></i>
</div>
{% else %}
<div class="direct-chat-img align-items-center">
<i class="fa fa-user-circle" style="font-size: 2rem"></i>
</div>
{% endif %}
<div class="direct-chat-text">
<p>{{ message.message|nl2br }}</p>
{% if message.imageFilename is not null %}
<i>Photo jointe au message : </i> <br/>
<a href="{{ lc_liip(message.imageFilename, 'big') }}"
data-toggle="lightbox">
<img src="{{ lc_liip(message.imageFilename, 'thumb') }}"
alt="Illustration ticket"/>
</a>
{% endif %}
</div>
</div>
{% endfor %}
</div>
</div>
{% endblock %}
{% endembed %}
</div>
</div>
{% endblock %}

+ 3
- 3
Resources/views/admin/ticket/index_status.html.twig 查看文件

@@ -2,9 +2,9 @@

{% set status = entity.instance.status %}
{% if status == 'open' %}
{{ macro.badge_success(('entity.Ticket.status.'~entity.instance.status)|trans({},'admin')) }}
{{ macro.badge_success(('entity.Ticket.fields.statusOptions.'~entity.instance.status)|trans({},'admin')) }}
{% elseif status == 'being-processed' %}
{{ macro.badge_warning(('entity.Ticket.status.'~entity.instance.status)|trans({},'admin')) }}
{{ macro.badge_warning(('entity.Ticket.fields.statusOptions.'~entity.instance.status)|trans({},'admin')) }}
{% elseif status == 'closed' %}
{{ macro.badge_danger(('entity.Ticket.status.'~entity.instance.status)|trans({},'admin')) }}
{{ macro.badge_danger(('entity.Ticket.fields.statusOptions.'~entity.instance.status)|trans({},'admin')) }}
{% endif %}

+ 19
- 0
Resources/views/admin/ticket/new.html.twig 查看文件

@@ -0,0 +1,19 @@
{% extends '@LcSov/adminlte/layout.html.twig' %}

{% block content_title %}
{# {{ 'ticket.profile'|lc_trans_admin_title }}#}
Créer un ticket
{% endblock %}

{% block main %}
<div class="col-8">
{% embed '@LcSov/adminlte/embed/card.html.twig' %}
{% block header_wrapper %}{% endblock %}
{% block body %}
{% form_theme form '@LcSov/adminlte/crud/form_theme.html.twig' %}
{{ form(form) }}
{% endblock %}
{% block footer_wrapper %}{% endblock %}
{% endembed %}
</div>
{% endblock main %}

+ 8
- 0
Resources/views/adminlte/embed/infobox.html.twig 查看文件

@@ -0,0 +1,8 @@
<div class="info-box">
<!-- Apply any bg-* class to to the icon to color it -->
<span class="info-box-icon bg-{% block color %}{% endblock %}"><i class="{% block icon %}{% endblock %}"></i></span>
<div class="info-box-content">
<span class="info-box-text">{% block title %}{% endblock %}</span>
<span class="info-box-number">{% block content %}{% endblock %}</span>
</div>
</div>

+ 2
- 2
Resources/views/adminlte/macro/infobox.html.twig 查看文件

@@ -1,10 +1,10 @@
{% macro infobox(title, number, color, icon) %}
{% macro infobox(title, content, color, icon) %}
<div class="info-box">
<!-- Apply any bg-* class to to the icon to color it -->
<span class="info-box-icon bg-{{ color }}"><i class="{{ icon }}"></i></span>
<div class="info-box-content">
<span class="info-box-text">{{ title }}</span>
<span class="info-box-number">{{ number }}</span>
<span class="info-box-number">{{ content }}</span>
</div>
<!-- /.info-box-content -->
</div>

Loading…
取消
儲存