Adding inbox layout.

1.10.x
Julio Montoya 11 years ago
parent 73ef65f787
commit 0f3760ff93
  1. 2
      app/AppKernel.php
  2. 19
      app/Resources/views/layout.html.twig
  3. 15
      src/Application/Sonata/UserBundle/Entity/User.php
  4. 11
      src/Application/Sonata/UserBundle/Resources/views/Profile/action.html.twig
  5. 2
      src/ChamiloLMS/CoreBundle/Controller/IndexController.php
  6. 4
      src/ChamiloLMS/CoreBundle/Resources/views/Index/index.html.twig
  7. 16
      src/ChamiloLMS/CoreBundle/Resources/views/main_layout.html.twig
  8. 19
      src/ChamiloLMS/MessageBundle/ChamiloLMSMessageBundle.php
  9. 9
      src/ChamiloLMS/MessageBundle/Resources/views/Message/inbox.html.twig
  10. 74
      src/ChamiloLMS/MessageBundle/Resources/views/Message/threads_list.html.twig

@ -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()
);

@ -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 %}

@ -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();

@ -1,14 +1,5 @@
{#
{% extends "::layout.html.twig" %}
This file is part of the Sonata package.
(c) Thomas Rabaix <thomas.rabaix@sonata-project.org>
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 %}

@ -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')
);
}

@ -5,7 +5,3 @@
{% include "@template_style/layout/hot_courses.tpl" %}
{% endautoescape %}
{% endblock %}
{% block title %}
Index 2
{% endblock %}

@ -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 %}
<div class="row">
<div class="col-xs-12">
{#{{ sonata_page_render_container('header', page) }}#}
{{ sonata_page_render_container('header', page) }}
@ -99,5 +88,4 @@
</div>
{% endblock %}
{% endif %}
{% endblock %}

@ -0,0 +1,19 @@
<?php
namespace ChamiloLMS\MessageBundle;
use Symfony\Component\HttpKernel\Bundle\Bundle;
use Symfony\Component\Console\Application;
use ChamiloLMS\InstallerBundle\Command\InstallCommand;
/**
* Class ChamiloLMSMessageBundle
* @package ChamiloLMS\ChamiloLMSMessageBundle
*/
class ChamiloLMSMessageBundle extends Bundle
{
public function getParent()
{
return 'FOSMessageBundle';
}
}

@ -0,0 +1,9 @@
{% extends 'FOSMessageBundle::layout.html.twig' %}
{% block fos_message_content %}
<h2>{% trans from 'FOSMessageBundle' %}inbox{% endtrans %}</h2>
{% include 'FOSMessageBundle:Message:threads_list.html.twig' with {'threads': threads} %}
{% endblock %}

@ -0,0 +1,74 @@
<table class="table table-mailbox">
<thead>
<tr>
<th>{% trans from 'FOSMessageBundle' %}subject{% endtrans %}</th>
<th>{% trans from 'FOSMessageBundle' %}starter{% endtrans %}</th>
<th>{% trans from 'FOSMessageBundle' %}startdate{% endtrans %}</th>
<th>{% trans from 'FOSMessageBundle' %}messages{% endtrans %}</th>
<th>{% trans from 'FOSMessageBundle' %}last_message{% endtrans %}</th>
<th>{% trans from 'FOSMessageBundle' %}actions{% endtrans %}</th>
</tr>
</thead>
<tbody>
{% if threads %}
{% for thread in threads %}
<tr>
<td>
<a href="{{ url('fos_message_thread_view', {'threadId': thread.id}) }}">
{{ thread.subject }}
</a>
{% if not fos_message_is_read(thread) %}
({% trans from 'FOSMessageBundle' %}new{% endtrans %})
{% endif %}
</td>
<td>
{{ thread.createdBy }}
</td>
<td>
{{ thread.createdAt|date }}
</td>
<td>
{{ thread.messages|length }}
</td>
<td>
{% if thread.lastMessage %}
<a href="{{ url('fos_message_thread_view', {'threadId': thread.id}) }}#message_{{ thread.lastMessage.id }}" title="{% trans from 'FOSMessageBundle' %}goto_last{% endtrans %}">
</a>
{% trans with {'%date%': thread.lastMessage.createdAt|date} from 'FOSMessageBundle' %}on{% endtrans %}
<br />
{% trans with {'%sender%': thread.lastMessage.sender|e } from 'FOSMessageBundle' %}by{% endtrans %}
{% else %}
----
{% endif %}
</td>
<td>
{% 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 %}
<form action="{{ formAction }}" method="post">
<input type="submit" value="{{ submitValue }}" />
</form>
{% endif %}
</td>
</tr>
{% endfor %}
{% else %}
<tr>
<td colspan="6">
{% trans from 'FOSMessageBundle' %}no_thread{% endtrans %}.
</td>
</tr>
{% endif %}
</tbody>
</table>
Loading…
Cancel
Save