diff --git a/public/uploaded/1735143659-contact-us-min.jpg b/public/uploaded/1735143659-contact-us-min.jpg old mode 100644 new mode 100755 diff --git a/public/uploaded/ae8df0c4-7d20-45f8-9ba9-1177a1b7185d.webp b/public/uploaded/ae8df0c4-7d20-45f8-9ba9-1177a1b7185d.webp old mode 100644 new mode 100755 diff --git a/public/uploaded/b315c85f-92c3-4d81-bc8c-72b698339f44 (1).webp b/public/uploaded/b315c85f-92c3-4d81-bc8c-72b698339f44 (1).webp old mode 100644 new mode 100755 diff --git a/public/uploaded/da1a81e5-f2fc-4f12-81cd-f428e32ccc9e (1).webp b/public/uploaded/da1a81e5-f2fc-4f12-81cd-f428e32ccc9e (1).webp new file mode 100644 index 0000000..712a703 Binary files /dev/null and b/public/uploaded/da1a81e5-f2fc-4f12-81cd-f428e32ccc9e (1).webp differ diff --git a/public/uploaded/da1a81e5-f2fc-4f12-81cd-f428e32ccc9e.webp b/public/uploaded/da1a81e5-f2fc-4f12-81cd-f428e32ccc9e.webp deleted file mode 100644 index f720d84..0000000 Binary files a/public/uploaded/da1a81e5-f2fc-4f12-81cd-f428e32ccc9e.webp and /dev/null differ diff --git a/public/uploaded/e85efd21-e115-4103-b596-b91583928367.webp b/public/uploaded/e85efd21-e115-4103-b596-b91583928367.webp old mode 100644 new mode 100755 diff --git a/public/uploaded/illustration showing why accounting software is essential for businesses. The image features a modern office setup with a computer scre.webp b/public/uploaded/illustration showing why accounting software is essential for businesses. The image features a modern office setup with a computer scre.webp old mode 100644 new mode 100755 diff --git a/src/Controller/Admin/PostCrudController.php b/src/Controller/Admin/PostCrudController.php index 4ffed31..a501774 100644 --- a/src/Controller/Admin/PostCrudController.php +++ b/src/Controller/Admin/PostCrudController.php @@ -2,10 +2,15 @@ namespace App\Controller\Admin; +use App\Entity\Cat; use App\Entity\Post; use EasyCorp\Bundle\EasyAdminBundle\Config\Crud; use EasyCorp\Bundle\EasyAdminBundle\Controller\AbstractCrudController; +use EasyCorp\Bundle\EasyAdminBundle\Field\AssociationField; +use EasyCorp\Bundle\EasyAdminBundle\Field\BooleanField; +use EasyCorp\Bundle\EasyAdminBundle\Field\CodeEditorField; use EasyCorp\Bundle\EasyAdminBundle\Field\IdField; +use EasyCorp\Bundle\EasyAdminBundle\Field\ImageField; use EasyCorp\Bundle\EasyAdminBundle\Field\TextareaField; use EasyCorp\Bundle\EasyAdminBundle\Field\TextEditorField; use EasyCorp\Bundle\EasyAdminBundle\Field\TextField; @@ -20,9 +25,18 @@ class PostCrudController extends AbstractCrudController public function configureFields(string $pageName): iterable { return [ + AssociationField::new('cat', 'نوع محتوا'), + AssociationField::new('tree', 'دسته‌بندی')->hideOnIndex(), + TextField::new('url', 'آدرس صفحه'), + TextField::new('version', 'شماره نسخه'), TextField::new('title', 'عنوان'), - TextareaField::new('intro', 'خلاصه مطلب'), - TextEditorField::new('body', 'متن'), + TextareaField::new('intro', 'خلاصه مطلب')->hideOnIndex(), + TextEditorField::new('body', 'متن')->hideOnIndex(), + CodeEditorField::new('plain', 'ساختار')->hideOnIndex(), + TextField::new('keywords', 'کلیدواژه‌ها'), + ImageField::new('mainPic','تصویر شاخص') + ->setUploadDir('/public/uploaded/') + ->setBasePath('/uploaded/') ]; } diff --git a/src/Entity/Cat.php b/src/Entity/Cat.php index 83896eb..c48754b 100644 --- a/src/Entity/Cat.php +++ b/src/Entity/Cat.php @@ -127,4 +127,9 @@ class Cat return $this; } + + public function __toString(): string + { + return $this->getLabel(); + } } diff --git a/src/Entity/Tree.php b/src/Entity/Tree.php index cd17462..b804647 100644 --- a/src/Entity/Tree.php +++ b/src/Entity/Tree.php @@ -118,4 +118,8 @@ class Tree return $this; } + public function __toString(): string + { + return $this->getLabel(); + } } diff --git a/templates/base.html.twig b/templates/base.html.twig index 4e197fd..40ad198 100644 --- a/templates/base.html.twig +++ b/templates/base.html.twig @@ -6,7 +6,16 @@ - {% if block('des') is not defined %} + + + + {% if block('des') is not defined %} {% else %}