From b07cbc5bf4e6d327d3a4fe62ffa7e694498a3be4 Mon Sep 17 00:00:00 2001 From: afornerot Date: Mon, 14 Jul 2025 11:50:52 +0200 Subject: [PATCH] svg --- src/Entity/Issue.php | 6 +++-- src/Form/Type/SelbgType.php | 5 ++-- templates/issue/edit.html.twig | 3 ++- templates/issue/view.html.twig | 3 ++- templates/project/view.html.twig | 44 ++++++++++++++++++++++++++++++-- 5 files changed, 53 insertions(+), 8 deletions(-) diff --git a/src/Entity/Issue.php b/src/Entity/Issue.php index 45b8bae..d9c29e5 100644 --- a/src/Entity/Issue.php +++ b/src/Entity/Issue.php @@ -31,7 +31,7 @@ class Issue private int $rowissue = 0; #[ORM\Column(nullable: true)] - private string $color = ''; + private ?string $color = null; #[ORM\ManyToOne(targetEntity: Project::class, inversedBy: 'issues')] #[ORM\JoinColumn(nullable: false)] @@ -130,7 +130,9 @@ class Issue public function getColor(): ?string { - return $this->rowsprint; + if($this->color) return $this->color; + elseif($this->parent) return $this->parent->getColor(); + else return null; } public function setColor(?string $color): static diff --git a/src/Form/Type/SelbgType.php b/src/Form/Type/SelbgType.php index fc080f7..5486f78 100644 --- a/src/Form/Type/SelbgType.php +++ b/src/Form/Type/SelbgType.php @@ -6,15 +6,16 @@ use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\Extension\Core\Type\ChoiceType; use Symfony\Component\OptionsResolver\OptionsResolver; + class SelbgType extends AbstractType { public function configureOptions(OptionsResolver $resolver): void { $choices = $this->loadCssClasses(); - + // clef => valeur $choices = array_combine($choices, $choices); - + $resolver->setDefaults([ 'choices' => $choices, 'choice_attr' => function ($choice, $key, $value) { diff --git a/templates/issue/edit.html.twig b/templates/issue/edit.html.twig index 9f3a02a..cda0557 100644 --- a/templates/issue/edit.html.twig +++ b/templates/issue/edit.html.twig @@ -6,7 +6,7 @@ {% endblock %} {% block title %} -Modification Issue = {{title}} + = Modification Issue = {{title}} {% endblock %} {% block body %} @@ -27,6 +27,7 @@ Modification Issue = {{title}}
Information
+ {{ form_row(form.color) }}
diff --git a/templates/issue/view.html.twig b/templates/issue/view.html.twig index 47aefef..e7a48a9 100644 --- a/templates/issue/view.html.twig +++ b/templates/issue/view.html.twig @@ -4,7 +4,6 @@
#{{ issue.redmine.id }} = {{ issue.redmine.subject }}
-
@@ -17,6 +16,8 @@ {% endfor %} {% endif %}
+ +
Modifier
diff --git a/templates/project/view.html.twig b/templates/project/view.html.twig index 3832b89..2417406 100644 --- a/templates/project/view.html.twig +++ b/templates/project/view.html.twig @@ -16,12 +16,14 @@ z-index: 1000; } + main { padding-top:80px; } content { padding:0px; + overflow:auto; } .issueContainer { @@ -42,6 +44,7 @@ .scrumContainer { display:none; padding-left:300px; + width:10000px; } .containerStatus{ @@ -313,7 +316,7 @@
{% for issue in project.issues %} -
+
#{{issue.id}}
@@ -665,8 +668,13 @@ $sourceContainer = ui.item.parent(); $movedItem = ui.item; originalIndex = ui.item.index(); + enableAutoScroll($(window)); // ou remplace par ton conteneur scrollable }, + stop: function () { + disableAutoScroll(); + }, + update: function (event, ui) { console.log("UPDATE"); if (!event.originalEvent) return; @@ -697,7 +705,7 @@ data: { target: targetId, targetIssues: targetIssues - }, + }, success: function (response) { console.log('Déplacement réussi', response); }, @@ -725,7 +733,39 @@ } }); + let autoScrollInterval = null; + function enableAutoScroll($container) { + $(document).on('mousemove.autoScroll', function (e) { + const scrollMargin = 50; // px depuis le bord de la fenêtre + const scrollSpeed = 20; // px à chaque tick + + const mouseY = e.clientY; + const windowHeight = window.innerHeight; + + // Scroll vers le haut + if (mouseY < scrollMargin) { + clearInterval(autoScrollInterval); + autoScrollInterval = setInterval(() => { + $container.scrollTop($container.scrollTop() - scrollSpeed); + }, 50); + } + // Scroll vers le bas + else if (mouseY > windowHeight - scrollMargin) { + clearInterval(autoScrollInterval); + autoScrollInterval = setInterval(() => { + $container.scrollTop($container.scrollTop() + scrollSpeed); + }, 50); + } else { + clearInterval(autoScrollInterval); + } + }); + } + + function disableAutoScroll() { + $(document).off('mousemove.autoScroll'); + clearInterval(autoScrollInterval); + } {% endblock %} \ No newline at end of file