Browse Source

Added user profile implementation + minor fixes

Hugo Briand 11 years ago
parent
commit
21ea5f1e66

+ 1 - 1
Resources/doc/reference/configuration.rst

@@ -60,7 +60,7 @@ Full Configuration Options
                 confirm_exit:                           true      # enabled confirmation when quitting with unsaved changes
                 use_select2:                            true      # enable select2
                 pager_links:                            ~         # pager max links to display
-                dropdown_number_groups_per_colums:          2         # max items per column in dropdown menu (add button in top nav)
+                dropdown_number_groups_per_colums:      2         # max items per column in dropdown menu (add button in top nav)
             dashboard:
                 groups:
 

+ 1 - 1
Resources/public/Admin.js

@@ -138,7 +138,7 @@ var Admin = {
                 content: message,
                 trigger: 'hover',
                 html: true,
-                placement: 'right',
+                placement: 'top',
                 template: '<div class="popover"><div class="arrow"></div><div class="popover-inner"><div class="popover-content alert-error"><p></p></div></div></div>'
             });
 

+ 18 - 0
Resources/public/css/styles.css

@@ -38,6 +38,24 @@ body > .header .logo {
     -moz-animation-duration: .3s;
 }
 
+/* Buttons */
+
+.btn.btn-outline {
+    color: inherit;
+    background-color: transparent;
+    transition: all .5s;
+}
+
+.btn.btn-primary.btn-outline:hover,
+.btn.btn-success.btn-outline:hover,
+.btn.btn-info.btn-outline:hover,
+.btn.btn-warning.btn-outline:hover,
+.btn.btn-danger.btn-outline:hover {
+    color: #fff;
+}
+
+
+
 /* navigation */
 
 .navbar-static-side ul li {

+ 2 - 2
Resources/views/CRUD/base_list.html.twig

@@ -161,9 +161,9 @@ file that was distributed with this source code.
                 </form>
                 {% endif %}
             {% else %}
-                <p class="notice">
+                <div class="callout callout-info">
                     {{ 'no_result'|trans({}, 'SonataAdminBundle') }}
-                </p>
+                </div>
             {% endif %}
 
             {% block list_footer %}{% endblock %}

+ 1 - 1
Resources/views/CRUD/base_standard_edit_field.html.twig

@@ -18,7 +18,7 @@ file that was distributed with this source code.
         {% endif %}
     {% endblock %}
 
-    <div class="col-sm-10 sonata-ba-field sonata-ba-field-{{ edit }}-{{ inline }} {% if field_element.vars.errors|length > 0 %}sonata-ba-field-error{% endif %}">
+    <div class="col-sm-10 col-md-5 sonata-ba-field sonata-ba-field-{{ edit }}-{{ inline }} {% if field_element.vars.errors|length > 0 %}sonata-ba-field-error{% endif %}">
 
         {% block field %}{{ form_widget(field_element) }}{% endblock %}
 

+ 3 - 3
Resources/views/Form/form_admin_fields.html.twig

@@ -113,7 +113,7 @@ file that was distributed with this source code.
     {% if sonata_admin is not defined or not sonata_admin_enabled or not sonata_admin.field_description %}
         <div class="form-group {% if errors|length > 0%} has-error{% endif %}">
             {{ form_label(form, label|default(null)) }}
-            <div class="col-sm-10 {% if label is sameas(false) %}sonata-collection-row-without-label{% endif %}">
+            <div class="col-sm-10 col-md-5 {% if label is sameas(false) %}sonata-collection-row-without-label{% endif %}">
                 {{ form_widget(form, {'horizontal': false, 'horizontal_input_wrapper_class': ''}) }} {# {'horizontal': false, 'horizontal_input_wrapper_class': ''} needed to avoid MopaBootstrapBundle messing with the DOM #}
                 {% if errors|length > 0 %}
                     <div class="help-block sonata-ba-field-error-messages">
@@ -133,7 +133,7 @@ file that was distributed with this source code.
             {% endblock %}
 
             {% set has_label = sonata_admin.field_description.options.name is defined or label is not sameas(false) %}
-            <div class="col-sm-10 sonata-ba-field sonata-ba-field-{{ sonata_admin.edit }}-{{ sonata_admin.inline }} {% if errors|length > 0 %}sonata-ba-field-error{% endif %} {% if not has_label %}sonata-collection-row-without-label{% endif %}">
+            <div class="col-sm-10 col-md-5 sonata-ba-field sonata-ba-field-{{ sonata_admin.edit }}-{{ sonata_admin.inline }} {% if errors|length > 0 %}sonata-ba-field-error{% endif %} {% if not has_label %}sonata-collection-row-without-label{% endif %}">
 
                 {{ form_widget(form, {'horizontal': false, 'horizontal_input_wrapper_class': ''}) }} {# {'horizontal': false, 'horizontal_input_wrapper_class': ''} needed to avoid MopaBootstrapBundle messing with the DOM #}
 
@@ -201,7 +201,7 @@ file that was distributed with this source code.
 
             {{ form_label(child) }}
 
-            <div class="col-sm-10 sonata-ba-field sonata-ba-field-{{ sonata_admin.edit }}-{{ sonata_admin.inline }} {% if errors|length > 0 %}sonata-ba-field-error{% endif %}">
+            <div class="col-sm-10 col-md-5 sonata-ba-field sonata-ba-field-{{ sonata_admin.edit }}-{{ sonata_admin.inline }} {% if errors|length > 0 %}sonata-ba-field-error{% endif %}">
                 {{ form_widget(child, {'horizontal': false, 'horizontal_input_wrapper_class': ''}) }} {# {'horizontal': false, 'horizontal_input_wrapper_class': ''} needed to avoid MopaBootstrapBundle messing with the DOM #}
             </div>
 

+ 1 - 1
Resources/views/Form/silex_form_div_layout.html.twig

@@ -74,7 +74,7 @@
 {% spaceless %}
     <div class="form-group {{ (0 < form_errors(form)|length)? 'has-error':'' }} ">
         {{ form_label(form, label|default(null)) }}
-        <div class="col-sm-10">
+        <div class="col-sm-10 col-md-5">
             {{ form_widget(form) }}
             {{ form_errors(form) }}
         </div>

+ 68 - 65
Resources/views/standard_layout.html.twig

@@ -128,7 +128,7 @@ file that was distributed with this source code.
                                         </a>
                                         {% include admin_pool.getTemplate('add_block') %}
                                     </li>
-                                    <li class="dropdown">
+                                    <li class="dropdown user-menu">
                                         <a class="dropdown-toggle" data-toggle="dropdown" href="#">
                                             <i class="fa fa-user fa-fw"></i> <i class="fa fa-caret-down"></i>
                                         </a>
@@ -145,74 +145,76 @@ file that was distributed with this source code.
         </header>
 
         <div class="wrapper row-offcanvas row-offcanvas-left">
-            <aside class="left-side sidebar-offcanvas">
-                <section class="sidebar">
-                    {% block sonata_side_nav %}
-                        {% block sonata_sidebar_search %}
-                            {% if app.security.token and is_granted('ROLE_SONATA_ADMIN') %}
-                                <form action="{{ url('sonata_admin_search') }}" method="GET" class="sidebar-form" role="search">
-                                    <div class="input-group custom-search-form">
-                                        <input type="text" name="q" value="{{ app.request.get('q') }}" class="form-control" placeholder="{{ 'search_placeholder'|trans({}, 'SonataAdminBundle') }}">
-                                            <span class="input-group-btn">
-                                                <button class="btn btn-flat" type="submit">
-                                                    <i class="fa fa-search"></i>
-                                                </button>
-                                            </span>
-                                    </div>
-                                </form>
-                            {% endif %}
-                        {% endblock sonata_sidebar_search %}
-
-                        {% block side_bar_before_nav %} {% endblock %}
-                        {% block side_bar_nav %}
-                            {% if app.security.token and is_granted('ROLE_SONATA_ADMIN') %}
-                                <ul class="sidebar-menu">
-                                    {% for group in admin_pool.dashboardgroups %}
-                                        {% set display = (group.roles is empty or is_granted('ROLE_SUPER_ADMIN') ) %}
-                                        {% for role in group.roles if not display %}
-                                            {% set display = is_granted(role) %}
-                                        {% endfor %}
+            {% block sonata_left_side %}
+                <aside class="left-side sidebar-offcanvas">
+                    <section class="sidebar">
+                        {% block sonata_side_nav %}
+                            {% block sonata_sidebar_search %}
+                                {% if app.security.token and is_granted('ROLE_SONATA_ADMIN') %}
+                                    <form action="{{ url('sonata_admin_search') }}" method="GET" class="sidebar-form" role="search">
+                                        <div class="input-group custom-search-form">
+                                            <input type="text" name="q" value="{{ app.request.get('q') }}" class="form-control" placeholder="{{ 'search_placeholder'|trans({}, 'SonataAdminBundle') }}">
+                                                <span class="input-group-btn">
+                                                    <button class="btn btn-flat" type="submit">
+                                                        <i class="fa fa-search"></i>
+                                                    </button>
+                                                </span>
+                                        </div>
+                                    </form>
+                                {% endif %}
+                            {% endblock sonata_sidebar_search %}
 
-                                        {# Do not display the group label if no item in group is available #}
-                                        {% set item_count = 0 %}
-                                        {% if display %}
-                                            {% for admin in group.items if item_count == 0 %}
-                                                {% if admin.hasroute('list') and admin.isGranted('LIST') %}
-                                                    {% set item_count = item_count+1 %}
-                                                {% endif %}
+                            {% block side_bar_before_nav %} {% endblock %}
+                            {% block side_bar_nav %}
+                                {% if app.security.token and is_granted('ROLE_SONATA_ADMIN') %}
+                                    <ul class="sidebar-menu">
+                                        {% for group in admin_pool.dashboardgroups %}
+                                            {% set display = (group.roles is empty or is_granted('ROLE_SUPER_ADMIN') ) %}
+                                            {% for role in group.roles if not display %}
+                                                {% set display = is_granted(role) %}
                                             {% endfor %}
-                                        {% endif %}
 
-                                        {% if display and (item_count > 0) %}
-                                            <li class="treeview">
-                                                <a href="#">
-                                                    {% if group.icon|default() %}{{ group.icon|raw }}{% endif %}
-                                                    <span>{{ group.label|trans({}, group.label_catalogue) }}</span>
-                                                    <i class="fa pull-right fa-angle-left"></i>
-                                                </a>
-                                                {% set active = false %}
-                                                {% for admin in group.items %}
-                                                    {% if admin.hasroute('list') and admin.isGranted('LIST') and app.request.get('_sonata_admin') == admin.code %}
-                                                        {% set active = true %}
+                                            {# Do not display the group label if no item in group is available #}
+                                            {% set item_count = 0 %}
+                                            {% if display %}
+                                                {% for admin in group.items if item_count == 0 %}
+                                                    {% if admin.hasroute('list') and admin.isGranted('LIST') %}
+                                                        {% set item_count = item_count+1 %}
                                                     {% endif %}
                                                 {% endfor %}
-                                                <ul class="treeview-menu{% if active %} active{% endif %}">
+                                            {% endif %}
+
+                                            {% if display and (item_count > 0) %}
+                                                <li class="treeview">
+                                                    <a href="#">
+                                                        {% if group.icon|default() %}{{ group.icon|raw }}{% endif %}
+                                                        <span>{{ group.label|trans({}, group.label_catalogue) }}</span>
+                                                        <i class="fa pull-right fa-angle-left"></i>
+                                                    </a>
+                                                    {% set active = false %}
                                                     {% for admin in group.items %}
-                                                        {% if admin.hasroute('list') and admin.isGranted('LIST') %}
-                                                            <li{% if app.request.get('_sonata_admin') == admin.code %} class="active"{% endif %}><a href="{{ admin.generateUrl('list')}}"><i class="fa fa-angle-double-right"></i> {{ admin.label|trans({}, admin.translationdomain) }}</a></li>
+                                                        {% if admin.hasroute('list') and admin.isGranted('LIST') and app.request.get('_sonata_admin') == admin.code %}
+                                                            {% set active = true %}
                                                         {% endif %}
                                                     {% endfor %}
-                                                </ul>
-                                            </li>
-                                        {% endif %}
-                                    {% endfor %}
-                                </ul>
-                            {% endif %}
-                        {% endblock side_bar_nav %}
-                        {% block side_bar_after_nav %} {% endblock %}
-                    {% endblock sonata_side_nav %}
-                </section>
-            </aside>
+                                                    <ul class="treeview-menu{% if active %} active{% endif %}">
+                                                        {% for admin in group.items %}
+                                                            {% if admin.hasroute('list') and admin.isGranted('LIST') %}
+                                                                <li{% if app.request.get('_sonata_admin') == admin.code %} class="active"{% endif %}><a href="{{ admin.generateUrl('list')}}"><i class="fa fa-angle-double-right"></i> {{ admin.label|trans({}, admin.translationdomain) }}</a></li>
+                                                            {% endif %}
+                                                        {% endfor %}
+                                                    </ul>
+                                                </li>
+                                            {% endif %}
+                                        {% endfor %}
+                                    </ul>
+                                {% endif %}
+                            {% endblock side_bar_nav %}
+                            {% block side_bar_after_nav %} {% endblock %}
+                        {% endblock sonata_side_nav %}
+                    </section>
+                </aside>
+            {% endblock sonata_left_side %}
 
             {% block sonata_wrapper %}
                 <aside class="right-side">
@@ -249,15 +251,16 @@ file that was distributed with this source code.
                                     {% endif %}
                                 {% endblock sonata_page_content_nav %}
 
-                                {% block notice %}
-                                    {% include 'SonataCoreBundle:FlashMessage:render.html.twig' %}
-                                {% endblock notice %}
-
                             {% endblock sonata_page_content_header %}
                         </section>
+
                         <section class="content">
                             {% block sonata_admin_content %}
 
+                                {% block notice %}
+                                    {% include 'SonataCoreBundle:FlashMessage:render.html.twig' %}
+                                {% endblock notice %}
+
                                 {% if _preview is not empty %}
                                     <div class="sonata-ba-preview">{{ _preview|raw }}</div>
                                 {% endif %}