Fixes
This commit is contained in:
parent
0a34cdefb7
commit
fdd0d452c4
19
src/new/assets/controllers/datepicker_controller.js
Normal file
19
src/new/assets/controllers/datepicker_controller.js
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
import { Controller } from '@hotwired/stimulus';
|
||||||
|
import { Datepicker } from 'flowbite-datepicker';
|
||||||
|
/* stimulusFetch: 'lazy' */
|
||||||
|
export default class extends Controller {
|
||||||
|
datepicker;
|
||||||
|
connect() {
|
||||||
|
this.element.type = 'text';
|
||||||
|
this.datepicker = new Datepicker(this.element, {
|
||||||
|
format: 'yyyy-mm-dd',
|
||||||
|
autohide: true,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
disconnect() {
|
||||||
|
if (this.datepicker) {
|
||||||
|
this.datepicker.destroy();
|
||||||
|
}
|
||||||
|
this.element.type = 'date';
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -3,12 +3,12 @@ import Alpine from 'alpinejs';
|
|||||||
import persist from '@alpinejs/persist'
|
import persist from '@alpinejs/persist'
|
||||||
import $ from 'jquery'
|
import $ from 'jquery'
|
||||||
window.$ = window.jQuery = $;
|
window.$ = window.jQuery = $;
|
||||||
import { startStimulusApp } from '@symfony/stimulus-bundle';
|
|
||||||
const app = startStimulusApp();
|
|
||||||
import { initTabs } from 'david-ai';
|
import { initTabs } from 'david-ai';
|
||||||
|
|
||||||
// Initialize tabs functionality
|
// Initialize tabs functionality
|
||||||
initTabs();
|
initTabs();
|
||||||
|
import { startStimulusApp } from '@symfony/stimulus-bundle';
|
||||||
|
const app = startStimulusApp();
|
||||||
Alpine.plugin(persist)
|
Alpine.plugin(persist)
|
||||||
|
|
||||||
Alpine.store('theme', {
|
Alpine.store('theme', {
|
||||||
|
|||||||
@ -324,4 +324,14 @@ return [
|
|||||||
'version' => '2.4.3',
|
'version' => '2.4.3',
|
||||||
'type' => 'css',
|
'type' => 'css',
|
||||||
],
|
],
|
||||||
|
'flowbite' => [
|
||||||
|
'version' => '3.1.2',
|
||||||
|
],
|
||||||
|
'flowbite-datepicker' => [
|
||||||
|
'version' => '1.3.2',
|
||||||
|
],
|
||||||
|
'flowbite/dist/flowbite.min.css' => [
|
||||||
|
'version' => '3.1.2',
|
||||||
|
'type' => 'css',
|
||||||
|
],
|
||||||
];
|
];
|
||||||
|
|||||||
@ -118,7 +118,6 @@ class EditController extends AbstractController
|
|||||||
/** @var News $news */
|
/** @var News $news */
|
||||||
$news = $entityManager
|
$news = $entityManager
|
||||||
->getRepository('PSC\Shop\NewsBundle\Entity\News')->findOneBy(array('uid' => $uid, 'shop' => $selectedShop));
|
->getRepository('PSC\Shop\NewsBundle\Entity\News')->findOneBy(array('uid' => $uid, 'shop' => $selectedShop));
|
||||||
dump($news);
|
|
||||||
$form = $this->createForm(NewsType::class, $news);
|
$form = $this->createForm(NewsType::class, $news);
|
||||||
$form->handleRequest($request);
|
$form->handleRequest($request);
|
||||||
if ($form->isSubmitted() && $form->isValid()) {
|
if ($form->isSubmitted() && $form->isValid()) {
|
||||||
|
|||||||
@ -46,7 +46,10 @@ class NewsType extends AbstractType
|
|||||||
->add('enable', CheckboxType::class, ['label' => 'active', 'required' => false])
|
->add('enable', CheckboxType::class, ['label' => 'active', 'required' => false])
|
||||||
->add('sortDate', DateType::class, ['label' => 'Sortdate', 'required' => false])
|
->add('sortDate', DateType::class, ['label' => 'Sortdate', 'required' => false])
|
||||||
->add('toDate', DateTimeType::class, ['label' => 'toDate', 'required' => false])
|
->add('toDate', DateTimeType::class, ['label' => 'toDate', 'required' => false])
|
||||||
->add('fromDate', DateTimeType::class, ['label' => 'fromDate', 'required' => false])
|
->add('fromDate', DateTimeType::class, ['label' => 'fromDate', 'required' => false,
|
||||||
|
'widget' => 'single_text',
|
||||||
|
'attr' => [
|
||||||
|
]])
|
||||||
->add('url', TextType::class, ['label' => 'Url', 'required' => false])
|
->add('url', TextType::class, ['label' => 'Url', 'required' => false])
|
||||||
->add('introduction', TextareaType::class, ['label' => 'Introduction', 'required' => false])
|
->add('introduction', TextareaType::class, ['label' => 'Introduction', 'required' => false])
|
||||||
->add('language', ChoiceType::class, [
|
->add('language', ChoiceType::class, [
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user