Browse Source

Fix previous merge, adding missing tpls

jmontoyaa 7 years ago
parent
commit
bcb8af5b5e

+ 1 - 0
main/inc/local.inc.php

@@ -2,6 +2,7 @@
 /* For licensing terms, see /license.txt */
 
 use ChamiloSession as Session;
+use Chamilo\CoreBundle\Component\Utils\ChamiloApi;
 
 /**
  *

+ 21 - 0
main/lp/learnpath.class.php

@@ -12072,5 +12072,26 @@ EOD;
         }
         return stripslashes($output);
     }
+
+    /**
+     * Get the parent names for the current item
+     * @param int $newItemId Optional. The item ID
+     * @return array
+     */
+    public function getCurrentItemParentNames($newItemId = 0)
+    {
+        $newItemId = $newItemId ?: $this->get_current_item_id();
+        $return = [];
+        $item = $this->getItem($newItemId);
+        $parent = $this->getItem($item->get_parent());
+
+        while ($parent) {
+            $return[] = $parent->get_title();
+
+            $parent = $this->getItem($parent->get_parent());
+        }
+
+        return array_reverse($return);
+    }
 }
 

+ 37 - 44
main/template/rainbow/admin/settings_index.tpl

@@ -42,56 +42,49 @@
 <section id="settings">
     {% set columns = 2 %}
     {% for block_item in blocks %}
-
-        {% if loop.first or loop.index0 is divisibleby(columns) %}
-            <div class="row">
-        {% endif %}
-
-        <div id="tabs-{{ loop.index }}" class="col-md-6">
-            <div class="panel panel-default {{ block_item.class }}">
-                <div class="panel-heading">
-                    {{ block_item.icon }} {{ block_item.label }}
-                    {% if block_item.editable and _u.is_admin %}
-                        <button type="button" class="btn btn-link btn-sm admin-edit-block pull-right"
-                                data-label="{{ block_item.label }}" data-id="{{ block_item.class }}">
-                            <img src="{{ "edit.png"|icon(22) }}" width="22" height="22" alt="{{ "Edit"|get_lang }}"
-                                 title="{{ "Edit"|get_lang }}"/>
-                        </button>
-                    {% endif %}
-                </div>
-                <div class="panel-body">
-                    <div style="display: block;">
-                        {{ block_item.search_form }}
+        {% if block_item.items %}
+            <div id="tabs-{{ loop.index }}" class="settings-block col-md-6">
+                <div class="panel panel-default {{ block_item.class }}">
+                    <div class="panel-heading">
+                        {{ block_item.icon }} {{ block_item.label }}
+                        {% if block_item.editable and _u.is_admin %}
+                            <button type="button" class="btn btn-link btn-sm admin-edit-block pull-right"
+                                    data-label="{{ block_item.label }}" data-id="{{ block_item.class }}">
+                                <img src="{{ "edit.png"|icon(22) }}" width="22" height="22" alt="{{ "Edit"|get_lang }}"
+                                     title="{{ "Edit"|get_lang }}"/>
+                            </button>
+                        {% endif %}
                     </div>
-                    {% if block_item.items is not null %}
-                        <div class="block-items-admin">
-                            <ul class="list-items-admin">
-                                {% for url in block_item.items %}
-                                    <li>
-                                        <a href="{{ url.url }}">
-                                            {{ url.label }}
-                                        </a>
-                                    </li>
-                                {% endfor %}
-                            </ul>
+                    <div class="panel-body">
+                        <div style="display: block;">
+                            {{ block_item.search_form }}
                         </div>
-                    {% endif %}
+                        {% if block_item.items is not null %}
+                            <div class="block-items-admin">
+                                <ul class="list-items-admin">
+                                    {% for url in block_item.items %}
+                                        <li>
+                                            <a href="{{ url.url }}">
+                                                {{ url.label }}
+                                            </a>
+                                        </li>
+                                    {% endfor %}
+                                </ul>
+                            </div>
+                        {% endif %}
 
-                    {% if block_item.extra is not null %}
-                        <div>
-                            {{ block_item.extra }}
-                        </div>
-                    {% endif %}
+                        {% if block_item.extra is not null %}
+                            <div>
+                                {{ block_item.extra }}
+                            </div>
+                        {% endif %}
 
-                    {% if block_item.extraContent %}
-                        <div>{{ block_item.extraContent }}</div>
-                    {% endif %}
+                        {% if block_item.extraContent %}
+                            <div>{{ block_item.extraContent }}</div>
+                        {% endif %}
+                    </div>
                 </div>
             </div>
-        </div>
-
-        {% if loop.last or loop.index is divisibleby(columns) %}
-            </div>
         {% endif %}
     {% endfor %}
 </section>

+ 49 - 66
main/template/rainbow/admin/teacher_time_report.tpl

@@ -1,70 +1,53 @@
-{% extends template ~ "/layout/main.tpl" %}
+<script>
+$(document).on('ready', function () {
+    $('#course').on('change', function () {
+        $('#session').prop('selectedIndex', 0);
+        $('#teacher').prop('selectedIndex', 0);
+    });
 
-{% block body %}
-    <script>
-        $(document).on('ready', function () {
-            $('#course').on('change', function () {
-                $('#session').prop('selectedIndex', 0);
-                $('#teacher').prop('selectedIndex', 0);
-            });
+    $('#session').on('change', function () {
+        $('#course').prop('selectedIndex', 0);
+        $('#teacher').prop('selectedIndex', 0);
+    });
 
-            $('#session').on('change', function () {
-                $('#course').prop('selectedIndex', 0);
-                $('#teacher').prop('selectedIndex', 0);
-            });
+    $('#teacher').on('change', function () {
+        $('#course').prop('selectedIndex', 0);
+        $('#session').prop('selectedIndex', 0);
+    });
 
-            $('#teacher').on('change', function () {
-                $('#course').prop('selectedIndex', 0);
-                $('#session').prop('selectedIndex', 0);
-            });
+    $('#daterange').on('apply.daterangepicker', function (ev, picker) {
+        $('[name="from"]').val(picker.startDate.format('YYYY-MM-DD'));
+        $('[name="until"]').val(picker.endDate.format('YYYY-MM-DD'));
+    }).on('cancel.daterangepicker', function (ev, picker) {
+        $('#daterange, [name="from"], [name="until"]').val('');
+    });
+});
+</script>
 
-            $('#daterange').on('apply.daterangepicker', function (ev, picker) {
-                $('[name="from"]').val(picker.startDate.format('YYYY-MM-DD'));
-                $('[name="until"]').val(picker.endDate.format('YYYY-MM-DD'));
-            }).on('cancel.daterangepicker', function (ev, picker) {
-                $('#daterange, [name="from"], [name="until"]').val('');
-            });
-        });
-    </script>
-    <div class="col-md-12">
-        <div class="actions">
-            <div class="row">
-                <div class="col-md-12">
-                    <a href="{{ _p.web_self }}?export=pdf&from={{ selectedFrom }}&until={{ selectedUntil }}&course={{ selectedCourse }}&session={{ selectedSession }}&teacher={{ selectedTeacher }}">
-                        {{ 'pdf.png' | img(32, 'ExportToPDF'|get_lang ) }}
-                    </a>
-                    <a href="{{ _p.web_self }}?export=xls&from={{ selectedFrom }}&until={{ selectedUntil }}&course={{ selectedCourse }}&session={{ selectedSession }}&teacher={{ selectedTeacher }}">
-                         {{ 'export_excel.png' | img(32, 'ExportExcel'|get_lang ) }}
-                    </a>
-                </div>
-            </div>
-        </div>
-        <h1 class="page-header">{{ 'TeacherTimeReport' | get_lang }}</h1>
-        {{ form }}
-        <h2 class="page-header">{{ reportTitle }} <small>{{ reportSubTitle }}</small></h2>
-        <table class="table">
-            <thead>
-                <tr>
-                    {% if withFilter %}
-                        <th>{{ 'Session' | get_lang }}</th>
-                        <th>{{ 'Course' | get_lang }}</th>
-                    {% endif %}
-                    <th>{{ 'Coach' | get_lang }}</th>
-                    <th>{{ 'TotalTime' | get_lang }}</th>
-                </tr>
-            </thead>
-            <tbody>
-                {% for row in rows %}
-                    <tr>
-                        {% if withFilter %}
-                            <td>{{ row.session ? row.session.name : '&nbsp' }}</td>
-                            <td>{{ row.course.name }}</td>
-                        {% endif %}
-                        <td>{{ row.coach.completeName }} ({{ row.coach.username}})</td>
-                        <td>{{ row.totalTime }}</td>
-                    </tr>
-                {% endfor %}
-            </tbody>
-        </table>
-    </div>
-{% endblock %}
+{{ form }}
+<h3 class="page-header">{{ report_title }} <small>{{ report_sub_title }}</small></h3>
+
+<table class="table">
+    <thead>
+        <tr>
+            {% if with_filter %}
+                <th>{{ 'Session' | get_lang }}</th>
+                <th>{{ 'Course' | get_lang }}</th>
+            {% endif %}
+            <th>{{ 'Coach' | get_lang }}</th>
+            <th class="text-center">{{ 'TotalTime' | get_lang }}</th>
+        </tr>
+    </thead>
+    <tbody>
+        {% for row in rows %}
+            <tr>
+                {% if with_filter %}
+                    <td>{{ row.session ? row.session.name : '&nbsp' }}</td>
+                    <td>{{ row.course.name }}</td>
+                {% endif %}
+                <td>{{ row.coach.complete_name }} ({{ row.coach.username}})</td>
+                <td class="text-center">{{ row.total_time }}</td>
+            </tr>
+        {% endfor %}
+    </tbody>
+</table>

+ 8 - 17
main/template/rainbow/agenda/month.tpl

@@ -125,9 +125,7 @@ $(document).ready(function() {
             for (dayIndex = 0; dayIndex < segsByDay.length; dayIndex++) {
                 daySegs = segsByDay[dayIndex];
                 if (daySegs) { // sparse array, so might be undefined
-
                     this.sortEventSegs(daySegs);
-
                     for (i = 0; i < daySegs.length; i++) {
                         var event = daySegs[i].event;
                         if (jQuery.inArray(event.id, eventList) !== -1) {
@@ -290,10 +288,12 @@ $(document).ready(function() {
                     $('#end_date').html('');
                 }
 
-				$('#color_calendar').html('{{ type_label | escape('js')}}');
-				$('#color_calendar').removeClass('group_event');
-				$('#color_calendar').addClass('label_tag');
-				$('#color_calendar').addClass('{{ type_event_class | escape('js') }}');
+				$('#color_calendar')
+                    .html('{{ type_label | escape('js')}}')
+                    .removeClass('group_event')
+                    .addClass('label_tag')
+                    .addClass('{{ type_event_class | escape('js') }}')
+                    .css('background-color', '{{ type_event_color }}');
 
                 //It shows the CKEDITOR while Adding an Event
                 $('#cke_content').show();
@@ -481,10 +481,9 @@ $(document).ready(function() {
                 $("#comment").hide();
 
 				allFields.removeClass( "ui-state-error" );
-
 				$("#dialog-form").dialog("open");
 
-				var url = '{{ web_agenda_ajax_url }}&a=edit_event&id='+calEvent.id+'&start='+calEvent.start.unix()+'&end='+calEvent.end.unix()+'&all_day='+calEvent.allDay+'&view='+view.name;
+				var url = '{{ web_agenda_ajax_url }}&a=edit_event&id='+calEvent.id+'&view='+view.name;
 				var delete_url = '{{ web_agenda_ajax_url }}&a=delete_event&id='+calEvent.id;
 
 				$("#dialog-form").dialog({
@@ -525,7 +524,7 @@ $(document).ready(function() {
 						},
                         {% endif %}
                         '{{ "Edit"|get_lang }}' : function() {
-                            url =  "{{ _p.web_main }}calendar/agenda.php?action=edit&type=fromjs&id=" + calEvent.id+'&course_id='+calEvent.course_id+"";
+                            url =  "{{ _p.web_main }}calendar/agenda.php?action=edit&type=fromjs&id="+calEvent.id+'&course_id='+calEvent.course_id+"";
                             window.location.href = url;
                             $("#dialog-form").dialog( "close" );
                         },
@@ -644,7 +643,6 @@ $(document).ready(function() {
                         '<div class="form-group"><label class="col-sm-3 control-label">{{ 'Session' | get_lang }}</label>' +
                         '<div class="col-sm-9">' + calEvent.session_name+"</div></div>"
                     );
-
                 } else {
                     $("#calendar_session_info").html('');
                 }
@@ -652,7 +650,6 @@ $(document).ready(function() {
                 $("#simple_title").html(calEvent.title);
                 $("#simple_content").html(calEvent.description);
                 $("#simple_comment").html(calEvent.comment);
-
                 $("#simple-dialog-form").dialog("open");
                 $("#simple-dialog-form").dialog({
 					buttons: {
@@ -706,12 +703,6 @@ $(document).ready(function() {
 			else $('#loading').hide();
 		}
 	});
-
-
-
-
-
-
 });
 </script>
 {{ actions_div }}

+ 5 - 1
main/template/rainbow/announcement/slider.tpl

@@ -1,3 +1,6 @@
+<div class="page-header">
+    <h4>{{ "SystemAnnouncements" | get_lang }}</h4>
+</div>
 <div id="carousel-announcement" class="carousel slide" data-ride="carousel">
     <!-- Indicators -->
     <ol class="carousel-indicators">
@@ -11,6 +14,7 @@
     {% for announcement in announcements %}
         <div class="item {% if loop.index0 == 0 %} active {% endif %}">
             <div class="carousel-caption">
+                {{ announcement.title }}
             </div>
             <div class="carousel-content">
                 {% if announcement.readMore %}
@@ -37,4 +41,4 @@
         <span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
         <span class="sr-only">Next</span>
     </a>
-</div>
+</div>

+ 5 - 2
main/template/rainbow/announcement/view.tpl

@@ -1,8 +1,11 @@
-<h2 class="page-header">{{ "SystemAnnouncements" | get_lang }}</h2>
+<div class="page-header">
+    <h4>{{ "SystemAnnouncements" | get_lang }}</h4>
+</div>
 
 {% if not announcement is empty %}
-    <article id="announcement-{{ announcement.id }}}" title="{{ announcement.title }}">
+    <article id="announcement-{{ announcement.id }}}">
         <div class="page-header">
+            <h3>{{ announcement.title }}</h3>
             {{ announcement.content }}
         </div>
     </article>

+ 18 - 0
main/template/rainbow/auth/hrm_courses.tpl

@@ -0,0 +1,18 @@
+{% for user in users %}
+    <div class="panel panel-info">
+        <div class="panel-heading">
+            <h3 class="panel-title">
+                <img src="{{ user.picture_url }}" alt="{{ user.complete_name }}">
+                {{ user.complete_name }}
+                <small>{{ user.username }}</small>
+            </h3>
+        </div>
+        <div class="panel-body">
+            {% if not user.course_list %}
+                <div class="alert alert-warning">{{ 'UserHasNoCourse'|get_lang }}</div>
+            {% else %}
+                {{ user.course_list }}
+            {% endif %}
+        </div>
+    </div>
+{% endfor %}

+ 50 - 41
main/template/rainbow/auth/session_catalog.tpl

@@ -11,10 +11,24 @@
     <div class="row">
         <div class="col-md-12">
         <!-- header catalog session -->
-        <h2 class="title-session">{{ 'Sessions'|get_lang }}</h2>      	
+        <h2 class="title-session">{{ 'Sessions'|get_lang }}</h2>
        	<div class="search-session">
                 <div class="row">
+                {% if show_courses %}
+                    <div class="col-md-4">
+                        <div class="return-catalog">
+                            <a class="btn btn-default btn-lg btn-block" href="{{ _p.web_self }}">
+                                <em class="fa fa-arrow-left"></em> {{ "CourseManagement"|get_lang }}
+                            </a>
+                        </div>
+                    </div>
+                {% endif %}
+
+                {% if show_courses %}
+                    <div class="col-md-4">
+                {% else %}
                     <div class="col-md-6">
+                {% endif %}
                         <form method="post" action="{{ _p.web_self }}?action=display_sessions">
                             <div class="form-group">
                                 <label>{{ "ByDate"|get_lang }}</label>
@@ -30,7 +44,12 @@
                             </div>
                         </form>
                     </div>
+
+                {% if show_courses %}
+                    <div class="col-md-4">
+                {% else %}
                     <div class="col-md-6">
+                {% endif %}
                         <form method="post" action="{{ _p.web_self }}?action=search_tag">
                             <label>{{ "ByTag"|get_lang }}</label>
                             <div class="input-group">
@@ -46,13 +65,6 @@
                     </div>
                 </div>
             </div>
-       	{% if show_courses %}
-        <div class="return-catalog">
-        	<a class="btn btn-default btn-lg btn-block" href="{{ _p.web_self }}">
-            	<em class="fa fa-arrow-left"></em> {{ "CourseManagement"|get_lang }}
-            </a>
-       	</div>
-       	{% endif %}
         </div>
     </div>
     <!-- new view session grib -->
@@ -61,7 +73,7 @@
             <div class="row">
                 {% for item in sessions %}
                     <div class="col-md-4 col-sm-6 col-xs-12">
-                        <div id="session-{{ item.id }}" class="items items-courses">
+                        <div id="session-{{ item.id }}" class="items items-courses items-sessions">
                             <div class="image">
                                 <a href="{{ _p.web ~ 'session/' ~ item.id ~ '/about/' }}" title="{{ item.name }}">
                                 	<img class="img-responsive" src="{{ item.image ? _p.web_upload ~ item.image : 'session_default.png'|icon() }}">
@@ -71,16 +83,14 @@
                                     <div class="cribbon"></div>
                                 {% endif %}
                                 <div class="admin-actions">
-                                    <div class="btn-group" role="group">
-                                        {% if item.edit_actions != '' %}
-                                            <a class="btn btn-default btn-sm" href="{{ item.edit_actions }}">
-                                                <i class="fa fa-pencil" aria-hidden="true"></i>
-                                            </a>
-                                        {% endif %}
-                                        {% if item.is_subscribed %}
-                                            {{ already_subscribed_label }}
-                                        {% endif %}
-                                    </div>
+                                    {% if item.edit_actions != '' %}
+                                        <a class="btn btn-default btn-sm" href="{{ item.edit_actions }}">
+                                            <i class="fa fa-pencil" aria-hidden="true"></i>
+                                        </a>
+                                    {% endif %}
+                                    {% if item.is_subscribed %}
+                                        {{ already_subscribed_label }}
+                                    {% endif %}
                                 </div>
                             </div>
                             <div class="description">
@@ -123,29 +133,28 @@
                                 <div class="block-date">
                                     {{ item.duration ? 'SessionDurationXDaysLeft'|get_lang|format(item.duration) : item.date }}
                                 </div>
-                                <div class="toolbar">
-                                    <div class="left">
-                                        {% if item.price %}
-                                            {{ item.price }}
-                                        {% endif %}
-                                    </div>
-                                    <div class="right">
-                                    	{% if _u.logged %}
-                                        <div class="btn-group btn-group-sm" role="group">
-                                            {% if not item.sequences is empty %}
-                                                <a class="btn btn-default btn-sm" role="button"
-                                                   title="{{ 'SeeSequences'|get_lang }}" data-toggle="popover"
-                                                   id="session-{{ item.id }}-sequences">
-                                                    <i class="fa fa-sitemap" aria-hidden="true"></i>
-                                                </a>
-                                            {% endif %}
-                                            {% if item.is_subscribed == false %}
-                                                {{ item.subscribe_button }}
-                                            {% endif %}
+                                <div class="toolbar row">
+                                    {% if item.price %}
+                                        <div class="col-sm-4">
+                                                {{ item.price }}
+                                        </div>
+                                    {% endif %}
+                                    {% if _u.logged %}
+                                        <div class="col-sm-8">
+                                            <div class="btn-group btn-group-sm" role="group">
+                                                {% if not item.sequences is empty %}
+                                                    <a class="btn btn-default btn-sm" role="button"
+                                                       title="{{ 'SeeSequences'|get_lang }}" data-toggle="popover"
+                                                       id="session-{{ item.id }}-sequences">
+                                                        <i class="fa fa-sitemap" aria-hidden="true"></i>
+                                                    </a>
+                                                {% endif %}
+                                                {% if item.is_subscribed == false %}
+                                                    {{ item.subscribe_button }}
+                                                {% endif %}
+                                            </div>
                                         </div>
-                                    	{% endif %}
-                                    </div>
-                                    
+                                    {% endif %}
                                 </div>
                             </div>
                             {% if _u.logged %}

+ 0 - 6
main/template/rainbow/chat/chat.tpl

@@ -78,12 +78,6 @@
                             friend: ChChat.currentFriend
                         })
                         .done(function (response) {
-                            if (response.data.chatIsDenied) {
-                                alert("{{ 'ChatDenied'|get_lang }}");
-
-                                return;
-                            }
-
                             if (response.data.history) {
                                 ChChat._historySize = response.data.oldFileSize;
                                 ChChat.setHistory(response.data.history);

+ 9 - 3
main/template/rainbow/chat/video.tpl

@@ -4,9 +4,11 @@
             <span aria-hidden="true">&times;</span>
         </button>
         <h4>{{ 'Warning'|get_lang }}</h4>
-        <p>
-            <em class="fa fa-warning"></em> {{ 'AvoidChangingPageAsThisWillCutYourCurrentVideoChatSession'|get_lang }}
-        </p>
+        <div id="dlg-webrtc-help">
+            <p>{{ 'WebRTCDialogHelp'|get_lang }}</p>
+            <img src="{{ _p.web_lib ~ 'javascript/chat/img/webrtc_' ~ (navigator_is_firefox ? 'firefox' : 'chrome') }}.png"
+                 alt="{{ 'Permissions'|get_lang }}" class="img-thumbnail img-responsive">
+        </div>
     </div>
     <div class="row">
         <div class="col-md-8 col-sm-7">
@@ -65,6 +67,10 @@
                     });
 
                     webRTC.on('readyToCall', function () {
+                        $('#dlg-webrtc-help').replaceWith("<p>" +
+                            "<em class=\"fa fa-warning\"></em> {{ 'AvoidChangingPageAsThisWillCutYourCurrentVideoChatSession'|get_lang }}" +
+                            "</p>");
+
                         webRTC.joinRoom('{{ room_name }}');
                     });
                     webRTC.on('videoAdded', function (video, peer) {

+ 19 - 23
main/template/rainbow/course_description/index.tpl

@@ -1,20 +1,18 @@
 {{javascript}}
 
-<script type="text/javascript">
-
+<script>
 {% if is_allowed_to_edit %}
     var sec_token = '{{sec_token}}';
 {% endif %}
 
-    
- function delete_entry(name, btn){   
+function delete_entry(name, btn){
     if(!confirm("{{'ConfirmYourChoice'|get_lang}}")){
         return false;
-    } 
+    }
 
     var item = $('#'+name);
-    var id = item.attr('data-id'); 
-    var c_id = item.attr('data-c_id'); 
+    var id = item.attr('data-id');
+    var c_id = item.attr('data-c_id');
 
     var f = function(data){
         if(data.success){
@@ -25,13 +23,13 @@
     };
     CourseDescription.del(c_id, id, f);
     $(btn).addClass("loading");
- }
+}
 
- function delete_all(){
+function delete_all(){
     if(!confirm("{{'ConfirmYourChoice'|get_lang}}")){
         return false;
-    } 
-    
+    }
+
     var f = function(data){
         if(data.success){
             var item = $('.course_descriptions');
@@ -40,9 +38,7 @@
         message.update(data);
     };
     CourseDescription.delete_by_course({{c_id}}, {{session_id}}, f);
-    
- }
- 
+}
 </script>
 
 {% for message in messages %}
@@ -50,12 +46,12 @@
 {% endfor %}
 
 {% if is_allowed_to_edit %}
-    <div class="btn-toolbar actions-bar" >
+    <div class="btn-toolbar actions-bar">
         <div class="btn-group edit new">
-            {% for type in types %}        
+            {% for type in types %}
                 <a href="{{root}}&amp;action=add&amp;description_type={{type.id}}" class="btn btn-default">
                     <img title="{{type.title}}" alt="{{type.title}}" src="{{type.icon|icon(32)}} " width="32" height="32">
-                </a>    
+                </a>
             {% endfor %}
         </div>
         <div class="btn-group edit">
@@ -78,26 +74,26 @@
         <div class="title sectiontitle">
             {% if is_allowed_to_edit %}
                 <div class="pull-right element-actions">
-                {% if session_id == description.session_id %}                    
-                    <a href="{{root}}&amp;action=delete&amp;id={{description.id}}" 
+                {% if session_id == description.session_id %}
+                    <a href="{{root}}&amp;action=delete&amp;id={{description.id}}"
                        onclick="delete_entry('description_{{description.id}}', this); return false;"
                        title="{{'Delete'|get_lang}}">
                         <em class="size-22 icon-delete"></em>
                     </a>
 
-                    <a href="{{root}}&amp;action=edit&amp;id={{description.id}}" 
+                    <a href="{{root}}&amp;action=edit&amp;id={{description.id}}"
                        title="{{'Edit'|get_lang}}">
                         <em class="size-22 icon-edit"></em>
                     </a>
                 {% else %}
-                    <img title="{{'EditionNotAvailableFromSession'|get_lang}}" 
-                         alt="{{'EditionNotAvailableFromSession'|get_lang}}" 
+                    <img title="{{'EditionNotAvailableFromSession'|get_lang}}"
+                         alt="{{'EditionNotAvailableFromSession'|get_lang}}"
                          src="{{'edit_na.png'|icon(22)}}"  width="22" height="22"
                          style="vertical-align:middle;">
                 {% endif %}
                 </div>
             {% endif %}
-            
+
             <img title="{{description.type.title}}" alt="{{description.type.title}}" src="{{description.type.icon|icon(32)}}" class="icon">
             {{description.title}}
         </div>

+ 35 - 0
main/template/rainbow/course_home/activity.tpl

@@ -0,0 +1,35 @@
+{% for block in blocks %}
+    {% if block.title %}
+        <h2 class="title-tools">{{ block.title }}</h2>
+    {% endif %}
+
+    <div class="row {{ block.class }}">
+        {% if 'homepage_view'|api_get_setting == 'activity' %}
+            {% for item in block.content %}
+                <div class="offset2 col-md-4 course-tool">
+                    {{ item.extra }}
+                    {{ item.visibility }}
+                    {{ item.icon }}
+                    {{ item.link }}
+                </div>
+            {% endfor %}
+        {% endif %}
+
+        {% if 'homepage_view'|api_get_setting == 'activity_big' %}
+            {% for item in block.content %}
+                <div class="col-xs-6 col-md-3 course-tool">
+                    <div class="big_icon">
+                        {{ item.tool.image }}
+                    </div>
+                    <div class="content">
+                        <h4>
+                            {{ item.visibility }}
+                            {{ item.extra }}
+                            {{ item.link }}
+                        </h4>
+                    </div>
+                </div>
+            {% endfor %}
+        {% endif %}
+    </div>
+{% endfor %}

+ 34 - 0
main/template/rainbow/course_home/vertical_activity.tpl

@@ -0,0 +1,34 @@
+{% for block in blocks %}
+    <div class="{{ block.class ?: 'courseadminview-activity-3col' }}">
+        {% if block.title %}
+            <span class="viewcaption">{{ block.title }}</span>
+        {% endif %}
+
+        {% for item in block.content %}
+            {% if loop.index0 == 0 %}
+                <ul>
+            {% endif %}
+
+            <li class="course-tool">
+                {{ item.extra }}
+                {{ item.visibility }}
+
+                {% set a_params = '' %}
+
+                {% for foo, bar in item.url_params %}
+                    {% set a_params = a_params ~ [foo, bar]|join('="') ~ '" ' %}
+                {% endfor %}
+
+                <a {{ a_params }} >
+                    <img src="{{ item.tool.image|replace({'.gif': '.png'})|icon() }}" alt="{{ item.name }}"
+                         id="toolimage_{{ item.tool.iid }}">
+                </a>
+                {{ item.link }}
+            </li>
+
+            {% if block.content|length == loop.index %}
+                </ul>
+            {% endif %}
+        {% endfor %}
+    </div>
+{% endfor %}

+ 1 - 1
main/template/rainbow/course_progress/progress.tpl

@@ -2,7 +2,7 @@
 {{ message }}
 {{ flash_messages }}
 {% if data is not empty %}
-{% set tutor =  false | api_convert_and_format_date(true) %}
+{% set tutor =  false|api_is_allowed_to_edit(true) %}
 <div id="course-progress" class="thematic">
     <div class="row">
         <div class="col-md-12">

+ 0 - 1
main/template/rainbow/create_course/add_course.tpl

@@ -1,5 +1,4 @@
 {% if just_created == 1%}
-{{ just_created_link }}
 <h3>{{ 'JustCreated'|get_lang }} {{ course_title }}</h3>
 <hr />
 {% endif %}

+ 19 - 162
main/template/rainbow/document/record_audio.tpl

@@ -55,167 +55,24 @@
 
 <script>
     $(document).on('ready', function () {
-        function useRecordRTC() {
-            $('#record-audio-recordrtc').show();
-
-            var audioTitle = '';
-
-            var mediaConstraints = {audio: true},
-                recordRTC = null,
-                btnStart = $('#btn-start-record'),
-                btnStop = $('#btn-stop-record'),
-                btnSave = $('#btn-save-record'),
-                tagAudio = $('#record-preview');
-
-            btnStart.on('click', function () {
-                audioTitle = $('#audio-title-rtc').val();
-
-                if (!$.trim(audioTitle)) {
-                    return;
-                }
-
-                navigator.getUserMedia = navigator.getUserMedia ||
-                    navigator.mozGetUserMedia ||
-                    navigator.webkitGetUserMedia;
-
-                if (navigator.getUserMedia) {
-                    navigator.getUserMedia(mediaConstraints, successCallback, errorCallback);
-                } else if (navigator.mediaDevices.getUserMedia) {
-                    navigator.mediaDevices.getUserMedia(mediaConstraints)
-                        .then(successCallback).error(errorCallback);
-                }
-
-                function successCallback(stream) {
-                    recordRTC = RecordRTC(stream, {
-                        numberOfAudioChannels: 1,
-                        type: 'audio'
-                    });
-                    recordRTC.startRecording();
-
-                    $('#audio-title-rtc').prop('readonly', true);
-                    btnSave.prop('disabled', true);
-                    btnStop.prop('disabled', false);
-                    btnStart.prop('disabled', true);
-                    tagAudio.removeClass('show').addClass('hidden');
-                }
-
-                function errorCallback(error) {
-                    alert(error.message);
-                }
-            });
-
-            btnStop.on('click', function () {
-                if (!recordRTC) {
-                    return;
-                }
-
-                recordRTC.stopRecording(function (audioURL) {
-                    btnStart.prop('disabled', false);
-                    btnStop.prop('disabled', true);
-                    btnSave.prop('disabled', false);
-
-                    tagAudio
-                            .removeClass('hidden')
-                            .addClass('show')
-                            .prop('src', audioURL);
-                });
-            });
-
-            btnSave.on('click', function () {
-                if (!recordRTC) {
-                    return;
-                }
-
-                var recordedBlob = recordRTC.getBlob();
-
-                if (!recordedBlob) {
-                    return;
-                }
-
-                var fileName = audioTitle,
-                        fileExtension = '.' + recordedBlob.type.split('/')[1];
-
-                var formData = new FormData();
-                formData.append('audio_blob', recordedBlob, audioTitle + fileExtension);
-                formData.append('audio_dir', '{{ directory }}');
-
-                $.ajax({
-                    url: '{{ _p.web_ajax }}record_audio_rtc.ajax.php',
-                    data: formData,
-                    processData: false,
-                    contentType: false,
-                    type: 'POST',
-                    success: function (fileURL) {
-                        if (!fileURL) {
-                            return;
-                        }
-
-                        $('#audio-title-rtc').prop('readonly', false);
-                        btnSave.prop('disabled', true);
-                        btnStop.prop('disabled', true);
-                        btnStart.prop('disabled', false);
-
-                        window.location.reload();
-                    }
-                });
-            });
-        }
-
-        function useWami() {
-            $('#record-audio-wami').show();
-
-            var audioTitle = '';
-
-            $('#btn-activate-wami').on('click', function (e) {
-                e.preventDefault();
-
-                audioTitle = $('#audio-title-wami').val();
-
-                if (!$.trim(audioTitle)) {
-                    return;
-                }
-
-                $('#audio-title-wami').prop('readonly', true);
-                $(this).prop('disabled', true);
-
-                Wami.setup({
-                    id : "record-audio-wami-container",
-                    onReady : setupGUI,
-                    swfUrl: '{{ _p.web_lib }}wami-recorder/Wami.swf'
-                });
-            });
-
-            function setupGUI() {
-                var gui = new Wami.GUI({
-                    id : 'record-audio-wami-container',
-                    singleButton : true,
-                    recordUrl : '{{ _p.web_ajax }}record_audio_wami.ajax.php?' + $.param({
-                        waminame: audioTitle + '.wav',
-                        wamidir: '{{ directory }}',
-                        wamiuserid: {{ user_id }}
-                    }),
-                    buttonUrl : '{{ _p.web_lib }}wami-recorder/buttons.png',
-                    buttonNoUrl: '{{ _p.web_img }}blank.gif',
-                    onRecordFinish: function() {
-                        window.location.reload();
-                    }
-                });
-
-                gui.setPlayEnabled(false);
-            }
-        }
-
-        $('#record-audio-recordrtc, #record-audio-wami').hide();
-
-        var webRTCIsEnabled = navigator.webkitGetUserMedia || navigator.mozGetUserMedia || navigator.getUserMedia ||
-                navigator.mediaDevices.getUserMedia;
-
-        if (webRTCIsEnabled) {
-            useRecordRTC();
-
-            return;
-        }
-
-        useWami();
+        RecordAudio.init(
+            {
+                blockId: '#record-audio-recordrtc',
+                btnStartId: '#btn-start-record',
+                btnPauseId: '#btn-pause-record',
+                btnPlayId: '#btn-play-record',
+                btnStopId: '#btn-stop-record',
+                btnSaveId: '#btn-save-record',
+                plyrPreviewId: '#record-preview',
+                directory: '{{ directory }}'
+            },
+            {
+                blockId: '#record-audio-wami',
+                containerId: 'record-audio-wami-container',
+                directory: '{{ directory }}',
+                userId: {{ user_id }}
+            },
+            null
+        );
     });
 </script>

+ 17 - 155
main/template/rainbow/exercise/oral_expression.tpl

@@ -36,159 +36,21 @@
 </div>
 
 <script>
-    $(document).on('ready', function () {
-        function useRecordRTC() {
-            $('#record-audio-recordrtc-{{ question_id }}').show();
-            var mediaConstraints = {audio: true},
-                recordRTC = null,
-                btnStart = $('#btn-start-record-{{ question_id }}'),
-                btnPause = $('#btn-pause-record-{{ question_id }}'),
-                btnPlay = $('#btn-play-record-{{ question_id }}'),
-                btnStop = $('#btn-stop-record-{{ question_id }}'),
-                btnSave = $('#btn-save-record-{{ question_id }}'),
-                tagAudio = $('#record-preview-{{ question_id }}');
-
-            btnStart.on('click', function () {
-                navigator.getUserMedia = navigator.getUserMedia ||
-                    navigator.mozGetUserMedia ||
-                    navigator.webkitGetUserMedia;
-
-                if (navigator.getUserMedia) {
-                    navigator.getUserMedia(mediaConstraints, successCallback, errorCallback);
-                } else if (navigator.mediaDevices.getUserMedia) {
-                    navigator.mediaDevices.getUserMedia(mediaConstraints)
-                        .then(successCallback).error(errorCallback);
-                }
-
-                function successCallback(stream) {
-                    recordRTC = RecordRTC(stream, {
-                        numberOfAudioChannels: 1,
-                        type: 'audio'
-                    });
-                    recordRTC.startRecording();
-
-                    btnSave.prop('disabled', true).addClass('hidden');
-                    btnStop.prop('disabled', false).removeClass('hidden');
-                    btnStart.prop('disabled', true).addClass('hidden');
-                    btnPause.prop('disabled', false).removeClass('hidden');
-                    tagAudio.removeClass('show').addClass('hidden');
-                }
-
-                function errorCallback(error) {
-                    alert(error.message);
-                }
-            });
-
-            btnPause.on('click', function () {
-                if (!recordRTC) {
-                    return;
-                }
-
-                btnPause.prop('disabled', true).addClass('hidden');
-                btnPlay.prop('disabled', false).removeClass('hidden');
-                btnStop.prop('disabled', true).addClass('hidden');
-                recordRTC.pauseRecording();
-            });
-
-            btnPlay.on('click', function () {
-                if (!recordRTC) {
-                    return;
-                }
-
-                btnPlay.prop('disabled', true).addClass('hidden');
-                btnPause.prop('disabled', false).removeClass('hidden');
-                btnStop.prop('disabled', false).removeClass('hidden');
-                recordRTC.resumeRecording();
-            });
-
-            btnStop.on('click', function () {
-                if (!recordRTC) {
-                    return;
-                }
-
-                recordRTC.stopRecording(function (audioURL) {
-                    btnStart.prop('disabled', false).removeClass('hidden');
-                    btnPause.prop('disabled', true).addClass('hidden');
-                    btnStop.prop('disabled', true).addClass('hidden');
-                    btnSave.prop('disabled', false).removeClass('hidden');
-
-                    tagAudio
-                        .removeClass('hidden')
-                        .addClass('show')
-                        .prop('src', audioURL);
-                });
-            });
-
-            // Download button
-            btnSave.on('click', function () {
-                if (!recordRTC) {
-                    return;
-                }
-
-                var recordedBlob = recordRTC.getBlob();
-                if (!recordedBlob) {
-                    return;
-                }
-
-                var fileName = '{{ file_name }}',
-                    fileExtension = '.' + recordedBlob.type.split('/')[1];
-
-                var formData = new FormData();
-                formData.append('audio_blob', recordedBlob, fileName + fileExtension);
-                formData.append('audio_dir', '{{ directory }}');
-
-                $.ajax({
-                    url: '{{ _p.web_ajax }}record_audio_rtc.ajax.php',
-                    data: formData,
-                    processData: false,
-                    contentType: false,
-                    type: 'POST'
-                }).then(function () {
-                    btnSave.prop('disabled', true).addClass('hidden');
-                    btnStop.prop('disabled', true).addClass('hidden');
-                    btnStart.prop('disabled', false).removeClass('hidden');
-                });
-            });
-        }
-
-        function useWami() {
-            $('#record-audio-wami-{{ question_id }}').show();
-
-            Wami.setup({
-                id: "record-audio-wami-container-{{ question_id }}",
-                onReady: setupGUI,
-                swfUrl: '{{ _p.web_lib }}wami-recorder/Wami.swf'
-            });
-
-            function setupGUI() {
-                var gui = new Wami.GUI({
-                        id: 'record-audio-wami-container-{{ question_id }}',
-                        singleButton: true,
-                        recordUrl: '{{ _p.web_ajax }}record_audio_wami.ajax.php?' + $.param({
-                            waminame: '{{ file_name }}.wav',
-                            wamidir: '{{ directory }}',
-                            wamiuserid: {{ user_id }}
-                        }),
-                        buttonUrl: '{{ _p.web_lib }}wami-recorder/buttons.png',
-                        buttonNoUrl: '{{ _p.web_img }}blank.gif'
-                    }
-                );
-
-                gui.setPlayEnabled(false);
-            }
-        }
-
-        $('#record-audio-recordrtc-{{ question_id }}, #record-audio-wami-{{ question_id }}').hide();
-
-        var webRTCIsEnabled = navigator.webkitGetUserMedia || navigator.mozGetUserMedia || navigator.getUserMedia ||
-            navigator.mediaDevices.getUserMedia;
-
-        if (webRTCIsEnabled) {
-            useRecordRTC();
-
-            return;
-        }
-
-        useWami();
-    });
+$(document).on('ready', function () {
+    RecordAudio.init({
+        blockId: '#record-audio-recordrtc-{{ question_id }}',
+        btnStartId: '#btn-start-record-{{ question_id }}',
+        btnPauseId: '#btn-pause-record-{{ question_id }}',
+        btnPlayId: '#btn-play-record-{{ question_id }}',
+        btnStopId: '#btn-stop-record-{{ question_id }}',
+        btnSaveId: '#btn-save-record-{{ question_id }}',
+        plyrPreviewId: '#record-preview-{{ question_id }}',
+        directory: '{{ directory }}'
+    }, {
+        blockId: '#record-audio-wami-{{ question_id }}',
+        containerId: 'record-audio-wami-container-{{ question_id }}',
+        directory: '{{ directory }}',
+        userId: {{ user_id }}
+    }, '{{ file_name }}');
+});
 </script>

+ 9 - 0
main/template/rainbow/export/alt_pdf_footer.tpl

@@ -0,0 +1,9 @@
+<table border="0" class="full-width border-top page-footer">
+    <tr>
+        <td class="text-center">
+            <strong>{{ _s.institution }}</strong>
+            <br>
+            <strong>{PAGENO} / {nb}</strong>
+        </td>
+    </tr>
+</table>

+ 88 - 0
main/template/rainbow/forum/list.tpl

@@ -0,0 +1,88 @@
+{% extends template ~ "/layout/layout_1_col.tpl" %}
+{% block content %}
+
+{{ introduction_section }}
+
+{{ form_content }}
+
+{% if data is not empty %}
+    {% for item in data %}
+        <div class="category-forum" id="category_{{ item.id }}">
+            <div class="pull-right">
+                {{ item.tools }}
+            </div>
+            <h3>
+                {{ 'forum_blue.png'|img(32) }}
+                <a href="{{ item.url }}" title="{{ item.title }}">{{ item.title }}{{ item.icon_session }}</a>
+            </h3>
+            <div class="forum-description">
+                {{ item.description }}
+            </div>
+        </div>
+            {% for subitem in item.forums %}
+                <div class="forum_display">
+                    <div class="panel panel-default forum">
+                        <div class="panel-body">
+                            <div class="row">
+                                <div class="col-md-3">
+                                    <div class="number-post">
+                                        <a href="{{ forum.url }}" title="{{forum.title}}">
+                                        {% if subitem.forum_image is not empty %}
+                                            <img src="{{ subitem.forum_image }}" width="48px">
+                                        {% else %}
+                                            {% if subitem.forum_of_group == 0 %}
+                                                {{ 'forum_group.png'|img(48) }}
+                                            {% else %}
+                                                {{ 'forum.png'|img(48) }}
+                                            {% endif %}
+                                        {% endif %}
+                                        </a>
+                                        <p>{{ 'ForumThreads'| get_lang }}: {{ subitem.number_threads }} </p>
+                                    </div>
+                                </div>
+                                <div class="col-md-9">
+                                    <div class="pull-right">
+                                        <div class="toolbar">
+                                            {{ subitem.tools }}
+                                        </div>
+                                    </div>
+                                    <h3 class="title">
+                                    {{ 'forum_yellow.png'|img(32) }}
+                                    <a href="{{ subitem.url }}" title="{{ subitem.title }}" class="{{ subitem.visibility != '1' ? 'text-muted': '' }}">{{ subitem.title }}</a>
+                                    {% if subitem.forum_of_group != 0 %}
+                                        <a class="forum-goto" href="../group/group_space.php?{{ _p.web_cid_query }}&gidReq={{ subitem.forum_of_group }}">
+                                            {{ "forum.png"|img(22) }} {{ "GoTo"|get_lang }} {{ subitem.forum_group_title }}
+                                        </a>
+                                    {% endif %}
+                                    {{ subitem.icon_session }}
+                                    </h3>
+                                    {% if subitem.last_poster_id is not empty %}
+                                        <div class="forum-date">
+                                            <i class="fa fa-comments" aria-hidden="true"></i>
+                                            {{ subitem.last_poster_date }}
+                                            {{ "By"|get_lang }}
+                                            {{ subitem.last_poster_user }}
+                                        </div>
+                                    {% endif %}
+                                    <div class="description">
+                                        {{ subitem.description }}
+                                    </div>
+                                    {{ subitem.alert }}
+                                    {% if subitem.moderation is not empty %}
+                                        <span class="label label-warning">
+                                            {{ "PostsPendingModeration"|get_lang }}: {{ subitem.moderation }}
+                                        </span>
+                                    {% endif %}
+                                </div>
+                            </div>
+                        </div>
+                    </div>
+                </div>
+            {% endfor %}
+    {% endfor %}
+    {% else %}
+        <div class="alert alert-warning">
+            {{ 'NoForumInThisCategory'|get_lang }}
+        </div>
+    {% endif %}
+{% endblock %}

+ 22 - 0
main/template/rainbow/user_portal/course_categories.tpl

@@ -0,0 +1,22 @@
+<p class="lead">{{ 'MyCoursePageCategoryIntroduction'|get_lang }}</p>
+<ul class="media-list">
+    {% for category in course_categories %}
+        {% if category %}
+            <li class="media">
+                <div class="media-left">
+                    <a href="{{ _p.web_self ~ '?' ~ {'category':category.code}|url_encode }}">
+                        <img src="{{ category.image ? _p.web_upload ~ category.image : 'session_default.png'|icon(128) }}"
+                             alt="{{ category.name }}" width="200" class="media-object">
+                    </a>
+                </div>
+                <div class="media-body">
+                    <h4 class="media-heading">{{ category.name }}</h4>
+                    <p>{{ category.code }}</p>
+                    <a href="{{ _p.web_self ~ '?' ~ {'category':category.code}|url_encode }}" class="btn btn-default">
+                        {{ 'View'|get_lang }} <span class="fa fa-arrow-right" aria-hidden="true"></span>
+                    </a>
+                </div>
+            </li>
+        {% endif %}
+    {% endfor %}
+</ul>