add admin panel foe edite content

This commit is contained in:
Hesabix 2025-01-11 07:50:19 +00:00
parent 9d84aeb307
commit 313d04ddf5
11 changed files with 35 additions and 3 deletions

0
public/uploaded/1735143659-contact-us-min.jpg Normal file → Executable file
View file

Before

Width:  |  Height:  |  Size: 247 KiB

After

Width:  |  Height:  |  Size: 247 KiB

View file

Before

Width:  |  Height:  |  Size: 585 KiB

After

Width:  |  Height:  |  Size: 585 KiB

View file

Before

Width:  |  Height:  |  Size: 127 KiB

After

Width:  |  Height:  |  Size: 127 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 191 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 462 KiB

View file

Before

Width:  |  Height:  |  Size: 311 KiB

After

Width:  |  Height:  |  Size: 311 KiB

View file

Before

Width:  |  Height:  |  Size: 246 KiB

After

Width:  |  Height:  |  Size: 246 KiB

View file

@ -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/')
];
}

View file

@ -127,4 +127,9 @@ class Cat
return $this;
}
public function __toString(): string
{
return $this->getLabel();
}
}

View file

@ -118,4 +118,8 @@ class Tree
return $this;
}
public function __toString(): string
{
return $this->getLabel();
}
}

View file

@ -6,6 +6,15 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta lang="fa">
<meta content="width=device-width,initial-scale=1.0" name="viewport"/>
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-K1R1SYQY8E"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-K1R1SYQY8E');
</script>
{% if block('des') is not defined %}
<meta content="{{twigFunctions.systemSettings.des}}" name="description"/>
{% else %}