Browse Source

Evolution #77: Cacher les "ajouter"

bastien 13 years ago
parent
commit
4132380a25

+ 11 - 0
app/Resources/translations/navigationui.fr.yml View File

@@ -22,6 +22,17 @@ home:
22 22
   add_element_box:
23 23
     close:              Fermer
24 24
   
25
+group:
26
+  add_element:          Ajouter un élément dans ce groupe
27
+  add_group:            Ajouter un groupe
28
+  add_element_box:
29
+    close:              Fermer
30
+  add_group_box:
31
+    close:              Fermer
32
+  
33
+my_groups:
34
+  title:                Mes groupes
35
+  
25 36
 title:
26 37
   hello:                Découvrez et partagez la musique !
27 38
   

+ 1 - 1
src/Muzich/CoreBundle/Resources/views/SearchElement/default.html.twig View File

@@ -19,7 +19,7 @@
19 19
         </span> 
20 20
         
21 21
         {% autoescape false %}
22
-          {% if element.group %}
22
+          {% if element.group and no_group_name is not defined%}
23 23
             {{ 'element.name.whoandgroup'|trans({
24 24
               '%owner_url%'  : path('show_user', {'slug': element.owner.slug}),
25 25
               '%owner_name%' : element.owner.name,

+ 2 - 1
src/Muzich/CoreBundle/Tests/Controller/HomeControllerTest.php View File

@@ -145,7 +145,8 @@ class HomeControllerTest extends FunctionalTest
145 145
     $this->procedure_add_element(
146 146
       'Mon bel element', 
147 147
       'http://www.youtube.com/watch?v=WC8qb_of04E', 
148
-      array($hardtek->getId(), $tribe->getId())
148
+      array($hardtek->getId(), $tribe->getId()),
149
+            null, true
149 150
     );
150 151
     
151 152
     $this->isResponseRedirection();

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

@@ -1,9 +1,13 @@
1 1
 {% extends "MuzichGroupBundle::layout.html.twig" %}
2 2
 
3
-{% block title %}Mes groupes{% endblock %}
3
+{% block title %}{{ 'my_groups.title'|trans({}, 'navigationui') }}{% endblock %}
4 4
 
5 5
 {% block content %}
6 6
 
7
+  <a href="#" id="group_add_link">
8
+    {{ 'group.add_group'|trans({}, 'navigationui') }} >>
9
+  </a>
10
+
7 11
   {% if groups|length %}
8 12
 
9 13
     {{ 'havegroups.sentence'|trans({}, 'groups') }}
@@ -22,13 +26,21 @@
22 26
 
23 27
   {% endif %}
24 28
 
25
-  <h2>Ajouter un groupe</h2>
29
+  <div id="group_add_box" style="display: none;">
26 30
 
27
-  <form name="{{ form_new_name }}" action="{{ path('group_add') }}" method="post" {{ form_enctype(form_new) }}>
31
+    <a href="#" id="group_add_close_link">
32
+      << {{ 'group.add_group_box.close'|trans({}, 'navigationui') }}
33
+    </a>
28 34
     
29
-    {% include "MuzichGroupBundle:Form:form.html.twig" with { 'form': form_new, 'form_name': form_new_name } %}
35
+    <h2>{{ 'group.add_group'|trans({}, 'navigationui') }}</h2>
36
+
37
+    <form name="{{ form_new_name }}" action="{{ path('group_add') }}" method="post" {{ form_enctype(form_new) }}>
38
+
39
+      {% include "MuzichGroupBundle:Form:form.html.twig" with { 'form': form_new, 'form_name': form_new_name } %}
30 40
 
31
-    <input type="submit" />
32
-  </form>
41
+      <input type="submit" />
42
+    </form>
43
+  
44
+  </div>
33 45
 
34 46
 {% endblock %}

+ 3 - 0
src/Muzich/GroupBundle/Resources/views/layout.html.twig View File

@@ -3,6 +3,9 @@
3 3
 {% block css %}
4 4
 	<link href="{{ asset('bundles/muzichgroups/css/groups.css') }}" rel="stylesheet" media="screen" type="text/css" />
5 5
 {% endblock %}
6
+{% block js %}
7
+  <script src="{{ asset('bundles/muzichgroups/js/groups.js') }}" type="text/javascript"></script>
8
+{% endblock %}
6 9
 
7 10
 {% block main_content %}
8 11
   

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

@@ -7,7 +7,7 @@
7 7
   <div id="element_add_box" style="display: none;">
8 8
     
9 9
     <a href="#" id="element_add_close_link">
10
-      {{ 'home.add_element_box.close'|trans({}, 'navigationui') }} >>
10
+      << {{ 'home.add_element_box.close'|trans({}, 'navigationui') }}
11 11
     </a>
12 12
     
13 13
     <form name="{{ add_form_name }}" action="{{ path('element_add') }}" method="post" {{ form_enctype(add_form) }}>

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

@@ -27,21 +27,29 @@
27 27
   
28 28
   {% if his_group or group.open %}
29 29
   
30
-    <form name="{{ add_form_name }}" action="{{ path('element_add', {'group_slug' : group.slug}) }}" method="post" {{ form_enctype(add_form) }}>
30
+    <div id="element_add_box" style="display: none;">
31
+  
32
+      <a href="#" id="element_add_close_link">
33
+        << {{ 'group.add_element_box.close'|trans({}, 'navigationui') }}
34
+      </a>
35
+      
36
+      <form name="{{ add_form_name }}" action="{{ path('element_add', {'group_slug' : group.slug}) }}" method="post" {{ form_enctype(add_form) }}>
31 37
 
32
-      {% include "MuzichCoreBundle:Element:form.add.html.twig" with { 'form': add_form, 'form_name': add_form_name } %}
38
+        {% include "MuzichCoreBundle:Element:form.add.html.twig" with { 'form': add_form, 'form_name': add_form_name } %}
33 39
 
34
-      <p>
35
-        <i>
36
-          {{ 'element.add.group.will_be_in'|trans({}, 'elements') }}
37
-        </i>
38
-      </p>
39
-      <input type="submit" />
40
-    </form>
40
+        <input type="submit" />
41
+      </form>
42
+      
43
+    </div>
44
+  
45
+    <a href="#" id="element_add_link">
46
+      {{ 'group.add_element'|trans({}, 'navigationui') }} >>
47
+    </a>
48
+    <br />
41 49
   
42 50
   {% endif %}
43 51
   
44
-  {% include "MuzichCoreBundle:SearchElement:default.html.twig" %}
52
+  {% include "MuzichCoreBundle:SearchElement:default.html.twig" with {'no_group_name' : true} %}
45 53
     
46 54
   {% if more_count is defined %} 
47 55
   {% if elements|length %}

+ 5 - 0
web/bundles/muzichcore/css/main.css View File

@@ -50,6 +50,11 @@
50 50
   color: #00d0de;
51 51
 }
52 52
 
53
+#container a:hover
54
+{
55
+  text-decoration: underline;
56
+}
57
+
53 58
 #container #top-tabs, .top-tabs-right
54 59
 {
55 60
   float: left;

+ 12 - 0
web/bundles/muzichgroups/css/groups.css View File

@@ -0,0 +1,12 @@
1
+
2
+#container #group_add_link, #container #group_add_close_link
3
+{
4
+  font-size: 120%;
5
+  float: right;
6
+}
7
+
8
+#container #group_add_box
9
+{
10
+  background-color: #e3f6fd;
11
+  padding: 20px;
12
+}

+ 17 - 0
web/bundles/muzichgroups/js/groups.js View File

@@ -0,0 +1,17 @@
1
+$(document).ready(function(){
2
+   
3
+   // Ouverture de la zone "ajouter un group""
4
+   $('#group_add_link').click(function(){
5
+     $('#group_add_box').slideDown("slow");
6
+     $('#group_add_link').hide();
7
+     return false;
8
+   });   
9
+   
10
+   // Fermeture de la zone "ajouter un group""
11
+   $('#group_add_close_link').click(function(){
12
+     $('#group_add_box').slideUp("slow");
13
+     $('#group_add_link').show();
14
+     return false;
15
+   }); 
16
+   
17
+ });