jmontoyaa 8 жил өмнө
parent
commit
279727aab3

+ 138 - 0
src/Chamilo/CoreBundle/Resources/views/User/profile.html.twig

@@ -0,0 +1,138 @@
+{% block left_column %}
+    <script>
+        function checkLength(o, n, min, max) {
+            if (o.val().length > max || o.val().length < min) {
+                o.addClass("ui-state-error");
+                //updateTips( "Length of " + n + " must be between " + min + " and " + max + "." );
+                return false;
+            } else {
+                return true;
+            }
+        }
+
+        function send_message_to_user(user_id) {
+            var subject = $("#subject_id");
+            var content = $("#content_id");
+            $("#send_message_form").show();
+            $("#send_message_div").dialog({
+                modal: true,
+                height: 350,
+                buttons: {
+                    "{{ 'Send' | trans }}": function () {
+                        var bValid = true;
+                        bValid = bValid && checkLength(subject, "subject", 1, 255);
+                        bValid = bValid && checkLength(content, "content", 1, 255);
+
+                        if (bValid) {
+                            var url = "{{ url('web.ajax') }}message.ajax.php?a=send_message&user_id=" + user_id;
+                            var params = $("#send_message_form").serialize();
+                            $.ajax({
+                                url: url + "&" + params,
+                                success: function (data) {
+                                    $("#message_ajax_reponse").html(data);
+                                    $("#message_ajax_reponse").show();
+                                    $("#send_message_div").dialog({buttons: {}});
+                                    $("#send_message_form").hide();
+                                    $("#send_message_div").dialog("close");
+                                    $("#subject_id").val("");
+                                    $("#content_id").val("");
+                                }
+                            });
+                        }
+                    }
+                },
+                close: function () {
+                }
+            });
+            $("#send_message_div").dialog("open");
+            //prevent the browser to follow the link
+        }
+
+        function send_invitation_to_user(user_id) {
+            var content = $("#content_invitation_id");
+            $("#send_invitation_form").show();
+            $("#send_invitation_div").dialog({
+                modal: true,
+                buttons: {
+                    "{{ 'SendInvitation' | trans }}": function () {
+                        var bValid = true;
+                        bValid = bValid && checkLength(content, "content", 1, 255);
+                        if (bValid) {
+                            var url = "{{ url('web.ajax') }}message.ajax.php?a=send_invitation&user_id=" + user_id;
+                            var params = $("#send_invitation_form").serialize();
+                            $.ajax({
+                                url: url + "&" + params,
+                                success: function (data) {
+                                    $("#message_ajax_reponse").html(data);
+                                    $("#message_ajax_reponse").show();
+                                    $("#send_invitation_div").dialog({buttons: {}});
+                                    $("#send_invitation_form").hide();
+                                    $("#send_invitation_div").dialog("close");
+                                    $("#content_invitation_id").val("");
+                                }
+                            });
+                        }
+                    }
+                },
+                close: function () {
+                }
+            });
+            $("#send_invitation_div").dialog("open");
+            //prevent the browser to follow the link
+        }
+
+        $(document).ready(function () {
+            $("input#id_btn_send_invitation").bind("click", function () {
+                if (confirm("'.trans('SendMessageInvitation', '').'")) {
+                    $("#form_register_friend").submit();
+                }
+            });
+
+            $("#send_message_div").dialog({
+                autoOpen: false,
+                modal: false,
+                width: 550,
+                height: 300
+            });
+
+            $("#send_invitation_div").dialog({
+                autoOpen: false,
+                modal: false,
+                width: 550,
+                height: 300
+            });
+
+        });
+    </script>
+
+    <div class="well social-background-content">
+        <img src="{{ user.avatar }}"/>
+    </div>
+
+    <div class="well sidebar-nav">
+        <ul class="nav nav-pills nav-stacked">
+            <li>
+                <a href="javascript:void(0);"
+                   onclick="javascript:send_message_to_user('{{ user.id }}');">
+                    {{ 'SendMessage' | trans }}
+                </a>
+            </li>
+            <li>
+                <a href="javascript:void(0);"
+                   onclick="javascript:send_invitation_to_user('{{ user.id }}');">
+                    {{ 'SendInvitation' | trans }}
+                </a>
+            </li>
+        </ul>
+    </div>
+
+{% endblock %}
+
+{% block right_column %}
+    <span id="message_ajax_reponse"></span>
+    <div class="well_border">
+        <h3>{{ user.complete_name }} @{{ user.username }} </h3>
+    </div>
+    {{ form_send_message }}
+    {{ form_send_invitation }}
+{% endblock %}

+ 2 - 0
src/Chamilo/CoreBundle/Resources/views/default/auth/lost_password.html.twig

@@ -1,5 +1,7 @@
 {% extends '@ChamiloTheme/Layout/layout_one_col.html.twig' %}
 
 {% block content %}
+{% autoescape false %}
 {{ form }}
+{% endautoescape %}
 {% endblock %}

+ 1 - 1
src/Chamilo/CoreBundle/Resources/views/default/mail/mail.html.twig

@@ -33,7 +33,7 @@
                     </tr>
                     <tr>
                         <td>
-                            {% include '@ChamiloCore/default/layout/footer.html.twig' %}
+                            {% include '@ChamiloCore/default/mail/footer.html.twig' %}
                         </td>
                     </tr>
                 </table>

+ 0 - 1
src/Chamilo/ThemeBundle/Resources/views/Sidebar/menu_knp.html.twig

@@ -23,7 +23,6 @@
 {% else %}
     {{ locale_switcher(null, null, 'ChamiloCoreBundle:Admin:switcher_links.html.twig') }}
     <div class="user-panel">
-
     </div>
     <form action="{{ path("fos_user_security_check") }}" method="post" role="form" class="sidebar-form">
         <input type="hidden" name="_csrf_token" value="{{ csrf_token('authenticate') }}"/>

+ 19 - 18
src/Chamilo/UserBundle/Resources/views/Security/base_login.html.twig

@@ -5,13 +5,11 @@
         <div class="col-sm-6">
             {% block sonata_user_login %}
                 <div class="login-box-body">
-
                     <div class="panel-heading">
                         <h2 class="panel-title">{{ 'title_user_authentication'|trans({}, 'SonataUserBundle') }}</h2>
                     </div>
 
                     <div class="panel-body">
-
                         {% block sonata_user_login_error %}
                             {% if error %}
                                 <div class="alert alert-danger alert-danger">{{ error|trans({}, 'FOSUserBundle') }}</div>
@@ -27,27 +25,30 @@
 
                                 <div class="form-group">
                                     <label for="username"
-                                           class="col-sm-4 control-label">{{ 'security.login.username'|trans({}, 'FOSUserBundle') }}</label>
-
-                                    <div class="col-sm-8"><input type="text"
-                                                                 class="form-control"
-                                                                 id="username"
-                                                                 name="_username"
-                                                                 value="{{ last_username }}"
-                                                                 required="required"/>
+                                           class="col-sm-4 control-label">
+                                        {{ 'security.login.username'|trans({}, 'FOSUserBundle') }}
+                                    </label>
+                                    <div class="col-sm-8">
+                                        <input type="text"
+                                             class="form-control"
+                                             id="username"
+                                             name="_username"
+                                             value="{{ last_username }}"
+                                             required="required"/>
                                     </div>
                                 </div>
-
-
                                 <div class="form-group control-group">
                                     <label for="password"
-                                           class="col-sm-4 control-label">{{ 'security.login.password'|trans({}, 'FOSUserBundle') }}</label>
+                                           class="col-sm-4 control-label">
+                                        {{ 'security.login.password'|trans({}, 'FOSUserBundle') }}
+                                    </label>
 
-                                    <div class="col-sm-8"><input type="password"
-                                                                 class="form-control"
-                                                                 id="password"
-                                                                 name="_password"
-                                                                 required="required"/>
+                                    <div class="col-sm-8">
+                                        <input type="password"
+                                         class="form-control"
+                                         id="password"
+                                         name="_password"
+                                         required="required"/>
                                     </div>
                                 </div>
 

+ 1 - 1
src/Chamilo/UserBundle/Resources/views/Security/login.html.twig

@@ -43,7 +43,7 @@
                     </div>
 
                     <div class="form-group has-feedback">
-                        <a href="{{ path('fos_user_resetting_request') }}">{{ 'forgotten_password'|trans({}, 'SonataUserBundle') }}</a>
+                        <a href="{{ path('main', { name: 'auth/lostPassword.php' }) }}">{{ 'forgotten_password'|trans({}, 'SonataUserBundle') }}</a>
                     </div>
 
                     <div class="form-group">