|
@@ -1,286 +0,0 @@
|
|
|
-<!-- Topbar -->
|
|
|
-{% autoescape false %}
|
|
|
- <script type="text/javascript">
|
|
|
- $(document).ready(function() {
|
|
|
- // Sidebar links
|
|
|
- $('.sidebar .sidebar-menu li a').on('click', function () {
|
|
|
- const $this = $(this);
|
|
|
-
|
|
|
- if ($this.parent().hasClass('open')) {
|
|
|
- $this
|
|
|
- .parent()
|
|
|
- .children('.dropdown-menu')
|
|
|
- .slideUp(200, () => {
|
|
|
- $this.parent().removeClass('open');
|
|
|
- });
|
|
|
- } else {
|
|
|
- $this
|
|
|
- .parent()
|
|
|
- .parent()
|
|
|
- .children('li.open')
|
|
|
- .children('.dropdown-menu')
|
|
|
- .slideUp(200);
|
|
|
-
|
|
|
- $this
|
|
|
- .parent()
|
|
|
- .parent()
|
|
|
- .children('li.open')
|
|
|
- .children('a')
|
|
|
- .removeClass('open');
|
|
|
-
|
|
|
- $this
|
|
|
- .parent()
|
|
|
- .parent()
|
|
|
- .children('li.open')
|
|
|
- .removeClass('open');
|
|
|
-
|
|
|
- $this
|
|
|
- .parent()
|
|
|
- .children('.dropdown-menu')
|
|
|
- .slideDown(200, () => {
|
|
|
- $this.parent().addClass('open');
|
|
|
- });
|
|
|
- }
|
|
|
- });
|
|
|
-
|
|
|
- // Sidebar Activity Class
|
|
|
- const sidebarLinks = $('.sidebar').find('.sidebar-link');
|
|
|
-
|
|
|
- sidebarLinks
|
|
|
- .each((index, el) => {
|
|
|
- $(el).removeClass('active');
|
|
|
- })
|
|
|
- .filter(function () {
|
|
|
- const href = $(this).attr('href');
|
|
|
- const pattern = href[0] === '/' ? href.substr(1) : href;
|
|
|
- return pattern === (window.location.pathname).substr(1);
|
|
|
- })
|
|
|
- .addClass('active');
|
|
|
-
|
|
|
- // ٍSidebar Toggle
|
|
|
- $('.sidebar-toggle').on('click', e => {
|
|
|
- $('.app').toggleClass('is-collapsed');
|
|
|
- e.preventDefault();
|
|
|
- $('.sidebar-search').toggleClass('d-none');
|
|
|
- });
|
|
|
-
|
|
|
- /**
|
|
|
- * Wait until sidebar fully toggled (animated in/out)
|
|
|
- * then trigger window resize event in order to recalculate
|
|
|
- * masonry layout widths and gutters.
|
|
|
- */
|
|
|
- $('#sidebar-toggle').click(e => {
|
|
|
- e.preventDefault();
|
|
|
- setTimeout(() => {
|
|
|
- window.dispatchEvent(window.EVENT);
|
|
|
- }, 300);
|
|
|
- });
|
|
|
-
|
|
|
- /**
|
|
|
- * Notifications Systems
|
|
|
- */
|
|
|
- $.get(
|
|
|
- '{{ url('legacy_main', { name : 'inc/ajax/message.ajax.php'}) }}',
|
|
|
- {'a': 'get_count_message'},
|
|
|
- function (data) {
|
|
|
- var countFriends = data.ms_friends;
|
|
|
- var countInbox = data.ms_inbox
|
|
|
- if (countFriends != 0) {
|
|
|
- $("#notifications-social").removeClass('d-none');
|
|
|
- $("#notifications-social").append(countFriends);
|
|
|
- }
|
|
|
- if(countInbox != 0){
|
|
|
- $("#notifications-inbox").removeClass('d-none');
|
|
|
- $("#notifications-inbox").append(countInbox);
|
|
|
- }
|
|
|
- }
|
|
|
- );
|
|
|
-
|
|
|
- $('#list_notifications_friends').on('click', e => {
|
|
|
- const $listFriends = $('#list_friends .content');
|
|
|
- let $html;
|
|
|
- $.get(
|
|
|
- '{{ url('legacy_main', { name : 'inc/ajax/message.ajax.php'}) }}',
|
|
|
- {'a': 'get_notifications_friends'},
|
|
|
- function (data) {
|
|
|
- $listFriends.empty();
|
|
|
- for (let i in data){
|
|
|
- $html = '<div class="dropdown-divider"></div>';
|
|
|
- $html += '<a class="dropdown-item preview-item">';
|
|
|
- $html += '<div class="preview-thumbnail"><img class="rounded-circle" src="'+data[i].avatar+'"/></div>';
|
|
|
- $html += '<div class="preview-item-content flex-grow">';
|
|
|
- $html += '<h6 class="preview-subject">' + data[i].fullname + '<span class="date-ago float-right">'+data[i].date+'</span></h6>';
|
|
|
- $html += '<p class="preview-text">' + data[i].content + '</p>';
|
|
|
- $html += '</div></a>';
|
|
|
- $listFriends.append($html);
|
|
|
- }
|
|
|
- }
|
|
|
- );
|
|
|
- });
|
|
|
-
|
|
|
- $('#list_notifications_inbox').on('click', e => {
|
|
|
- const $listInbox = $('#list_inbox .content');
|
|
|
- let $html;
|
|
|
- $.get(
|
|
|
- '{{ url('legacy_main', { name : 'inc/ajax/message.ajax.php'}) }}',
|
|
|
- {'a': 'get_notifications_inbox'},
|
|
|
- function (data) {
|
|
|
- $listInbox.empty();
|
|
|
- for (let i in data){
|
|
|
- $html = '<div class="dropdown-divider"></div>';
|
|
|
- $html += '<a class="dropdown-item preview-item" href="'+data[i].url+'">';
|
|
|
- $html += '<div class="preview-thumbnail"><div class="preview-icon bg-info">';
|
|
|
- $html += '<i class="far fa-envelope"></i>';
|
|
|
- $html += '</div></div>';
|
|
|
- $html += '<div class="preview-item-content flex-grow">';
|
|
|
- $html += '<h6 class="preview-subject">' + data[i].fullname + '<span class="date-ago float-right">'+data[i].date+'</span></h6>';
|
|
|
- $html += '<p class="preview-text">' + data[i].title + '</p>';
|
|
|
- $html += '</div></a>';
|
|
|
- $listInbox.append($html);
|
|
|
- }
|
|
|
- }
|
|
|
- );
|
|
|
- });
|
|
|
- });
|
|
|
- </script>
|
|
|
- <div class="header navbar">
|
|
|
- <div class="header-container">
|
|
|
-
|
|
|
- <!-- NAVBAR LEFT -->
|
|
|
- <ul class="nav-left">
|
|
|
- <li>
|
|
|
- <a id='sidebar-toggle' class="sidebar-toggle" href="javascript:void(0);">
|
|
|
- <i class="fas fa-bars"></i>
|
|
|
- </a>
|
|
|
- </li>
|
|
|
- <li>
|
|
|
-
|
|
|
- </li>
|
|
|
- </ul>
|
|
|
- <!-- END NAVBAR LEFT -->
|
|
|
- <!-- NAVBAR RIGHT -->
|
|
|
-
|
|
|
- {% if app.user is not null and is_granted('IS_AUTHENTICATED_FULLY') %}
|
|
|
- <ul class="nav-right">
|
|
|
-
|
|
|
- <li class="btn-menu">
|
|
|
- <a href="{{ url('legacy_main', { 'name' : 'calendar/agenda_js.php' }) }}">
|
|
|
- <i class="far fa-calendar"></i>
|
|
|
- </a>
|
|
|
- </li>
|
|
|
-
|
|
|
- <li class="notifications dropdown">
|
|
|
- <span id="notifications-social" class="counter d-none"></span>
|
|
|
- <a id="list_notifications_friends" href="#" class="dropdown-toggle no-after" data-toggle="dropdown">
|
|
|
- <i class="far fa-bell"></i>
|
|
|
- </a>
|
|
|
-
|
|
|
- <ul id="list_friends" class="dropdown-menu ">
|
|
|
- <a class="dropdown-item">
|
|
|
- <p id="notifications_text" class="mb-0 font-weight-normal float-left">
|
|
|
- Your recent notifications
|
|
|
- </p>
|
|
|
- <span class="badge badge-pill badge-warning float-right">View all</span>
|
|
|
- </a>
|
|
|
- <div class="content">
|
|
|
- <div class="spinner"></div>
|
|
|
- </div>
|
|
|
- </ul>
|
|
|
-
|
|
|
- </li>
|
|
|
- <li class="notifications">
|
|
|
- <span id="notifications-inbox" class="counter d-none"></span>
|
|
|
- <a id="list_notifications_inbox" href="#" class="dropdown-toggle no-after" data-toggle="dropdown">
|
|
|
- <i class="far fa-envelope"></i>
|
|
|
- </a>
|
|
|
- <ul id="list_inbox" class="dropdown-menu ">
|
|
|
- <a class="dropdown-item">
|
|
|
- <p id="notifications_text" class="mb-0 font-weight-normal float-left">
|
|
|
- Recent messages
|
|
|
- </p>
|
|
|
- <span class="badge badge-pill badge-warning float-right">View all</span>
|
|
|
- </a>
|
|
|
- <div class="content">
|
|
|
- <div class="spinner"></div>
|
|
|
- </div>
|
|
|
- </ul>
|
|
|
- </li>
|
|
|
-
|
|
|
- <li class="dropdown">
|
|
|
- <a href="" class="dropdown-toggle" data-toggle="dropdown">
|
|
|
-
|
|
|
- {% set avatar %}
|
|
|
- {% if app.user.pictureUri is empty %}
|
|
|
- <img
|
|
|
- class="rounded-circle"
|
|
|
- src="{{ url('legacy_public') ~ app.user.avatarOrAnonymous(32) }}"
|
|
|
- alt="{{ app.user.firstname }} {{ app.user.lastname }}"
|
|
|
- >
|
|
|
- {% else %}
|
|
|
- <img
|
|
|
- class="rounded-circle"
|
|
|
- src="{{ url('legacy_upload') ~ app.user.getPictureLegacy() }}"
|
|
|
- alt="{{ app.user.firstname }} {{ app.user.lastname }}"
|
|
|
- >
|
|
|
- {% endif %}
|
|
|
- {% endset %}
|
|
|
-
|
|
|
- {{ avatar }}
|
|
|
-
|
|
|
- <span class="profile-text">{{ app.user.firstname }} {{ app.user.lastname }}</span>
|
|
|
- </a>
|
|
|
- <ul class="dropdown-menu">
|
|
|
- <li>
|
|
|
- <a title="{{ "Inbox"|trans }}" class="dropdown-item"
|
|
|
- href="{{ url('legacy_main', { 'name' : 'auth/profile.php' }) }}">
|
|
|
- <em class="fa fa-envelope" aria-hidden="true"></em> {{ "Edit profile"|trans }}
|
|
|
- </a>
|
|
|
- </li>
|
|
|
- <li>
|
|
|
- <a title="{{ "Inbox"|trans }}" class="dropdown-item"
|
|
|
- href="{{ url('legacy_main', { 'name' : 'messages/inbox.php' }) }}">
|
|
|
- <em class="fa fa-envelope" aria-hidden="true"></em> {{ "Inbox"|trans }}
|
|
|
- </a>
|
|
|
- </li>
|
|
|
- <li>
|
|
|
- <a href="{{ url('legacy_main', { 'name' : 'survey/pending.php' }) }}" class="dropdown-item">
|
|
|
- <em class="fa fa-chart-pie"></em> {{ 'PendingSurveys'|trans }}
|
|
|
- </a>
|
|
|
- </li>
|
|
|
- <li>
|
|
|
- <a title="{{ "MyCertificates"|trans }}" class="dropdown-item"
|
|
|
- href="{{ url('legacy_main', { 'name' : 'gradebook/my_certificates.php' }) }}">
|
|
|
- <em class="fa fa-graduation-cap"
|
|
|
- aria-hidden="true"></em> {{ "MyCertificates"|trans }}
|
|
|
- </a>
|
|
|
- </li>
|
|
|
- <li role="separator" class="divider"></li>
|
|
|
- <li>
|
|
|
- <a id="logout_button" title="{{ "Logout"|trans }}" class="dropdown-item"
|
|
|
- href="{{ path('legacy_main', { 'name' : '../public/logout'}) }}">
|
|
|
- <em class="fa fa-sign-out-alt"></em> {{ "Logout"|trans }}
|
|
|
- </a>
|
|
|
- </li>
|
|
|
- </ul>
|
|
|
- </li>
|
|
|
- </ul>
|
|
|
- {% else %}
|
|
|
- <ul class="nav-right">
|
|
|
- <li class="btn-padding">
|
|
|
- <a class="btn btn-light btn-create-two btn-sm" href="{{ url('legacy_main', { 'name' : 'auth/inscription.php' }) }}">
|
|
|
- <i class="fas fa-pencil-alt"></i>
|
|
|
- {{ "Register"|trans }}
|
|
|
- </a>
|
|
|
- </li>
|
|
|
- <li class="btn-padding">
|
|
|
- <a class="btn btn-light btn-create-one btn-sm" href="{{ url('legacy_main', { 'name' : '../public/login' }) }}">
|
|
|
- <i class="fas fa-sign-in-alt"></i>
|
|
|
- {{ "Sign in"|trans }}
|
|
|
- </a>
|
|
|
- </li>
|
|
|
- </ul>
|
|
|
- {% endif %}
|
|
|
- <!-- END NAVBAR RIGHT -->
|
|
|
- </div>
|
|
|
- </div>
|
|
|
-{% endautoescape %}
|