Browse Source

Evolution #66: Ajout de tags: sablier

bastien 13 years ago
parent
commit
cc1653dd99

+ 1 - 1
src/Muzich/CoreBundle/Resources/views/Tag/tagFavoritesForm.html.twig View File

@@ -1,4 +1,4 @@
1
-<form action="{{ path('update_tag_favorites', { 'redirect' : redirect }) }}" method="post" {{ form_enctype(form) }}>
1
+<form name="{{ form_name }}" action="{{ path('update_tag_favorites', { 'redirect' : redirect }) }}" method="post" {{ form_enctype(form) }}>
2 2
   
3 3
   {{ form_errors(form) }}
4 4
 

+ 4 - 2
src/Muzich/CoreBundle/Resources/views/Tag/tagsPrompt.html.twig View File

@@ -2,7 +2,7 @@
2 2
 
3 3
 <div class="tags_prompt" id="tags_prompt_{{ form_name }}">
4 4
   <span class="help">{{ 'tags.help'|trans({}, 'userui') }}</span>
5
-  
5
+    
6 6
   {% if display_specials_buttons is defined %}
7 7
     {% if display_specials_buttons == true %}
8 8
       <br />
@@ -13,6 +13,7 @@
13 13
     {% endif %}
14 14
   {% endif %}
15 15
   
16
+   <img id="tag_loader_{{ form_name }}" class="tag_loader" style="display: none;" src="{{ asset('/bundles/muzichcore/img/ajax-loader.gif') }}" alt="loading"/>
16 17
    <input class="tags_prompt_list" id="tags_prompt_list_{{ form_name }}" name="tags" value=""> 
17 18
 </div>
18 19
 
@@ -53,9 +54,10 @@
53 54
         
54 55
         // ici il faut faire une ajax q pour obtenir la liste
55 56
         // ou a est un tableau de strings
56
-        
57
+        $('#tag_loader_{{ form_name }}').css('display', 'block');
57 58
         $.getJSON('/app_dev.php/fr/search/tag/'+req.term, function(data) {
58 59
           responseFn( data );
60
+          $('#tag_loader_{{ form_name }}').css('display', 'none');
59 61
         });
60 62
       },
61 63
       minLength: 2,

+ 1 - 1
src/Muzich/GroupBundle/Resources/views/Default/edit.html.twig View File

@@ -6,7 +6,7 @@
6 6
 
7 7
   <h2>Edition du groupe {{ group.name }}</h2>
8 8
 
9
-  <form action="{{ path('group_update', { 'slug': group.slug }) }}" method="post" {{ form_enctype(form) }}>
9
+  <form name="{{ form_name }}" action="{{ path('group_update', { 'slug': group.slug }) }}" method="post" {{ form_enctype(form) }}>
10 10
     
11 11
     {% include "MuzichGroupBundle:Form:form.html.twig" %}
12 12
 

+ 1 - 1
src/Muzich/GroupBundle/Resources/views/Default/myList.html.twig View File

@@ -24,7 +24,7 @@
24 24
 
25 25
   <h2>Ajouter un groupe</h2>
26 26
 
27
-  <form action="{{ path('group_add') }}" method="post" {{ form_enctype(form_new) }}>
27
+  <form name="{{ form_new_name }}" action="{{ path('group_add') }}" method="post" {{ form_enctype(form_new) }}>
28 28
     
29 29
     {% include "MuzichGroupBundle:Form:form.html.twig" with { 'form': form_new, 'form_name': form_new_name } %}
30 30
 

+ 2 - 2
src/Muzich/HomeBundle/Resources/views/Home/index.html.twig View File

@@ -10,7 +10,7 @@
10 10
       {{ 'home.add_element_box.close'|trans({}, 'navigationui') }} >>
11 11
     </a>
12 12
     
13
-    <form action="{{ path('element_add') }}" method="post" {{ form_enctype(add_form) }}>
13
+    <form name="{{ add_form_name }}" action="{{ path('element_add') }}" method="post" {{ form_enctype(add_form) }}>
14 14
 
15 15
       {% include "MuzichCoreBundle:Element:form.add.html.twig" with { 
16 16
         'form'          : add_form, 
@@ -25,7 +25,7 @@
25 25
     {{ 'home.add_element'|trans({}, 'navigationui') }} >>
26 26
   </a>
27 27
 
28
-  <form action="{{ path('search_elements') }}" method="post" {{ form_enctype(search_form) }}>
28
+  <form name="{{ search_form_name }}" action="{{ path('search_elements') }}" method="post" {{ form_enctype(search_form) }}>
29 29
 
30 30
     {% include "MuzichCoreBundle:SearchElement:form.html.twig" with { 
31 31
       'form_name'               : search_form_name,

+ 1 - 1
src/Muzich/HomeBundle/Resources/views/Show/showGroup.html.twig View File

@@ -27,7 +27,7 @@
27 27
   
28 28
   {% if his_group or group.open %}
29 29
   
30
-    <form action="{{ path('element_add', {'group_slug' : group.slug}) }}" method="post" {{ form_enctype(add_form) }}>
30
+    <form name="{{ add_form_name }}" action="{{ path('element_add', {'group_slug' : group.slug}) }}" method="post" {{ form_enctype(add_form) }}>
31 31
 
32 32
       {% include "MuzichCoreBundle:Element:form.add.html.twig" with { 'form': add_form, 'form_name': add_form_name } %}
33 33
 

+ 7 - 1
web/bundles/muzichcore/css/main.css View File

@@ -323,7 +323,6 @@ cursor: text;
323 323
 border: 1px solid #ccc;
324 324
 overflow: hidden;
325 325
 padding: 0 0 1px 3px;
326
-min-height:48px;
327 326
 }
328 327
 ul.tagbox li {
329 328
 margin:0;
@@ -480,4 +479,11 @@ ul.tagbox input[type="text"]:FOCUS
480 479
     color-stop(0.49, rgb(168,238,255)),
481 480
     color-stop(1, rgb(189,241,254))
482 481
   );
482
+}
483
+
484
+.tag_loader
485
+{
486
+  float: right;
487
+  margin-top: 36px;
488
+  margin-left: 5px;
483 489
 }

BIN
web/bundles/muzichcore/img/ajax-loader.gif View File


+ 6 - 0
web/js/tags/jquery.tagBox.js View File

@@ -63,11 +63,17 @@
63 63
           input = $(this);
64 64
 
65 65
           // Ici il faut faire un ajax q pour connaitre l'id, on a que le string
66
+          // ajax loader gif
67
+          $('#tag_loader_'+options.form_name).css('display', 'block');
68
+          // On bloque le submit le temps de la validation du tag
69
+          $('form[name="'+options.form_name+'"] input[type="submit"]').attr('disabled', 'disabled');
66 70
           $.getJSON('/app_dev.php/fr/search/tagid/'+$(this).val(), function(data) {
67 71
             if (isInteger(data))
68 72
             {
69 73
               self.addTag(input.val(), data, options.form_name, false);
70 74
               input.val("");
75
+              $('#tag_loader_'+options.form_name).css('display', 'none');
76
+              $('form[name="'+options.form_name+'"] input[type="submit"]').removeAttr('disabled');
71 77
             }
72 78
           });
73 79