Преглед на файлове

status + toggle + dashboard style

develop
Charly преди 3 години
родител
ревизия
8100de5589
променени са 6 файла, в които са добавени 18 реда и са изтрити 9 реда
  1. +1
    -1
      Controller/Newsletter/NewsletterAdminController.php
  2. +2
    -1
      Field/BooleanField.php
  3. +0
    -3
      Field/StatusField.php
  4. +14
    -2
      Resources/assets/app/adminlte/main/scss/_common.scss
  5. +0
    -1
      Resources/views/adminlte/crud/field/status.html.twig
  6. +1
    -1
      Resources/views/adminlte/crud/field/toggle.html.twig

+ 1
- 1
Controller/Newsletter/NewsletterAdminController.php Целия файл

@@ -6,7 +6,7 @@ use EasyCorp\Bundle\EasyAdminBundle\Field\FormField;
use EasyCorp\Bundle\EasyAdminBundle\Field\TextField;
use Lc\SovBundle\Controller\AbstractAdminController;
use Lc\SovBundle\Factory\Newsletter\NewsletterFactory;
use Lc\SovBundle\Field\ToggleField;
use Lc\SovBundle\Field\BooleanField;
use Lc\SovBundle\Field\CKEditorField;
use Lc\SovBundle\Field\StatusField;


+ 2
- 1
Field/BooleanField.php Целия файл

@@ -4,6 +4,7 @@ namespace Lc\SovBundle\Field;

use EasyCorp\Bundle\EasyAdminBundle\Contracts\Field\FieldInterface;
use EasyCorp\Bundle\EasyAdminBundle\Field\FieldTrait;
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
use Symfony\Component\Form\Extension\Core\Type\TextType;

/**
@@ -19,7 +20,7 @@ final class BooleanField implements FieldInterface
->setProperty($propertyName)
->setLabel($label)
->setTemplatePath('@LcSov/adminlte/crud/field/boolean.html.twig')
->setFormType(TextType::class);
->setFormType(CheckboxType::class);
}

}

+ 0
- 3
Field/StatusField.php Целия файл

@@ -4,9 +4,7 @@ namespace Lc\SovBundle\Field;

use EasyCorp\Bundle\EasyAdminBundle\Contracts\Field\FieldInterface;
use EasyCorp\Bundle\EasyAdminBundle\Field\FieldTrait;
use Lc\SovBundle\Form\Type\FileManagerType;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\Form\Extension\Core\Type\TextType;

/**
* @author La clic ! <contact@laclic.fr>
@@ -31,7 +29,6 @@ final class StatusField implements FieldInterface
if (!$templateToggle) {
$template = 'status.html.twig';
}

$field->setTemplatePath('@LcSov/adminlte/crud/field/' . $template);

return $field;

+ 14
- 2
Resources/assets/app/adminlte/main/scss/_common.scss Целия файл

@@ -3,8 +3,8 @@ nav.main-header {
ul.navbar-nav {
li.nav-item-user-menu {
.dropdown-menu {
position: absolute ;
z-index: 1000 ;
position: absolute;
z-index: 1000;
}
}

@@ -16,4 +16,16 @@ nav.main-header {
}
}
}
}

.main-sidebar p {
font-size: 0.8rem;
}

.nav-link {
padding: 0.5rem 0.5rem;
}

.nav-treeview .nav-link {
padding: 0.2rem 0.5rem 0.2rem 1.2rem;
}

+ 0
- 1
Resources/views/adminlte/crud/field/status.html.twig Целия файл

@@ -1,4 +1,3 @@

{% if field.value == 1 %}
<div class="badge badge-success">En ligne</div>
{% else %}

+ 1
- 1
Resources/views/adminlte/crud/field/toggle.html.twig Целия файл

@@ -1,6 +1,6 @@
{% set item = entity.instance %}
{% set property_name = field.getProperty() %}
{% set id_toggle = 'toogle-'~item.id~'-'~property_name %}
{% set id_toggle = 'toggle-'~item.id~'-'~property_name %}

<div class="custom-control custom-switch custom-switch-on-success custom-switch-off-default"
data-url="{{ ea_url({crudAction: 'edit', entityId: item.id, fieldName: property_name }) }}">

Loading…
Отказ
Запис