Browse Source

Improve settings UI

jmontoya 9 years ago
parent
commit
564c5b406e

+ 2 - 0
src/Chamilo/SettingsBundle/Controller/SettingsController.php

@@ -105,10 +105,12 @@ class SettingsController extends SyliusSettingsController
                 return $this->redirect($request->headers->get('referer'));
             }*/
         }
+        $schemas = $manager->getSchemas();
 
         return $this->render(
             'ChamiloSettingsBundle:Settings:default.html.twig',
             array(
+                'schemas' => $schemas,
                 'settings' => $settings,
                 'form' => $form->createView(),
                 'keyword' => $keyword,

+ 32 - 22
src/Chamilo/SettingsBundle/Resources/views/Settings/default.html.twig

@@ -4,30 +4,40 @@
 {% set namespace = app.request.get('namespace') %}
 
 {% block content %}
-    <h3>{{ namespace }} {{ 'Settings' | trans }}</h3>
-
-    <form
-        class="form-horizontal"
-        action="{{ path('chamilo_platform_settings', { 'namespace': namespace }) }}"
-        method="post"
-    >
-        {{ form_widget(search_form) }}
-    </form>
 
     <div class="row">
-        <div class="col-md-12">
-            <div class="box box-primary">
-                <div class="box-body">
-                    {{ form_errors(form) }}
-                    <form
-                        class="form-horizontal"
-                        action="{{ path('chamilo_platform_settings', { 'namespace': namespace , 'keyword': keyword } ) }}"
-                        method="post"
-                        novalidate
-                    >
-                    {{ form_rest(form) }}
-                    {{ update() }}
-                    </form>
+        <div class="col-xs-3 col-md-3">
+        {% include '@ChamiloSettings/Settings/menu.html.twig' %}
+        </div>
+        <div class="col-xs-9 col-md-9">
+            <div class="page-header">
+                <h3>{{ namespace }} {{ 'Settings' | trans }}</h3>
+            </div>
+
+            <form
+                class="form-horizontal"
+                action="{{ path('chamilo_platform_settings', { 'namespace': namespace }) }}"
+                method="post"
+            >
+                {{ form_widget(search_form) }}
+            </form>
+
+            <div class="row">
+                <div class="col-md-12">
+                    <div class="box box-primary">
+                        <div class="box-body">
+                            {{ form_errors(form) }}
+                            <form
+                                class="form-horizontal"
+                                action="{{ path('chamilo_platform_settings', { 'namespace': namespace , 'keyword': keyword } ) }}"
+                                method="post"
+                                novalidate
+                            >
+                                {{ form_rest(form) }}
+                                {{ update() }}
+                            </form>
+                        </div>
+                    </div>
                 </div>
             </div>
         </div>

+ 7 - 10
src/Chamilo/SettingsBundle/Resources/views/Settings/index.html.twig

@@ -8,14 +8,11 @@
 {% endblock %}
 
 {% block page_content %}
-    <ul>
-    {% for namespace in schemas|keys %}
-        <li>
-            <img src="{{ asset('bundles/chamilocore/img/icons/32/' ~ namespace ~'.png') }}" />
-            <a href="{{ path('chamilo_platform_settings', { 'namespace': namespace }) }}">
-            {{ namespace | capitalize | trans }}
-            </a>
-        </li>
-    {% endfor %}
-    </ul>
+    <div class="row">
+        <div class="col-xs-3 col-md-3">
+        {% include '@ChamiloSettings/Settings/menu.html.twig' %}
+        </div>
+        <div class="col-xs-9 col-md-9">
+        </div>
+    </div>
 {% endblock%}

+ 11 - 0
src/Chamilo/SettingsBundle/Resources/views/Settings/menu.html.twig

@@ -0,0 +1,11 @@
+<ul class="nav nav-pills nav-stacked">
+{% set current_namespace = app.request.get('namespace') %}
+    {% for namespace in schemas|keys %}
+        <li class="{% if (current_namespace ==  namespace)  %} active {% endif %}">
+            <a href="{{ path('chamilo_platform_settings', { 'namespace': namespace }) }}">
+                <img src="{{ asset('bundles/chamilocore/img/icons/32/' ~ namespace ~'.png') }}" />
+                {{ namespace | capitalize | trans }}
+            </a>
+        </li>
+    {% endfor %}
+</ul>