Procházet zdrojové kódy

Evolution #92: Refonte des boutons: Refonte des boutons réseau public / mon réseau

bastien před 12 roky
rodič
revize
da26a68f0e

+ 2 - 0
app/Resources/translations/userui.fr.yml Zobrazit soubor

@@ -37,6 +37,8 @@ filter:
37 37
   submit:  Filtrer
38 38
   clear:   Aucun filtre
39 39
   mytags:  Tous mes tags
40
+  network_all:   Réseau global
41
+  network_my:    Mon réseau
40 42
   
41 43
 element_add:
42 44
   url:

+ 12 - 4
src/Muzich/CoreBundle/Resources/views/SearchElement/form.html.twig Zobrazit soubor

@@ -1,10 +1,18 @@
1 1
 
2 2
   {{ form_errors(search_form) }}
3 3
 
4
-  <div class="field">
5
-    {{ form_errors(search_form.network) }}
6
-    {{ form_label(search_form.network, 'filter.network'|trans({}, 'userui')) }}
7
-    {{ form_widget(search_form.network) }}
4
+  <div class="select_network">
5
+    <div class="field">
6
+      {{ form_errors(search_form.network) }}
7
+      {{ form_widget(search_form.network, { 'attr': {'style': 'display: none;'} }) }}
8
+    </div>
9
+    
10
+    <a href="#" class="button all_network {% if network_public %}active{% endif %}">
11
+      {{ 'filter.network_all'|trans({}, 'userui') }}
12
+    </a>
13
+    <a href="#" class="button my_network {% if not network_public %}active{% endif %}">
14
+      {{ 'filter.network_my'|trans({}, 'userui') }}
15
+    </a>
8 16
   </div>
9 17
   
10 18
   {% include "MuzichCoreBundle:Tag:tagsPrompt.html.twig" with { 

+ 18 - 0
src/Muzich/CoreBundle/Searcher/ElementSearcher.php Zobrazit soubor

@@ -116,6 +116,24 @@ class ElementSearcher extends Searcher implements SearcherInterface
116 116
     return $this->network;
117 117
   }
118 118
   
119
+  public function isNetworkPublic()
120
+  {
121
+    if ($this->network == self::NETWORK_PUBLIC)
122
+    {
123
+      return true;
124
+    }
125
+    return false;
126
+  }
127
+  
128
+  public function isNetworkPersonal()
129
+  {
130
+    if ($this->network == self::NETWORK_PERSONAL)
131
+    {
132
+      return true;
133
+    }
134
+    return false;
135
+  }
136
+  
119 137
   public function getTags($tags_string = false)
120 138
   {
121 139
     if (!$tags_string)

+ 1 - 0
src/Muzich/HomeBundle/Controller/HomeController.php Zobrazit soubor

@@ -35,6 +35,7 @@ class HomeController extends Controller
35 35
       'add_form_name'    => 'add',
36 36
       'search_form'      => $search_form->createView(),
37 37
       'search_form_name' => 'search',
38
+      'network_public'   => $search_object->isNetworkPublic(),
38 39
       'elements'         => $search_object->getElements($this->getDoctrine(), $this->getUserId()),
39 40
       'more_count'       => ($count)?$count+$this->container->getParameter('search_default_count'):$this->container->getParameter('search_default_count')*2
40 41
     );

+ 1 - 2
web/bundles/muzichcore/css/main.css Zobrazit soubor

@@ -62,8 +62,7 @@ input.button, button.button {
62 62
 }
63 63
 
64 64
 .button:active {
65
-  padding: 3px 6px;
66
-  border: 1px solid #165c6d;
65
+  background-color: #39c9cc;
67 66
 }
68 67
 
69 68
 #container a

binární
web/bundles/muzichcore/img/1328191129_edit_group.png Zobrazit soubor


binární
web/bundles/muzichcore/img/1328191242_keyboard_layout.png Zobrazit soubor


+ 17 - 0
web/bundles/muzichcore/js/muzich.js Zobrazit soubor

@@ -649,5 +649,22 @@ $(document).ready(function(){
649 649
     onOpen: function(){},
650 650
     onClose: function(){}
651 651
   });
652
+  
653
+  // Selection Réseau global / Mon réseau
654
+  $('div.select_network a').live('click', function(){
655
+    divSelect = $(this).parent('div');
656
+    if ($(this).hasClass('all_network'))
657
+    {
658
+      divSelect.find('a.all_network').addClass('active');
659
+      divSelect.find('a.my_network').removeClass('active');
660
+      divSelect.find('select').val('network_public');
661
+    }
662
+    else
663
+    {
664
+      divSelect.find('a.my_network').addClass('active');
665
+      divSelect.find('a.all_network').removeClass('active');
666
+      divSelect.find('select').val('network_personal');
667
+    }
668
+  });
652 669
    
653 670
  });

+ 31 - 0
web/bundles/muzichhome/css/home.css Zobrazit soubor

@@ -17,4 +17,35 @@
17 17
 {
18 18
   background-color: #e3f6fd;
19 19
   padding: 20px;
20
+}
21
+
22
+#container div.select_network a
23
+{
24
+  color: white;
25
+}
26
+
27
+div.select_network a.all_network
28
+{
29
+  padding-left: 20px;
30
+  background-image: url(/bundles/muzichcore/img/1328191242_keyboard_layout.png);
31
+  background-repeat: no-repeat;
32
+  background-position: 2px 3px;
33
+}
34
+
35
+div.select_network a.my_network
36
+{
37
+  padding-left: 20px;
38
+  background-image: url(/bundles/muzichcore/img/1328191129_edit_group.png);
39
+  background-repeat: no-repeat;
40
+  background-position: 2px 3px;
41
+}
42
+
43
+div.select_network a.active
44
+{
45
+  background-color: #39c9cc
46
+}
47
+
48
+div.tags_prompt
49
+{
50
+  margin-top: 5px;
20 51
 }