diff --git a/app/AppKernel.php b/app/AppKernel.php index 990c839685..4bbdd039a1 100644 --- a/app/AppKernel.php +++ b/app/AppKernel.php @@ -127,6 +127,8 @@ class AppKernel extends Kernel new ChamiloLMS\CoreBundle\ChamiloLMSCoreBundle(), new ChamiloLMS\CourseBundle\ChamiloLMSCourseBundle(), new ChamiloLMS\InstallerBundle\ChamiloLMSInstallerBundle(), + new ChamiloLMS\MessageBundle\ChamiloLMSMessageBundle(), + new Stof\DoctrineExtensionsBundle\StofDoctrineExtensionsBundle() ); diff --git a/app/Resources/views/layout.html.twig b/app/Resources/views/layout.html.twig index 190a18037c..cea5a8462d 100644 --- a/app/Resources/views/layout.html.twig +++ b/app/Resources/views/layout.html.twig @@ -1 +1,18 @@ -123 +{% extends "AvanzuAdminThemeBundle:layout:base-layout.html.twig" %} + +{% block title %} + {#{{ parent() }}#} + {{ 'Institution' | get_setting }} - {{ 'siteName' | get_setting }} +{% endblock %} + +{% block avanzu_logo %} + {{ 'Institution' | get_setting }} +{% endblock %} + +{% block page_title %} + {% if page is defined %} + {{ page.name }} + {% else %} + {{ parent() }} + {% endif %} +{% endblock %} diff --git a/app/Resources/views/login.html.twig b/app/Resources/views/login.html.twig index 05c2a97986..65e34fbf46 100644 --- a/app/Resources/views/login.html.twig +++ b/app/Resources/views/login.html.twig @@ -2,7 +2,7 @@ - {% block title %} Log in {% endblock %} + {% block title %}Log in {% endblock %} {% stylesheets '@admin_lte_css' %} diff --git a/src/Application/Sonata/UserBundle/Entity/User.php b/src/Application/Sonata/UserBundle/Entity/User.php index 03f430547a..24470402b8 100644 --- a/src/Application/Sonata/UserBundle/Entity/User.php +++ b/src/Application/Sonata/UserBundle/Entity/User.php @@ -1247,22 +1247,33 @@ class User extends BaseUser implements ParticipantInterface, ThemeUser return $this->hrDeptId; } - + /** + * @return string + */ public function getAvatar() { - return 'avatar'; + return ''; } + /** + * @return \DateTime + */ public function getMemberSince() { return $this->registrationDate; } + /** + * @return bool + */ public function isOnline() { return false; } + /** + * @return int + */ public function getIdentifier() { return $this->getId(); diff --git a/src/Application/Sonata/UserBundle/Resources/views/Profile/action.html.twig b/src/Application/Sonata/UserBundle/Resources/views/Profile/action.html.twig index 7d06ab457a..46389a3fb6 100644 --- a/src/Application/Sonata/UserBundle/Resources/views/Profile/action.html.twig +++ b/src/Application/Sonata/UserBundle/Resources/views/Profile/action.html.twig @@ -1,14 +1,5 @@ -{# +{% extends "::layout.html.twig" %} -This file is part of the Sonata package. - -(c) Thomas Rabaix - -For the full copyright and license information, please view the LICENSE -file that was distributed with this source code. - -#} -{% extends "AvanzuAdminThemeBundle:layout:base-layout.html.twig" %} {% block page_content %} {% block sonata_page_breadcrumb %} diff --git a/src/ChamiloLMS/CoreBundle/Controller/IndexController.php b/src/ChamiloLMS/CoreBundle/Controller/IndexController.php index 69f8255e03..3b42af493d 100644 --- a/src/ChamiloLMS/CoreBundle/Controller/IndexController.php +++ b/src/ChamiloLMS/CoreBundle/Controller/IndexController.php @@ -287,7 +287,7 @@ class IndexController extends BaseController return $this->render( 'ChamiloLMSCoreBundle:Index:userportal.html.twig', - array('content' => $items) + array('content' => $items, 'page_title' => 'dsqd') ); } diff --git a/src/ChamiloLMS/CoreBundle/Resources/views/Index/index.html.twig b/src/ChamiloLMS/CoreBundle/Resources/views/Index/index.html.twig index 9f28f88a74..064ec49d07 100644 --- a/src/ChamiloLMS/CoreBundle/Resources/views/Index/index.html.twig +++ b/src/ChamiloLMS/CoreBundle/Resources/views/Index/index.html.twig @@ -5,7 +5,3 @@ {% include "@template_style/layout/hot_courses.tpl" %} {% endautoescape %} {% endblock %} - -{% block title %} - Index 2 -{% endblock %} diff --git a/src/ChamiloLMS/CoreBundle/Resources/views/Index/userportal.html.twig b/src/ChamiloLMS/CoreBundle/Resources/views/Index/userportal.html.twig index 7d17ebd393..bdc84fb182 100644 --- a/src/ChamiloLMS/CoreBundle/Resources/views/Index/userportal.html.twig +++ b/src/ChamiloLMS/CoreBundle/Resources/views/Index/userportal.html.twig @@ -1,4 +1,4 @@ -{% block page_content %} +{% block page_content %} {% autoescape false %} {{ content }} {% endautoescape %} diff --git a/src/ChamiloLMS/CoreBundle/Resources/views/main_layout.html.twig b/src/ChamiloLMS/CoreBundle/Resources/views/main_layout.html.twig index 50fb924a4c..abaf5e96e3 100644 --- a/src/ChamiloLMS/CoreBundle/Resources/views/main_layout.html.twig +++ b/src/ChamiloLMS/CoreBundle/Resources/views/main_layout.html.twig @@ -1,8 +1,4 @@ -{% extends "AvanzuAdminThemeBundle:layout:base-layout.html.twig" %} - -{% block title %} - {{ parent() }} -{% endblock %} +{% extends "::layout.html.twig" %} {% block javascripts_head %} {{ parent() }} @@ -43,18 +39,11 @@ {% endblock %} {% endblock %} -{% block page_title %} - {% if page is defined %} - {{ page.name }} - {% else %} - {{ parent() }} - {% endif %} -{% endblock %} - {% block page_content %} {% if page is defined %} {% block sonata_page_container %}
+
{#{{ sonata_page_render_container('header', page) }}#} {{ sonata_page_render_container('header', page) }} @@ -99,5 +88,4 @@
{% endblock %} {% endif %} - {% endblock %} diff --git a/src/ChamiloLMS/MessageBundle/ChamiloLMSMessageBundle.php b/src/ChamiloLMS/MessageBundle/ChamiloLMSMessageBundle.php new file mode 100644 index 0000000000..37e651f909 --- /dev/null +++ b/src/ChamiloLMS/MessageBundle/ChamiloLMSMessageBundle.php @@ -0,0 +1,19 @@ +{% trans from 'FOSMessageBundle' %}inbox{% endtrans %} + +{% include 'FOSMessageBundle:Message:threads_list.html.twig' with {'threads': threads} %} + +{% endblock %} diff --git a/src/ChamiloLMS/MessageBundle/Resources/views/Message/threads_list.html.twig b/src/ChamiloLMS/MessageBundle/Resources/views/Message/threads_list.html.twig new file mode 100644 index 0000000000..e3a81043ae --- /dev/null +++ b/src/ChamiloLMS/MessageBundle/Resources/views/Message/threads_list.html.twig @@ -0,0 +1,74 @@ + + + + + + + + + + + + + + + {% if threads %} + {% for thread in threads %} + + + + + + + + + {% endfor %} + {% else %} + + + + {% endif %} + + + +
{% trans from 'FOSMessageBundle' %}subject{% endtrans %}{% trans from 'FOSMessageBundle' %}starter{% endtrans %}{% trans from 'FOSMessageBundle' %}startdate{% endtrans %}{% trans from 'FOSMessageBundle' %}messages{% endtrans %}{% trans from 'FOSMessageBundle' %}last_message{% endtrans %}{% trans from 'FOSMessageBundle' %}actions{% endtrans %}
+ + {{ thread.subject }} + + + {% if not fos_message_is_read(thread) %} + ({% trans from 'FOSMessageBundle' %}new{% endtrans %}) + {% endif %} + + {{ thread.createdBy }} + + {{ thread.createdAt|date }} + + {{ thread.messages|length }} + + {% if thread.lastMessage %} + + → + + {% trans with {'%date%': thread.lastMessage.createdAt|date} from 'FOSMessageBundle' %}on{% endtrans %} +
+ {% trans with {'%sender%': thread.lastMessage.sender|e } from 'FOSMessageBundle' %}by{% endtrans %} + {% else %} + ---- + {% endif %} +
+ {% if fos_message_can_delete_thread(thread) %} + {% if fos_message_deleted_by_participant(thread) %} + {% set formAction %}{{ url('fos_message_thread_undelete', {'threadId': thread.id}) }}{% endset %} + {% set submitValue %}{% trans from 'FOSMessageBundle' %}undelete{% endtrans %}{% endset %} + {% else %} + {% set formAction %}{{ url('fos_message_thread_delete', {'threadId': thread.id}) }}{% endset %} + {% set submitValue %}{% trans from 'FOSMessageBundle' %}delete{% endtrans %}{% endset %} + {% endif %} +
+ +
+ {% endif %} +
+ {% trans from 'FOSMessageBundle' %}no_thread{% endtrans %}. +