Browse Source

Evolution #70: Zone de tag plus claires

bastien 13 years ago
parent
commit
a9d498bf0b

+ 3 - 1
app/Resources/translations/userui.fr.yml View File

@@ -11,7 +11,7 @@ start:
11 11
   tags:
12 12
     title:     Choisissez vos tags préférés
13 13
     remind:    Vous pourrez egallement modifier vos tags préféré dans la partie 'mon compte'.
14
-
14
+    
15 15
 my_account: 
16 16
   title:          Mon compte
17 17
   username:         Nom d'utilisateur
@@ -29,6 +29,8 @@ tags:
29 29
            Tapez dans le cadre ci-dessous le mot que vous souhaitez utiliser. 
30 30
            Une liste de tags disponibles apparaitra et vous pourrez choisir le 
31 31
            tag voulu dans la liste. Vous pouvez choisir plueurs tags.
32
+  inputtext:
33
+    help:      Tapez votre tag ici
32 34
            
33 35
 filter:
34 36
   network: "Résultats de "

+ 19 - 10
src/Muzich/CoreBundle/Resources/views/Tag/tagsPrompt.html.twig View File

@@ -25,6 +25,7 @@
25 25
     {% endfor %}
26 26
   {% endif %}
27 27
   
28
+  tag_text_help = "{{ 'tags.inputtext.help'|trans({}, 'userui') }}";
28 29
   var options = new Array();
29 30
   options.form_name  = "{{ form_name }}";
30 31
   options.tag_init   = taginit;
@@ -56,16 +57,6 @@
56 57
         $.getJSON('/app_dev.php/fr/search/tag/'+req.term, function(data) {
57 58
           responseFn( data );
58 59
         });
59
-        
60
-          //var sstr = $.trim(req.term);
61
-          //var re = $.ui.autocomplete.escapeRegex(sstr);
62
-          //var matcher = new RegExp(re, "i" );
63
-          //var a = $.grep( taglist, function(item,index){
64
-          //    return matcher.test(item);
65
-          //});
66
-          //console.debug(a);
67
-          
68
-          //responseFn( a );
69 60
       },
70 61
       minLength: 2,
71 62
       select: function(e, ui) {
@@ -76,5 +67,23 @@
76 67
           }
77 68
       }
78 69
   });  
70
+  
71
+  $('#tags_prompt_{{ form_name }} input[type="text"]').val(tag_text_help);
72
+  $('#tags_prompt_{{ form_name }} input[type="text"]').focus(function(){
73
+    if ($(this).val() == tag_text_help)
74
+    {
75
+      $(this).val('');
76
+      //$(this).addClass('focuson');
77
+      //$(this).removeClass('focusout');
78
+    }
79
+  });
80
+  $('#tags_prompt_{{ form_name }} input[type="text"]').focusout(function(){
81
+    if (!$(this).val())
82
+    {
83
+      $(this).val(tag_text_help);
84
+      //$(this).removeClass('focuson');
85
+      //$(this).addClass('focusout');
86
+    }
87
+  });
79 88
     
80 89
 </script>

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

@@ -307,8 +307,10 @@ background:#fff;
307 307
 list-style:none;
308 308
 position: absolute;
309 309
 cursor: default;
310
+list-style-type: none;
311
+width: 300px;
310 312
 }
311
-.ui-autocomplete li {margin:0;}
313
+.ui-autocomplete li {margin-right:8px; float: left;}
312 314
 .ui-autocomplete li a {display:block; padding:4px;}
313 315
 .ui-autocomplete li a.ui-state-hover,
314 316
 .ui-autocomplete li a:hover {background:#eee;} 
@@ -446,4 +448,36 @@ input.main
446 448
 input.clear, input.mytags
447 449
 {
448 450
   font-size: 80%;
451
+}
452
+
453
+ul.tagbox, ul.tagbox input[type="text"]
454
+{
455
+  background-color: #bdf1fe;
456
+}
457
+
458
+ul.tagbox input[type="text"]
459
+{
460
+  height: 14px;
461
+  margin-top: 3px;
462
+  width: 150px;
463
+  color: #676767;
464
+  font-weight: bold;
465
+}
466
+
467
+ul.tagbox input[type="text"]:FOCUS
468
+{
469
+  background-image: linear-gradient(left , rgb(137,232,253) 10%, rgb(168,238,255) 49%, rgb(189,241,254) 100%);
470
+  background-image: -o-linear-gradient(left , rgb(137,232,253) 10%, rgb(168,238,255) 49%, rgb(189,241,254) 100%);
471
+  background-image: -moz-linear-gradient(left , rgb(137,232,253) 10%, rgb(168,238,255) 49%, rgb(189,241,254) 100%);
472
+  background-image: -webkit-linear-gradient(left , rgb(137,232,253) 10%, rgb(168,238,255) 49%, rgb(189,241,254) 100%);
473
+  background-image: -ms-linear-gradient(left , rgb(137,232,253) 10%, rgb(168,238,255) 49%, rgb(189,241,254) 100%);
474
+
475
+  background-image: -webkit-gradient(
476
+    linear,
477
+    left bottom,
478
+    right bottom,
479
+    color-stop(0.1, rgb(137,232,253)),
480
+    color-stop(0.49, rgb(168,238,255)),
481
+    color-stop(1, rgb(189,241,254))
482
+  );
449 483
 }