Pārlūkot izejas kodu

status + toggle + dashboard style

develop
Charly pirms 3 gadiem
vecāks
revīzija
8100de5589
6 mainītis faili ar 18 papildinājumiem un 9 dzēšanām
  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 Parādīt failu

@@ -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 Parādīt failu

@@ -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 Parādīt failu

@@ -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 Parādīt failu

@@ -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 Parādīt failu

@@ -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 Parādīt failu

@@ -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 }) }}">

Notiek ielāde…
Atcelt
Saglabāt