File tree Expand file tree Collapse file tree 2 files changed +32
-2
lines changed Expand file tree Collapse file tree 2 files changed +32
-2
lines changed Original file line number Diff line number Diff line change
1
+ <?php
2
+ namespace App \Controller \Editor ;
3
+
4
+ use Symfony \Component \HttpFoundation \JsonResponse ;
5
+ use Symfony \Component \HttpFoundation \Response ;
6
+ use Symfony \Component \Routing \Attribute \Route ;
7
+
8
+
9
+ class ArticleUploadImages extends ArticleEditBaseController
10
+ {
11
+ #[Route('/ajax/editor/article/{articleId<[1-9]+[0-9]*>}/images/upload ' , name: 'app_article_edit_images-upload ' , methods: ['POST ' ])]
12
+ public function upload (int $ articleId ) : JsonResponse |Response
13
+ {
14
+ try {
15
+ dd ("TODO " );
16
+ $ arrIdsAndTags = $ this ->request ->get ('tags ' ) ?? [];
17
+ $ this ->loadArticleEditor ($ articleId )->setTagsFromIdsAndTags ($ arrIdsAndTags );
18
+ $ this ->factory ->getEntityManager ()->flush ();
19
+ return $ this ->jsonOKResponse ("Tag salvati " );
20
+
21
+ } catch (Exception |Error $ ex ) { return $ this ->textErrorResponse ($ ex ); }
22
+ }
23
+ }
Original file line number Diff line number Diff line change 1
1
<!-- ARTICLE side column editor images gallery START -->
2
- <div id =" tli-article-editor-image-gallery" class =" col-lg-4 sticky-top overflow-auto mt-15" >
2
+ <div id =" tli-article-editor-image-gallery" class =" col-lg-4 sticky-top overflow-auto mt-15"
3
+ data-save-url =" {{ path(' app_article_edit_images-upload' , {' articleId' : Article .id }) }}" >
3
4
4
5
{% embed ' parts/alert-chalkboard.html.twig' %}
5
6
{% block alertStyle %}{% if Article .Images is empty %}collapse{% endif%} tli-images-guide{% endblock %}
24
25
{% endfor %}
25
26
</div >
26
27
28
+
27
29
<div class =" sticky-bottom text-center mt-2" >
30
+
28
31
<button type =" button" class =" btn btn-primary tli-image-upload" >
29
32
<i class =" fa-solid fa-upload" ></i > Carica immagini
30
33
</button >
31
34
32
35
<input type =" file" multiple accept =" image/*" class =" d-none" >
33
36
34
- <div class =" tli-image-upload-progress" ></div >
37
+ <div id =" tli-image-upload-progress" class =" progress d-none" role =" progressbar"
38
+ aria-valuenow =" 0" aria-valuemin =" 0" aria-valuemax =" 100" >
39
+ <div class =" progress-bar progress-bar-striped progress-bar-animated" style =" width: 0%" ></div >
40
+ </div >
41
+
35
42
</div >
36
43
37
44
</div >
You can’t perform that action at this time.
0 commit comments