Ver código fonte

add themplate and theme css for OFAJ, name rainbow BT#10657

Alex Aragon 8 anos atrás
pai
commit
27d8c2882a
100 arquivos alterados com 8194 adições e 0 exclusões
  1. 293 0
      app/Resources/public/css/themes/rainbow/default.css
  2. BIN
      app/Resources/public/css/themes/rainbow/fonts/OpenSans-Bold.woff
  3. BIN
      app/Resources/public/css/themes/rainbow/fonts/OpenSans-Bold.woff2
  4. BIN
      app/Resources/public/css/themes/rainbow/fonts/OpenSans-Light.woff
  5. BIN
      app/Resources/public/css/themes/rainbow/fonts/OpenSans-Light.woff2
  6. BIN
      app/Resources/public/css/themes/rainbow/fonts/OpenSans-Semibold.woff
  7. BIN
      app/Resources/public/css/themes/rainbow/fonts/OpenSans-Semibold.woff2
  8. BIN
      app/Resources/public/css/themes/rainbow/fonts/OpenSans.woff
  9. BIN
      app/Resources/public/css/themes/rainbow/fonts/OpenSans.woff2
  10. BIN
      app/Resources/public/css/themes/rainbow/images/favicon.ico
  11. BIN
      app/Resources/public/css/themes/rainbow/images/header-logo.png
  12. 218 0
      app/Resources/public/css/themes/rainbow/learnpath.css
  13. 943 0
      app/Resources/public/css/themes/rainbow/print.css
  14. 316 0
      main/template/rainbow/admin/resource_sequence.tpl
  15. 111 0
      main/template/rainbow/admin/settings_index.tpl
  16. 70 0
      main/template/rainbow/admin/teacher_time_report.tpl
  17. 62 0
      main/template/rainbow/agenda/event_list.tpl
  18. 605 0
      main/template/rainbow/agenda/month.tpl
  19. 35 0
      main/template/rainbow/announcement/slider.tpl
  20. 13 0
      main/template/rainbow/announcement/view.tpl
  21. 21 0
      main/template/rainbow/auth/catalog_layout.php
  22. 32 0
      main/template/rainbow/auth/categories_list.php
  23. 8 0
      main/template/rainbow/auth/confirm_session_subscription.tpl
  24. 0 0
      main/template/rainbow/auth/courses.tpl
  25. 413 0
      main/template/rainbow/auth/courses_categories.php
  26. 280 0
      main/template/rainbow/auth/courses_list.php
  27. 14 0
      main/template/rainbow/auth/inscription.tpl
  28. 20 0
      main/template/rainbow/auth/layout.php
  29. 7 0
      main/template/rainbow/auth/lost_password.tpl
  30. 194 0
      main/template/rainbow/auth/session_catalog.tpl
  31. 4 0
      main/template/rainbow/auth/set_temp_password.tpl
  32. 153 0
      main/template/rainbow/chat/video.tpl
  33. 34 0
      main/template/rainbow/course_description/edit.tpl
  34. 109 0
      main/template/rainbow/course_description/index.tpl
  35. 15 0
      main/template/rainbow/course_description/upload.tpl
  36. 59 0
      main/template/rainbow/create_course/add_course.tpl
  37. 190 0
      main/template/rainbow/document/record_audio.tpl
  38. 48 0
      main/template/rainbow/document/recycle.tpl
  39. 139 0
      main/template/rainbow/exercise/oral_expression.tpl
  40. 252 0
      main/template/rainbow/exercise/submit.js.tpl
  41. 107 0
      main/template/rainbow/export/table_pdf.tpl
  42. 87 0
      main/template/rainbow/gamification/my_progress.tpl
  43. 100 0
      main/template/rainbow/glossary/glossary_auto.js.tpl
  44. 48 0
      main/template/rainbow/glossary/glossary_manual.js.tpl
  45. 92 0
      main/template/rainbow/gradebook/certificate_report.tpl
  46. 63 0
      main/template/rainbow/gradebook/my_certificates.tpl
  47. 96 0
      main/template/rainbow/gradebook/search.tpl
  48. 114 0
      main/template/rainbow/javascript/editor/ckeditor/config_js.tpl
  49. 5 0
      main/template/rainbow/javascript/editor/ckeditor/elfinder.tpl
  50. 6 0
      main/template/rainbow/javascript/editor/ckeditor/templates.tpl
  51. 35 0
      main/template/rainbow/javascript/editor/elfinder_standalone.tpl
  52. 3 0
      main/template/rainbow/layout/blank.tpl
  53. 62 0
      main/template/rainbow/layout/course_navigation.tpl
  54. 113 0
      main/template/rainbow/layout/footer.js.tpl
  55. 77 0
      main/template/rainbow/layout/footer.tpl
  56. 32 0
      main/template/rainbow/layout/head.tpl
  57. 425 0
      main/template/rainbow/layout/header.js.tpl
  58. 27 0
      main/template/rainbow/layout/hot_course_item.tpl
  59. 23 0
      main/template/rainbow/layout/hot_course_item_popup.tpl
  60. 42 0
      main/template/rainbow/layout/hot_courses.tpl
  61. 44 0
      main/template/rainbow/layout/layout_1_col.tpl
  62. 113 0
      main/template/rainbow/layout/layout_2_col.tpl
  63. 24 0
      main/template/rainbow/layout/layout_3_col.tpl
  64. 35 0
      main/template/rainbow/layout/login_form.tpl
  65. 19 0
      main/template/rainbow/layout/main.tpl
  66. 19 0
      main/template/rainbow/layout/main_footer.tpl
  67. 93 0
      main/template/rainbow/layout/main_header.tpl
  68. 63 0
      main/template/rainbow/layout/menu.tpl
  69. 16 0
      main/template/rainbow/layout/no_layout.tpl
  70. 25 0
      main/template/rainbow/layout/page_body.tpl
  71. 26 0
      main/template/rainbow/layout/show_footer.tpl
  72. 17 0
      main/template/rainbow/layout/show_header.tpl
  73. 134 0
      main/template/rainbow/layout/sniff.tpl
  74. 93 0
      main/template/rainbow/layout/topbar.tpl
  75. 20 0
      main/template/rainbow/layout/welcome_to_course.tpl
  76. 24 0
      main/template/rainbow/learnpath/impress.tpl
  77. 153 0
      main/template/rainbow/learnpath/list.tpl
  78. 1 0
      main/template/rainbow/learnpath/lp_upload_audio.tpl
  79. 133 0
      main/template/rainbow/learnpath/record_voice.tpl
  80. 61 0
      main/template/rainbow/learnpath/report.tpl
  81. 6 0
      main/template/rainbow/learnpath/subscribe_users.tpl
  82. 278 0
      main/template/rainbow/learnpath/view.tpl
  83. 16 0
      main/template/rainbow/link/edit_category.tpl
  84. 16 0
      main/template/rainbow/link/edit_link.tpl
  85. 343 0
      main/template/rainbow/link/index.tpl
  86. 12 0
      main/template/rainbow/mail/content_registration_platform.tpl
  87. 9 0
      main/template/rainbow/mail/content_subscription_to_session_confirmation.tpl
  88. 1 0
      main/template/rainbow/mail/cron_course_finished_body.tpl
  89. 1 0
      main/template/rainbow/mail/cron_course_finished_subject.tpl
  90. 1 0
      main/template/rainbow/mail/cron_remind_course_expiration_body.tpl
  91. 1 0
      main/template/rainbow/mail/cron_remind_course_expiration_subject.tpl
  92. 7 0
      main/template/rainbow/mail/footer.tpl
  93. 12 0
      main/template/rainbow/mail/header.tpl
  94. 44 0
      main/template/rainbow/mail/mail.tpl
  95. 4 0
      main/template/rainbow/mail/reset_password.tpl
  96. 1 0
      main/template/rainbow/mail/subject_registration_platform.tpl
  97. 1 0
      main/template/rainbow/mail/subject_subscription_to_session_confirmation.tpl
  98. 6 0
      main/template/rainbow/mail/subscribe_me_to_session.tpl
  99. 71 0
      main/template/rainbow/mail_editor/email_link.js.tpl
  100. 36 0
      main/template/rainbow/my_space/accessoverview.tpl

+ 293 - 0
app/Resources/public/css/themes/rainbow/default.css

@@ -0,0 +1,293 @@
+/*!
+ * CSS Chamilo LMS - Default v.2.0
+ * Homepage: http://www.chamilo.org
+ * Copyright 2012-2015 Alex Aragón
+ * Licensed GLP
+ * Based on Bootstrap
+*/
+@font-face {
+  font-family: 'Open Sans';
+  font-style: normal;
+  font-weight: 300;
+  src: local('Open Sans Light'), local('OpenSans-Light'), url(fonts/OpenSans-Light.woff2) format('woff2'), url(fonts/OpenSans-Light.woff) format('woff');
+}
+@font-face {
+  font-family: 'Open Sans';
+  font-style: normal;
+  font-weight: 400;
+  src: local('Open Sans'), local('OpenSans'), url(fonts/OpenSans.woff2) format('woff2'), url(fonts/OpenSans.woff) format('woff');
+}
+@font-face {
+  font-family: 'Open Sans';
+  font-style: normal;
+  font-weight: 600;
+  src: local('Open Sans Semibold'), local('OpenSans-Semibold'), url(fonts/OpenSans-Semibold.woff2) format('woff2'), url(fonts/OpenSans-Semibold.woff) format('woff');
+}
+@font-face {
+  font-family: 'Open Sans';
+  font-style: normal;
+  font-weight: 700;
+  src: local('Open Sans Bold'), local('OpenSans-Bold'), url(fonts/OpenSans-Bold.woff2) format('woff2'), url(fonts/OpenSans-Bold.woff) format('woff');
+}
+
+
+html {
+  -ms-text-size-adjust: 100%;
+  -webkit-text-size-adjust: 100%;
+}
+body {
+  margin: 0;
+  font-family: 'Open Sans', sans-serif;
+  line-height: 1.72222;
+}
+
+a {
+  color: #00829C;
+  text-decoration: none;
+}
+a:hover,
+a:focus {
+  color: #1abc9c;
+  text-decoration: none;
+}
+a:focus {
+  outline: none;
+}
+/* Menu Option */
+.item-menu a{
+    padding-left: 30% !important;
+    padding-right: 30% !important;
+    color: #fff !important;
+    font-size: 15px;
+}
+.navbar-collapse{
+    padding: 0;
+}
+.menu-one{
+    background: #41A62A;
+}
+.menu-two{
+    background: #97BF0D;
+}
+.menu-three{
+    background: #F9B200;
+}
+.menu-four{
+    background: #E53140;
+}
+.menu-five{
+    background: #E2007A;
+}
+/* end Menu Option */
+.stadistics{
+    padding-top: 20px;
+    padding-bottom: 20px;
+    margin-top: 10px;
+    margin-bottom: 10px;
+}
+.stadistics .icon-color{
+    color: #E53140;
+}
+.stadistics .number{
+    color: #162A83;
+    font-weight: 700;
+}
+.stadistics .text{
+    color: #162A83;
+}
+.stadistics .items{
+    padding: 0;
+    margin: 0;
+    list-style: none;
+    margin-left: 90px;
+}
+.stadistics .items li{
+    display: inline-block;
+    padding-right: 10px;
+}
+.stadistics .items li h2{
+    padding: 0;
+    margin: 0;
+}
+#carousel-announcement .carousel-indicators .active{
+    background: #009EE0;
+}
+.carousel-indicators li{
+    border: none;
+}
+#carousel-announcement .carousel-indicators li{
+    width: 15px;
+    height: 15px;
+}
+.carousel-control{
+    opacity: 1;
+}
+.carousel-control:focus, .carousel-control:hover{
+    opacity: 1;
+    color: #009EE0;
+}
+.navbar{
+  border-radius: 0;
+}
+.navbar {
+  background: #FFFFFF;
+  border: none;
+}
+.nav li a{
+   padding: 10px 15px;
+}
+.navbar-nav li a{
+  font-weight: bold;
+  line-height: 22px;
+  padding-top: 12.5px;
+  padding-bottom: 12.5px;
+}
+.navbar-collapse{
+  overflow: hidden !important;
+}
+.navbar-default .navbar-nav > li > a:focus,
+.navbar-default .navbar-nav > li > a:hover {
+  color: #A4DC2D;
+}
+.navbar-default .navbar-nav > .active > a,
+.navbar-default .navbar-nav > .active > a:hover,
+.navbar-default .navbar-nav > .active > a:focus{
+  color: #fff;
+  background:#000080;
+}
+.navbar-default .navbar-nav > li > a{
+  color: #333333;
+}
+.navbar-default .navbar-nav > .open > a,
+.navbar-default .navbar-nav > .open > a:hover,
+.navbar-default .navbar-nav > .open > a:focus{
+  background: #07578a;
+  color: #ffffff;
+}
+.navbar-nav > li > .dropdown-menu{
+  min-width: 100%;
+  margin-top: 2px;
+  border-radius: 4px;
+  -webkit-border-radius: 4px;
+  -moz-border-radius: 4px;
+}
+.navbar-default .navbar-nav > .open > .dropdown-menu{
+  padding: 3px 4px;
+  background-color: #07578a;
+}
+.navbar-default .navbar-nav > .open > .dropdown-menu > li > a{
+  padding: 6px 9px;
+  border-radius: 4px;
+  -webkit-border-radius: 4px;
+  -moz-border-radius: 4px;
+  color: #ffffff !important;
+}
+.navbar-default .navbar-nav > .open > .dropdown-menu > li > a:hover,
+.navbar-default .navbar-nav > .open > .dropdown-menu > li > a:focus{
+  background-color:#2E75A3;
+}
+.nav > li > a:hover, .nav > li > a:focus{
+   background-color: transparent;
+}
+
+.navbar-inverse li a{
+  line-height: 30px;
+  background: none !important;
+  font-size: 12px;
+  font-weight: normal;
+  padding-top: 5px;
+  padding-right: 10px;
+  padding-left: 10px;
+  padding-bottom: 5px;
+}
+.navbar-fixed-top .navbar-collapse{
+  min-height:auto;
+}
+.navbar-inverse .navbar-brand{
+  padding: 10px;
+  font-size: 14px;
+  height: auto;
+}
+.navbar-form .form-control{
+  height: 25px;
+  padding: 6px;
+}
+.navbar-fixed-top{
+  min-height: 40px;
+}
+.navbar-fixed-top .dropdown-menu li a{
+  line-height: 20px;
+}
+.navbar-inverse .navbar-brand:hover, .navbar-inverse .navbar-brand:focus{
+  color: #ffffff;
+}
+.navbar-inverse li a:hover {
+  background-image: -webkit-linear-gradient(#020202, #101112 40%, #191b1d) !important;
+  background-image: -o-linear-gradient(#020202, #101112 40%, #191b1d) !important;
+  background-image: -webkit-gradient(linear, left top, left bottom, from(#020202), color-stop(40%, #101112), to(#191b1d)) !important;
+  background-image: linear-gradient(#020202, #101112 40%, #191b1d) !important;
+  background-repeat: no-repeat !important;
+  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff020202', endColorstr='#ff191b1d', GradientType=0) !important;
+  -webkit-filter: none !important;
+  filter: none !important;
+  border-left-color: transparent !important;
+}
+.navbar-inverse .dropdown-menu li a:hover,
+.navbar-inverse .dropdown-menu li a:focus{
+  background:#3C4147 !important;
+  color: #fff;
+}
+
+.badge-warning{
+  background-color: #FD6600;
+}
+.breadcrumb{
+  padding: 8px 15px;
+  margin-bottom: 21px;
+  list-style: outside none none;
+  background-color: #ECF0F1;
+}
+.breadcrumb > .active{
+  color: #95a5a6;
+}
+.panel-default{
+  border-color: #ECF0F1;
+}
+.panel-default .panel-heading{
+  color: #2c3e50;
+  background-color:#ECF0F1;
+  border-color: #ECF0F1;
+}
+/* Jquery UI */
+.ui-accordion .ui-accordion-icons{
+  padding-left: 0.2em;
+}
+/* End Jquery UI */
+footer{
+  background-color:#009EE0;
+}
+footer{
+  color: #ffffff;
+}
+footer a{
+  color: #ffffff;
+}
+
+.navbar-default .navbar-brand {
+  color:white;
+}
+.navbar-default .navbar-collapse, .navbar-default .navbar-form{
+  border-color: #00677C;
+}
+.navbar-default .navbar-toggle{
+  border-color: #00677C;
+}
+.navbar-default .navbar-toggle .icon-bar{
+  background-color: #ffffff;
+}
+.navbar-default .navbar-toggle:focus, .navbar-default .navbar-toggle:hover{
+  background-color: #00677C;
+}
+.page-header{
+  margin: 10px 0 10px;
+}

BIN
app/Resources/public/css/themes/rainbow/fonts/OpenSans-Bold.woff


BIN
app/Resources/public/css/themes/rainbow/fonts/OpenSans-Bold.woff2


BIN
app/Resources/public/css/themes/rainbow/fonts/OpenSans-Light.woff


BIN
app/Resources/public/css/themes/rainbow/fonts/OpenSans-Light.woff2


BIN
app/Resources/public/css/themes/rainbow/fonts/OpenSans-Semibold.woff


BIN
app/Resources/public/css/themes/rainbow/fonts/OpenSans-Semibold.woff2


BIN
app/Resources/public/css/themes/rainbow/fonts/OpenSans.woff


BIN
app/Resources/public/css/themes/rainbow/fonts/OpenSans.woff2


BIN
app/Resources/public/css/themes/rainbow/images/favicon.ico


BIN
app/Resources/public/css/themes/rainbow/images/header-logo.png


+ 218 - 0
app/Resources/public/css/themes/rainbow/learnpath.css

@@ -0,0 +1,218 @@
+div.text {
+	margin-left : 6;
+	margin-right : 6;
+	margin-top : 5;
+	margin-bottom : 5;
+	text-align : justify;
+}
+span.messagesmall {
+	font-style : italic;
+	color : Red;
+}
+/* newscorm/learnpath */ 
+
+div.lp_actions {
+	background:#F8F8F8;
+	border-bottom:1px solid #999999;
+	padding:3px;
+}
+div.lp_actions img {
+	margin-right:5px;
+}
+div.lp_small_form {
+	background:#F8F8F8;
+	border:1px solid #999999;
+	padding:10px;
+}
+div.lp_small_form input {
+	font-size:10px;
+}
+div.lp_manipulate {
+	background:#F8F8F8;
+	border-bottom:1px dotted #999999;
+	margin-bottom:0px;
+	padding:3px 0 3px 10px;
+}
+div.lp_manipulate a {
+	padding-right:10px;
+}
+div.lp_message {
+	background:#FEC880;
+	border:1px solid #E28C15;
+	font-size:12px;
+	padding:10px;
+}
+div.lp_resource_header {
+	cursor: pointer;
+	background:#F0F0F0;
+	border:1px solid #999999;
+	font-weight:bold;
+	padding:10px;
+	width:350px;
+}
+div.lp_resource_header_end {
+	background:#F0F0F0;
+	border:1px solid #999999;
+	font-weight:bold;
+	padding:10px;
+	width:350px;
+}
+div.lp_resource_elements {
+	background:#FAFAFA;
+	border:1px solid #999999;
+	border-bottom:0;
+	display:none;
+	padding:5px 10px;
+	width:350px;
+}
+div.lp_resource_elements_end {
+	background:#FAFAFA;
+	border:1px solid #999999;
+	border-top: 0px;
+	display:none;
+	padding:5px 10px;
+	width:350px;
+}
+div.lp_resource_elements div {
+	padding:3px;
+}
+div.lp_tree {
+	height:100%;
+	padding:3px 10px 3px 0;
+	overflow-x : auto;
+	overflow-y : auto;
+	width:190px;
+}
+hr {
+	background:#999999;
+	border:0;
+	color:#999999;
+	height:1px;
+	margin:10px auto;
+	width:75%;
+}
+option.bottom {
+	border-top:1px solid #999999;
+	margin-top:2px;
+	padding-top:2px;
+}
+option.top {
+	border-bottom:1px solid #999999;
+	margin-bottom:2px;
+	padding-bottom:2px;
+}
+p.lp_action {
+	margin:5px 0;
+}
+p.lp_text {
+	margin-top:0px;
+}
+p.lp_title {
+	font-weight:bold;
+	margin-top:5px;
+	padding-left:7px;
+}
+table.lp_build {
+	font-size:12px;
+	height:400px;
+	width:100%;
+}
+table.lp_build td {
+	vertical-align:top;
+}
+table.lp_build td.tree {
+	/* border-right:1px solid #999999;*/
+	padding-right: 5px;
+	width:205px;
+}
+table.lp_build td.workspace {
+	padding: 0px;
+	padding-left:5px;
+	width:auto;
+}
+table.lp_form {
+	font-size:12px;
+	margin:0 10px;
+	width:auto;
+}
+table.lp_form td {
+	height:25px;
+	padding:5px;
+	vertical-align:top;
+	width:auto;
+}
+table.lp_form td.label {
+	padding-top:7px;
+	text-align:right;
+}
+table.lp_form td.radio {
+	width:300px;
+}
+table.lp_form td.exercise {
+	width:50px;
+}
+table.lp_form th {
+	background:#F8F8F8;
+	border-bottom:1px solid #999999;
+	border-top:1px solid #999999;
+}
+table.lp_overview th.exercise {
+	width:50px;
+}
+table.lp_form input, table.lp_form select, table.lp_form textarea {
+/*	background:#F8F8F8;
+	border:1px solid #999999;
+	font-family:Arial, Verdana, Helvetica, sans-serif;
+	font-size:12px;
+	padding:1px 2px;
+	width:300px;*/
+}
+table.lp_form td.radio input, table.lp_form td.exercise input {
+	width:auto;
+}
+table.lp_form .small_form {
+	background:#FFFFFF;
+}
+table.lp_form select {
+/*	padding:0;*/
+}
+table.lp_form input.button {
+	width:75px;
+}
+table.lp_overview {
+	font-size:12px;
+	width:100%;
+}
+table.lp_overview td {
+	border-bottom:1px solid #999999;
+	border-top:1px solid #999999;
+	height:20px;
+	padding:3px;
+	vertical-align:middle;
+	width:auto;
+}
+table.lp_overview td.title {
+	width:200px;
+}
+table.lp_overview td.actions {
+	text-align:center;
+	width:100px;
+}
+table.lp_overview td.move {
+	text-align:center;
+	width:50px;
+}
+table.lp_overview th {
+	background:#FFFFFF;
+	padding-left:3px;
+	text-align:center;
+}
+table.lp_overview tr {
+	background:#F8F8F8;
+}
+table.lp_overview tr:hover {
+	background:#E5EDF9;
+}
+table.lp_overview img {
+	margin-left:3px;
+}

+ 943 - 0
app/Resources/public/css/themes/rainbow/print.css

@@ -0,0 +1,943 @@
+/* Print Style Sheet for Dokeos  (in progress ...)
+   first default style sheet
+   2004-07-18 by Wolfgang Schneider
+   (info@ws-webservice.de / webmaster@bibelcenter.de)
+   updated on 2005-02-25 by Olivier Brouckaert
+   (oli.brouckaert@dokeos.com)
+   update on 2005-03-01 by Wolfgang Schneider
+   update on 2005-05-27 by Patrick Cool
+   update to print.css on 2005-01-05 by Jeroen Coupe
+   */
+
+body {
+	font-family: arial, verdana, helvetica, sans-serif;
+	font-size: 12px;
+	color: #000;
+	margin: 0;
+	padding: 0;
+	background-color: #fff;
+}
+img {
+	border: none;
+}
+#outerframe {
+	position: relative;  /* do not remove, fixes a bug in IE */
+	border: 1px solid #fff;
+	background-color: #fff;
+}
+/* Hides from IE5-mac \*/
+* html #outerframe {
+	height: 1%;
+}
+/* End hide from IE5-mac */
+
+/*****************************************************
+ *  HEADER STYLES                                    *
+ *****************************************************/
+
+
+#my_courses {
+	background-color: #fff;
+	color: #009;
+}
+/*show the institution*/
+#header1 {
+	padding: 2px;
+	float: right;
+}
+#my_courses {
+	display: none;
+}
+#header2 {
+	display: none;
+}
+.subnav {
+	display: none;
+}
+/* show the way to the printed document (breadcrumbs)*/
+#header4 {
+	padding: 2px;
+	border-bottom: 1px solid #4171B5;
+}
+#header4 a {
+	color: #4171b5;
+}
+#toolshortcuts {
+	display:none;
+}
+/*****************************************************
+ *  FOOTER STYLES                                    *
+ *****************************************************/
+#footer {
+	padding: 8px;
+	border-top: 1px solid #4171B5;
+	background-color: #E5EDF9;
+	font-size: 12px;
+}
+#footer .copyright {
+	float: right;
+}
+/*****************************************************
+ *  MAIN STYLES                                      *
+ *****************************************************/
+#main {
+	position: relative; /* to avoid the IE peekabo bug*/
+	margin: 0px auto;
+	margin-top: 10px;
+	width: 98%;
+	padding: 0px 10px 10px 10px;
+	background-color: #fff;
+	min-height: 320px;
+}
+/* for content section in main index.php file */
+.maincontent {
+	float: left;
+	width: 78%;
+	padding: 4px;
+	background-color: #fff;
+}
+/* "menu" doesn't show in printed version*/
+.menu {
+	display: none;
+}
+#lang_form {
+	text-align: left;
+	font-size: 12px;
+	margin: 2px 0 10px 0;
+	padding: 2px;
+}
+#lang_form input, #lang_form select {
+	font-size: 12px;
+}
+#formLogin label {
+	font-size: 12px;
+	margin: 4px 6px;
+}
+#formLogin input {
+	font-size: 13px;
+	margin: 4px 6px;
+}
+#login_fail {
+	margin: 0 6px 6px 6px;
+	padding: 4px;
+	border: 1px solid #f00;
+	background-color: #fff;
+	font-size: 12px;
+	color: #f00;
+}
+/*** layout divs for course and tool pages (being tested in some pages) ****/
+#contentfloatholder {/* also makes the right "sliding" tab  */
+	/*background: url(../pics/sidebar-r.gif) repeat-y 100% 0;
+background: url(../pics/bg_fountain.jpg) no-repeat 100% 0; */
+float: left;
+	width: 100%;
+	position: relative;
+}
+#contentfloatholder:after {
+	/* this is for NN6 to clear floats */
+content: ".";
+	display: block;
+	height: 0px;
+	clear: both;
+	visibility: hidden;
+}
+#centerwrap {
+	float: left;
+	width: 100%;
+	margin-right: -95%;/* this needs to be less than 100% for Moz/Mac which thinks
+         it's empty otherwise. The difference is made up by putting a
+         negative left margin on the left float:
+	   Note IE/Mac doesn't like this method ~ it wants the 100% so it can
+	   be fed in using IE only CSS below becasue IE/Win also works with the 100% method.
+	*/
+}
+/*no navigation options need to be showed in the print version */
+#toolnav {
+	display:none;
+}
+/* Hide from IE5-mac. Only IE-win sees this. \*/
+* html #toolnav {
+	margin-right: 0px;
+}
+* html #center {
+	height: 1%;
+	margin-left: 0;
+}
+/* End hide from IE5/mac */
+
+
+/* various sections in course-home.php file  */
+#toolremove {
+	width: 40%;
+	color: #f00;
+	font-weight: bold;
+	margin: 10px auto;
+	padding: 10px;
+	border: 2px solid #f00;
+}
+#courseintro {
+	clear: both;
+	width: 80%;
+	margin: 10px auto;
+	padding: 10px;
+	border-bottom: 1px solid #4171B5;
+}
+#courseintro_icons {
+	clear: both;
+	width: 80%;
+	margin: 10px auto;
+}
+.everybodyview {
+	position: relative; /* to avoid the IE peekabo bug ?*/
+	width: 80%;
+	margin: 10px auto;
+	padding: 10px;
+}
+.courseadminview, .platformadminview {
+	position: relative;
+	width: 80%;
+	margin: 25px auto 10px;
+	padding: 10px;
+	border: 1px solid #4171B5;
+}
+.viewcaption {
+	position: relative;
+	top: -20px;
+	font-size: 12px;
+	font-weight: bold;
+	color: #4171B5;
+	background-color: #fff;
+	padding: 0 4px;
+}
+/***********************************/
+
+/* ===================================================
+					AGENDA STYLES
+===================================================*/
+
+/* ---------------------------------------------------
+	check if these are still used or not
+-----------------------------------------------------*/
+#agenda {
+	width: 100%;
+	margin: 0 auto;
+	border: 1px solid #4171B5;
+	border-collapse: collapse;
+}
+.agenda_month_divider {
+	background-color: #4171B5;
+	font-weight: bold;
+	font-size: 12px;
+	color: #fff;
+	text-align: center;
+}
+#agenda #title a {
+	color: #fff;
+}
+#agenda .agendaitem {
+	font-size: 12px;
+}
+#smallcalendar .title {
+	background-color: #4171B5;
+	font-weight: bold;
+	padding: 2px;
+	color: #fff;
+	text-align: center;
+	font-size: 11px;
+}
+#smallcalendar .title a {
+	color: #fff;
+}
+/*agenda select not visible on print*/
+#agenda_select {
+	display:none;
+}
+/* ---------------------------------------------------
+	styles for the agenda (day, week, month view)
+-----------------------------------------------------*/
+#agenda_list {
+	width: 100%;
+	margin: 0 auto;
+	border: 1px solid #fff;
+	border-collapse: collapse;
+}
+/*The caption of the calendar (displays the month and the << and >> links*/
+#agenda_list #title {
+	background-color: #4171B5;
+	font-weight: bold;
+	font-size: 12px;
+	color: #fff;
+	text-align: left;
+	padding: 2px 10px;
+	text-align: center;
+	border: 1px solid #264269;
+}
+#agenda_list #title a:link, #agenda_list #title a:visited {
+	background-color: #4171B5;
+	font-weight: bold;
+	font-size: 12px;
+	color: #fff;
+	text-align: left;
+	padding: 2px 10px;
+	text-align: center;
+}
+#agenda_list #title a:hover {
+	background-color: #4171B5;
+	font-weight: bold;
+	font-size: 12px;
+	color: #ff0000;
+	text-align: left;
+	padding: 2px 10px;
+	text-align: center;
+}
+/* The cells with the name of the days of the weeks (mon->sun)*/
+#agenda_list .weekdays {
+	background-color: #D3DFF1;
+	text-align: center;
+	font-weight: bold;
+	border: 1px solid #264269;
+	border-collapse: collapse;
+}
+/* The cells for the days (1->31) */
+#agenda_list .days_week {
+	height: 40px;
+	width: 12%;
+	text-align: left;
+	vertical-align: top;
+	border: 1px solid #264269;
+	border-collapse: collapse;
+	background-color: #f5f5f5;
+}
+#agenda_list .days_weekend {
+	height: 40px;
+	width: 12%;
+	text-align: left;
+	vertical-align: top;
+	border: 1px solid #264269;
+	border-collapse: collapse;
+	background-color: #e6e6e6;
+}
+#agenda_list .days_today {
+	height: 40px;
+	width: 12%;
+	text-align: left;
+	vertical-align: top;
+	border: 1px solid #264269;
+	border-collapse: collapse;
+	background-color: #FFCA8D;
+	color: #CC3300;
+	font-weight: bold;
+}
+/* text in the cells: display of agenda items (visible)*/
+#agenda_list .data {
+	background-color: #eee;
+	text-align: left;
+	padding: 2px 10px;
+	font-weight: bold;
+	border: 0px solid #4171B5;
+	border-collapse: collapse;
+}
+#agenda_list .datanotbold {
+	background-color: #eee;
+	text-align: left;
+	padding: 2px 10px;
+	font-weight: normal;
+	border: 0px solid #4171B5;
+	border-collapse: collapse;
+}
+#agenda_list .text {
+	background-color: #fff;
+	text-align: left;
+	padding: 2px 10px;
+	font-weight: normal;
+	border: 0px solid #4171B5;
+	border-collapse: collapse;
+}
+/*text in the cells: display of agenda items (invisible)*/
+#agenda_list .data_hidden {
+	background-color: #eee;
+	text-align: left;
+	padding: 2px 10px;
+	font-weight: bold;
+	border: 0px solid #4171B5;
+	border-collapse: collapse;
+	color: #999999;
+}
+#agenda_list .datanotbold_hidden {
+	background-color: #eee;
+	text-align: left;
+	padding: 2px 10px;
+	font-weight: normal;
+	border: 0px solid #4171B5;
+	border-collapse: collapse;
+	color: #999999;
+}
+#agenda_list .text_hidden {
+	background-color: #fff;
+	text-align: left;
+	padding: 2px 10px;
+	font-weight: normal;
+	border: 0px solid #4171B5;
+	border-collapse: collapse;
+	color: #999999;
+}
+/*text in the cells: display of agenda items (highlighted)*/
+#agenda_list .datanow {
+	background-color: #FFCC00;
+	text-align: left;
+	padding: 2px 10px;
+	font-weight: bold;
+	border: 0px solid #4171B5;
+	border-collapse: collapse;
+}
+#agenda_list .datanotboldnow {
+	background-color: #FFCC00;
+	text-align: left;
+	padding: 2px 10px;
+	font-weight: normal;
+	border: 0px solid #4171B5;
+	border-collapse: collapse;
+}
+#agenda_list .textnow {
+	background-color: #fff;
+	text-align: left;
+	padding: 2px 10px;
+	font-weight: normal;
+	border: 0px solid #4171B5;
+	border-collapse: collapse;
+}
+/* ---------------------------------------------------
+	styles for the mini agenda
+-----------------------------------------------------*/
+/* mini agenda invisible in print */
+
+#smallcalendar {
+	display:none;
+}
+/*without this the small calendar's space isn't liberated, because the table width is hardcoded in the php*/
+#layoutHulp {
+	display:none;
+}
+/* ---------------------------------------------------
+	styles for the personal agenda
+-----------------------------------------------------*/
+.personal_agenda {
+	color: #008000;
+}
+.personal_agenda a:link, .personal_agenda a:visited {
+	color: #008000;
+}
+a.personal_agenda:link, a.personal_agenda:visited {
+	color: #008000;
+}
+.personal_agenda a:hover, .personal_agenda a:hover {
+	color: #666666;
+}
+a.personal_agenda:hover, a.personal_agenda:hover {
+	color: #666666;
+}
+/* normal and erro message-box */
+.normal-message, .error-message {
+	position: relative;
+	margin: 10px auto;
+	margin-left: -250px;
+	width: 500px;
+	left: 50%;
+	right: 50%;
+	border-width: 1px;
+	border-style: solid;
+	padding: 5px;
+}
+.normal-message {
+	border: 1px solid #FF8001;
+	color: #000;
+	background-color: #FDC77E;
+}
+.error-message {
+	border: 1px solid #3F70AC;
+	color: #000;
+	background-color: #FDC273;
+}
+#message {
+	margin: 0 auto;
+	text-align: center;
+}
+#message select {
+	margin: 10px 0;
+	width: 220px;
+}
+#message textarea {
+	margin: 10px 0;
+}
+#message td {
+	padding: 4px;
+}
+/* styles from the document.php file */
+.comment {
+	margin-left: 30px;
+}
+.invisible {
+	color: #999;
+}
+.invisible a:link, .invisible a:visited {
+	color: #999;
+}
+a.invisible:link, a.invisible:visited {
+	color: #999;
+}
+/* styles from the upload.php file */
+dl.upload_option {
+	margin: 1em 0;
+	padding: 0;
+}
+.upload_option dt {
+	font-weight:bold;
+	margin:0;
+}
+.upload_option dd {
+	margin:0;
+}
+/* styles from dropbox.php file */
+.dropbox_detail {
+	font-size: small
+}
+.dropbox_date {
+	font-style: italic
+}
+.dropbox_person {
+	font-weight: bold
+}
+.dropbox_listTitle {
+	color: #000000;
+}
+.dropbox_feedback {
+	font-size: x-small;
+	height: 50px;
+	width: 200px;
+	overflow: auto
+}
+.dropbox_feedbacks {
+	height: 250px;
+	width: 100%;
+	overflow: auto
+}
+/* styles for chat / conference tools */
+#chat_entermessage {
+	background-color: #D6E5FA;
+	border-top: 1px solid #4171B5;
+	padding: 5px;
+	margin: 0;
+}
+/* styles for general formatting */
+.clear {
+	clear: both;
+	line-height: 0px;
+	height: 0;
+}
+p, blockquote, ol, ul {
+	font-size: 12px;
+}
+h1 {
+	font-size: 21px;
+}
+h2 {
+	font-size: 18px;
+}
+h3 {
+	font-size: 15px;
+	margin-top:0px;
+	padding-top:0px;
+}
+h4 {
+	font-size: 12px;
+}
+h5, h6 {
+	font-family: verdana, arial, helvetica, sans-serif;
+}
+/* the following for regular <a> elements */
+a:link {
+	text-decoration: none;
+	font-weight : bold;
+	color : #4171b5;
+}
+a:visited {
+	text-decoration: none;
+	font-weight : bold;
+	color : #4171b5;
+}
+a:active {
+	text-decoration: none;
+	font-weight : bold;
+	color : #f00;
+}
+input.link_alike {
+	background-color: #FFFFFF;
+	border-width: 0px;
+	color: #4171b5;
+	font-weight: bold;
+	text-align: left;
+	padding: 0px;
+	margin: 0px;
+}
+input.link_alike:hover {
+	background-color: #FFFFFF;
+	border-width: 0px;
+	color: #FF0000;
+	font-weight: bold;
+	text-align: left;
+	padding: 0px;
+	margin: 0px;
+}
+/* the following for the greyed out elements */
+a.nobold:link, a.nobold:visited, a.nobold:active {
+	font-weight: normal;
+	color: #999;
+	margin: 0 0 0 25px;
+}
+a.nobold:hover {
+	font-weight: normal;
+	color: #999;
+	text-decoration: underline;
+	margin: 0 0 0 25px;
+}
+.note {
+	margin: 6px;
+	font-size: 12px;
+	line-height: 14px;
+	font-family: verdana, arial, helvetica, sans-serif;
+	background-color: #FFF089;
+	color: #4171B5;
+	border: 1px solid #4171B5;
+	padding: 4px;
+}
+.alternativeBgLight {
+	background-color: #f5f5f5;
+	border: 1px solid #4171B5;
+	border-collapse: collapse;
+}
+.alternativeBgDark {
+	background-color: #ccf;
+	border: 1px solid #4171B5;
+	border-collapse: collapse;
+}
+.myagendatoday {
+	background-color: #FFCA8D;
+	border-collapse: collapse;
+	font-family: verdana, arial, helvetica, sans-serif;
+	color: #CC3300;
+	font-weight: bold;
+}
+/*****************************************************
+ *  FORM STYLES                                      *
+ *****************************************************/
+div.row {
+	clear: both;
+	padding-top: 5px;
+}
+div.row div.form_header {
+	white-space: nowrap;
+	padding: 2px;
+	background-color: #E5EDF9;
+	border: 1px solid #4271B5;
+}
+div.row div.label {
+	display: inline;
+	float: left;
+	width: 18%;
+	text-align: right;
+}
+div.row div.formw {
+	display: inline;
+	width: 80%;
+}
+[dir=ltr] div.row div.label, [dir=rtl] div.row div.formw {
+	float: left;
+	text-align: right;
+}
+[dir=rtl] div.row div.label, [dir=ltr] div.row div.formw {
+	float: right;
+	text-align: left;
+}
+span.form_required {
+	color: #f00;
+}
+span.form_error {
+	color: #f00;
+	font-size: x-small;
+	margin: 2px;
+}
+/* Form elements - some general styling */
+select, textarea {
+	color : #000;
+	border: 1px solid #000;
+}
+input.checkbox {
+	border-width: 0;
+}
+input.mainoption {
+	font-weight : bold;
+}   /* Main submit button      */
+input.liteoption {
+	font-weight : normal;
+} /* None-bold submit button */
+select, input[type=checkbox], input[type=radio], input[type=button], input[type=submit] {
+	cursor:	pointer;
+	font-size: 12px;
+}
+input[text] {
+	font-size: 12px;
+}
+/************************************************************
+  styles below here are not necessarily used in the current
+	release and the CVS files, they are from earlier versions,
+	and have been left untouched for anyone needing them in
+	their own platform ...
+*************************************************************/
+.topBanner a:link, .topBanner a:active, .topBanner a:visited {
+	text-decoration:none;
+	color:white;
+}
+.topBanner table {
+	text-decoration:none;
+}
+.topBanner a:hover {
+	text-decoration:underline;
+}
+.topBanner td {
+	border-top: solid White 1px;
+}
+.alternativeBgLight {
+	background-color: #f5f5f5;
+}
+.alternativeBgDark {
+	background-color: #e6e6e6
+}
+.forms {
+	letter-spacing: normal;
+	text-align: justify;
+	text-indent: 3pt;
+	word-spacing: normal;
+	padding: 2px 5px;
+}
+.formsTips {
+	text-align: justify;
+	text-indent: 15pt;
+	word-spacing: normal;
+}
+/*
+input.forms	{ letter-spacing: normal; text-align: justify; text-indent: 3pt;	word-spacing: normal;
+padding-top: 0px;	padding-right: 0px;	padding-bottom: 0px;	padding-left: 0px;}
+*/
+.warn {
+	border: thin double Silver;
+	margin-left: 15px;
+	margin-right: 15px;
+	font-family: serif;
+	color: Red;
+	padding-left: 25px;
+}
+.small {
+	font-family: Verdana, Arial, Helvetica, sans-serif;
+	font-size: 11px
+}
+.xsmall {
+	font-family: Verdana, Arial, Helvetica, sans-serif;
+	font-size: 11px
+}
+.xxsmall {
+	font-family: Verdana, Arial, Helvetica, sans-serif;
+	font-size: 9px
+}
+/*****************************************************
+ *  DATA TABLE STYLES                                *
+ *****************************************************/
+.cell_header {
+	background-color: #EEEEFF;
+	font-weight:bold;
+	text-align:left;
+	padding-left:5px;
+}   /* header cell in data table in tools */
+.data_table {
+	border-collapse: collapse;
+	width: 100%;
+	padding: 5px;
+}
+.data_table th {
+	/*padding-right: 20px;*/
+	border: 1px solid gray;
+	background-color: #E5EDF9;
+	text-align: left;
+}
+.data_table tr.row_odd {
+	background-color: #fafafa;	
+}
+.data_table tr.row_odd:hover, .data_table tr.row_even:hover {
+	background-color: #f0f0f0;
+}
+.data_table tr.row_even {
+	background-color: #fff;	
+}
+.data_table td .highlight {
+    font-weight: bold;
+}
+.data_table td {
+	padding: 5px;	
+	border-bottom: 1px solid #b0b0b0;
+	border-right: 1px dotted #e1e1e1;
+	border-left: 1px dotted #e1e1e1;
+	text-align: left;
+}
+
+
+.data_table_no_border {
+    border-collapse: collapse;
+    border-spacing: 0;
+    font-size: 12px;
+    margin-bottom: 15px;
+    margin-top: 8px;
+    text-align: left;
+    width: 100%;    
+}
+
+.data_table_no_border td {
+    line-height: normal;
+    padding: 6px;
+    text-align: left;
+    vertical-align: middle;
+}
+.data_table_no_border .highlight {
+    font-weight: bold;
+}
+
+/* admin page tool list definitions */
+.tool_list dt {
+	font-weight: bold;
+}
+.tool_list dd {
+	margin: 0;
+	padding: 4px 0 0 10px;
+}
+/* divs for category list / platform news on home page */
+.home_cats {
+	width: 45%;
+	float: left;
+	position: relative;
+	margin: 0;
+	padding: 0px;
+	padding-top: 8px;
+	background: #fff;
+}
+.home_news {
+	width: 45%;
+	float: right;
+	position: relative;
+	margin: 0;
+	padding: 0px;
+	padding-top: 8px;
+	background: #fff;
+}
+label.left {
+	float: left;
+	width: 15em;
+	margin: 0 0 0.5em 0;
+}
+form br {
+	clear: both;
+}
+/* Fix for alignment problem in IE-Win browsers  */
+/*  Hide from IE5-mac. Only IE-win sees this. \*/
+* html .label {
+	margin-right: 10px;
+}
+* html .data {
+	height: 1%;
+	margin-left: 0;
+}
+/* End hide from IE5/mac */
+
+.radio, .checkbox {
+	margin: 0;
+	padding: 0;
+	border: none;
+	background-color: transparent;
+}
+.required {
+	color: #f00;
+	font-weight: bold;
+}
+/* Admin section */
+div.admin_section {
+	width: 40%;
+	float: left;
+	padding: 5px;
+	margin: 10px 20px;
+}
+div.admin_section h4 {
+	margin: 0;
+	border-bottom: 1px solid gray;
+	width: 100%;
+}
+.user_course_category {
+	background-color: #efefef;
+	border: 1px solid #666;
+	font-weight: bold;
+	color: #666;
+	list-style-type: none;
+	margin: 5px;
+	padding: 5px;
+}
+/* Styles for the Dokeos Config Settings of the platform admin section*/
+.sectiontitle {
+	background-color: #EFEFEF;
+	border: 1px solid #cccccc;
+	font-weight: bold;
+	color: #666666;
+	list-style-type: none;
+	margin: 5px;
+	padding: 5px;
+	font-size: 11px;
+}
+.sectioncomment {
+	color: #000000;
+	margin: 5px;
+	padding: 5px;
+	font-size: 11px;
+}
+.sectionvalue {
+	list-style-type: none;
+	margin: 5px;
+	padding: 5px;
+}
+/* New Announcements Tool */
+.announcements_datum {
+	font-size: 12px;
+	font-style: italic;
+	color: #666666;
+}
+/* System announcements on homepage */
+div.system_announcements {
+}
+div.system_announcements h3 {
+}
+div.system_announcement {
+	margin: 5px;
+}
+div.system_announcement_title {
+}
+div.system_announcement_content {
+	margin-left: 20px;
+	border-left: 1px solid gray;
+	padding-left: 5px;
+}
+/*****************************************************
+ * special print ccs classes						 *
+ *****************************************************/
+
+ a.full_url_print:after {
+	content: "(" attr(href) ")";
+	font-size: 75%;
+}
+/* to make it in visible in the printed version*/
+.print_invisible {
+	display:none;
+}

+ 316 - 0
main/template/rainbow/admin/resource_sequence.tpl

@@ -0,0 +1,316 @@
+{% extends template ~ "/layout/layout_1_col.tpl" %}
+
+{% block content %}
+    <script>
+        var url = '{{ _p.web_ajax }}sequence.ajax.php';
+        var parentList = [];
+        var resourceId = 0;
+        var sequenceId = 0;
+
+        function useAsReference(type, sequenceId, itemId) {
+            var id = itemId || $("#item option:selected" ).val();
+
+            sequenceId = $("#sequence_id option:selected" ).val();
+
+            // Cleaning parent list.
+            parentList = [];
+
+            // Check if data exists and load parents
+            $.ajax({
+                url: url + '?a=load_resource&load_resource_type=parent&id=' + id + '&type='+type+'&sequence_id='+sequenceId,
+                success: function (data) {
+                    if (data) {
+                        var loadingResources = new Array(),
+                            listLoaded = data.split(',');
+
+                        listLoaded.forEach(function(value) {
+                            var loadResource = $.ajax(url, {
+                                data: {
+                                    a: 'get_icon',
+                                    id: value,
+                                    type: type,
+                                    sequence_id: sequenceId,
+                                    show_delete: 1
+                                },
+                                success: function() {
+                                    parentList.push(value);
+                                }
+                            });
+
+                            loadingResources.push(loadResource);
+                        });
+
+                        if (loadingResources.length) {
+                            $.when.apply($, loadingResources).done(function() {
+                                if (loadingResources.length === 1) {
+                                    $('#parents').append(arguments[0]);
+
+                                    return;
+                                }
+
+                                var i;
+
+                                for (i = 0; i < arguments.length; i++) {
+                                    $('#parents').append(arguments[i][0]);
+
+                                    if (i !== arguments.length - 1) {
+                                        $('#parents').append('<em class="fa fa-plus fa-3x sequence-plus-icon"></em>');
+                                    }
+                                }
+                            });
+                        }
+                    }
+                }
+            });
+
+            // Check if data exists and load children
+            $.ajax({
+                url: url + '?a=load_resource&load_resource_type=children&id=' + id + '&type='+type+'&sequence_id='+sequenceId,
+                success: function (data) {
+                    if (data) {
+                        var listLoaded = data.split(',');
+                        listLoaded.forEach(function(value) {
+                            $.ajax({
+                                url: url + '?a=get_icon&id='+ value+'&type='+type+'&sequence_id='+sequenceId,
+                                success:function(data){
+                                    $('#children').append(data);
+                                }
+                            });
+                        });
+                    }
+                }
+            });
+
+            // Cleaning
+            $('#parents').html('');
+            $('#children').html('');
+
+            $.ajax({
+                url: url + '?a=get_icon&id='+ id+'&type='+type+'&sequence_id='+sequenceId,
+                success:function(data){
+                    $('#resource').html(data);
+                    parentList.push(id);
+                    resourceId = id;
+                }
+            });
+
+            $.ajax({
+                url: url + '?a=graph&type='+type+'&sequence_id='+sequenceId,
+                success: function (data) {
+                    $('#show_graph').html(data);
+                }
+            });
+        }
+
+        $(document).ready(function() {
+            var type = $('input[name="sequence_type"]').val();
+            // By default "set requirement" is set to false
+
+            $('button[name="set_requirement"]').prop('disabled', true);
+            $('#requirements').prop('disabled', true);
+            $('button[name="save_resource"]').prop('disabled', true);
+
+            sequenceId = $("#sequence_id option:selected" ).val();
+
+            // Load parents
+            $('#parents').on('click', 'a.delete_vertex, a.undo_delete', function(e) {
+                e.preventDefault();
+
+                var self = $(this),
+                    parent = self.parent(),
+                    vertexId = self.attr('data-id') || 0;
+
+                if (!vertexId) {
+                    return;
+                }
+
+                if (self.is('.delete_vertex')) {
+                    self.hide();
+                    parent.find('.undo_delete').show();
+
+                    self.parents('.parent').addClass('parent-deleted');
+                } else if (self.is('.undo_delete')) {
+                    self.hide();
+                    parent.find('.delete_vertex').show();
+
+                    self.parents('.parent').removeClass('parent-deleted');
+                }
+            });
+
+            $('#parents, #resource, #children').on('click', '.parent .sequence-id', function(e) {
+                e.preventDefault();
+
+                var itemId = $(this).parents('.parent').data('id') || 0;
+
+                if (!itemId) {
+                    return;
+                }
+
+                $('button[name="set_requirement"]').prop('disabled', false);
+                $('#requirements').prop('disabled', false);
+                $('button[name="save_resource"]').prop('disabled', false);
+
+                useAsReference(type, sequenceId, itemId);
+            });
+
+            // Button use as reference
+
+            $('button[name="use_as_reference"]').click(function() {
+                $('button[name="set_requirement"]').prop('disabled', false);
+                $('#requirements').prop('disabled', false);
+                $('#requirements').selectpicker('refresh');
+                $('button[name="save_resource"]').prop('disabled', false);
+
+                useAsReference(type, sequenceId);
+
+                return false;
+            });
+
+            // Button set requirement
+
+            $('button[name="set_requirement"]').click(function() {
+                $("#requirements option:selected" ).each(function() {
+                    var id = $(this).val();
+                    if ($.inArray(id, parentList) == -1) {
+                        $.ajax({
+                            url: url + '?a=get_icon&id=' + id + '&type='+type+'&sequence_id='+sequenceId,
+                            success: function (data) {
+                                $('#parents').append(data);
+                                parentList.push(id);
+                            }
+                        });
+                    }
+                });
+                return false;
+            });
+
+            // Button save
+            $('button[name="save_resource"]').click(function(e) {
+                e.preventDefault();
+
+                var self = $(this).prop('disabled', true);
+
+                // parse to integer the parents IDs
+                parentList = parentList.map(function(id) {
+                    return parseInt(id);
+                });
+
+                var deletingVertex = new Array();
+
+                // Delete all vertex confirmed to be deleted.
+                $('#parents .parent.parent-deleted').each(function() {
+                    var self = $(this),
+                        vertexId = self.data('id') || 0,
+                        deleteVertex;
+
+                    deleteVertex = $.ajax(url, {
+                        data: {
+                            a: 'delete_vertex',
+                            id: resourceId,
+                            vertex_id: vertexId,
+                            type: type,
+                            sequence_id: sequenceId
+                        },
+                        success: function() {
+                            parentList.splice($.inArray(vertexId, parentList), 1);
+                        }
+                    });
+
+                    deletingVertex.push(deleteVertex);
+                });
+
+                $.when.apply($, deletingVertex).done(function() {
+                    if (resourceId != 0) {
+                        var params = decodeURIComponent(parentList);
+
+                        var savingResource = $.ajax(url, {
+                            data: {
+                                a: 'save_resource',
+                                id: resourceId,
+                                parents: params,
+                                type: type,
+                                sequence_id: sequenceId
+                            }
+                        });
+
+                        $.when(savingResource).done(function(response) {
+                            $('#global-modal')
+                                    .find('.modal-dialog')
+                                    .removeClass('modal-lg')
+                                    .addClass('modal-sm');
+                            $('#global-modal')
+                                    .find('.modal-body')
+                                    .html(response);
+                            $('#global-modal').modal('show');
+
+                            self.prop('disabled', false);
+
+                            useAsReference(type, sequenceId);
+                        });
+                    }
+                });
+            });
+
+            $('select#sequence_id').on('change', function() {
+                sequenceId = $(this).val();
+            });
+        });
+    </script>
+    <div class="panel panel-default">
+        <div class="panel-body">
+            <div class="section-title-sequence">{{ 'SequenceSelection' | get_lang }}</div>
+            <div class="row">
+                <div class="col-md-6">
+                    {{ create_sequence }}
+                </div>
+                <div class="col-md-6">
+                    {{ select_sequence }}
+                </div>
+            </div>
+        </div>
+    </div>
+
+    <div class="panel panel-default">
+        <div class="panel-body">
+            <div class="section-title-sequence">{{ 'SequenceConfiguration' | get_lang }}</div>
+            <div class="row">
+
+                {{ configure_sequence }}
+            </div>
+
+        </div>
+    </div>
+    <div class="panel panel-default">
+        <div class="panel-body">
+            <div class="section-title-sequence">{{ 'SequencePreview' | get_lang }}</div>
+            <div class="row">
+                <div class="col-md-9">
+                    <h4 class="title-sequence">
+                        {{ 'ItemsTheReferenceDependsOn' | get_lang }}
+                    </h4>
+                    <div id="parents">
+                    </div>
+                    <div class="border-sequence">
+                        <div class="arrow-sequence"></div>
+                    </div>
+                    <h4 class="title-sequence">{{ 'Item' | get_lang }}</h4>
+                    <div id="resource">
+                    </div>
+                    <div class="border-sequence">
+                        <div class="arrow-sequence"></div>
+                    </div>
+                    <h4 class="title-sequence">{{ 'Dependencies' | get_lang }}</h4>
+                    <div id="children">
+                    </div>
+
+                </div>
+                <div class="col-md-3">
+                    <h4 class="title-sequence">{{ 'GraphDependencyTree' | get_lang }}</h4>
+                    <div id="show_graph"></div>
+                </div>
+
+            </div>
+            {{ save_sequence }}
+        </div>
+    </div>
+{% endblock %}

+ 111 - 0
main/template/rainbow/admin/settings_index.tpl

@@ -0,0 +1,111 @@
+<script>
+$(document).ready(function() {
+    $.ajax({
+        url:'{{ web_admin_ajax_url }}?a=version',
+        success:function(version){
+            $(".admin-block-version").html(version);
+        }
+    });
+
+{% if _u.is_admin %}
+    (function(CKEDITOR) {
+        CKEDITOR.replace('extra_content');
+
+        var extraContentEditor = CKEDITOR.instances.extra_content;
+
+        $('a.admin-edit-block').on('click', function(e) {
+            e.preventDefault();
+
+            var $self = $(this);
+
+            var extraContent = $.ajax('{{ _p.web_ajax }}admin.ajax.php', {
+                type: 'post',
+                data: {
+                    a: 'get_extra_content',
+                    block: $self.data('id')
+                }
+            });
+
+            $.when(extraContent).done(function(content) {
+                extraContentEditor.setData(content);
+                $('#extra-block').val($self.data('id'));
+                $('#modal-extra-title').text($self.data('label'));
+
+                $('#modal-extra').modal('show');
+            });
+        });
+    })(window.CKEDITOR);
+{% endif %}
+});
+</script>
+
+<section id="settings">
+    {% for block_item in blocks %}
+        {% if loop.index % 2 == 0 %}
+        <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 %}
+                        <a class="admin-edit-block pull-right" href="#" data-label="{{ block_item.label }}" title="{{ 'Edit' | get_lang }}" data-id="{{ block_item.class }}">
+                            <img src="{{ _p.web_img }}icons/22/edit.png" alt="{{ 'Edit' | get_lang }}">
+                        </a>
+                    {% endif %}
+                </div>
+                <div class="panel-body">
+                <div style="display: block;">
+                    {{ block_item.search_form }}
+                </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>
+                {% endif %}
+
+                {% if block_item.extra is not null %}
+                    <div>
+                    {{ block_item.extra }}
+                    </div>
+                {% endif %}
+
+                {% if block_item.extraContent %}
+                    <div>{{ block_item.extraContent }}</div>
+                {% endif %}
+            </div>
+            </div>
+        </div>
+
+        {% if loop.index % 2 == 0 %}
+            </div>
+        {% endif %}
+    {% endfor %}
+</section>
+
+{% if _u.is_admin %}
+    <div class="modal fade" id="modal-extra">
+        <div class="modal-dialog">
+            <div class="modal-content">
+                <div class="modal-header">
+                    <button type="button" class="close" data-dismiss="modal" aria-label="{{ 'Close' | get_lang }}">
+                        <span aria-hidden="true">&times;</span>
+                    </button>
+                    <h4 class="modal-title" id="modal-extra-title">{{ 'Blocks' | get_lang }}</h4>
+                </div>
+                <div class="modal-body">
+                     {{ extraDataForm }}
+                </div>
+            </div>
+        </div>
+    </div>
+{% endif %}

+ 70 - 0
main/template/rainbow/admin/teacher_time_report.tpl

@@ -0,0 +1,70 @@
+{% extends template ~ "/layout/main.tpl" %}
+
+{% 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);
+            });
+
+            $('#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>
+    <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 %}

+ 62 - 0
main/template/rainbow/agenda/event_list.tpl

@@ -0,0 +1,62 @@
+<table class="data_table">
+    <tr>
+        <th>
+            {{ 'StartDate'| get_lang }}
+        </th>
+        <th>
+            {{ 'EndDate'| get_lang }}
+        </th>
+        <th>
+            {{ 'Title' | get_lang }}
+        </th>
+        {% if is_allowed_to_edit %}
+            <th>
+                {{ 'Actions' | get_lang }}
+            </th>
+        {% endif %}
+    </tr>
+    {% for event in agenda_events %}
+        <tr>
+            <td style="width:20%">
+                {{ event.start_date_localtime }}
+            </td>
+            <td style="width:20%">
+                {% if event.allDay %}
+                    {{ 'AllDay' | get_lang }}
+                {% else %}
+                    {{ event.end_date_localtime }}
+                {% endif %}
+            </td>
+            <td style="width:50%">
+                {{ event.title }}
+
+                {% if event.description %}
+                    <p>{{ event.description}}</p>
+                {% endif %}
+
+                {% if event.comment %}
+                    <p>{{ event.comment}}</p>
+                {% endif %}
+
+                {{ event.attachment }}
+            </td>
+
+            {% if is_allowed_to_edit %}
+                <td>
+                    {% if event.visibility == 1 %}
+                        <a class="btn btn-default" href="{% if url %}{{ url }}{% else %}{{ event.url }}{% endif %}&action=change_visibility&visibility=0&id={{ event.real_id }}">
+                            <img title="{{ 'Invisible' }}" src="{{'visible.png'|icon(32)}} " width="32" height="32">
+                        </a>
+                    {% else %}
+                        {% if event.type == 'course' or event.type == 'session' %}
+                            <a class="btn btn-default" href="{% if url %}{{ url }}{% else %}{{ event.url }}{% endif %}&action=change_visibility&visibility=1&id={{ event.real_id }}">
+                                <img title="{{ 'Visible' }}" src="{{'invisible.png'|icon(32)}} " width="32" height="32">
+                            </a>
+                        {% endif %}
+                    {% endif %}
+                </td>
+            {% endif %}
+
+        </tr>
+    {% endfor %}
+</table>

+ 605 - 0
main/template/rainbow/agenda/month.tpl

@@ -0,0 +1,605 @@
+<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 clean_user_select() {
+    //Cleans the selected attr
+    $("#users_to_send").val('').trigger("chosen:updated");
+    /*$('#users_to_send')
+        .find('option')
+        .removeAttr('selected')
+        .end();*/
+}
+
+var region_value = '{{ region_value }}';
+
+$(document).ready(function() {
+	var date = new Date();
+
+    // Reset button.
+    $("button[type=reset]").click(function() {
+        $("#session_id").find('option').removeAttr("selected");
+    });
+
+	$("#dialog-form").dialog({
+		autoOpen: false,
+		modal	: false,
+		width	: 580,
+		height	: 480,
+        zIndex: 20000 // added because of qtip2
+   	});
+
+    $("#simple-dialog-form").dialog({
+		autoOpen: false,
+		modal	: false,
+		width	: 580,
+		height	: 480,
+        zIndex: 20000 // added because of qtip2
+   	});
+
+	var title = $("#title"),
+	content = $( "#content" ),
+	allFields = $( [] ).add( title ).add( content ), tips = $(".validateTips");
+
+    $("#select_form_id_search").change(function() {
+        var temp ="&user_id="+$("#select_form_id_search").val();
+        var position =String(window.location).indexOf("&user");
+        var url_length = String(window.location).length;
+        var url = String(window.location).substring(0,position)+temp;
+        if (position > 0) {
+            window.location.replace(url);
+        } else {
+            url = String(window.location)+temp;
+            window.location.replace(url);
+        }
+    });
+
+    $.datepicker.setDefaults( $.datepicker.regional[region_value] );
+
+	var calendar = $('#calendar').fullCalendar({
+		header: {
+			left: 'today prev,next',
+			center: 'title',
+			right: 'month,agendaWeek,agendaDay'
+		},
+        {% if use_google_calendar == 1 %}
+            eventSources: [
+                // if you want to add more just add URL in this array
+                '{{ google_calendar_url }}',
+                {
+                    className: 'gcal-event' // an option!
+                }
+            ],
+        {% endif %}
+
+        defaultView:    '{{ default_view }}',
+		buttonText: 	{{ button_text }},
+		monthNames: 	{{ month_names }},
+		monthNamesShort:{{ month_names_short }},
+		dayNames: 		{{ day_names }},
+		dayNamesShort: 	{{ day_names_short }},
+        firstHour: 8,
+        firstDay: 1,
+		selectable	: true,
+		selectHelper: true,
+        viewDisplay: function(view) {
+            /* When changing the view update the qtips */
+            /*var api = $('.qtip').qtip('api'); // Access the API of the first tooltip on the page
+            if (api) {
+                api.destroy();
+                //api.render();
+            }*/
+        },
+		// Add event
+		select: function(start, end, jsEvent, view) {
+            var start_date = start.format("YY-MM-DD");
+            var end_date = end.format("YY-MM-DD");
+
+            var allDay = true;
+            if (end.hasTime()) {
+                allDay = false;
+            }
+
+			$('#visible_to_input').show();
+			$('#add_as_announcement_div').show();
+			$('#visible_to_read_only').hide();
+
+			// Cleans the selected attr
+		    clean_user_select();
+
+            // Sets the 1st item selected by default
+            $('#users_to_send option').eq(0).attr('selected', 'selected');
+
+			// Update chz-select
+			//$("#users_to_send").trigger("chosen:updated");
+
+			if ({{ can_add_events }} == 1) {
+				var url = '{{ web_agenda_ajax_url }}&a=add_event&start='+start.format('YYYY-MM-DD 00:00:00')+'&end='+end.format('YYYY-MM-DD 00:00:00')+'&all_day='+allDay+'&view='+view.name;
+                var start_date_value = start.format('{{ js_format_date }}');
+                var end_date_value = end.format('{{ js_format_date }}');
+
+                $('#start_date').html(start_date_value);
+                
+                if (start_date_value == end_date_value) {
+                    $('#end_date').html(' - ' + end_date_value);
+                } else {
+                    $('#start_date').html('');
+                    $('#end_date').html(start_date_value+" - " + end_date_value);
+                }
+
+				$('#color_calendar').html('{{ type_label }}');
+				$('#color_calendar').removeClass('group_event');
+				$('#color_calendar').addClass('label_tag');
+				$('#color_calendar').addClass('{{ type_event_class }}');
+                                
+                //It shows the CKEDITOR while Adding an Event
+                $('#cke_content').show();
+                //It Fixing a minor bug with textarea ckeditor.remplace
+                $('#content').css('display','none');
+                //Reset the CKEditor content that persist in memory
+                CKEDITOR.instances['content'].setData('');
+
+				allFields.removeClass("ui-state-error");
+				$("#dialog-form").dialog("open");
+				$("#dialog-form").dialog({
+					buttons: {
+						'{{ "Add" | get_lang }}' : function() {
+							var bValid = true;
+							bValid = bValid && checkLength(title, "title", 1, 255);
+                                                        
+                            //Update the CKEditor Instance to the remplaced textarea, ready to be serializable
+                            for ( instance in CKEDITOR.instances ) {
+                                CKEDITOR.instances[instance].updateElement();
+                            }
+
+							var params = $("#add_event_form").serialize();
+
+							$.ajax({
+								url: url+'&'+params,
+								success:function(data) {
+									var user = $('#users_to_send').val();
+                                    if (user) {
+                                        if (user.length > 1) {
+                                            user = 0;
+                                        } else {
+                                            user = user[0];
+                                        }
+                                        var user_length = String(user).length;
+                                        if (String(user).substring(0,1) == 'G') {
+                                            var user_id = String(user).substring(6,user_length);
+                                            var user_id = "G:"+user_id;
+                                        } else {
+                                            var user_id = String(user).substring(5,user_length);
+                                        }
+                                        var temp = "&user_id="+user_id;
+                                        var position = String(window.location).indexOf("&user");
+                                        var url_length = String(window.location).length;
+                                        var url = String(window.location).substring(0, position)+temp;
+                                        /*if (position > 0) {
+                                            window.location.replace(url);
+                                        } else {
+                                            url = String(window.location)+temp;
+                                            window.location.replace(url);
+                                        }*/
+                                    } else {
+                                	   /* calendar.fullCalendar("refetchEvents");
+									    calendar.fullCalendar("rerenderEvents");*/
+                                    }
+
+                                    $("#title").val('');
+                                    $("#content").val('');
+                                    $("#comment").val('');
+
+                                    calendar.fullCalendar("refetchEvents");
+                                    calendar.fullCalendar("rerenderEvents");
+
+									$("#dialog-form").dialog("close");
+								}
+							});
+						}
+					},
+					close: function() {
+                        $("#title").val('');
+                        $("#content").val('');
+                        $("#comment").val('');
+					}
+				});
+
+				calendar.fullCalendar('unselect');
+                //Reload events
+                calendar.fullCalendar("refetchEvents");
+                calendar.fullCalendar("rerenderEvents");
+			}
+		},
+		eventRender: function(event, element) {
+            if (event.attachment) {
+                /*element.qtip({
+                    hide: {
+                        delay: 2000
+                    },
+		            content: event.attachment,
+		            position: { at:'top right' , my:'bottom right'}
+		        }).removeData('qtip'); // this is an special hack to add multiple qtip in the same target
+		        */
+            }
+			if (event.description) {
+                var comment = '';
+                if (event.comment) {
+                    comment = event.comment;
+                }
+
+				/*element.qtip({
+                    hide: {
+                        delay: 2000
+                    },
+		            content: event.description + ' ' + comment,
+		            position: { at:'top left' , my:'bottom left'}
+		        });*/
+			}
+	    },
+		eventClick: function(calEvent, jsEvent, view) {
+            if (!calEvent.end) {
+                calEvent.end = calEvent.start;
+            }
+
+            var start_date = calEvent.start.format("YY-MM-DD");
+
+            if (calEvent.allDay == 1) {
+                var end_date 	= '';
+            } else {
+                var end_date 	= '';
+                if (calEvent.end && calEvent.end != '') {
+                    var end_date  = calEvent.end.format("YY-MM-DD");
+                }
+            }
+
+			// Edit event.
+			if (calEvent.editable) {
+
+				$('#visible_to_input').hide();
+                $('#add_as_announcement_div').hide();
+
+                {% if type != 'admin' %}
+                    $('#visible_to_read_only').show();
+                    $("#visible_to_read_only_users").html(calEvent.sent_to);
+				{% endif %}
+
+                $('#color_calendar').html('{{type_label}}');
+                $('#color_calendar').addClass('label_tag');
+                $('#color_calendar').removeClass('course_event');
+                $('#color_calendar').removeClass('personal_event');
+                $('#color_calendar').removeClass('group_event');
+                $('#color_calendar').addClass(calEvent.type+'_event');
+                
+                //It hides the CKEDITOR while clicking an existing Event
+                $('#cke_content').hide();
+
+                $('#start_date').html(calEvent.start.format("YY-MM-DD"));
+                if (calEvent.end) {
+                    $('#end_date').html(' - '+calEvent.end.format("YY-MM-DD"));
+                }
+
+                if ($("#title").parent().find('#title_edit').length == 0) {
+                    $("#title").parent().append('<div id="title_edit"></div>');
+                }
+
+                $("#title_edit").html(calEvent.title);
+
+                if ($("#content").parent().find('#content_edit').length == 0) {
+                    $("#content").parent().append('<div id="content_edit"></div>');
+                }
+                $("#content_edit").html(calEvent.description);
+
+                if ($("#comment").parent().find('#comment_edit').length == 0) {
+                    $("#comment").parent().append('<div id="comment_edit"></div>');
+                }
+
+                if (calEvent.course_name) {
+                    $("#calendar_course_info").html(
+                        '<div class="form-group"><label class="col-sm-2 control-label">{{ 'Course' | get_lang }}</label>' +
+                        '<div class="class="col-sm-8">' + calEvent.course_name+"</div></div>"
+                    );
+                } else {
+                    $("#calendar_course_info").html('');
+                }
+
+                if (calEvent.session_name) {
+                    $("#calendar_session_info").html(
+                        '<div class="form-group"><label class="col-sm-2 control-label">{{ 'Session' | get_lang }}</label>'+
+                        '<div class="class="col-sm-8">' + calEvent.session_name+"</div></div>"
+                    );
+                } else {
+                    $("#calendar_session_info").html('');
+                }
+
+                $("#comment_edit").html(calEvent.comment);
+
+                $("#title_edit").show();
+                $("#content_edit").show();
+                $("#comment_edit").show();
+
+                $("#title").hide();
+                $("#content").hide();
+                $("#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 delete_url = '{{ web_agenda_ajax_url }}&a=delete_event&id='+calEvent.id;
+
+				$("#dialog-form").dialog({
+					buttons: {
+                        '{{ "ExportiCalConfidential"|get_lang }}' : function() {
+                            url =  "{{ _p.web_main }}calendar/ical_export.php?id=" + calEvent.id+'&course_id='+calEvent.course_id+"&class=confidential";
+                            window.location.href = url;
+						},
+						'{{ "ExportiCalPrivate"|get_lang }}': function() {
+                            url =  "{{ _p.web_main }}calendar/ical_export.php?id=" + calEvent.id+'&course_id='+calEvent.course_id+"&class=private";
+                            window.location.href = url;
+						},
+                        '{{ "ExportiCalPublic"|get_lang }}': function() {
+                            url =  "{{ _p.web_main }}calendar/ical_export.php?id=" + calEvent.id+'&course_id='+calEvent.course_id+"&class=public";
+                            window.location.href = url;
+						},
+                        {% if type == 'not_available' %}
+						'{{ "Edit" | get_lang }}' : function() {
+							var bValid = true;
+							bValid = bValid && checkLength( title, "title", 1, 255 );
+
+							var params = $("#add_event_form").serialize();
+							$.ajax({
+								url: url+'&'+params,
+								success:function() {
+									calEvent.title = $("#title").val();
+									calEvent.start = calEvent.start;
+									calEvent.end = calEvent.end;
+									calEvent.allDay = calEvent.allDay;
+									calEvent.description = $("#content").val();
+									calendar.fullCalendar('updateEvent',
+                                        calEvent,
+                                        true // make the event "stick"
+									);
+									$("#dialog-form").dialog("close");
+								}
+							});
+						},
+                        {% endif %}
+
+                        '{{ "Edit"|get_lang }}' : function() {
+                            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" );
+                        },
+						'{{ "Delete"|get_lang }}': function() {
+
+                            if (calEvent.parent_event_id || calEvent.has_children != '') {
+                                var newDiv = $('<div>');
+                                newDiv.dialog({
+                                    modal: true,
+                                    title: "{{ 'DeleteThisItem' | get_lang }}",
+                                    buttons: []
+                                });
+
+                                var buttons = newDiv.dialog("option", "buttons");
+
+                                if (calEvent.has_children == '0') {
+                                    buttons.push({
+                                        text: '{{ "DeleteThisItem" | get_lang }}',
+                                        click: function() {
+                                            $.ajax({
+                                                url: delete_url,
+                                                success:function() {
+                                                    calendar.fullCalendar('removeEvents',
+                                                        calEvent
+                                                    );
+                                                    calendar.fullCalendar("refetchEvents");
+                                                    calendar.fullCalendar("rerenderEvents");
+                                                    $("#dialog-form").dialog("close");
+                                                    newDiv.dialog( "destroy" );
+                                                }
+                                            });
+                                        }
+                                    });
+                                    newDiv.dialog("option", "buttons", buttons);
+                                }
+
+                                var buttons = newDiv.dialog("option", "buttons");
+                                buttons.push({
+                                    text: '{{ "DeleteAllItems" | get_lang }}',
+                                    click: function() {
+                                        $.ajax({
+                                            url: delete_url+'&delete_all_events=1',
+                                            success:function() {
+                                                calendar.fullCalendar('removeEvents',
+                                                    calEvent
+                                                );
+                                                calendar.fullCalendar("refetchEvents");
+                                                calendar.fullCalendar("rerenderEvents");
+                                                $("#dialog-form").dialog( "close" );
+                                                newDiv.dialog( "destroy" );
+                                            }
+                                        });
+                                    }
+                                });
+                                newDiv.dialog("option", "buttons", buttons);
+
+                                return true;
+                            }
+
+							$.ajax({
+								url: delete_url,
+								success:function() {
+									calendar.fullCalendar('removeEvents',
+										calEvent
+									);
+									calendar.fullCalendar("refetchEvents");
+									calendar.fullCalendar("rerenderEvents");
+									$("#dialog-form").dialog( "close" );
+								}
+							});
+						}
+					},
+					close: function() {
+                        $("#title_edit").hide();
+                        $("#content_edit").hide();
+                        $("#comment_edit").hide();
+
+                        $("#title").show();
+                        $("#content").show();
+                        $("#comment").show();
+
+						$("#title_edit").html('');
+						$("#content_edit").html('');
+                        $("#comment_edit").html('');
+
+                        $("#title").val('');
+                        $("#content").val('');
+                        $("#comment").val('');
+					}
+				});
+			} else {
+			    // Simple form
+                $('#simple_start_date').html(calEvent.start.format("YY-MM-DD"));
+
+                if (end_date != '') {
+                    $('#simple_start_date').html(calEvent.start.format("YY-MM-DD"));
+                    $('#simple_end_date').html(' ' + calEvent.end.format("YY-MM-DD"));
+                }
+                if (calEvent.course_name) {
+                    $("#calendar_course_info_simple").html(
+                        '<div class="form-group"><label class="col-sm-3 control-label">{{ 'Course' | get_lang }}</label>' +
+                        '<div class="col-sm-9">' + calEvent.course_name+"</div></div>"
+                    );
+                } else {
+                    $("#calendar_course_info_simple").html('');
+                }
+
+                if (calEvent.session_name) {
+                    $("#calendar_session_info").html(
+                        '<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('');
+                }
+
+                $("#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: {
+						'{{"ExportiCalConfidential"|get_lang}}' : function() {
+                            url =  "ical_export.php?id=" + calEvent.id+'&course_id='+calEvent.course_id+"&class=confidential";
+                            window.location.href = url;
+						},
+						'{{"ExportiCalPrivate"|get_lang}}': function() {
+                            url =  "ical_export.php?id=" + calEvent.id+'&course_id='+calEvent.course_id+"&class=private";
+                            window.location.href = url;
+						},
+                        '{{"ExportiCalPublic"|get_lang}}': function() {
+                            url =  "ical_export.php?id=" + calEvent.id+'&course_id='+calEvent.course_id+"&class=public";
+                            window.location.href = url;
+						}
+					}
+				});
+            }
+		},
+		editable: true,
+		events: "{{web_agenda_ajax_url}}&a=get_events",
+		eventDrop: function(event, delta, revert_func) {
+			$.ajax({
+				url: '{{ web_agenda_ajax_url }}',
+				data: {
+                    a: 'move_event',
+                    id: event.id,
+                    day_delta: delta.days(),
+                    minute_delta: delta.minutes()
+				}
+			});
+		},
+        eventResize: function(event, delta, revert_func) {
+            $.ajax({
+				url: '{{ web_agenda_ajax_url }}',
+				data: {
+                    a: 'resize_event',
+                    id: event.id,
+                    day_delta: delta.days(),
+                    minute_delta: delta.minutes()
+				}
+			});
+        },
+		axisFormat: 'h(:mm)a',
+		timeFormat: 'h:mm',
+		loading: function(bool) {
+			if (bool) $('#loading').show();
+			else $('#loading').hide();
+		}
+	});
+});
+</script>
+{{ actions_div }}
+{{ toolbar }}
+
+<div id="simple-dialog-form" style="display:none;">
+    <div style="width:500px">
+        <form name="form-simple" class="form-horizontal">
+            <span id="calendar_course_info_simple"></span>
+            <span id="calendar_session_info"></span>
+            <div class="form-group">
+                <label class="col-sm-3 control-label">
+                    <b>{{ "Date" |get_lang}}</b>
+                </label>
+                <div class="col-sm-9">
+                    <span id="simple_start_date"></span>
+                    <span id="simple_end_date"></span>
+                </div>
+            </div>
+            <div class="form-group">
+                <label class="col-sm-3 control-label">
+                    <b>{{ "Title" |get_lang}}</b>
+                </label>
+                <div class="col-sm-9">
+                    <div id="simple_title"></div>
+                </div>
+            </div>
+            <div class="form-group">
+                <label class="col-sm-3 control-label">
+                    <b>{{ "Description" |get_lang}}</b>
+                </label>
+                <div class="col-sm-9">
+                    <div id="simple_content"></div>
+                </div>
+            </div>
+            <div class="form-group">
+                <label class="col-sm-3 control-label">
+                    <b>{{ "Comment" |get_lang}}</b>
+                </label>
+                <div class="col-sm-9">
+                    <div id="simple_comment"></div>
+                </div>
+            </div>
+        </form>
+    </div>
+</div>
+
+<div id="dialog-form" style="display:none;">
+	<div class="dialog-form-content">
+        {{ form_add }}
+	</div>
+</div>
+<div id="loading" style="margin-left:150px;position:absolute;display:none">
+    {{ "Loading" | get_lang }}...
+</div>
+<div id="calendar"></div>

+ 35 - 0
main/template/rainbow/announcement/slider.tpl

@@ -0,0 +1,35 @@
+
+   
+ <div id="carousel-announcement" class="carousel slide" data-ride="carousel">
+  <!-- Indicators -->
+  <ol class="carousel-indicators">
+      {% for announcement in announcements %}
+        <li data-target="#carousel-announcement" data-slide-to="{{ loop.index0 }}" {% if loop.index0 == 0 %} class="active" {% endif %}></li>
+      {% endfor %}
+  </ol>
+
+  <!-- Wrapper for slides -->
+  <div class="carousel-inner" role="listbox">
+      {% for announcement in announcements %}
+        <div class="item {% if loop.index0 == 0 %} active {% endif %}">
+         
+          <div class="carousel-content" title="{{ announcement.title }}">
+              {{ announcement.content }}
+          </div>
+            {% if announcement.readMore %}
+                <a href="{{ _p.web }}news_list.php?id={{ announcement.id }}">{{ "More" | get_lang }}</a>
+            {% endif %}
+        </div>
+    {% endfor %}
+  </div>
+
+  <!-- Controls -->
+  <a class="left carousel-control" href="#carousel-announcement" role="button" data-slide="prev">
+    <span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
+    <span class="sr-only">Previous</span>
+  </a>
+  <a class="right carousel-control" href="#carousel-announcement" role="button" data-slide="next">
+    <span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
+    <span class="sr-only">Next</span>
+  </a>
+</div>

+ 13 - 0
main/template/rainbow/announcement/view.tpl

@@ -0,0 +1,13 @@
+<h2 class="page-header">{{ "SystemAnnouncements" | get_lang }}</h2>
+
+{% if not announcement is empty %}
+    <article id="announcement-{{ announcement.id }}}" title="{{ announcement.title }}">
+        <div class="page-header">
+            {{ announcement.content }}
+        </div>
+    </article>
+{% else %}
+    <div class="alert alert-danger" role="alert">
+        {{ "NoResults" | get_lang }}
+    </div>
+{% endif %}

+ 21 - 0
main/template/rainbow/auth/catalog_layout.php

@@ -0,0 +1,21 @@
+<?php
+/* For licensing terms, see /license.txt */
+/**
+ * Layout (principal view) used for structuring course/session catalog
+ * @author Angel Fernando Quiroz Campos <angel.quiroz@beeznest.com>
+ * @package chamilo.auth
+ */
+
+if (api_get_setting('course_catalog_published') !== 'true') {
+    // Acces rights: anonymous users can't do anything usefull here.
+    api_block_anonymous_users();
+}
+
+// Header
+Display::display_header('');
+
+// Display
+echo $content;
+
+// Footer
+Display::display_footer();

+ 32 - 0
main/template/rainbow/auth/categories_list.php

@@ -0,0 +1,32 @@
+<?php
+/* For licensing terms, see /license.txt */
+
+/**
+* View (MVC patter) for creating course category
+* @author Christian Fasanando <christian1827@gmail.com> - Beeznest
+* @package chamilo.auth
+*/
+
+// Acces rights: anonymous users can't do anything usefull here.
+api_block_anonymous_users();
+
+$stok = Security::get_token();
+
+?>
+<!-- Actions: The menu with the different options in cathe course management -->
+<div id="actions" class="actions">
+    <a href="<?php echo api_get_self() ?>?action=sortmycourses">
+        <?php echo Display::return_icon('back.png', get_lang('Back'),'','32'); ?>
+    </a>
+</div>
+
+<?php
+$form = new FormValidator(
+    'create_course_category',
+    'post',
+    api_get_self().'?createcoursecategory'
+);
+$form->addHidden('sec_token', $stok);
+$form->addText('title_course_category', get_lang('Name'));
+$form->addButtonSave(get_lang('AddCategory'), 'create_course_category');
+$form->display();

+ 8 - 0
main/template/rainbow/auth/confirm_session_subscription.tpl

@@ -0,0 +1,8 @@
+<div class="row">
+    <div class="col-sm-3 col-sm-offset-3">
+        <a href="{{ _p.web_main }}auth/courses.php?{{ {'action':'subscribe_to_session', 'session_id':session_id, 'confirm':'1'}|url_encode() }}" class="btn btn-success btn-block">{{ 'Yes'|get_lang }}</a>
+    </div>
+    <div class="col-sm-3">
+        <button type="button" class="btn btn-danger btn-block" data-dismiss="modal">{{ 'No'|get_lang }}</button>
+    </div>
+</div>

+ 0 - 0
main/template/rainbow/auth/courses.tpl


+ 413 - 0
main/template/rainbow/auth/courses_categories.php

@@ -0,0 +1,413 @@
+<?php
+/* For licensing terms, see /license.txt */
+
+/**
+ * View (MVC patter) for courses categories
+ * @author Christian Fasanando <christian1827@gmail.com> - Beeznest
+ * @package chamilo.auth
+ */
+
+if (isset($_REQUEST['action']) && Security::remove_XSS($_REQUEST['action']) !== 'subscribe') {
+    $stok = Security::get_token();
+} else {
+    $stok = $_SESSION['sec_token'];
+}
+
+$showCourses = CoursesAndSessionsCatalog::showCourses();
+$showSessions = CoursesAndSessionsCatalog::showSessions();
+$pageCurrent = isset($pageCurrent) ? $pageCurrent :
+    isset($_GET['pageCurrent']) ? intval($_GET['pageCurrent']) :
+        1;
+$pageLength = isset($pageLength) ? $pageLength :
+    isset($_GET['pageLength']) ? intval($_GET['pageLength']) :
+        10;
+$pageTotal = intval(ceil(intval($countCoursesInCategory) / $pageLength));
+$cataloguePagination = $pageTotal > 1 ?
+    CourseCategory::getCatalogPagination($pageCurrent, $pageLength, $pageTotal) :
+    '';
+$search_term = isset($search_term) ? $search_term :null;
+
+if ($showSessions && isset($_POST['date'])) {
+    $date = $_POST['date'];
+} else {
+    $date = date('Y-m-d');
+}
+
+$userInfo = api_get_user_info();
+$code = isset($code) ? $code : null;
+
+?>
+<script>
+    $(document).ready( function() {
+        $('.star-rating li a').on('click', function(event) {
+            var id = $(this).parents('ul').attr('id');
+            $('#vote_label2_' + id).html("<?php echo get_lang('Loading'); ?>");
+            $.ajax({
+                url: $(this).attr('data-link'),
+                success: function(data) {
+                    $("#rating_wrapper_"+id).html(data);
+                    if(data == 'added') {
+                        //$('#vote_label2_' + id).html("{'Saved'|get_lang}");
+                    }
+                    if(data == 'updated') {
+                        //$('#vote_label2_' + id).html("{'Saved'|get_lang}");
+                    }
+                }
+            });
+        });
+
+        /*$('.courses-list-btn').toggle(function (e) {
+            e.preventDefault();
+
+            var $el = $(this);
+            var sessionId = getSessionId(this);
+
+            $el.children('img').remove();
+            $el.prepend('<?php echo Display::display_icon('nolines_minus.gif'); ?>');
+
+            $.ajax({
+                url: '<?php echo api_get_path(WEB_AJAX_PATH) . 'course.ajax.php' ?>',
+                type: 'GET',
+                dataType: 'json',
+                data: {
+                    a: 'display_sessions_courses',
+                    session: sessionId
+                },
+                success: function (response){
+                    var $container = $el.prev('.course-list');
+                    var $courseList = $('<ul>');
+                    $.each(response, function (index, course) {
+                        $courseList.append('<li><div><strong>' + course.name + '</strong><br>' + course.coachName + '</div></li>');
+                    });
+
+                    $container.append($courseList).show(250);
+                }
+            });
+        }, function (e) {
+            e.preventDefault();
+            var $el = $(this);
+            var $container = $el.prev('.course-list');
+            $container.hide(250).empty();
+            $el.children('img').remove();
+            $el.prepend('<?php echo Display::display_icon('nolines_plus.gif'); ?>');
+        });*/
+
+        var getSessionId = function (el) {
+            var parts = el.id.split('_');
+            return parseInt(parts[1], 10);
+        };
+
+        <?php if ($showSessions) { ?>
+        $('#date').datepicker({
+            dateFormat: 'yy-mm-dd'
+        });
+        <?php } ?>
+    });
+</script>
+
+<div class="row">
+    <div class="col-md-4">
+        <h5><?php echo get_lang('Search'); ?></h5>
+        <?php
+        if ($showCourses) {
+            if (!isset($_GET['hidden_links']) || intval($_GET['hidden_links']) != 1) { ?>
+            <form class="form-horizontal" method="post" action="<?php echo CourseCategory::getCourseCategoryUrl(1, $pageLength, 'ALL', 0, 'subscribe'); ?>">
+                <input type="hidden" name="sec_token" value="<?php echo $stok; ?>">
+                <input type="hidden" name="search_course" value="1" />
+                <div class="input-group">
+                    <input class="form-control" type="text" name="search_term" value="<?php echo (empty($_POST['search_term']) ? '' : api_htmlentities(Security::remove_XSS($_POST['search_term']))); ?>" />
+                    <div class="input-group-btn">
+                        <button class="btn btn-default" type="submit">
+                            <em class="fa fa-search"></em> <?php echo get_lang('Search'); ?>
+                        </button>
+                    </div>
+                </div>
+            </form>
+            <?php } ?>
+    </div>
+    <div class="col-md-4">
+        <h5><?php echo get_lang('CourseCategories'); ?></h5>
+        <?php
+
+            $webAction = api_get_path(WEB_CODE_PATH).'auth/courses.php';
+            $action = (!empty($_REQUEST['action'])?Security::remove_XSS($_REQUEST['action']):'display_courses');
+            $pageLength = (!empty($_REQUEST['pageLength'])?intval($_REQUEST['pageLength']):10);
+            $pageCurrent = (!empty($_REQUEST['pageCurrent'])?intval($_REQUEST['pageCurrent']):1);
+            $form = '<form action="'.$webAction.'" method="GET" class="form-horizontal">';
+            $form .= '<input type="hidden" name="action" value="' . $action . '">';
+            $form .= '<input type="hidden" name="pageCurrent" value="' . $pageCurrent . '">';
+            $form .= '<input type="hidden" name="pageLength" value="' . $pageLength . '">';
+            $form .= '<div class="form-group">';
+            $form .= '<div class="col-sm-12">';
+            $form .= '<select name="category_code" onchange="submit();" class="selectpicker show-tick form-control">';
+            $codeType = isset($_REQUEST['category_code']) ? Security::remove_XSS($_REQUEST['category_code']) : '';
+            foreach ($browse_course_categories[0] as $category) {
+                $categoryCode = $category['code'];
+                $countCourse = $category['count_courses'];
+
+                $form .= '<option '. ($categoryCode == $codeType? 'selected="selected" ':'') .' value="' . $category['code'] . '">' . $category['name'] . ' ( '. $countCourse .' ) </option>';
+                if (!empty($browse_course_categories[$categoryCode])) {
+                    foreach ($browse_course_categories[$categoryCode] as $subCategory){
+                        $subCategoryCode = $subCategory['code'];
+                        $form .= '<option '. ($subCategoryCode == $codeType ? 'selected="selected" ':'') .' value="' . $subCategory['code'] . '"> ---' . $subCategory['name'] . ' ( '. $subCategory['count_courses'] .' ) </option>';
+                    }
+                }
+            }
+            $form .= '</select>';
+            $form .= '</div>';
+            $form .= '</form>';
+            echo $form;
+        ?>
+    </div>
+    </div>
+<?php
+    if ($showSessions) { ?>
+        <div class="col-md-4">
+            <h5><?php echo get_lang('Sessions'); ?></h5>
+            <a class="btn btn-default btn-block" href="<?php echo CourseCategory::getCourseCategoryUrl(1, $pageLength, null, 0, 'display_sessions'); ?>">
+                <?php echo get_lang('SessionList'); ?>
+            </a>
+        </div>
+    <?php } ?>
+</div>
+ <?php  } ?>
+<div class="row">
+<?php
+if ($showCourses && $action != 'display_sessions') {
+
+    if (!empty($message)) {
+        Display::display_confirmation_message($message, false);
+    }
+    if (!empty($error)) {
+        Display::display_error_message($error, false);
+    }
+
+    if (!empty($content)) {
+        echo $content;
+    }
+
+    if (!empty($search_term)) {
+        echo "<p><strong>".get_lang('SearchResultsFor')." ".Security::remove_XSS($_POST['search_term'])."</strong><br />";
+    }
+
+    $ajax_url = api_get_path(WEB_AJAX_PATH).'course.ajax.php?a=add_course_vote';
+    $user_id = api_get_user_id();
+
+    if (!empty($browse_courses_in_category)) {
+        foreach ($browse_courses_in_category as $course) {
+            $course_hidden = ($course['visibility'] == COURSE_VISIBILITY_HIDDEN);
+
+            if ($course_hidden) {
+                continue;
+            }
+
+            $user_registerd_in_course = CourseManager::is_user_subscribed_in_course($user_id, $course['code']);
+            $user_registerd_in_course_as_teacher = CourseManager::is_course_teacher($user_id, $course['code']);
+            $user_registerd_in_course_as_student = ($user_registerd_in_course && !$user_registerd_in_course_as_teacher);
+            $course_public = ($course['visibility'] == COURSE_VISIBILITY_OPEN_WORLD);
+            $course_open = ($course['visibility'] == COURSE_VISIBILITY_OPEN_PLATFORM);
+            $course_private = ($course['visibility'] == COURSE_VISIBILITY_REGISTERED);
+            $course_closed = ($course['visibility'] == COURSE_VISIBILITY_CLOSED);
+
+            $course_subscribe_allowed = ($course['subscribe'] == 1);
+            $course_unsubscribe_allowed = ($course['unsubscribe'] == 1);
+            $count_connections = $course['count_connections'];
+            $creation_date = substr($course['creation_date'],0,10);
+
+            $icon_title = null;
+            $html = null;
+            // display the course bloc
+            $html .= '<div class="col-xs-6 col-sm-6 col-md-3"><div class="items-course">';
+
+            // display thumbnail
+            $html .= return_thumbnail($course, $icon_title);
+
+            // display course title and button bloc
+            $html .= '<div class="items-course-info">';
+            $html .= return_title($course);
+            // display button line
+            $html .= '<div class="toolbar">';
+            $html .= '<div class="btn-group">';
+            // if user registered as student
+
+            $html .= return_description_button($course, $icon_title);
+
+            if ($user_registerd_in_course_as_student) {
+                $html .= return_already_registered_label('student');
+
+                if (!$course_closed) {
+                    if ($course_unsubscribe_allowed) {
+                        $html .= return_unregister_button($course, $stok, $search_term, $code);
+                    }
+                }
+            } elseif ($user_registerd_in_course_as_teacher) {
+                // if user registered as teacher
+                $html .= return_goto_button($course);
+
+                if ($course_unsubscribe_allowed) {
+                    $html .= return_unregister_button($course, $stok, $search_term, $code);
+                }
+                $html .= return_already_registered_label('teacher');
+
+            } else {
+                // if user not registered in the course
+                if (!$course_closed) {
+                    if (!$course_private) {
+                        $html .= return_goto_button($course);
+                        if ($course_subscribe_allowed) {
+                            $html .= return_register_button($course, $stok, $code, $search_term);
+                        }
+                    }
+                }
+
+            }
+            $html .= '</div>';
+            $html .= '</div>';
+            $html .= '</div>';
+            $html .= '</div>';
+            $html .= '</div>';
+            echo $html;
+
+        }
+    } else {
+        if (!isset($_REQUEST['subscribe_user_with_password']) &&
+            !isset($_REQUEST['subscribe_course'])
+        ) {
+            Display::display_warning_message(get_lang('ThereAreNoCoursesInThisCategory'));
+        }
+    }
+}
+?>
+</div>
+<?php
+
+echo $cataloguePagination;
+
+/**
+ * Display the course catalog image of a course
+ * @param $course
+ * @param $icon_title
+ */
+function return_thumbnail($course, $icon_title)
+{
+    $html = '';
+    $title = cut($course['title'], 70);
+    // course path
+    $course_path = api_get_path(SYS_COURSE_PATH).$course['directory'];
+
+    if (file_exists($course_path.'/course-pic.png')) {
+        $course_medium_image = api_get_path(WEB_COURSE_PATH).$course['directory'].'/course-pic.png'; // redimensioned image 85x85
+    } else {
+        // without picture
+        $course_medium_image = Display::returnIconPath('session_default.png');
+    }
+
+    // course image
+
+    $html .= '<div class="items-course-image">';
+    if (api_get_setting('show_courses_descriptions_in_catalog') == 'true') {
+        $html .= '<a class="ajax" href="'.api_get_path(WEB_CODE_PATH).'inc/ajax/course_home.ajax.php?a=show_course_information&code='.$course['code'].'" title="'.$icon_title.'" rel="gb_page_center[778]">';
+        $html .= '<img class="img-responsive" src="'.$course_medium_image.'" alt="'.api_htmlentities($title).'" />';
+        $html .= '</a>';
+    } else {
+        $html .= '<img class="img-responsive" src="'.$course_medium_image.'" alt="'.api_htmlentities($title).'"/>';
+    }
+    $html .= '</div>';
+
+    return $html;
+}
+
+/**
+ * Display the title of a course in course catalog
+ * @param $course
+ */
+function return_title($course)
+{
+    $html = '';
+    $linkCourse = api_get_course_url($course['code']);
+    $title = cut($course['title'], 70);
+    $ajax_url = api_get_path(WEB_AJAX_PATH).'course.ajax.php?a=add_course_vote';
+    $teachers = CourseManager::get_teacher_list_from_course_code_to_string($course['code']);
+    $rating = Display::return_rating_system('star_'.$course['real_id'], $ajax_url.'&course_id='.$course['real_id'], $course['point_info']);
+    $html .=  '<h4 class="title"><a href="' . $linkCourse . '">' . cut($title, 60) . '</a></h4>';
+    $html .= '<div class="teachers">'.$teachers.'</div>';
+    $html .= '<div class="ranking">'. $rating . '</div>';
+
+    return $html;
+}
+
+/**
+ * Display the description button of a course in the course catalog
+ * @param $course
+ * @param $icon_title
+ */
+function return_description_button($course, $icon_title)
+{
+    $title = $course['title'];
+    $html = '';
+    if (api_get_setting('show_courses_descriptions_in_catalog') == 'true') {
+        $html = '<a data-title="' . $title . '" class="ajax btn btn-default btn-sm" href="'.api_get_path(WEB_CODE_PATH).'inc/ajax/course_home.ajax.php?a=show_course_information&code='.$course['code'].'" title="' . get_lang('Description') . '">' .
+        Display::returnFontAwesomeIcon('info-circle') . '</a>';
+    }
+
+    return $html;
+}
+
+/**
+ * Display the goto course button of a course in the course catalog
+ * @param $course
+ */
+function return_goto_button($course)
+{
+    $html = ' <a class="btn btn-default btn-sm" title="' . get_lang('GoToCourse') . '" href="'.api_get_course_url($course['code']).'">'.
+    Display::returnFontAwesomeIcon('share').'</a>';
+
+    return $html;
+}
+
+/**
+ * Display the already registerd text in a course in the course catalog
+ * @param $in_status
+ */
+function return_already_registered_label($in_status)
+{
+    $icon = Display::return_icon('teacher.png', get_lang('Teacher'), null, ICON_SIZE_TINY);
+    if ($in_status == 'student') {
+        $icon = Display::return_icon('user.png', get_lang('Student'), null, ICON_SIZE_TINY);
+    }
+    $html = Display::tag(
+        'button',
+        $icon,
+        array('id' => 'register', 'class' => 'btn btn-default btn-sm', 'title' => get_lang("AlreadyRegisteredToCourse"))
+    );
+
+    return $html;
+}
+
+/**
+ * Display the register button of a course in the course catalog
+ * @param $course
+ * @param $stok
+ * @param $code
+ * @param $search_term
+ */
+function return_register_button($course, $stok, $code, $search_term)
+{
+    $html = ' <a class="btn btn-success btn-sm" title="' . get_lang('Subscribe') . '" href="'.api_get_self().'?action=subscribe_course&sec_token='.$stok.'&subscribe_course='.$course['code'].'&search_term='.$search_term.'&category_code='.$code.'">' .
+    Display::returnFontAwesomeIcon('sign-in') . '</a>';
+    return $html;
+}
+
+/**
+ * Display the unregister button of a course in the course catalog
+ * @param $course
+ * @param $stok
+ * @param $search_term
+ * @param $code
+ */
+function return_unregister_button($course, $stok, $search_term, $code)
+{
+    $html = ' <a class="btn btn-danger btn-sm" title="' . get_lang('Unsubscribe') . '" href="'. api_get_self().'?action=unsubscribe&sec_token='.$stok.'&unsubscribe='.$course['code'].'&search_term='.$search_term.'&category_code='.$code.'">' .
+    Display::returnFontAwesomeIcon('sign-out') . '</a>';
+    return $html;
+}

+ 280 - 0
main/template/rainbow/auth/courses_list.php

@@ -0,0 +1,280 @@
+<?php
+/* For licensing terms, see /license.txt */
+
+/**
+* View (MVC patter) for courses
+* @author Christian Fasanando <christian1827@gmail.com> - Beeznest
+* @package chamilo.auth
+*/
+
+// Access rights: anonymous users can't do anything usefull here.
+api_block_anonymous_users();
+$stok = Security::get_token();
+$courses_without_category = isset($courses_in_category[0]) ? $courses_in_category[0] : null;
+
+?>
+
+<!-- Actions: The menu with the different options in cathe course management -->
+<div id="actions" class="actions">
+    <?php if ($action != 'createcoursecategory') { ?>
+	<a href="<?php echo api_get_self(); ?>?action=createcoursecategory"><?php echo Display::return_icon('new_folder.png', get_lang('CreateCourseCategory'),'','32'); ?></a>
+    <?php } ?>
+</div>
+
+<?php
+if (!empty($message)) {
+    Display::display_confirmation_message($message, false);
+}
+
+// COURSES WITH CATEGORIES
+if (!empty($user_course_categories)) {
+       foreach ($user_course_categories as $row) {
+           echo Display::page_subheader($row['title']);
+           echo '<a name="category'.$row['id'].'"></a>';
+
+           if (isset($_GET['categoryid']) && $_GET['categoryid'] == $row['id']) { ?>
+            <!-- We display the edit form for the category -->
+
+            <form name="edit_course_category" method="post" action="courses.php?action=<?php echo $action; ?>">
+                <input type="hidden" name="edit_course_category" value="<?php echo $row['id']; ?>" />
+                <input type="hidden" name="sec_token" value="<?php echo $stok; ?>">
+                <input type="text" name="title_course_category" value="<?php echo $row['title']; ?>" />
+                <button class="save" type="submit" name="submit_edit_course_category"><?php echo get_lang('Ok'); ?></button>
+            </form>
+            <?php } ?>
+
+
+            <!-- display category icons -->
+            <?php
+            $max_category_key = count($user_course_categories);
+            if ($action != 'unsubscribe') { ?>
+                <a href="courses.php?action=sortmycourses&amp;categoryid=<?php echo $row['id']; ?>&amp;sec_token=<?php echo $stok; ?>#category<?php echo $row['id']; ?>">
+                <?php echo Display::display_icon('edit.png', get_lang('Edit'),'',22); ?>
+                </a>
+
+                <?php if ($row['id'] != $user_course_categories[0]['id']) { ?>
+                        <a href="courses.php?action=<?php echo $action ?>&amp;move=up&amp;category=<?php echo $row['id']; ?>&amp;sec_token=<?php echo $stok; ?>">
+                        <?php echo Display::return_icon('up.png', get_lang('Up'),'',22); ?>
+                        </a>
+                <?php } else { ?>
+                    <?php echo Display::return_icon('up_na.png', get_lang('Up'),'',22); ?>
+               <?php } ?>
+
+                <?php if ($row['id'] != $user_course_categories[$max_category_key - 1]['id']) { ?>
+                    <a href="courses.php?action=<?php echo $action; ?>&amp;move=down&amp;category=<?php echo $row['id']; ?>&amp;sec_token=<?php echo $stok; ?>">
+                    <?php echo Display::return_icon('down.png', get_lang('Down'),'',22); ?>
+                    </a>
+                <?php } else { ?>
+                    <?php echo Display::return_icon('down_na.png', get_lang('Down'),'',22); ?>
+                <?php } ?>
+                <a href="courses.php?action=deletecoursecategory&amp;id=<?php echo $row['id']; ?>&amp;sec_token=<?php echo $stok; ?>">
+                <?php echo Display::display_icon('delete.png', get_lang('Delete'), array('onclick' => "javascript: if (!confirm('".addslashes(api_htmlentities(get_lang("CourseCategoryAbout2bedeleted"), ENT_QUOTES, api_get_system_encoding()))."')) return false;"),22) ?>
+                </a>
+            <?php }
+            echo '<br /><br />';
+            // Show the courses inside this category
+            echo '<table class="data_table">';
+
+            $number_of_courses = isset($courses_in_category[$row['id']]) ? count($courses_in_category[$row['id']]) : 0;
+            $key = 0;
+            if (!empty($courses_in_category[$row['id']])) {
+                foreach ($courses_in_category[$row['id']] as $course) {
+            ?>
+                <tr>
+                    <td>
+                    <a name="course<?php echo $course['code']; ?>"></a>
+                    <strong><?php echo $course['title']; ?></strong><br />
+                    <?php
+                    if (api_get_setting('display_coursecode_in_courselist') == 'true') {
+                        echo $course['visual_code'];
+                    }
+
+                    if (api_get_setting('display_coursecode_in_courselist') == 'true' &&
+                        api_get_setting('display_teacher_in_courselist') == 'true'
+                    ) {
+                        echo " - ";
+                    }
+
+                    if (api_get_setting('display_teacher_in_courselist') == 'true') {
+                        echo $course['tutor'];
+                    }
+                    ?>
+                    </td>
+                    <td valign="top">
+                    <!-- edit -->
+                    <?php
+                        if (isset($_GET['edit']) && $course['code'] == $_GET['edit']) {
+                            $edit_course = Security::remove_XSS($_GET['edit']); ?>
+
+                            <form name="edit_course_category" method="post" action="courses.php?action=<?php echo $action; ?>">
+                            <input type="hidden" name="sec_token" value="<?php echo $stok; ?>">
+                            <input type="hidden" name="course_2_edit_category" value="<?php echo $edit_course; ?>" />
+                            <select name="course_categories">
+                            <option value="0"><?php echo get_lang("NoCourseCategory"); ?></option>
+                            <?php foreach ($user_course_categories as $row) { ?>
+                                <option value="<?php echo $row['id'] ?>"><?php echo $row['title']; ?></option>
+                            <?php } ?>
+                            </select>
+                            <button class="save" type="submit" name="submit_change_course_category"><?php echo get_lang('Ok'); ?></button>
+                            </form>
+                    <?php }  ?>
+
+                    <div style="float:left;width:110px;">
+                    <?php
+                        if (api_get_setting('show_courses_descriptions_in_catalog') == 'true') {
+                            $icon_title = get_lang('CourseDetails') . ' - ' . $course['title'];
+                    ?>
+                    <a href="<?php echo api_get_path(WEB_CODE_PATH); ?>inc/ajax/course_home.ajax.php?a=show_course_information&code=<?php echo $course['code'] ?>" data-title="<?php echo $icon_title ?>" title="<?php echo $icon_title ?>" class="ajax">
+                        <?php echo Display::return_icon('info.png', $icon_title,'','22') ?>
+                       <?php } ?>
+                    </a>
+
+                    <?php if (isset($_GET['edit']) && $course['code'] == $_GET['edit']) { ?>
+                          <?php echo Display::display_icon('edit_na.png', get_lang('Edit'),'',22); ?>
+                    <?php } else { ?>
+                        <a href="courses.php?action=<?php echo $action; ?>&amp;edit=<?php echo $course['code']; ?>&amp;sec_token=<?php echo $stok; ?>">
+                            <?php echo Display::display_icon('edit.png', get_lang('Edit'),'',22); ?>
+                            </a>
+                    <?php } ?>
+
+                    <?php if ($key > 0) { ?>
+                        <a href="courses.php?action=<?php echo $action; ?>&amp;move=up&amp;course=<?php echo $course['code']; ?>&amp;category=<?php echo $course['user_course_cat']; ?>&amp;sec_token=<?php echo $stok; ?>">
+                        <?php echo Display::display_icon('up.png', get_lang('Up'),'',22); ?>
+                        </a>
+                    <?php } else { ?>
+                        <?php echo Display::display_icon('up_na.png', get_lang('Up'),'',22); ?>
+                    <?php } ?>
+
+                    <?php if ($key < $number_of_courses - 1) { ?>
+                        <a href="courses.php?action=<?php echo $action; ?>&amp;move=down&amp;course=<?php echo $course['code']; ?>&amp;category=<?php echo $course['user_course_cat']; ?>&amp;sec_token=<?php echo $stok; ?>">
+                        <?php echo Display::display_icon('down.png', get_lang('Down'),'',22); ?>
+                        </a>
+                    <?php } else { ?>
+                        <?php echo Display::display_icon('down_na.png', get_lang('Down'),'',22); ?>
+                    <?php } ?>
+
+                  </div>
+                  <div style="float:left; margin-right:10px;">
+                    <?php if ($course['status'] != 1) {
+                            if ($course['unsubscr'] == 1) {
+                    ?>
+
+                    <form action="<?php echo api_get_self(); ?>" method="post" onsubmit="javascript: if (!confirm('<?php echo addslashes(api_htmlentities(get_lang("ConfirmUnsubscribeFromCourse"), ENT_QUOTES, api_get_system_encoding()))?>')) return false">
+                        <input type="hidden" name="sec_token" value="<?php echo $stok; ?>">
+                        <input type="hidden" name="unsubscribe" value="<?php echo $course['code']; ?>" />
+                         <button class="btn btn-default" value="<?php echo get_lang('Unsubscribe'); ?>" name="unsub">
+                        <?php echo get_lang('Unsubscribe'); ?>
+                        </button>
+                    </form>
+                  </div>
+                      <?php }
+                    }
+                    $key++;
+                }
+                echo '</table>';
+            }
+    }
+}
+
+echo Display::page_subheader(get_lang('NoCourseCategory'));
+
+echo '<table class="data_table">';
+// COURSES WITHOUT CATEGORY
+if (!empty($courses_without_category)) {
+    $number_of_courses = count($courses_without_category);
+    $key = 0;
+
+    foreach ($courses_without_category as $course) {
+        echo '<tr>';
+        ?>
+
+        <td>
+            <a name="course<?php echo $course['code']; ?>"></a>
+            <strong><?php echo $course['title']; ?></strong><br />
+            <?php
+            if (api_get_setting('display_coursecode_in_courselist') == 'true') { echo $course['visual_code']; }
+            if (api_get_setting('display_coursecode_in_courselist') == 'true' && api_get_setting('display_teacher_in_courselist') == 'true') { echo " - "; }
+            if (api_get_setting('display_teacher_in_courselist') == 'true') { echo $course['tutor']; }
+            ?>
+        </td>
+        <td valign="top">
+
+            <!-- the edit icon OR the edit dropdown list -->
+            <?php if (isset($_GET['edit']) && $course['code'] == $_GET['edit']) {
+                $edit_course = Security::remove_XSS($_GET['edit']);
+            ?>
+            <div style="float:left;">
+            <form name="edit_course_category" method="post" action="courses.php?action=<?php echo $action; ?>">
+                <input type="hidden" name="sec_token" value="<?php echo $stok; ?>">
+                <input type="hidden" name="course_2_edit_category" value="<?php echo $edit_course; ?>" />
+                <select name="course_categories">
+                    <option value="0"><?php echo get_lang("NoCourseCategory"); ?></option>
+                    <?php foreach ($user_course_categories as $row) { ?>
+                        <option value="<?php echo $row['id']; ?>"><?php echo $row['title']; ?></option>
+                    <?php } ?>
+                </select>
+                <button class="save" type="submit" name="submit_change_course_category"><?php echo get_lang('Ok') ?></button>
+            </form><br />
+            </div>
+            <?php } ?>
+
+            <div style="float:left; width:110px">
+            <?php
+            if (api_get_setting('show_courses_descriptions_in_catalog') == 'true') {
+            $icon_title = get_lang('CourseDetails') . ' - ' . $course['title'];
+            ?>
+            <a href="<?php echo api_get_path(WEB_CODE_PATH); ?>inc/ajax/course_home.ajax.php?a=show_course_information&code=<?php echo $course['code'] ?>" data-title="<?php echo $icon_title ?>" title="<?php echo $icon_title ?>" class="ajax">
+                <?php echo Display::return_icon('info.png', $icon_title, '','22'); ?>
+            </a>
+            <?php } ?>
+
+             <?php if (isset($_GET['edit']) && $course['code'] == $_GET['edit']) {   ?>
+                    <?php echo Display::display_icon('edit_na.png', get_lang('Edit'),'',22); ?>
+                  <?php } else { ?>
+                    <a href="courses.php?action=<?php echo $action; ?>&amp;edit=<?php echo $course['code']; ?>&amp;sec_token=<?php echo $stok; ?>">
+                    <?php echo Display::display_icon('edit.png', get_lang('Edit'),'',22); ?>
+                    </a>
+             <?php } ?>
+
+            <!-- up /down icons-->
+            <?php if ($key > 0) { ?>
+                    <a href="courses.php?action=<?php echo $action; ?>&amp;move=up&amp;course=<?php echo $course['code']; ?>&amp;category=<?php echo $course['user_course_cat']; ?>&amp;sec_token=<?php echo $stok; ?>">
+                    <?php echo Display::display_icon('up.png', get_lang('Up'),'',22) ?>
+                    </a>
+            <?php } else {
+                    echo Display::display_icon('up_na.png', get_lang('Up'),'',22);
+                  }
+
+                  if ($key < $number_of_courses - 1) { ?>
+                    <a href="courses.php?action=<?php echo $action; ?>&amp;move=down&amp;course=<?php echo $course['code']; ?>&amp;category=<?php echo $course['user_course_cat']; ?>&amp;sec_token=<?php echo $stok; ?>">
+                    <?php echo Display::display_icon('down.png', get_lang('Down'),'',22); ?>
+                    </a>
+            <?php } else {
+                    echo Display::display_icon('down_na.png', get_lang('Down'),'',22);
+                  }?>
+                </div>
+                 <div style="float:left; margin-right:10px;">
+                  <!-- cancel subscrioption-->
+            <?php if ($course['status'] != 1) {
+                    if ($course['unsubscr'] == 1) {
+            ?>
+                    <!-- changed link to submit to avoid action by the search tool indexer -->
+                    <form action="<?php echo api_get_self(); ?>" method="post" onsubmit="javascript: if (!confirm('<?php echo addslashes(api_htmlentities(get_lang("ConfirmUnsubscribeFromCourse"), ENT_QUOTES, api_get_system_encoding())) ?>')) return false;">
+                        <input type="hidden" name="sec_token" value="<?php echo $stok; ?>">
+                        <input type="hidden" name="unsubscribe" value="<?php echo $course['code']; ?>" />
+                        <button class="btn btn-default" value="<?php echo get_lang('Unsubscribe'); ?>" name="unsub">
+                            <?php echo get_lang('Unsubscribe'); ?>
+                        </button>
+                    </form>
+                    </div>
+              <?php }
+                }
+              ?>
+            </td>
+            </tr>
+            <?php
+            $key++;
+        }
+    }
+?>
+</table>

+ 14 - 0
main/template/rainbow/auth/inscription.tpl

@@ -0,0 +1,14 @@
+{%
+    extends hide_header == true
+    ? template ~ "/layout/blank.tpl"
+    : template ~ "/layout/layout_1_col.tpl"
+%}
+
+{% block content %}
+
+{{ inscription_header }}
+{{ inscription_content }}
+{{ form }}
+{{ text_after_registration }}
+
+{% endblock %}

+ 20 - 0
main/template/rainbow/auth/layout.php

@@ -0,0 +1,20 @@
+<?php
+/* For licensing terms, see /license.txt */
+
+/**
+* Layout (principal view) used for structuring other views
+* @author Christian Fasanando <christian1827@gmail.com> - Beeznest
+* @package chamilo.auth
+*/
+
+// Access rights: anonymous users can't do anything useful here.
+api_block_anonymous_users();
+
+// Header
+Display::display_header('');
+
+// Display
+echo $content;
+
+// Footer
+Display::display_footer();

+ 7 - 0
main/template/rainbow/auth/lost_password.tpl

@@ -0,0 +1,7 @@
+{% extends template ~ "/layout/layout_1_col.tpl" %}
+
+{% block content %}
+
+{{ form }}
+
+{% endblock %}

+ 194 - 0
main/template/rainbow/auth/session_catalog.tpl

@@ -0,0 +1,194 @@
+{% extends template ~ "/layout/main.tpl" %}
+
+{% block body %}
+    <script type="text/javascript">
+        $(document).ready(function () {
+            $('#date').datepicker({
+                dateFormat: 'yy-mm-dd'
+            });
+        });
+    </script>
+
+    <div class="col-md-12">
+        <div class="row">
+            {% if show_courses %}
+                <div class="col-md-4">
+                    <div class="section-title-catalog">{{ 'Courses'|get_lang }}</div>
+                    {% if not hidden_links %}
+                        <form class="form-horizontal" method="post" action="{{ course_url }}">
+                            <div class="form-group">
+                                <div class="col-sm-12">
+                                    <input type="hidden" name="sec_token" value="{{ search_token }}">
+                                    <input type="hidden" name="search_course" value="1" />
+                                    <div class="input-group">
+                                        <input type="text" name="search_term" class="form-control" />
+                                        <span class="input-group-btn">
+                                            <button class="btn btn-default" type="submit"><em class="fa fa-search"></em> {{ 'Search'|get_lang }}</button>
+                                        </span>
+                                    </div>
+                                </div>
+                            </div>
+                        </form>
+                    {% endif %}
+                </div>
+            {% endif %}
+
+            <div class="col-md-8">
+                {% if show_sessions %}
+                    <div class="section-title-catalog">{{ 'Sessions'|get_lang }}</div>
+
+                    <div class="row">
+                        <div class="col-md-6">
+                            <form class="form-horizontal" method="post" action="{{ _p.web_self }}?action=display_sessions">
+                                <div class="form-group">
+                                    <label class="col-sm-3">{{ "ByDate"|get_lang }}</label>
+                                    <div class="col-sm-9">
+                                        <div class="input-group">
+                                            <input type="date" name="date" id="date" class="form-control" value="{{ search_date }}" readonly>
+                                            <span class="input-group-btn">
+                                                <button class="btn btn-default" type="submit"><em class="fa fa-search"></em> {{ 'Search'|get_lang }}</button>
+                                            </span>
+                                        </div>
+                                    </div>
+                                </div>
+                            </form>
+                        </div>
+                        <div class="col-md-6">
+                            <form class="form-horizontal" method="post" action="{{ _p.web_self }}?action=search_tag">
+                                <div class="form-group">
+                                    <label class="col-sm-4">{{ "ByTag"|get_lang }}</label>
+                                    <div class="col-sm-8">
+                                        <div class="input-group">
+                                            <input type="text" name="search_tag" class="form-control" value="{{ search_tag }}" />
+                                            <span class="input-group-btn">
+                                                <button class="btn btn-default" type="submit"><em class="fa fa-search"></em> {{ 'Search'|get_lang }}</button>
+                                            </span>
+                                        </div>
+                                    </div>
+                                </div>
+                            </form>
+                        </div>
+                    </div>
+                {% endif %}
+            </div>
+        </div>
+    </div>
+
+    <section id="session-list">
+        <div class="col-md-12">
+            <div class="row">
+                {% for session in sessions %}
+                    <div class="col-xs-6 col-sm-6 col-md-3 session-col">
+                        <div class="item" id="session-{{ session.id }}">
+                            <img src="{{ session.image ? _p.web_upload ~ session.image : _p.web_img ~ 'session_default.png' }}">
+
+                            <div class="information-item">
+                                <h3 class="title-session">
+                                    <a href="{{ _p.web ~ 'session/' ~ session.id ~ '/about/' }}" title="{{ session.name }}">
+                                        {{ session.name }}
+                                    </a>
+                                </h3>
+                                <ul class="list-unstyled">
+                                    {% if show_tutor %}
+                                        <li class="author-session">
+                                            <em class="fa fa-user"></em> {{ session.coach_name }}
+                                        </li>
+                                    {% endif %}
+                                    <li class="date-session">
+                                        <em class="fa fa-calendar-o"></em> {{ session.date }}
+                                    </li>
+                                    {% if session.tags %}
+                                        <li class="tags-session">
+                                            <em class="fa fa-tags"></em> {{ session.tags|join(', ')}}
+                                        </li>
+                                    {% endif %}
+                                </ul>
+
+                                <div class="options">
+                                    {% if not _u.logged %}
+                                        <p>
+                                            <a class="btn btn-info btn-block btn-sm" href="{{ "#{_p.web}session/#{session.id}/about/" }}" title="{{ session.name }}">{{ 'SeeCourseInformationAndRequirements'|get_lang }}</a>
+                                        </p>
+                                    {% else %}
+                                        <p>
+                                            <a class="btn btn-info btn-block btn-sm" role="button" data-toggle="popover" id="session-{{ session.id }}-sequences">{{ 'SeeSequences'|get_lang }}</a>
+                                        </p>
+                                        <p class="buttom-subscribed">
+                                            {% if session.is_subscribed %}
+                                                {{ already_subscribed_label }}
+                                            {% else %}
+                                                {{ session.subscribe_button }}
+                                            {% endif %}
+                                        </p>
+                                    {% endif %}
+                                </div>
+                            </div>
+
+                            {% if _u.logged %}
+                                <script>
+                                    $('#session-{{ session.id }}-sequences').popover({
+                                        placement: 'bottom',
+                                        html: true,
+                                        trigger: 'click',
+                                        content: function () {
+                                            var content = '';
+
+                                            {% if session.sequences %}
+                                                {% for sequence in session.sequences %}
+                                                    content += '<p class="lead">{{ sequence.name }}</p>';
+
+                                                    {% if sequence.requirements %}
+                                                        content += '<p><em class="fa fa-sort-amount-desc"></em> {{ 'RequiredSessions'|get_lang }}</p>';
+                                                        content += '<ul>';
+
+                                                        {% for requirement in sequence.requirements %}
+                                                            content += '<li>';
+                                                            content += '<a href="{{ _p.web ~ 'session/' ~ requirement.id ~ '/about/' }}">{{ requirement.name }}</a>';
+                                                            content += '</li>';
+                                                        {% endfor %}
+
+                                                        content += '</ul>';
+                                                    {% endif %}
+
+                                                    {% if sequence.dependencies %}
+                                                        content += '<p><em class="fa fa-sort-amount-desc"></em> {{ 'DependentSessions'|get_lang }}</p>';
+                                                        content += '<ul>';
+
+                                                        {% for dependency in sequence.dependencies %}
+                                                            content += '<li>';
+                                                            content += '<a href="{{ _p.web ~ 'session/' ~ dependency.id ~ '/about/' }}">{{ dependency.name }}</a>';
+                                                            content += '</li>';
+                                                        {% endfor %}
+
+                                                        content += '</ul>';
+                                                    {% endif %}
+
+                                                    {% if session.sequences|length > 1 %}
+                                                        content += '<hr>';
+                                                    {% endif %}
+                                                {% endfor %}
+                                            {% else %}
+                                                content = "{{ 'NoDependencies'|get_lang }}";
+                                            {% endif %}
+
+                                            return content;
+                                        }
+                                    });
+                                </script>
+                            {% endif %}
+                        </div>
+                    </div>
+                {% else %}
+                    <div class="col-xs-12">
+                        <div class="alert alert-warning">
+                            {{ 'NoResults'|get_lang }}
+                        </div>
+                    </div>
+                {% endfor %}
+            </div>
+        </div>
+    </section>
+
+    {{ catalog_pagination }}
+
+{% endblock %}

+ 4 - 0
main/template/rainbow/auth/set_temp_password.tpl

@@ -0,0 +1,4 @@
+{% if error_message %}
+{{ error_message }}
+{% endif %}
+{{form}}

+ 153 - 0
main/template/rainbow/chat/video.tpl

@@ -0,0 +1,153 @@
+<div id="chat-video-panel">
+    <div class="alert alert-warning alert-dismissible fade in">
+        <button type="button" class="close" data-dismiss="alert" aria-label="{{ 'Close'|get_lang }}">
+            <span aria-hidden="true">&times;</span>
+        </button>
+        <h4>{{ 'Warning'|get_lang }}</h4>
+        <p>
+            <em class="fa fa-warning"></em> {{ 'AvoidChangingPageAsThisWillCutYourCurrentVideoChatSession'|get_lang }}
+        </p>
+    </div>
+    <div class="row">
+        <div class="col-md-8 col-sm-7">
+            <div class="thumbnail video-chat-user">
+                <div id="chat-remote-video"></div>
+                <div class="caption">
+                    <p class="text-muted text-center">{{ "ChatWithXUser"|get_lang|format(chat_user.complete_name) }}</p>
+                </div>
+            </div>
+        </div>
+        <div class="col-md-4 col-sm-5">
+            <div class="thumbnail">
+                <div id="chat-local-video"></div>
+                <div class="caption">
+                    <p class="text-muted text-center">{{ user_local.complete_name }}</p>
+                </div>
+            </div>
+            <div id="connection-status"></div>
+            <div class="chat-friends">
+                <div class="panel-group" id="blocklistFriends" role="tablist" aria-multiselectable="true">
+                    <div class="panel panel-default">
+                        <div class="panel-heading" role="tab" id="headingOne">
+                            <h4 class="panel-title">
+                                <a role="button" data-toggle="collapse" data-parent="#blocklistFriends" href="#listFriends" aria-expanded="true" aria-controls="listFriends">
+                                    {{ "SocialFriend" | get_lang }}
+                                </a>
+                            </h4>
+                        </div>
+                        <div id="listFriends" class="panel-collapse collapse in" role="tabpanel" aria-labelledby="headingOne">
+                            {{ block_friends }}
+                        </div>
+                    </div>
+                </div>
+            </div>
+        </div>
+    </div>
+</div>
+<script>
+    (function () {
+        var VideoChat = {
+            init: function () {
+                var isCompatible = !!Modernizr.prefixed('RTCPeerConnection', window);
+
+                var notifyNotSupport = function () {
+                    $.get('{{ _p.web_ajax }}chat.ajax.php', {
+                        action: 'notify_not_support',
+                        to:{{ chat_user.id }}
+                    });
+                };
+
+                var startVideoChat = function () {
+                    var webRTC = new SimpleWebRTC({
+                        localVideoEl: 'chat-local-video',
+                        remoteVideosEl: '',
+                        autoRequestMedia: true
+                    });
+
+                    webRTC.on('readyToCall', function () {
+                        webRTC.joinRoom('{{ room_name }}');
+                    });
+                    webRTC.on('videoAdded', function (video, peer) {
+                        $(video).addClass('skip');
+                        $('#chat-remote-video').html(video);
+
+                        if (peer && peer.pc) {
+                            peer.pc.on('iceConnectionStateChange', function () {
+                                var alertDiv = $('<div>')
+                                        .addClass('alert');
+
+                                switch (peer.pc.iceConnectionState) {
+                                    case 'checking':
+                                        alertDiv
+                                            .addClass('alert-info')
+                                            .html('<em class="fa fa-spinner fa-spin"></em> ' + "{{ 'ConnectingToPeer'|get_lang }}");
+                                        break;
+                                    case 'connected':
+                                        //no break
+                                    case 'completed':
+                                        alertDiv
+                                            .addClass('alert-success')
+                                            .html('<em class="fa fa-commenting"></em> ' + "{{ 'ConnectionEstablished'|get_lang }}");
+                                        break;
+                                    case 'disconnected':
+                                        alertDiv
+                                            .addClass('alert-info')
+                                            .html('<em class="fa fa-frown-o"></em> ' + "{{ 'Disconnected'|get_lang }}");
+                                        break;
+                                    case 'failed':
+                                        alertDiv
+                                            .addClass('alert-danger')
+                                            .html('<em class="fa fa-times"></em> ' + "{{ 'ConnectionFailed'|get_lang }}");
+                                        break;
+                                    case 'closed':
+                                        alertDiv
+                                            .addClass('alert-danger')
+                                            .html('<em class="fa fa-close"></em> ' + "{{ 'ConnectionClosed'|get_lang }}");
+                                        break;
+                                }
+
+                                $('#connection-status').html(alertDiv);
+                            });
+                        }
+                    });
+                    webRTC.on('videoRemoved', function (video, peer) {
+                        video.src = '';
+                    });
+                    webRTC.on('iceFailed', function (peer) {
+                        var alertDiv = $('<div>')
+                            .addClass('alert-danger')
+                            .html('<em class="fa fa-close"></em> ' + "{{ 'LocalConnectionFailed'|get_lang }}");
+
+                        $('#connection-status').html(alertDiv);
+                    });
+                    webRTC.on('connectivityError', function (peer) {
+                        var alertDiv = $('<div>')
+                            .addClass('alert-danger')
+                            .html('<em class="fa fa-close"></em> ' + "{{ 'RemoteConnectionFailed'|get_lang }}");
+
+                        $('#connection-status').html(alertDiv);
+                    });
+                };
+
+                if (!isCompatible) {
+                    notifyNotSupport();
+
+                    $('#chat-video-panel').remove();
+                    return;
+                }
+
+                $('#messages').remove();
+
+                startVideoChat();
+
+                window.onbeforeunload = function () {
+                    return "{{ 'AvoidChangingPageAsThisWillCutYourCurrentVideoChatSession'|get_lang }}";
+                };
+            }
+        };
+
+        $(document).on('ready', function () {
+            VideoChat.init();
+        });
+    })();
+</script>

+ 34 - 0
main/template/rainbow/course_description/edit.tpl

@@ -0,0 +1,34 @@
+{{javascript}}
+
+{% for message in messages %}
+    {{ message }}
+{% endfor %}
+
+{% if is_allowed_to_edit %}
+    <div class="btn-toolbar actions-bar" >
+        <div class="btn-group">
+            <a href="{{root}}&amp;action=listing" class="btn btn-default" title="{{'ImportCSV'|get_lang}}">
+                <em class="size-32 icon-back"></em>
+            </a>
+        </div>
+        <div class="btn-group edit new">
+            {% 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>    
+            {% endfor %}
+        </div>
+    </div>
+{% endif %}
+
+
+{% if type.question %}
+    <div class="normal-message">
+        <div>
+            <strong>{{'QuestionPlan'|get_lang}}</strong>
+        </div>
+        {{type.question}}
+    </div>
+{% endif %}
+
+{{form.return_form()}}

+ 109 - 0
main/template/rainbow/course_description/index.tpl

@@ -0,0 +1,109 @@
+{{javascript}}
+
+<script type="text/javascript">
+
+{% if is_allowed_to_edit %}
+    var sec_token = '{{sec_token}}';
+{% endif %}
+
+    
+ 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 f = function(data){
+        if(data.success){
+            item.remove();
+        }
+        message.update(data);
+        $(btn).removeClass("loading");
+    };
+    CourseDescription.del(c_id, id, f);
+    $(btn).addClass("loading");
+ }
+
+ function delete_all(){
+    if(!confirm("{{'ConfirmYourChoice'|get_lang}}")){
+        return false;
+    } 
+    
+    var f = function(data){
+        if(data.success){
+            var item = $('.course_descriptions');
+            item.remove();
+        }
+        message.update(data);
+    };
+    CourseDescription.delete_by_course({{c_id}}, {{session_id}}, f);
+    
+ }
+ 
+</script>
+
+{% for message in messages %}
+    {{ message }}
+{% endfor %}
+
+{% if is_allowed_to_edit %}
+    <div class="btn-toolbar actions-bar" >
+        <div class="btn-group edit new">
+            {% 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>    
+            {% endfor %}
+        </div>
+        <div class="btn-group edit">
+            <a href="{{root}}&amp;action=import_csv" class="btn btn-default" title="{{'ImportCSV'|get_lang}}">
+                <em class="size-32 icon-import-csv"></em>
+            </a>
+            <a href="{{root}}&amp;action=export_csv" class="btn btn-default" title="{{'ExportAsCSV'|get_lang}}">
+                <em class="size-32 icon-export-csv"></em>
+            </a>
+            <a href="javascript:void(0)" onclick="delete_all();return false;" class="btn btn-default" title="{{'DeleteAll'|get_lang}}">
+                <em class="size-32 icon-delete-all"></em>
+            </a>
+        </div>
+    </div>
+{% endif %}
+
+<ul style="list-style: none; margin-left:0;" class="course_descriptions">
+{% for description in descriptions %}
+    <li id="description_{{description.id}}" class="course_description" data-id="{{description.id}}" data-c_id="{{description.c_id}}" data-type="course_description">
+        <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}}" 
+                       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}}" 
+                       title="{{'Edit'|get_lang}}">
+                        <em class="size-22 icon-edit"></em>
+                    </a>
+                {% else %}
+                    <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>
+        <div class="sectioncomment">
+            {{description.content}}
+        </div>
+    </li>
+{% endfor %}
+</ul>

+ 15 - 0
main/template/rainbow/course_description/upload.tpl

@@ -0,0 +1,15 @@
+{{javascript}}
+
+{% for message in messages %}
+    {{ message }}
+{% endfor %}
+
+<div class="btn-toolbar actions-bar" >
+    <div class="btn-group">
+        <a href="{{root}}&amp;action=listing" class="btn" title="{{'ImportCSV'|get_lang}}">
+            <em class="size-32 icon-back"></em>
+        </a>
+    </div>
+</div>
+
+{{form.return_form()}}

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

@@ -0,0 +1,59 @@
+{% if just_created == 1%}
+{{ just_created_link }}
+<h3>{{ 'JustCreated'|get_lang }} {{ course_title }}</h3>
+<hr />
+{% endif %}
+
+<h3>{{ 'ThingsToDo'|get_lang }}</h3>
+<br />
+
+<div id="course_thing_to_do" class="row">
+    <div class="col-md-3">
+        <div class="thumbnail">
+            {{ 'info.png' | img(64, 'AddCourseDescription'|get_lang ) }}
+            <div class="caption">
+                <a href="{{ _p.web_main }}course_description/?cidReq={{ course_id }}" class="btn btn-default">
+                    <em class="fa fa-info-circle"></em> {{'AddCourseDescription'|get_lang}}
+                </a>
+            </div>
+        </div>
+    </div>
+    <div class="col-md-3">
+        <div class="thumbnail">
+            {{ 'folder_document.png' | img(64, 'UploadADocument'|get_lang ) }}
+            <div class="caption">
+                <a href="{{ _p.web_main }}document/document.php?cidReq={{ course_id }}" class="btn btn-default">
+                    <em class="fa fa-paper-plane"></em> {{'UploadADocument'|get_lang}}
+                </a>
+            </div>
+        </div>
+    </div>
+    <div class="col-md-3">
+        <div class="thumbnail">
+            {{ 'forum.png' | img(64, 'AddForum'|get_lang ) }}
+            
+            <div class="caption">
+                <a href="{{ _p.web_main }}forum/index.php?cidReq={{ course_id }}" class="btn btn-default">
+                    <em class="fa fa-users"></em> {{ 'AddForum'|get_lang }}
+                </a>
+            </div>
+        </div>
+    </div>
+    {% if ("allow_user_course_subscription_by_course_admin" | get_setting) == 'true' or _u.is_admin == 1 %}
+    <div class="col-md-3">
+        <div class="thumbnail">
+        
+        {{ 'user.png' | img(64, 'SubscribeUserToCourse'|get_lang ) }}
+            <div class="caption">
+            <a href="{{ _p.web_main }}user/subscribe_user.php?cidReq={{ course_id }}" class="btn btn-default">
+                <em class="fa fa-user-plus"></em> {{ 'SubscribeUserToCourse'|get_lang }}
+            </a>
+            </div>
+        </div>
+    </div>
+    {% endif %}
+
+
+</div>
+
+<div class="clear"></div>

+ 190 - 0
main/template/rainbow/document/record_audio.tpl

@@ -0,0 +1,190 @@
+<div class="alert alert-warning">
+    <span class="fa fa-warning fa-fw" aria-hidden="true"></span> {{ 'WamiNeedFilename'|get_lang }}
+</div>
+
+<div id="record-audio-recordrtc" class="row text-center">
+    <form>
+        <div class="row">
+            <div class="col-sm-4 col-sm-offset-4">
+                <div class="form-group">
+                    <span class="fa fa-microphone fa-5x fa-fw" aria-hidden="true"></span>
+                    <span class="sr-only">{{ 'RecordAudio'|get_lang }}</span>
+                </div>
+                <div class="form-group">
+                    <input type="text" name="audio_title" id="audio-title-rtc" class="form-control" placeholder="{{ 'InputNameHere'|get_lang }}">
+                </div>
+            </div>
+        </div>
+        <div class="text-center">
+            <div class="form-groups">
+                <button class="btn btn-primary" type="button" id="btn-start-record">
+                    <span class="fa fa-circle fa-fw" aria-hidden="true"></span> {{ 'StartRecordingAudio'|get_lang }}
+                </button>
+                <button class="btn btn-success" type="button" id="btn-stop-record" disabled>
+                    <span class="fa fa-square fa-fw" aria-hidden="true"></span> {{ 'StopRecordingAudio'|get_lang }}
+                </button>
+            </div>
+        </div>
+    </form>
+</div>
+
+<div class="row" id="record-audio-wami">
+    <div class="col-sm-3 col-sm-offset-3">
+        <br>
+        <form>
+            <div class="form-group">
+                <input type="text" name="audio_title" id="audio-title-wami" class="form-control" placeholder="{{ 'InputNameHere'|get_lang }}">
+            </div>
+            <div class="form-group text-center">
+                <button class="btn btn-primary" type="button" id="btn-activate-wami">
+                    <span class="fa fa-check fa-fw" aria-hidden=""></span> {{ 'Activate'|get_lang }}
+                </button>
+            </div>
+        </form>
+    </div>
+    <div class="col-sm-3">
+        <div id="record-audio-wami-container" class="wami-container"></div>
+    </div>
+</div>
+
+<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');
+
+            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);
+                    btnStop.prop('disabled', false);
+                    btnStart.prop('disabled', true);
+                }
+
+                function errorCallback(error) {
+                    alert(error.message);
+                }
+            });
+
+            btnStop.on('click', function () {
+                if (!recordRTC) {
+                    return;
+                }
+
+                recordRTC.stopRecording(function (audioURL) {
+                    var recordedBlob = recordRTC.getBlob(),
+                            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;
+                            }
+
+                            window.location.reload();
+                        }
+                    });
+
+                    $('#audio-title-rtc').prop('readonly', false);
+                    btnStop.prop('disabled', true);
+                    btnStart.prop('disabled', false);
+                });
+            });
+        }
+
+        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();
+    });
+</script>

+ 48 - 0
main/template/rainbow/document/recycle.tpl

@@ -0,0 +1,48 @@
+{% macro bytesToSize(bytes) %}
+{% spaceless %}
+{% set kilobyte = 1024 %}
+{% set megabyte = kilobyte * 1024 %}
+{% set gigabyte = megabyte * 1024 %}
+{% set terabyte = gigabyte * 1024 %}
+
+{% if bytes < kilobyte %}
+{{ bytes ~ ' B' }}
+{% elseif bytes < megabyte %}
+{{ (bytes / kilobyte)|number_format(2, '.') ~ ' KB' }}
+{% elseif bytes < gigabyte %}
+{{ (bytes / megabyte)|number_format(2, '.') ~ ' MB' }}
+{% elseif bytes < terabyte %}
+{{ (bytes / gigabyte)|number_format(2, '.') ~ ' GB' }}
+{% else %}
+{{ (bytes / terabyte)|number_format(2, '.') ~ ' TB' }}
+{% endif %}
+{% endspaceless %}
+{% endmacro %}
+
+{% if files %}
+    <table class="table">
+        <tr>
+            <th>{{ 'Path' | get_lang }}</th>
+            <th>{{ 'Size' | get_lang }}</th>
+            <th>{{ 'Actions' | get_lang }}</th>
+        </tr>
+    {% for file in files %}
+        <tr>
+            <td>
+                {{ file.path }}
+            </td>
+            <td>
+                {{ _self.bytesToSize(file.size) }}
+            </td>
+
+            <td>
+                <a href="{{ web_self }}?{{web_cid_query}}&action=download&id={{ file.id }}" class="btn btn-default">{{ 'Download' | get_lang }}</a>
+                <a href="{{ web_self }}?{{web_cid_query}}&action=delete&id={{ file.id }}" class="btn btn-danger">{{ 'Delete' | get_lang }}</a>
+            </td>
+        </tr>
+    {% endfor %}
+    </table>
+{% else %}
+    {{ 'NoData' | get_lang }}
+{% endif %}
+

+ 139 - 0
main/template/rainbow/exercise/oral_expression.tpl

@@ -0,0 +1,139 @@
+<div class="alert alert-warning">
+    <span class="fa fa-warning fa-fw" aria-hidden="true"></span> {{ 'WamiNeedFilename'|get_lang }}
+</div>
+
+<div id="record-audio-recordrtc" class="row text-center">
+    <form>
+        <div class="row">
+            <div class="col-sm-4 col-sm-offset-4">
+                <div class="form-group">
+                    <span class="fa fa-microphone fa-5x fa-fw" aria-hidden="true"></span>
+                    <span class="sr-only">{{ 'RecordAudio'|get_lang }}</span>
+                </div>
+            </div>
+            <div class="col-sm-12">
+                <div class="form-groups">
+                    <button class="btn btn-primary" type="button" id="btn-start-record">
+                        <span class="fa fa-circle fa-fw" aria-hidden="true"></span> {{ 'StartRecordingAudio'|get_lang }}
+                    </button>
+                    <button class="btn btn-success" type="button" id="btn-stop-record" disabled>
+                        <span class="fa fa-square fa-fw" aria-hidden="true"></span> {{ 'StopRecordingAudio'|get_lang }}
+                    </button>
+                </div>
+            </div>
+        </div>
+    </form>
+</div>
+
+<div class="row" id="record-audio-wami">
+    <div class="col-sm-4 col-sm-offset-4 text-center">
+        <div id="record-audio-wami-container" class="wami-container"></div>
+    </div>
+</div>
+
+<script>
+    $(document).on('ready', function () {
+        function useRecordRTC() {
+            $('#record-audio-recordrtc').show();
+            var mediaConstraints = {audio: true},
+                    recordRTC = null,
+                    btnStart = $('#btn-start-record'),
+                    btnStop = $('#btn-stop-record');
+
+            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();
+
+                    btnStop.prop('disabled', false);
+                    btnStart.prop('disabled', true);
+                }
+
+                function errorCallback(error) {
+                    alert(error.message);
+                }
+            });
+
+            btnStop.on('click', function () {
+                if (!recordRTC) {
+                    return;
+                }
+
+                recordRTC.stopRecording(function (audioURL) {
+                    var recordedBlob = recordRTC.getBlob(),
+                            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'
+                    });
+
+                    btnStop.prop('disabled', true);
+                    btnStart.prop('disabled', false);
+                });
+            });
+        }
+
+        function useWami() {
+            $('#record-audio-wami').show();
+
+            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: '{{ 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, #record-audio-wami').hide();
+
+        var webRTCIsEnabled = navigator.webkitGetUserMedia || navigator.mozGetUserMedia || navigator.getUserMedia ||
+                navigator.mediaDevices.getUserMedia;
+
+        if (webRTCIsEnabled) {
+            useRecordRTC();
+
+            return;
+        }
+
+        useWami();
+    });
+</script>

+ 252 - 0
main/template/rainbow/exercise/submit.js.tpl

@@ -0,0 +1,252 @@
+<script>
+
+var DraggableAnswer = {
+    gallery: null,
+    trash: null,
+    deleteItem: function (item, insertHere) {
+        if (insertHere.find(".exercise-draggable-answer-option").length > 0) {
+            return false;
+        }
+
+        item.fadeOut(function () {
+            var $list = $('<ul>').addClass('gallery ui-helper-reset').appendTo(insertHere);
+
+            item.find('a.btn').remove();
+
+            var droppedId = item.attr('id'),
+                dropedOnId = insertHere.attr('id'),
+                originSelectId = 'window_' + droppedId + '_select',
+                value = dropedOnId.split('_')[2];
+
+            $('#' + originSelectId + ' option')
+                .filter(function (index) {
+                    return index === parseInt(value);
+                })
+                .attr("selected", true);
+
+            item.appendTo($list).fadeIn();
+        });
+    },
+    recycleItem: function (item) {
+        item.fadeOut(function () {
+            item
+                .find('a.btn')
+                .remove()
+                .end()
+                .find("img")
+                .end()
+                .appendTo(DraggableAnswer.gallery)
+                .fadeIn();
+        });
+
+        var droppedId = item.attr('id'),
+            originSelectId = 'window_' + droppedId + '_select';
+
+        $('#' + originSelectId + ' option:first').attr('selected', 'selected');
+    },
+    init: function (gallery, trash) {
+        this.gallery = gallery;
+        this.trash = trash;
+
+        $("li", DraggableAnswer.gallery).draggable({
+            cancel: "a.ui-icon",
+            revert: "invalid",
+            containment: "document",
+            helper: "clone",
+            cursor: "move"
+        });
+
+        DraggableAnswer.trash.droppable({
+            accept: ".exercise-draggable-answer > li",
+            hoverClass: "ui-state-active",
+            drop: function (e, ui) {
+                DraggableAnswer.deleteItem(ui.draggable, $(this));
+            }
+        });
+
+        DraggableAnswer.gallery.droppable({
+            drop: function (e, ui) {
+                DraggableAnswer.recycleItem(ui.draggable, $(this));
+            }
+        });
+    }
+};
+
+var MatchingDraggable = {
+    colorDestination: '#316B31',
+    curviness: 0,
+    connectorType: 'Straight',
+    initialized: false,
+    init: function (questionId) {
+        var windowQuestionSelector = '.window' + questionId + '_question',
+            countConnections = $(windowQuestionSelector).length,
+            colorArray = [],
+            colorArrayDestination = [];
+
+        if (countConnections > 0) {
+            colorArray = $.xcolor.analogous("#da0", countConnections);
+            colorArrayDestination = $.xcolor.analogous("#51a351", countConnections);
+        } else {
+            colorArray = $.xcolor.analogous("#da0", 10);
+            colorArrayDestination = $.xcolor.analogous("#51a351", 10);
+        }
+
+        jsPlumb.importDefaults({
+            DragOptions: {cursor: 'pointer', zIndex: 2000},
+            PaintStyle: {strokeStyle: '#000'},
+            EndpointStyle: {strokeStyle: '#316b31'},
+            Endpoint: 'Rectangle',
+            Anchors: ['TopCenter', 'TopCenter']
+        });
+
+        var exampleDropOptions = {
+            tolerance: 'touch',
+            hoverClass: 'dropHover',
+            activeClass: 'dragActive'
+        };
+
+        var destinationEndPoint = {
+            endpoint: ["Dot", {radius: 15}],
+            paintStyle: {fillStyle: MatchingDraggable.colorDestination},
+            isSource: false,
+            connectorStyle: {strokeStyle: MatchingDraggable.colorDestination, lineWidth: 8},
+            connector: [
+                MatchingDraggable.connectorType,
+                {curviness: MatchingDraggable.curviness}
+            ],
+            maxConnections: 1000,
+            isTarget: true,
+            dropOptions: exampleDropOptions,
+            beforeDrop: function (params) {
+                jsPlumb.select({source: params.sourceId}).each(function (connection) {
+                    jsPlumb.detach(connection);
+                });
+
+                var selectId = params.sourceId + "_select";
+                var value = params.targetId.split("_")[2];
+
+                $("#" + selectId + " option")
+                    .removeAttr('selected')
+                    .filter(function (index) {
+                        return index === parseInt(value);
+                    })
+                    .attr("selected", true);
+
+                return true;
+            }
+        };
+
+        var count = 0;
+        var sourceDestinationArray = [];
+
+        $(windowQuestionSelector).each(function (index) {
+            var windowId = $(this).attr("id");
+            var scope = windowId + "scope";
+            var destinationColor = colorArray[count].getHex();
+
+            var sourceEndPoint = {
+                endpoint: [
+                    "Dot",
+                    {radius: 15}
+                ],
+                paintStyle: {
+                    fillStyle: destinationColor
+                },
+                isSource: true,
+                connectorStyle: {
+                    strokeStyle: "#8a8888",
+                    lineWidth: 8
+                },
+                connector: [
+                    MatchingDraggable.connectorType,
+                    {curviness: MatchingDraggable.curviness}
+                ],
+                maxConnections: 1,
+                isTarget: false,
+                dropOptions: exampleDropOptions,
+                scope: scope
+            };
+
+            sourceDestinationArray[count + 1] = sourceEndPoint;
+
+            count++;
+
+            jsPlumb.addEndpoint(
+                windowId,
+                {
+                    anchor: ['RightMiddle', 'RightMiddle', 'RightMiddle', 'RightMiddle']
+                },
+                sourceEndPoint
+            );
+
+            var destinationCount = 0;
+
+            $(windowQuestionSelector).each(function (index) {
+                var windowDestinationId = $(this).attr("id");
+                destinationEndPoint.scope = scope;
+                destinationEndPoint.paintStyle.fillStyle = colorArrayDestination[destinationCount].getHex();
+                destinationCount++;
+
+                jsPlumb.addEndpoint(
+                    windowDestinationId + "_answer",
+                    {
+                        anchors: ['LeftMiddle', 'LeftMiddle', 'LeftMiddle', 'LeftMiddle']
+                    },
+                    destinationEndPoint
+                );
+            });
+        });
+
+        MatchingDraggable.attachBehaviour();
+    },
+    attachBehaviour: function () {
+        if (!MatchingDraggable.initialized) {
+            MatchingDraggable.initialized = true;
+        }
+    }
+};
+
+jsPlumb.ready(function () {
+    if ($(".drag_question").length > 0) {
+        MatchingDraggable.init();
+
+        $(document).scroll(function () {
+            jsPlumb.repaintEverything();
+        });
+
+        $(window).resize(function () {
+            jsPlumb.repaintEverything();
+        });
+    }
+});
+
+$(document).on('ready', function () {
+    DraggableAnswer.init(
+        $(".exercise-draggable-answer"),
+        $(".droppable")
+    );
+
+    // if shuffle answers
+    if ('{{ shuffle_answers }}' == '1') {
+        $('.exercise-draggable-answer').each(function(){
+            // get current ul
+            var $ul = $(this);
+            // get array of list items in current ul
+            var $liArr = $ul.children('li');
+            // sort array of list items in current ul randomly
+            $liArr.sort(function(a,b){
+                // Get a random number between 0 and 10
+                var temp = parseInt( Math.random()*100 );
+                // Get 1 or 0, whether temp is odd or even
+                var isOddOrEven = temp%2;
+                // Get +1 or -1, whether temp greater or smaller than 5
+                var isPosOrNeg = temp>5 ? 1 : -1;
+                // Return -1, 0, or +1
+                return( isOddOrEven*isPosOrNeg );
+            })
+            // append list items to ul
+            .appendTo($ul);
+        });
+    }
+});
+</script>

+ 107 - 0
main/template/rainbow/export/table_pdf.tpl

@@ -0,0 +1,107 @@
+{{ organization }}
+
+<h2 align="center"> {{ pdf_title }} </h2>
+
+{% if pdf_description %}
+    {{ pdf_description }}
+    <br /><br />
+{% endif %}
+
+<table align="center" width="100%">
+    {% if pdf_student_info %}
+    <tr>
+        <td>
+            <strong>{{ "Student" | get_lang }}:</strong>  {{ pdf_student_info.complete_name }}
+        </td>
+    </tr>
+    {% endif %}
+
+
+    {% if pdf_teachers %}
+        <tr>
+            <td>
+                <strong>{{ "Teacher" | get_lang }}:</strong> {{ pdf_teachers }}
+            </td>
+        </tr>
+    {% endif %}
+
+    {% if pdf_session_info %}
+        <tr>
+            <td>
+                <strong>{{ "Session" | get_lang }}:</strong> {{ pdf_session_info.name }}
+            </td>
+
+            {% if pdf_session_info.description %}
+            <td>
+                <strong>{{ "Description" | get_lang }}:</strong> {{ pdf_session_info.description }}
+            </td>
+            {% endif %}
+        </tr>
+
+        {% if pdf_session_info.access_start_date != '' and pdf_session_info.access_end_date != '0000-00-00' %}
+        <tr>
+            <td>
+                <strong>{{ "PeriodToDisplay" | get_lang }}:</strong> {{ "FromDateXToDateY"| get_lang | format(pdf_session_info.access_start_date, pdf_session_info.access_end_date ) }}
+            </td>
+        </tr>
+        {% endif %}
+    {% endif %}
+
+    {% if pdf_course_info %}
+    <tr>
+        <td>
+            <strong>{{ "Course" | get_lang }}:</strong> {{ pdf_course_info.title }} ({{ pdf_course_info.code }})
+
+            {% if pdf_course_category %}
+            <strong>{{ "Category" | get_lang }}:</strong> {{ pdf_course_category }}
+            {% endif %}
+
+        </td>
+    </tr>
+    {% endif %}
+
+    {% if pdf_date %}
+    <tr>
+        <td>
+            <strong>{{ "Date" | get_lang }}:</strong> {{ pdf_date }}
+        </td>
+    </tr>
+    {% endif %}
+
+</table>
+
+
+{% if show_grade_generated_date == true %}
+<h5 align="right">
+    {{ 'GradeGeneratedOnX' | get_lang | format("now"| date("d/m/Y")) }}
+</h5>
+{% endif %}
+
+<br />
+
+{{ pdf_content }}
+
+{% if add_signatures == true %}
+    <br />
+    <br />
+
+    <table style="text-align:center" width="100%">
+        <tr>
+            <td>
+                _____________________________
+                <br />
+                {{ "Drh" | get_lang }}
+            </td>
+            <td>
+                _____________________________
+                <br />
+                {{ "Teacher" | get_lang }}
+            </td>
+            <td>
+                _____________________________
+                <br />
+                {{ "Date" | get_lang }}
+            </td>
+        </tr>
+    </table>
+{% endif %}

+ 87 - 0
main/template/rainbow/gamification/my_progress.tpl

@@ -0,0 +1,87 @@
+<div class="my-progress row">
+    <div class="col-md-3">
+        <div class="panel panel-default">
+            <div class="panel-body">
+                <div class="profile-user">
+                    {{ user_avatar }}
+                    <div class="username">{{ user.getCompleteName() }}</div>
+                    <div class="star-progress">
+                        <span class="pull-right">{{ 'XPoints'|get_lang|format(gamification_points) }}</span>
+
+                        {% if gamification_stars > 0 %}
+                            {% for i in 1..gamification_stars %}
+                                <em class="fa fa-star"></em>
+                            {% endfor %}
+                        {% endif %}
+
+                        {% if 4 - gamification_stars > 0 %}
+                            {% for i in 1..(4 - gamification_stars) %}
+                                <em class="fa fa-star in"></em>
+                            {% endfor %}
+                        {% endif %}
+                    </div>
+
+                    <div class="progress">
+                        <div class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="{{ gamification_progress }}" aria-valuemin="0" aria-valuemax="100" style="width: {{ gamification_progress }}%">
+                            <span class="sr-only">{{ gamification_progress }} Complete (success)</span>
+                        </div>
+                    </div>
+
+                    <div class="progress-percentage text-right">{{ 'XPercent'|get_lang|format(gamification_progress) }}</div>
+                </div>
+            </div>
+        </div>
+        <div class="panel panel-default">
+            <div class="panel-heading">
+                {{ 'ShowProgress'|get_lang }}
+            </div>
+            <div class="panel-body">
+                <ul class="list-course">
+                    {% for session in sessions %}
+                    <li><a href="{{ _p.self ~ '?' ~ {"session_id": session.getId}|url_encode() }}" class="list-course-item {{ current_session and session.getId == current_session.getId ? 'active' }}">
+                            <em class="fa fa-chevron-circle-right"></em> {{ session.getName }}
+                        </a>
+                    </li>
+                    {% endfor %}
+                </ul>
+            </div>
+        </div>
+    </div>
+
+    <div class="col-md-9">
+        {% if current_session %}
+
+            <div class="panel panel-default">
+                <div class="panel-heading"><em class="fa fa-book"></em> {{ current_session.getName() }}</div>
+                <div class="panel-body">
+                    {% for course_id, course in session_data %}
+                    <h3><img src="{{ 'blackboard_blue.png'|icon(32) }}"/> {{ course.title }}</h3>
+                    <div class="panel-group" id="course-accordion" role="tablist" aria-multiselectable="true">
+                        {% for stats_url in course.stats %}
+                        {% set panel_id = course_id ~ '-' ~ loop.index %}
+                        <div class="panel panel-default">
+                            <div class="panel-heading" role="tab" id="heading-{{ panel_id }}">
+                                <h4 class="panel-title">
+                                    <a role="button" data-toggle="collapse" data-parent="#course-accordion" href="#collapse-{{ panel_id }}" aria-expanded="true" aria-controls="collapse-{{ panel_id }}">
+                                        {{ stats_url.0 }}
+                                    </a>
+                                </h4>
+                            </div>
+                            <div id="collapse-{{ panel_id }}" class="panel-collapse collapse in" role="tabpanel" aria-labelledby="heading-{{ panel_id }}">
+                                <div class="panel-body">
+                                    <div class="embed-container">
+                                        <iframe src="{{ _p.web_main ~ stats_url.1 }}"></iframe>
+                                    </div>
+                                </div>
+                            </div>
+                        </div>
+                        {% endfor %}
+                    </div>
+                    {% endfor %}
+                </div>
+            </div>
+
+
+        {% endif %}
+    </div>
+</div>

+ 100 - 0
main/template/rainbow/glossary/glossary_auto.js.tpl

@@ -0,0 +1,100 @@
+{% if add_ready %}
+$(document).ready(function() {
+    $(window).load(function () {
+{% endif %}
+
+        var my_text = $(".glossary-content").html();
+        var ajaxRequestUrl = "{{ _p.web }}main/glossary/glossary_ajax_request.php";
+        var imageSource = "{{ _p.web }}main/inc/lib/javascript/indicator.gif";
+        var indicatorImage ='<img src="' + imageSource + '" />';
+
+        $.ajax({
+            contentType: "application/x-www-form-urlencoded",
+            beforeSend: function(content_object) {},
+            type: "POST",
+            url: ajaxRequestUrl,
+            data: "glossary_data=true",
+            success: function(datas) {
+                if (datas.length==0) {
+                    return false;
+                }
+                // glossary terms
+                data_terms=datas.split("[|.|_|.|-|.|]");
+                var complex_array = new Array();
+                var cp_complex_array = new Array();
+                for(i=0;i<data_terms.length;i++) {
+                    specific_terms=data_terms[i].split("__|__|");
+                    var real_term = specific_terms[1]; // glossary term
+                    var real_code = specific_terms[0]; // glossary id
+                    complex_array[real_code] = real_term;
+                    cp_complex_array[real_code] = real_term;
+                }
+
+                complex_array.reverse();
+
+                for (var my_index in complex_array) {
+                    n = complex_array[my_index];
+                    if (n == null) {
+                        n = '';
+                    } else {
+                        for (var cp_my_index in cp_complex_array) {
+                            cp_data = cp_complex_array[cp_my_index];
+                            if (cp_data == null) {
+                                cp_data = '';
+                            } else {
+                                if (cp_data == n) {
+                                    my_index = cp_my_index;
+                                }
+                            }
+                        }
+                        $('body').removeHighlight().highlight(n, my_index);
+                    }
+                }
+
+                var complex_array = new Array();
+                //mouse on click
+                $("body").on("click", ".glossary-ajax", function(e) {
+                    random_id = Math.round(Math.random()*100);
+                    div_show_id = "div_show_id";
+                    div_content_id = "div_content_id";
+
+                    $(this).append("<div id="+div_show_id+"><div id="+div_content_id+">&nbsp;</div></div>");
+                    var $target = $(this);
+
+                    //$("#"+div_show_id).dialog("destroy");
+                    $("#"+div_show_id).dialog({
+                        autoOpen: false,
+                        width: 600,
+                        height: 200,
+                        position:  { my: 'left top', at: 'right top', of: $target },
+                        close: function(){
+                            $("div#"+div_show_id).remove();
+                            $("div#"+div_content_id).remove();
+                        }
+                    });
+
+                    notebook_id = $(this).attr("name");
+                    data_notebook = notebook_id.split("link");
+                    my_glossary_id = data_notebook[1];
+
+                    $.ajax({
+                        contentType: "application/x-www-form-urlencoded",
+                        beforeSend: function(content_object) {
+                            $("div#"+div_content_id).html(indicatorImage);
+                        },
+                        type: "POST",
+                        url: ajaxRequestUrl,
+                        data: "glossary_id="+my_glossary_id,
+                        success: function(datas) {
+                            $("div#"+div_content_id).html(datas);
+                            $("#"+div_show_id).dialog("open");
+                        }
+                    });
+                });
+            }
+        });
+{% if add_ready %}
+    });
+});
+
+{% endif %}

+ 48 - 0
main/template/rainbow/glossary/glossary_manual.js.tpl

@@ -0,0 +1,48 @@
+var ajaxRequestUrl = "{{ _p.web }}main/glossary/glossary_ajax_request.php";
+var imageSource = "{{ _p.web_main }}" + "inc/lib/javascript/indicator.gif";
+var indicatorImage ='<img src="' + imageSource + '" />';
+
+{% if add_ready %}
+$(document).ready(function() {
+{% endif %}
+
+    $("body").on("click", ".glossary", function() {
+        is_glossary_name = $(this).html();
+        random_id = Math.round(Math.random()*100);
+        div_show_id = "div_show_id";
+        div_content_id = "div_content_id";
+
+        $(this).append("<div id="+div_show_id+" ><div id="+div_content_id+">&nbsp;</div></div>");
+
+        var $target = $(this);
+
+        //$("#"+div_show_id).dialog("destroy");
+        $("#"+div_show_id).dialog({
+            autoOpen: false,
+            width: 600,
+            height: 200,
+            position:  { my: 'left top', at: 'right top', of: $target },
+            close: function(){
+                $("div#"+div_show_id).remove();
+                $("div#"+div_content_id).remove();
+            }
+        });
+        var indicator =
+                $.ajax({
+                    contentType: "application/x-www-form-urlencoded",
+                    beforeSend: function(result) {
+                        $("div#"+div_content_id).html(indicatorImage);
+                    },
+                    type: "POST",
+                    url: ajaxRequestUrl,
+                    data: "glossary_name="+is_glossary_name,
+                    success: function(data) {
+                        $("div#"+div_content_id).html(data);
+                        $("#"+div_show_id).dialog("open");
+                    }
+                });
+    });
+
+{% if add_ready %}
+});
+{% endif %}

+ 92 - 0
main/template/rainbow/gradebook/certificate_report.tpl

@@ -0,0 +1,92 @@
+<script>
+    $(document).on('ready', function () {
+        $('select#session').on('change', function () {
+            var sessionId = parseInt(this.value, 10),
+                    $selectCourse = $('select#course');
+
+            $selectCourse.empty();
+
+            $.get('{{ _p.web_main }}inc/ajax/course.ajax.php', {
+                a: 'display_sessions_courses',
+                session: sessionId
+            }, function (courseList) {
+                $('<option>', {
+                    value: 0,
+                    text: "{{ 'Select' | get_lang }}"
+                }).appendTo($selectCourse);
+
+                if (courseList.length > 0) {
+                    $.each(courseList, function (index, course) {
+                        $('<option>', {
+                            value: course.id,
+                            text: course.name
+                        }).appendTo($selectCourse);
+                    });
+                }
+            }, 'json');
+        });
+    });
+</script>
+
+{{ searchBySessionCourseDateForm }}
+
+<hr>
+
+{{ searchByStudentForm }}
+
+{% if errorMessage is defined %}
+    <div class="alert alert-error">{{ errorMessage }}</div>
+{% endif %}
+
+{% if not certificateStudents is empty %}
+    <h2 class="page-header">{{ "GradebookListOfStudentsCertificates" | get_lang }}</h2>
+    {% if not exportAllLink is null %}
+        <div class="actions">
+            <a href="{{ exportAllLink }}" class="btn btn-info">
+                <em class="fa fa-check"></em> {{ 'ExportAllCertificatesToPDF' | get_lang }}
+            </a>
+        </div>
+    {% endif %}
+
+    <table class="table table-striped">
+        <thead>
+            <tr>
+                <th>{{ 'Student' | get_lang }}</th>
+                <th>{{ 'Sesion' | get_lang }}</th>
+                <th>{{ 'Course' | get_lang }}</th>
+                <th>{{ 'Date' | get_lang }}</th>
+                <th>{{ 'Certificate' | get_lang }}</th>
+            </tr>
+        </thead>
+        <tfoot>
+            <tr>
+                <th>{{ 'Student' | get_lang }}</th>
+                <th>{{ 'Sesion' | get_lang }}</th>
+                <th>{{ 'Course' | get_lang }}</th>
+                <th>{{ 'Date' | get_lang }}</th>
+                <th>{{ 'Certificate' | get_lang }}</th>
+            </tr>
+        </tfoot>
+        <tbody>
+            {% for student in certificateStudents %}
+                <tr>
+                    <td>{{ student.fullName }}</td>
+                    <td>{{ student.sessionName }}</td>
+                    <td>{{ student.courseName }}</td>
+                    <td>
+                        {% for certificate in student.certificates %}
+                            <p>{{ certificate.createdAt }}</p>
+                        {% endfor %}
+                    </td>
+                    <td>
+                        {% for certificate in student.certificates %}
+                            <a href="{{ _p.web }}certificates/index.php?id={{ certificate.id }}" class="btn btn-default"><em class="fa fa-floppy-o"></em> {{ 'Certificate' | get_lang }}</a>
+                        {% endfor %}
+                    </td>
+                </tr>
+            {% endfor %}
+        </tbody>
+    </table>
+{% else %}
+    <p class="alert alert-info">{{ 'NoResults' | get_lang }}</p>
+{% endif %}

+ 63 - 0
main/template/rainbow/gradebook/my_certificates.tpl

@@ -0,0 +1,63 @@
+{% if course_list is not empty %}
+    <h1 class="page-header">{{ "Courses"|get_lang }}</h1>
+
+    <div class="table-responsive">
+        <table class="table table-hover table-striped">
+            <thead>
+                <tr>
+                    <th>{{ "Course"|get_lang }}</th>
+                    <th class="text-right">{{ "Score"|get_lang }}</th>
+                    <th class="text-center">{{ "Date"|get_lang }}</th>
+                    <th class="text-right">&nbsp;</th>
+                </tr>
+            </thead>
+            <tbody>
+                {% for row in course_list %}
+                    <tr>
+                        <td>{{ row.course }}</td>
+                        <td class="text-right">{{ row.score }}</td>
+                        <td class="text-center">{{ row.date }}</td>
+                        <td class="text-right">
+                            <a href="{{ row.link }}" target="_blank" class="btn btn-default">
+                                <em class="fa fa-external-link"></em> {{ 'Certificate'|get_lang }}
+                            </a>
+                        </td>
+                    </tr>
+                {% endfor %}
+            </tbody>
+        </table>
+    </div>
+{% endif %}
+
+{% if session_list is not empty %}
+    <h1 class="page-header">{{ "Sessions"|get_lang }}</h1>
+
+    <div class="table-responsive">
+        <table class="table table-hover table-striped">
+            <thead>
+                <tr>
+                    <th>{{ "Session"|get_lang }}</th>
+                    <th>{{ "Course"|get_lang }}</th>
+                    <th class="text-right">{{ "Score"|get_lang }}</th>
+                    <th class="text-center">{{ "Date"|get_lang }}</th>
+                    <th class="text-right">&nbsp;</th>
+                </tr>
+            </thead>
+            <tbody>
+                {% for row in session_list %}
+                    <tr>
+                        <td>{{ row.session }}</td>
+                        <td>{{ row.course }}</td>
+                        <td class="text-right">{{ row.score }}</td>
+                        <td class="text-center">{{ row.date }}</td>
+                        <td class="text-right">
+                            <a href="{{ row.link }}" target="_blank" class="btn btn-default">
+                                <em class="fa fa-external-link"></em> {{ 'Certificate'|get_lang }}
+                            </a>
+                        </td>
+                    </tr>
+                {% endfor %}
+            </tbody>
+        </table>
+    </div>
+{% endif %}

+ 96 - 0
main/template/rainbow/gradebook/search.tpl

@@ -0,0 +1,96 @@
+{{ search_form }}
+
+{% if user_list is not empty %}
+    <div class="table-responsive">
+        <table class="table table-hover table-striped">
+            <thead>
+                <tr>
+                    <th>{{ "FirstName"|get_lang }}</th>
+                    <th>{{ "LastName"|get_lang }}</th>
+                    <th class="text-right">&nbsp;</th>
+                </tr>
+            </thead>
+            <tbody>
+                {% for user in user_list %}
+                    <tr>
+                        <td>{{ user.firstname }}</td>
+                        <td>{{ user.lastname }}</td>
+                        <td class="text-right">
+                            <a href="{{ _p.web_main }}gradebook/search.php?id={{ user.id }}" class="btn btn-default">
+                                <em class="fa fa-external-link"></em> {{ "Certificates"|get_lang }}
+                            </a>
+                        </td>
+                    </tr>
+                {% endfor %}
+            </tbody>
+        </table>
+    </div>
+{% endif %}
+
+{% if course_list is not empty or session_list is not empty %}
+    <h2>{{ user_info.complete_name }}</h2>
+
+    {% if course_list is not empty %}
+        <h3 class="page-header">{{ "Courses"|get_lang }}</h3>
+
+        <div class="table-responsive">
+            <table class="table table-hover table-striped">
+                <thead>
+                    <tr>
+                        <th>{{ "Course"|get_lang }}</th>
+                        <th class="text-right">{{ "Score"|get_lang }}</th>
+                        <th class="text-center">{{ "Date"|get_lang }}</th>
+                        <th class="text-right">&nbsp;</th>
+                    </tr>
+                </thead>
+                <tbody>
+                    {% for row in course_list %}
+                        <tr>
+                            <td>{{ row.course }}</td>
+                            <td class="text-right">{{ row.score }}</td>
+                            <td class="text-center">{{ row.date }}</td>
+                            <td class="text-right">
+                                <a href="{{ row.link }}" target="_blank" class="btn btn-default">
+                                    <em class="fa fa-external-link"></em> {{ 'Certificate'|get_lang }}
+                                </a>
+                            </td>
+                        </tr>
+                    {% endfor %}
+                </tbody>
+            </table>
+        </div>
+    {% endif %}
+
+    {% if session_list is not empty %}
+        <h3 class="page-header">{{ "Sessions"|get_lang }}</h3>
+
+        <div class="table-responsive">
+            <table class="table table-hover table-striped">
+                <thead>
+                    <tr>
+                        <th>{{ "Session"|get_lang }}</th>
+                        <th>{{ "Course"|get_lang }}</th>
+                        <th class="text-right">{{ "Score"|get_lang }}</th>
+                        <th class="text-center">{{ "Date"|get_lang }}</th>
+                        <th class="text-right">&nbsp;</th>
+                    </tr>
+                </thead>
+                <tbody>
+                    {% for row in session_list %}
+                        <tr>
+                            <td>{{ row.session }}</td>
+                            <td>{{ row.course }}</td>
+                            <td class="text-right">{{ row.score }}</td>
+                            <td class="text-center">{{ row.date }}</td>
+                            <td class="text-right">
+                                <a href="{{ row.link }}" target="_blank" class="btn btn-default">
+                                    <em class="fa fa-external-link"></em> {{ 'Certificate'|get_lang }}
+                                </a>
+                            </td>
+                        </tr>
+                    {% endfor %}
+                </tbody>
+            </table>
+        </div>
+    {% endif %}
+{% endif %}

+ 114 - 0
main/template/rainbow/javascript/editor/ckeditor/config_js.tpl

@@ -0,0 +1,114 @@
+/* Ckeditor global configuration file */
+
+CKEDITOR.editorConfig = function (config) {
+    // Define changes to default configuration here.
+    // For complete reference see:
+    // http://docs.ckeditor.com/#!/api/CKEDITOR.config
+
+    // Remove some buttons provided by the standard plugins, which are
+    // not needed in the Standard(s) toolbar.
+    //config.removeButtons = 'Underline,Subscript,Superscript';
+
+    // Set the most common block elements.
+    config.format_tags = 'p;h1;h2;h3;h4;h5;h6;pre';
+
+    // Simplify the dialog windows.
+    config.removeDialogTabs = 'image:advanced;link:advanced';
+
+    config.templates_files  = [
+        '{{ _p.web_main ~ 'inc/lib/elfinder/templates.php'}}'
+    ];
+    //Style for default CKEditor Chamilo LMS
+    config.stylesSet = [
+        { 
+            name : 'Title 1',
+            element : 'h1',
+            attributes : { 'class': 'ck ck-title' }
+        },
+        { 
+            name : 'Title 2',
+            element : 'h2',
+            attributes : { 'class': 'ck ck-title2' }
+        },
+        { 
+            name : 'Alert Success',
+            element : 'p',
+            attributes : { 'class': 'alert alert-success' }
+        },
+        { 
+            name : 'Alert Info',
+            element : 'p',
+            attributes : { 'class': 'alert alert-info' }
+        },
+        { 
+            name : 'Alert Warning',
+            element : 'p',
+            attributes : { 'class': 'alert alert-warning' }
+        },
+        { 
+            name : 'Alert Danger',
+            element : 'p',
+            attributes : { 'class': 'alert alert-danger' }
+        },
+        { 
+            name : 'Section Article' ,
+            element : 'h3' ,
+            attributes : { 'class': 'ck ck-article' }
+        }, {
+            name : 'Paragraph box' ,
+            element : 'p' ,
+            attributes: { 'class': 'ck-paragraph-box' }
+        }, {
+            name : 'Superscript' ,
+            element : 'sup'
+        },
+        {
+            name : 'Subscript' ,
+            element : 'sub'
+        },
+        {
+            name : 'Strikethrough' ,
+            element : 'del'
+        },
+        {
+            name : 'Underlined' ,
+            element : 'ins'
+        },
+        {
+            name : 'Stand Out' ,
+            element : 'span',
+            attributes: { 'class':'ck-stand-out'}
+        },
+        {
+            name : 'Separate Style 1' ,
+            element : 'hr',
+            attributes: { 'class':'ck-style1'}
+        },
+        {
+            name : 'Separate Style 2' ,
+            element : 'hr',
+            attributes: { 'class':'ck-style2'}
+        },
+        {
+            name : 'Separate Style 3' ,
+            element : 'hr',
+            attributes: { 'class':'ck-style3'}
+        }
+    ];
+    
+    
+    {% if moreButtonsInMaximizedMode %}
+        config.toolbar = 'minToolbar';
+        config.smallToolbar = 'minToolbar';
+        config.maximizedToolbar = 'maxToolbar';
+    {% endif %}
+
+    // File manager (elFinder)
+    config.filebrowserBrowseUrl = '{{ _p.web_lib ~ 'elfinder/filemanager.php' }}';
+
+    // Allows to use "class" attribute inside divs and spans.
+    config.allowedContent = true;
+    config.contentsCss = '{{ cssEditor }}';
+
+    config.customConfig = '{{ _p.web_main ~ 'inc/lib/javascript/ckeditor/config_js.php'}}';
+};

+ 5 - 0
main/template/rainbow/javascript/editor/ckeditor/elfinder.tpl

@@ -0,0 +1,5 @@
+{% extends "default/layout/no_layout.tpl" %}
+
+{% block body %}
+    {% include 'default/javascript/editor/elfinder_standalone.tpl' %}
+{% endblock %}

+ 6 - 0
main/template/rainbow/javascript/editor/ckeditor/templates.tpl

@@ -0,0 +1,6 @@
+CKEDITOR.addTemplates("default",
+{
+    imagesPath: ' ',
+    templates:
+        {{ templates }}
+});

+ 35 - 0
main/template/rainbow/javascript/editor/elfinder_standalone.tpl

@@ -0,0 +1,35 @@
+{% set finderFolder = _p.web ~ 'vendor/barryvdh/elfinder-builds/' %}
+<!-- elFinder CSS (REQUIRED) -->
+<link rel="stylesheet" type="text/css" media="screen" href="{{ finderFolder }}css/elfinder.full.css">
+<link rel="stylesheet" type="text/css" media="screen" href="{{ finderFolder }}css/theme.css">
+
+<!-- elFinder JS (REQUIRED) -->
+<script type="text/javascript" src="{{ finderFolder }}js/elfinder.full.js"></script>
+
+<!-- elFinder translation (OPTIONAL) -->
+<script type="text/javascript" src="{{ finderFolder }}js/i18n/elfinder.ru.js"></script>
+
+<script type="text/javascript" charset="utf-8">
+    // Helper function to get parameters from the query string.
+    function getUrlParam(paramName) {
+        var reParam = new RegExp('(?:[\?&]|&amp;)' + paramName + '=([^&]+)', 'i');
+        var match = window.location.search.match(reParam);
+        return (match && match.length > 1) ? match[1] : '';
+    }
+
+    $().ready(function() {
+        var funcNum = getUrlParam('CKEditorFuncNum');
+        var elf = $('#elfinder').elfinder({
+            url : '{{ _p.web_lib ~ 'elfinder/connectorAction.php' }}',  // connector URL (REQUIRED)
+            getFileCallback : function(file) {
+                window.opener.CKEDITOR.tools.callFunction(funcNum, file.url);
+                window.close();
+            },
+            resizable: false
+        }).elfinder('instance');
+    });
+</script>
+<div id="elfinder"></div>
+
+
+

+ 3 - 0
main/template/rainbow/layout/blank.tpl

@@ -0,0 +1,3 @@
+{% block content %}
+{{ content }}
+{% endblock %}

+ 62 - 0
main/template/rainbow/layout/course_navigation.tpl

@@ -0,0 +1,62 @@
+{# Course navigation icons - these are two optional features that have to be enabled through admin settings #}
+{% if show_header == true %}
+
+    {% if show_course_shortcut is not null %}
+        <div class="col-md-12">
+            {{ show_course_shortcut }}
+        </div>
+    {% endif %}
+
+    {% if show_course_navigation_menu is not null %}
+        <script>
+            $(document).ready( function() {
+                if (readCookie('menu_state') == 0) {
+                    swap_menu();
+                }
+            });
+            function createCookie(name, value, days) {
+                if (days) {
+                    var date = new Date();
+                    date.setTime(date.getTime()+(days*24*60*60*1000));
+                    var expires = "; expires="+date.toGMTString();
+                }
+                else var expires = "";
+                document.cookie = name+"="+value+expires+"; path=/";
+            }
+            function readCookie(name) {
+                var nameEQ = name + "=";
+                var ca = document.cookie.split(';');
+                for (var i = 0; i < ca.length; i++)
+                {
+                    var c = ca[i];
+                    while (c.charAt(0)==' ') c = c.substring(1,c.length);
+                    if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
+                }
+                return null;
+            }
+            function swap_menu() {
+                toolnavlist_el = document.getElementById('toolnav');
+                center_el = document.getElementById('center');
+                swap_menu_link_el = document.getElementById('swap_menu_link');
+
+                if (toolnavlist_el.style.display == 'none') {
+                    toolnavlist_el.style.display = '';
+                    if (center_el) {
+                        center_el.style.margin = '0 190px 0 0';
+                    }
+                    swap_menu_link_el.innerHTML = '{{'Hide'|get_lang}}';
+                    createCookie('menu_state',1,10);
+                } else {
+                    toolnavlist_el.style.display = 'none';
+                    if (center_el) {
+                        center_el.style.margin = '0 0 0 0';
+                    }
+                    swap_menu_link_el.innerHTML = '{{'Show'|get_lang}}';
+                    createCookie('menu_state',0,10);
+                }
+            }
+            document.write('<div class="col-md-12 pull-right"> <a class="btn btn-default" href="javascript: void(0);" id="swap_menu_link" onclick="javascript: swap_menu();">{{'Hide'|get_lang}}<\/a></div>');
+        </script>
+    {{ show_course_navigation_menu }}
+    {% endif %}
+{% endif %}

+ 113 - 0
main/template/rainbow/layout/footer.js.tpl

@@ -0,0 +1,113 @@
+<script>
+    $("form").on("click", ' .advanced_parameters', function() {
+        /*var id = $(this).attr('id') + '_options';
+         console.log(id);
+         $("#"+id).toggleClass('active');
+         var button = $(this);
+         $("#"+id).toggle(function() {
+         $("#"+id).toggleClass('active');
+         });*/
+    });
+
+    /* Makes row highlighting possible */
+    $(document).ready( function() {
+        // Date time settings.
+        moment.locale('{{ locale }}');
+        $.datepicker.setDefaults($.datepicker.regional["{{ locale }}"]);
+        $.datepicker.regional["local"] = $.datepicker.regional["{{ locale }}"];
+
+        // Chosen select
+        $(".chzn-select").chosen({
+            disable_search_threshold: 10,
+            no_results_text: '{{ 'SearchNoResultsFound' | get_lang }}',
+            placeholder_text_multiple: '{{ 'SelectSomeOptions' | get_lang }}',
+            placeholder_text_single: '{{ 'SelectAnOption' | get_lang }}',
+            width: "100%"
+        });
+
+        // Bootstrap tabs.
+        $('.tab-wrapper a').click(function (e) {
+            e.preventDefault();
+            $(this).tab('show');
+
+            //$('#tabs a:first').tab('show') // Select first tab
+        });
+
+        // Fixes bug when loading links inside a tab.
+        $('.tab-wrapper .tab-pane a').unbind();
+
+        /**
+         * Advanced options
+         * Usage
+         * <a id="link" href="url">Advanced</a>
+         * <div id="link_options">
+         *     hidden content :)
+         * </div>
+         * */
+        $(".advanced_options").on("click", function (event) {
+            event.preventDefault();
+            var id = $(this).attr('id') + '_options';
+            var button = $(this);
+            button.toggleClass('active');
+            $("#" + id).toggle();
+        });
+
+        /**
+         * <a class="advanced_options_open" href="http://" rel="div_id">Open</a>
+         * <a class="advanced_options_close" href="http://" rel="div_id">Close</a>
+         * <div id="div_id">Div content</div>
+         * */
+        $(".advanced_options_open").on("click", function (event) {
+            event.preventDefault();
+            var id = $(this).attr('rel');
+            $("#" + id).show();
+        });
+
+        $(".advanced_options_close").on("click", function (event) {
+            event.preventDefault();
+            var id = $(this).attr('rel');
+            $("#" + id).hide();
+        });
+
+        // Adv multi-select search input.
+        $('.select_class_filter').on('focus', function () {
+            var inputId = $(this).attr('id');
+            inputId = inputId.replace('-filter', '');
+            $("#" + inputId).filterByText($("#" + inputId + "-filter"));
+        });
+
+        $(".jp-jplayer audio").addClass('skip');
+
+        // Mediaelement
+        if ( {{ show_media_element }} == 1) {
+            jQuery('video:not(.skip), audio:not(.skip)').mediaelementplayer(/* Options */);
+        }
+
+        // Table highlight.
+        $("form .data_table input:checkbox").click(function () {
+            if ($(this).is(":checked")) {
+                $(this).parentsUntil("tr").parent().addClass("row_selected");
+
+            } else {
+                $(this).parentsUntil("tr").parent().removeClass("row_selected");
+            }
+        });
+
+        /* For non HTML5 browsers */
+        if ($("#formLogin".length > 1)) {
+            $("input[name=login]").focus();
+        }
+
+        /* For IOS users */
+        $('.autocapitalize_off').attr('autocapitalize', 'off');
+
+        // Tool tip (in exercises)
+        var tip_options = {
+            placement: 'right'
+        };
+        $('.boot-tooltip').tooltip(tip_options);
+    });
+
+
+
+</script>

+ 77 - 0
main/template/rainbow/layout/footer.tpl

@@ -0,0 +1,77 @@
+<footer> <!-- start of #footer section -->
+    <div class="container">
+        <div class="row">
+            <div id="footer_left" class="col-md-4">
+                {% if session_teachers is not null %}
+                    <div id="session_teachers">
+                        {{ session_teachers }}
+                    </div>
+                {% endif %}
+
+                {% if teachers is not null %}
+                    <div id="teachers">
+                        {{ teachers }}
+                    </div>
+                {% endif %}
+
+                {#  Plugins for footer section #}
+                {% if plugin_footer_left is not null %}
+                    <div id="plugin_footer_left">
+                        {{ plugin_footer_left }}
+                    </div>
+                {% endif %}
+                &nbsp;
+            </div>
+
+            <div id="footer_center" class="col-md-4">
+                {#   Plugins for footer section  #}
+                {% if plugin_footer_center is not null %}
+                    <div id="plugin_footer_center">
+                        {{ plugin_footer_center }}
+                    </div>
+                {% endif %}
+                &nbsp;
+            </div>
+
+            <div id="footer_right" class="col-md-4">
+                {% if administrator_name is not null %}
+                    <div id="admin_name">
+                        {{ administrator_name }}
+                    </div>
+                {% endif %}
+
+                <div id="software_name">
+	                <a href="{{_p.web}}" target="_blank">{{ "PoweredByX" |get_lang | format(_s.software_name) }}</a>
+                    &copy; {{ "now"|date("Y") }}
+                </div>
+                {#   Plugins for footer section  #}
+                {% if plugin_footer_right is not null %}
+                    <div id="plugin_footer_right">
+                        {{ plugin_footer_right }}
+                    </div>
+                {% endif %}
+                &nbsp;
+            </div><!-- end of #footer_right -->
+        </div><!-- end of #row -->
+        <div class="extra-footer">
+            {{ footer_extra_content }}
+        </div>
+    </div><!-- end of #container -->
+</footer>
+
+<div class="modal fade" id="expand-image-modal" tabindex="-1" role="dialog" aria-labelledby="expand-image-modal-title" aria-hidden="true">
+    <div class="modal-dialog modal-lg">
+        <div class="modal-content">
+            <div class="modal-header">
+                <button type="button" class="close" data-dismiss="modal" aria-label="{{ "Close" | get_lang }}"><span aria-hidden="true">&times;</span></button>
+                <h4 class="modal-title" id="expand-image-modal-title">&nbsp;</h4>
+            </div>
+            <div class="modal-body">
+            </div>
+        </div>
+    </div>
+</div>
+
+{% include template ~ '/layout/footer.js.tpl' %}
+
+{{ execution_stats }}

+ 32 - 0
main/template/rainbow/layout/head.tpl

@@ -0,0 +1,32 @@
+<meta charset="{{ system_charset }}" />
+<link href="https://chamilo.org/chamilo-lms/" rel="help" />
+<link href="https://chamilo.org/the-association/" rel="author" />
+<link href="https://chamilo.org/the-association/" rel="copyright" />
+<!-- Force latest IE rendering engine or ChromeFrame if installed -->
+<!--[if IE]>
+<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
+<![endif]-->
+{{ prefetch }}
+{{ favico }}
+<link rel="apple-touch-icon" href="{{ _p.web }}apple-touch-icon.png" />
+<meta name="apple-mobile-web-app-capable" content="yes" />
+<meta name="Generator" content="{{ _s.software_name }} {{ _s.system_version|slice(0,1) }}" />
+<meta name="viewport" content="width=device-width, initial-scale=1.0">
+<title>{{ title_string }}</title>
+{{ social_meta }}
+{{ css_static_file_to_string }}
+{{ js_file_to_string }}
+{{ extra_headers }}
+<script>
+/* Global chat variables */
+var ajax_url = '{{ _p.web_ajax }}chat.ajax.php';
+var online_button = '{{ online_button }}';
+var offline_button = '{{ offline_button }}';
+var connect_lang = '{{ "ChatConnected"|get_lang }}';
+var disconnect_lang = '{{ "ChatDisconnected"|get_lang }}';
+</script>
+{% include template ~ '/layout/header.js.tpl' %}
+
+{{ css_custom_file_to_string }}
+{{ css_style_print }}
+{{ header_extra_content }}

+ 425 - 0
main/template/rainbow/layout/header.js.tpl

@@ -0,0 +1,425 @@
+<script>
+// External plugins not part of the default Ckeditor package.
+var plugins = [
+    'asciimath',
+    'asciisvg',
+    'audio',
+    'ckeditor_wiris',
+    'dialogui',
+    'glossary',
+    'leaflet',
+    'mapping',
+    'maximize',
+    'mathjax',
+    'oembed',
+    'toolbar',
+    'toolbarswitch',
+    'video',
+    'wikilink',
+    'wordcount',
+    'youtube'
+];
+
+plugins.forEach(function(plugin) {
+    CKEDITOR.plugins.addExternal(plugin, '{{ _p.web_main ~ 'inc/lib/javascript/ckeditor/plugins/' }}' + plugin + '/');
+});
+
+/**
+ * Function use to load templates in a div
+ **/
+var showTemplates = function (ckeditorName) {
+    var editorName = 'content';
+    if (ckeditorName && ckeditorName.length > 0) {
+        editorName = ckeditorName;
+    }
+    CKEDITOR.editorConfig(CKEDITOR.config);
+    CKEDITOR.loadTemplates(CKEDITOR.config.templates_files, function (a){
+        var templatesConfig = CKEDITOR.getTemplates("default");
+
+        var $templatesUL = $("<ul>");
+
+        $.each(templatesConfig.templates, function () {
+            var template = this;
+            var $templateLi = $("<li>");
+
+            var templateHTML = "<img src=\"" + templatesConfig.imagesPath + template.image + "\" ><div>";
+            templateHTML += "<b>" + template.title + "</b>";
+
+            if (template.description) {
+                templateHTML += "<div class=description>" + template.description + "</div>";
+            }
+
+            templateHTML += "</div>";
+
+            $("<a>", {
+                href: "#",
+                html: templateHTML,
+                click: function (e) {
+                    e.preventDefault();
+                    if (CKEDITOR.instances[editorName]) {
+                        CKEDITOR.instances[editorName].setData(template.html, function () {
+                            this.checkDirty();
+                        });
+                    }
+                }
+            }).appendTo($templateLi);
+            $templatesUL.append($templateLi);
+        });
+        $templatesUL.appendTo("#frmModel");
+    });
+};
+
+$(document).ready(function(){
+    $("#open-view-list").click(function(){
+        $("#student-list-work").fadeIn(300);
+    });
+    $("#closed-view-list").click(function(){
+        $("#student-list-work").fadeOut(300);
+    });
+
+    check_brand();
+    //if exists the toolbar admin
+
+    if($('#toolbar-admin').length){
+        var heigthToolBar= $('#toolbar-admin').height();
+        $('header').css('margin-top', heigthToolBar+'px');
+        $('#page-back').css('padding-top', heigthToolBar+20+'px');
+    }
+
+    // Removes the yellow input in Chrome
+    if (navigator.userAgent.toLowerCase().indexOf("chrome") >= 0) {
+        $(window).load(function(){
+            $('input:-webkit-autofill').each(function(){
+                var text = $(this).val();
+                var name = $(this).attr('name');
+                $(this).after(this.outerHTML).remove();
+                $('input[name=' + name + ']').val(text);
+            });
+        });
+    }
+
+    $(".accordion_jquery").accordion({
+        autoHeight: false,
+        active: false, // all items closed by default
+        collapsible: true,
+        header: ".accordion-heading"
+    });
+
+    // Global popup
+    $('body').on('click', 'a.ajax', function(e) {
+        e.preventDefault();
+
+        var contentUrl = this.href,
+                loadModalContent = $.get(contentUrl),
+                self = $(this);
+
+        $.when(loadModalContent).done(function(modalContent) {
+            var modalDialog = $('#global-modal').find('.modal-dialog'),
+                    modalSize = self.data('size') || get_url_params(contentUrl, 'modal_size'),
+                    modalWidth = self.data('width') || get_url_params(contentUrl, 'width'),
+                    modalTitle = self.data('title') || ' ';
+
+            modalDialog.removeClass('modal-lg modal-sm').css('width', '');
+
+            if (modalSize) {
+                switch (modalSize) {
+                    case 'lg':
+                        modalDialog.addClass('modal-lg');
+                        break;
+                    case 'sm':
+                        modalDialog.addClass('modal-sm');
+                        break;
+                }
+            } else if (modalWidth) {
+                modalDialog.css('width', modalWidth + 'px');
+            }
+
+            $('#global-modal').find('.modal-title').text(modalTitle);
+            $('#global-modal').find('.modal-body').html(modalContent);
+            $('#global-modal').modal('show');
+        });
+    });
+
+    $('a.expand-image').on('click', function(e) {
+        e.preventDefault();
+        var title = $(this).attr('title');
+        var image = new Image();
+        image.onload = function() {
+            if (title) {
+                $('#expand-image-modal').find('.modal-title').text(title);
+            } else {
+                $('#expand-image-modal').find('.modal-title').html('&nbsp;');
+            }
+
+            $('#expand-image-modal').find('.modal-body').html(image);
+            $('#expand-image-modal').modal({
+                show: true
+            });
+        };
+        image.src = this.href;
+    });
+
+    // Global confirmation
+    $('.popup-confirmation').on('click', function() {
+        showConfirmationPopup(this);
+        return false;
+    });
+
+    // old jquery.menu.js
+    $('#navigation a').stop().animate({
+        'marginLeft':'50px'
+    },1000);
+
+    $('#navigation > li').hover(
+        function () {
+            $('a',$(this)).stop().animate({
+                'marginLeft':'1px'
+            },200);
+        },
+        function () {
+            $('a',$(this)).stop().animate({
+                'marginLeft':'50px'
+            },200);
+        }
+    );
+
+    /* Make responsive image maps */
+    $('map').imageMapResize();
+
+    jQuery.fn.filterByText = function(textbox) {
+        return this.each(function() {
+            var select = this;
+            var options = [];
+            $(select).find('option').each(function() {
+                options.push({value: $(this).val(), text: $(this).text()});
+            });
+            $(select).data('options', options);
+
+            $(textbox).bind('change keyup', function() {
+                var options = $(select).empty().data('options');
+                var search = $.trim($(this).val());
+                var regex = new RegExp(search,"gi");
+
+                $.each(options, function(i) {
+                    var option = options[i];
+                    if(option.text.match(regex) !== null) {
+                        $(select).append(
+                                $('<option>').text(option.text).val(option.value)
+                        );
+                    }
+                });
+            });
+        });
+    };
+});
+
+$(window).resize(function() {
+    check_brand();
+});
+
+$(document).scroll(function() {
+
+    //Exercise warning fixed at the top
+    var fixed =  $("#exercise_clock_warning");
+    if (fixed.length) {
+        if (!fixed.attr('data-top')) {
+            // If already fixed, then do nothing
+            if (fixed.hasClass('subnav-fixed')) return;
+            // Remember top position
+            var offset = fixed.offset();
+            fixed.attr('data-top', offset.top);
+            fixed.css('width', '100%');
+        }
+
+        if (fixed.attr('data-top') - fixed.outerHeight() <= $(this).scrollTop()) {
+            fixed.addClass('navbar-fixed-top');
+            fixed.css('width', '100%');
+        } else {
+            fixed.removeClass('navbar-fixed-top');
+            fixed.css('width', '100%');
+        }
+    }
+
+    // Admin -> Settings toolbar.
+    if ($('body').width() > 959) {
+        if ($('.new_actions').length) {
+            if (!$('.new_actions').attr('data-top')) {
+                // If already fixed, then do nothing
+                if ($('.new_actions').hasClass('new_actions-fixed')) return;
+                // Remember top position
+                var offset = $('.new_actions').offset();
+
+                var more_top = 0;
+                if ($('.subnav').hasClass('new_actions-fixed')) {
+                    more_top = 50;
+                }
+                $('.new_actions').attr('data-top', offset.top + more_top);
+            }
+
+            if ($('.new_actions').attr('data-top') - $('.new_actions').outerHeight() <= $(this).scrollTop()) {
+                $('.new_actions').addClass('new_actions-fixed');
+            } else {
+                $('.new_actions').removeClass('new_actions-fixed');
+            }
+        }
+    }
+
+    // Bottom actions.
+    if ($('.bottom_actions').length) {
+        if (!$('.bottom_actions').attr('data-top')) {
+            // If already fixed, then do nothing
+            if ($('.bottom_actions').hasClass('bottom_actions_fixed')) return;
+
+            // Remember top position
+            var offset = $('.bottom_actions').offset();
+            $('.bottom_actions').attr('data-top', offset.top);
+        }
+
+        if ($('.bottom_actions').attr('data-top') > $('body').outerHeight()) {
+            if ( ($('.bottom_actions').attr('data-top') - $('body').outerHeight() - $('.bottom_actions').outerHeight()) >= $(this).scrollTop()) {
+                $('.bottom_actions').addClass('bottom_actions_fixed');
+                $('.bottom_actions').css("width", "100%");
+            } else {
+                $('.bottom_actions').css("width", "");
+                $('.bottom_actions').removeClass('bottom_actions_fixed');
+            }
+        } else {
+            if ( ($('.bottom_actions').attr('data-top') -  $('.bottom_actions').outerHeight()) <= $(this).scrollTop()) {
+                $('.bottom_actions').addClass('bottom_actions_fixed');
+                $('.bottom_actions').css("width", "100%");
+            } else {
+                $('.bottom_actions').removeClass('bottom_actions_fixed');
+                $('.bottom_actions').css("width", "");
+            }
+        }
+    }
+});
+
+function get_url_params(q, attribute) {
+    var vars;
+    var hash;
+    if (q != undefined) {
+        q = q.split('&');
+        for(var i = 0; i < q.length; i++){
+            hash = q[i].split('=');
+            if (hash[0] == attribute) {
+                return hash[1];
+            }
+        }
+    }
+}
+
+function check_brand() {
+    if ($('.subnav').length) {
+        if ($(window).width() >= 969) {
+            $('.subnav .brand').hide();
+        } else {
+            $('.subnav .brand').show();
+        }
+    }
+}
+
+function showConfirmationPopup(obj, urlParam) {
+    if (urlParam) {
+        url = urlParam
+    } else {
+        url = obj.href;
+    }
+
+    var dialog  = $("#dialog");
+    if ($("#dialog").length == 0) {
+        dialog  = $('<div id="dialog" style="display:none">{{ "ConfirmYourChoice" | get_lang }} </div>').appendTo('body');
+    }
+
+    var width_value = 350;
+    var height_value = 150;
+    var resizable_value = true;
+
+    var new_param = get_url_params(url, 'width');
+    if (new_param) {
+        width_value = new_param;
+    }
+
+    var new_param = get_url_params(url, 'height')
+    if (new_param) {
+        height_value = new_param;
+    }
+
+    var new_param = get_url_params(url, 'resizable');
+    if (new_param) {
+        resizable_value = new_param;
+    }
+
+    // Show dialog
+    dialog.dialog({
+        modal       : true,
+        width       : width_value,
+        height      : height_value,
+        resizable   : resizable_value,
+        buttons: [
+            {
+                text: '{{ 'Yes' | get_lang }}',
+                click: function() {
+                    window.location = url;
+                },
+                icons:{
+                    primary:'ui-icon-locked'
+                }
+            },
+            {
+                text: '{{ 'No' | get_lang }}',
+                click: function() { $(this).dialog("close"); },
+                icons:{
+                    primary:'ui-icon-locked'
+                }
+            }
+        ]
+    });
+    // prevent the browser to follow the link
+    return false;
+}
+
+function setCheckbox(value, table_id) {
+    checkboxes = $("#"+table_id+" input:checkbox");
+    $.each(checkboxes, function(index, checkbox) {
+        checkbox.checked = value;
+        if (value) {
+            $(checkbox).parentsUntil("tr").parent().addClass("row_selected");
+        } else {
+            $(checkbox).parentsUntil("tr").parent().removeClass("row_selected");
+        }
+    });
+    return false;
+}
+
+function action_click(element, table_id) {
+    d = $("#"+table_id);
+    if (!confirm('{{ "ConfirmYourChoice"|get_lang }}')) {
+        return false;
+    } else {
+        var action =$(element).attr("data-action");
+        $('#'+table_id+' input[name="action"] ').attr("value", action);
+        d.submit();
+        return false;
+    }
+}
+
+/**
+ * Generic function to replace the deprecated jQuery toggle function
+ * @param inId          : id of block to hide / unhide
+ * @param inIdTxt       : id of the button
+ * @param inTxtHide     : text one of the button
+ * @param inTxtUnhide   : text two of the button
+ * @todo : allow to detect if text is from a button or from a <a>
+ */
+function hideUnhide(inId, inIdTxt, inTxtHide, inTxtUnhide)
+{
+    if ($('#'+inId).css("display") == "none") {
+        $('#'+inId).show(400);
+        $('#'+inIdTxt).attr("value", inTxtUnhide);
+    } else {
+        $('#'+inId).hide(400);
+        $('#'+inIdTxt).attr("value", inTxtHide);
+    }
+}
+</script>

+ 27 - 0
main/template/rainbow/layout/hot_course_item.tpl

@@ -0,0 +1,27 @@
+{% for hot_course in hot_courses %}
+    {% if hot_course.extra_info.title %}
+                    <div class="col-md-3">
+                        <div class="items-course">
+                            <div class="items-course-image">
+                                <a href="{{ hot_course.extra_info.course_public_url }}"><img class="img-responsive" src="{{ hot_course.extra_info.course_image_large }}" alt="{{ hot_course.extra_info.title|e }}"/></a>
+                            </div>
+                            <div class="items-course-info">
+                                <h4 class="title">
+                                    <a title="{{ hot_course.extra_info.title}}" href="{{ hot_course.extra_info.course_public_url }}">{{ hot_course.extra_info.title}}</a>
+                                </h4>
+                                <div class="teachers">{{ hot_course.extra_info.teachers }}</div>
+                                <div class="ranking">
+                                    {{ hot_course.extra_info.rating_html }}
+                                </div>
+                                <div class="toolbar">
+                                    <div class="btn-group" role="group">
+                                    {{ hot_course.extra_info.description_button }}
+                                    {{ hot_course.extra_info.register_button }}
+                                    {{ hot_course.extra_info.unsubscribe_button }}
+                                    </div>
+                                </div>
+                            </div>
+                        </div>
+                    </div>
+    {% endif %}
+{% endfor %}

+ 23 - 0
main/template/rainbow/layout/hot_course_item_popup.tpl

@@ -0,0 +1,23 @@
+{% for hot_course in hot_courses %}               
+    {% if hot_course.extra_info.title %}        
+        <div class="row">
+            <div class="col-sm-3">
+                <div class="thumbnail">
+                    <img src="{{ hot_course.extra_info.course_image }}" />
+                </div>
+            </div>
+            <div class="col-sm-9">
+                <div class="categories-course-description">
+                    <h3>{{ hot_course.extra_info.title}}</h3>
+                    <h5>{{ hot_course.extra_info.teachers }}</h5>
+                    {# hot_course.extra_info.rating_html #}
+                </div>
+                <p>
+                    {{ hot_course.extra_info.description_button }}
+                    {{ hot_course.extra_info.go_to_course_button }}
+                    {{ hot_course.extra_info.register_button }}
+                </p>
+            </div>
+        </div>
+    {% endif %}
+{% endfor %}

+ 42 - 0
main/template/rainbow/layout/hot_courses.tpl

@@ -0,0 +1,42 @@
+{% if hot_courses is not null and hot_courses is not empty %}
+
+<script>
+$(document).ready( function() {
+    $('.star-rating li a').on('click', function(event) {
+        var id = $(this).parents('ul').attr('id');
+        $('#vote_label2_' + id).html("{{'Loading'|get_lang}}");
+        $.ajax({
+            url: $(this).attr('data-link'),
+            success: function(data) {
+                $("#rating_wrapper_"+id).html(data);
+                if (data == 'added') {
+                    //$('#vote_label2_' + id).html("{{'Saved'|get_lang}}");
+                }
+                if (data == 'updated') {
+                    //$('#vote_label2_' + id).html("{{'Saved'|get_lang}}");
+                }
+            }
+        });
+    });
+});
+</script>
+<section id="hot_courses" class="container">
+    <div class="hot-course-head">
+        <h4 class="hot-course-title">
+            {{ "HottestCourses"|get_lang}}
+            {% if _u.is_admin %}
+            <span class="pull-right">
+                <a title="{{ "Hide"|get_lang }}" alt="{{ "Hide"|get_lang }}" href="{{ _p.web_main }}admin/settings.php?search_field=show_hot_courses&submit_button=&_qf__search_settings=&category=search_setting">
+                    <img src="{{ "eyes.png"|icon(22) }}" width="22" height="22">
+                </a>
+            </span>
+            {% endif %}
+        </h4>
+    </div>
+    <div id="hot-course">
+        <div class="row">
+            {% include template ~ '/layout/hot_course_item.tpl' %}
+        </div>
+    </div>
+</section>
+{% endif %}

+ 44 - 0
main/template/rainbow/layout/layout_1_col.tpl

@@ -0,0 +1,44 @@
+{% extends template ~ "/layout/main.tpl" %}
+
+{#  1 column  #}
+{% block body %}
+    {# Plugin main top #}
+    {% if plugin_main_top %}
+        <div id="plugin_main_top" class="col-md-12">
+            {{ plugin_main_top }}
+        </div>
+    {% endif %}
+
+    {#  Plugin top  #}
+    {% if plugin_content_top %}
+        <div id="plugin_content_top" class="col-md-12 movil">
+            {{ plugin_content_top }}
+        </div>
+    {% endif %}
+
+    <div class="col-xs-12 col-md-12">
+        {% include template ~ "/layout/page_body.tpl" %}
+        {% block content %}
+            {% if content is not null %}
+                <section id="main_content">
+                {{ content }}
+                </section>
+            {% endif %}
+        {% endblock %}
+        &nbsp;
+    </div>
+
+    {#  Plugin bottom  #}
+    {% if plugin_content_bottom %}
+        <div id="plugin_content_bottom" class="col-md-12">
+            {{ plugin_content_bottom }}
+        </div>
+    {% endif %}
+
+    {# Plugin main bottom #}
+    {% if plugin_main_bottom %}
+        <div id="plugin_main_bottom" class="col-md-12">
+            {{ plugin_main_bottom }}
+        </div>
+    {% endif %}
+{% endblock %}

+ 113 - 0
main/template/rainbow/layout/layout_2_col.tpl

@@ -0,0 +1,113 @@
+{% extends template ~ "/layout/main.tpl" %}
+
+{% block body %}
+<div class="container">
+    <div class="row">
+        <div class="col-md-3 menu-column">
+            {% block login_form %}
+                    {% if _u.logged  == 0 %}
+                            {% include template ~ "/layout/login_form.tpl" %}
+                    {% endif %}
+            {% endblock %}
+            {% if _u.logged  == 1 %}
+                {{ user_image_block }}
+            {% endif %}
+            {{ profile_block }}
+        </div>
+        <div class="col-md-9">
+            {% if announcements_block %}
+                <section id="homepage-announcements">
+                {{ announcements_block }}
+                </section>
+            {% endif %}
+        </div>
+    </div>
+</div>
+<div class="container">
+    <div class="row">
+        <div class="col-md-12">
+            <div class="stadistics">
+                <div class="row">
+                    <div class="col-md-4">
+                        <ul class="items">
+                            <li><i class="fa fa-user fa-4x icon-color" aria-hidden="true"></i></li>
+                            <li>
+                                <h2 class="number">450+</h2>
+                                <p class="text">Les utilisateurs enregistrés</p>
+                            </li>
+                        </ul>
+                    </div>
+                    <div class="col-md-4">
+                        <ul class="items">
+                            <li><i class="fa fa-book fa-4x icon-color" aria-hidden="true"></i></li>
+                            <li>
+                                <h2 class="number">30</h2>
+                                <p class="text">Les cours ouverts</p>
+                            </li>
+                        </ul>
+                    </div>
+                    <div class="col-md-4">
+                        <ul class="items">
+                            <li><i class="fa fa-signal fa-4x icon-color" aria-hidden="true"></i></li>
+                            <li>
+                                <h2 class="number">300+</h2>
+                                <p class="text">Les diplomés</p>
+                            </li>
+                        </ul>
+                    </div>
+                </div>
+            </div>
+        {% if home_page_block %}
+            <section id="homepage-home">
+                {{ home_page_block }}
+            </section>
+        {% endif %}
+        </div>
+    </div>    
+</div>	
+	<div class="col-md-12">
+        {{ sniff_notification }}
+
+        {% block page_body %}
+        {% include template ~ "/layout/page_body.tpl" %}
+        {% endblock %}
+
+        {% if welcome_to_course_block %}
+            <section id="homepage-course">
+            {{ welcome_to_course_block }}
+            </section>
+        {% endif %}
+
+        {% block content %}
+        {% if content is not null %}
+            <section id="page-content" class="{{ course_history_page }}">
+                {{ content }}
+            </section>
+        {% endif %}
+        {% endblock %}
+
+        {% if course_category_block %}
+            <section id="homepage-course-category">
+                {{ course_category_block }}
+            </section>
+        {% endif %}
+
+        {% include template ~ "/layout/hot_courses.tpl" %}
+
+       
+        {% if plugin_content_bottom %}
+            <div id="plugin_content_bottom">
+                {{plugin_content_bottom}}
+            </div>
+        {% endif %}
+      
+	</div>
+
+    
+    {% if plugin_main_bottom %}
+        <div id="plugin_main_bottom" class="col-md-12">
+            {{ plugin_main_bottom }}
+        </div>
+    {% endif %}
+
+{% endblock %}

+ 24 - 0
main/template/rainbow/layout/layout_3_col.tpl

@@ -0,0 +1,24 @@
+{#  This template is NOT used in chamilo 1.9 #}
+{% extends template ~ "/layout/main.tpl" %}
+
+{% block body %}
+	<div id="maincontent" class="maincontent">
+		{{ plugin_courses_block}}
+		{{ home_page_block}}
+		{{ message}}
+		{{ content}}
+		{{ announcements_block}}
+	</div>
+
+	<div id="menu-wrapper">
+		{{ login_block}}
+		{{ profile_block}}
+		{{ account_block}}
+		{{ teacher_block}}
+		{{ notice_block}}
+		{{ navigation_course_links}}
+		{{ plugin_courses_right_block}}
+		{{ search_block}}
+		{{ classes_block}}
+	</div>
+{% endblock %}

+ 35 - 0
main/template/rainbow/layout/login_form.tpl

@@ -0,0 +1,35 @@
+{% if login_form %}
+    <div id="login_block" class="panel panel-default">
+        <div class="panel-body">
+        {{ login_language_form }}
+
+        {% if plugin_login_top is not null %}
+            <div id="plugin_login_top">
+                {{ plugin_login_top }}
+            </div>
+        {% endif %}
+
+        {{ login_failed }}
+
+        {{ login_form }}
+
+        {% if "allow_lostpassword" | get_setting == 'true' or "allow_registration" | get_setting == 'true' %}
+            <ul class="nav nav-pills nav-stacked">
+                {% if "allow_registration" | get_setting != 'false' %}
+                    <li><a href="main/auth/inscription.php"> {{ 'SignUp' | get_lang }} </a></li>
+                {% endif %}
+
+                {% if "allow_lostpassword" | get_setting == 'true' %}
+                    <li><a href="main/auth/lostPassword.php"> {{ 'LostPassword' | get_lang }} </a></li>
+                {% endif %}
+            </ul>
+        {% endif %}
+
+        {% if plugin_login_bottom is not null %}
+            <div id="plugin_login_bottom">
+                {{ plugin_login_bottom }}
+            </div>
+        {% endif %}
+        </div>
+    </div>
+{% endif %}

+ 19 - 0
main/template/rainbow/layout/main.tpl

@@ -0,0 +1,19 @@
+{% block header %}
+{% include template ~ "/layout/main_header.tpl" %}
+{% endblock %}
+
+{% block body %}
+	{% if show_sniff == 1 %}
+	 	{% include template ~ "/layout/sniff.tpl" %}
+	{% endif %}
+{% endblock %}
+
+{% block footer %}
+   
+    {% if show_footer == true %}
+        </div> <!-- end of #col" -->
+        
+        </div> <!-- end of #container" -->
+    {% endif %}
+    {% include template ~ "/layout/main_footer.tpl" %}
+{% endblock %}

+ 19 - 0
main/template/rainbow/layout/main_footer.tpl

@@ -0,0 +1,19 @@
+{% if show_footer == true %}
+    {% include template ~ "/layout/footer.tpl" %}
+{% endif %}
+    <div class="modal fade" id="global-modal" tabindex="-1" role="dialog" aria-labelledby="global-modal-title" aria-hidden="true">
+        <div class="modal-dialog modal-lg">
+            <div class="modal-content">
+                <div class="modal-header">
+                    <button type="button" class="close" data-dismiss="modal" aria-label="{{ "Close" | get_lang }}">
+                        <span aria-hidden="true">&times;</span>
+                    </button>
+                    <h4 class="modal-title" id="global-modal-title">&nbsp;</h4>
+                </div>
+                <div class="modal-body">
+                </div>
+            </div>
+        </div>
+    </div>
+</body>
+</html>

+ 93 - 0
main/template/rainbow/layout/main_header.tpl

@@ -0,0 +1,93 @@
+<!DOCTYPE html>
+<!--[if lt IE 7]> <html lang="{{ document_language }}" class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
+<!--[if IE 7]>    <html lang="{{ document_language }}" class="no-js lt-ie9 lt-ie8"> <![endif]-->
+<!--[if IE 8]>    <html lang="{{ document_language }}" class="no-js lt-ie9"> <![endif]-->
+<!--[if gt IE 8]><!--><html lang="{{ document_language }}" class="no-js"> <!--<![endif]-->
+<head>
+{% block head %}
+{% include template ~ "/layout/head.tpl" %}
+{% endblock %}
+</head>
+<body dir="{{ text_direction }}" class="{{ section_name }} {{ login_class }}">
+<noscript>{{ "NoJavascript"|get_lang }}</noscript>
+
+<!-- Display the Chamilo Uses Cookies Warning Validation if needed -->
+{% if displayCookieUsageWarning == true %}
+    <!-- If toolbar is displayed, we have to display this block bellow it -->
+    {% if toolBarDisplayed == true %}
+        <div class="displayUnderToolbar" >&nbsp;</div>
+    {% endif %}
+    <form onSubmit="$(this).toggle('slow')" action="" method="post">
+        <input value=1 type="hidden" name="acceptCookies"/>
+        <div class="cookieUsageValidation">
+            {{ "YouAcceptCookies" | get_lang }}
+            <span style="margin-left:20px;" onclick="$(this).next().toggle('slow'); $(this).toggle('slow')">
+                ({{"More" | get_lang }})
+            </span>
+            <div style="display:none; margin:20px 0;">
+                {{ "HelpCookieUsageValidation" | get_lang}}
+            </div>
+            <span style="margin-left:20px;" onclick="$(this).parent().parent().submit()">
+                ({{"Accept" | get_lang }})
+            </span>
+        </div>
+    </form>
+{% endif %}
+
+
+{% if show_header == true %}
+
+<div id="page-wrap"><!-- page section -->
+    {% block help_notifications %}
+    <ul id="navigation" class="notification-panel">
+        {{ help_content }}
+        {{ bug_notification_link }}
+    </ul>
+    {% endblock %}
+    {% block topbar %}
+        {% include template ~ "/layout/topbar.tpl" %}
+        {% if show_toolbar == 1 %}
+            <div class="clear-header"></div>
+        {% endif %}
+    {% endblock %}
+    
+        <header>
+            <div class="extra-header">{{ header_extra_content }}</div>
+            <section id="main" class="container">
+                {% if plugin_header_main %}
+                <div class="row">
+                    <div class="col-lg-12">
+                        {{ plugin_header_main }}
+                    </div>
+                </div>
+                {% endif %}
+                <div class="row">
+                    <div class="col-xs-6 col-md-4">
+                        <h2>{{ _s.site_name }}</h2>
+                    </div>
+                    <div class="col-xs-6 col-md-4">
+                         
+                    </div>
+                        <div class="col-xs-6 col-md-4">
+                            <div class="logo pull-right">
+                                {{ logo }}
+                            </div>
+                        </div>
+                </div>
+            </section>
+            <section id="menu-bar">
+                {% block menu %}
+                {% include template ~ "/layout/menu.tpl" %}
+                {% endblock %}
+            </section>
+            <section id="breadcrumb-bar">
+                <div class="container">
+                    {% block breadcrumb %}
+                        {{ breadcrumb }}
+                    {% endblock %}
+                </div>
+            </section>
+        </header>
+    <div id="top_main_content">
+       
+{% endif %}

+ 63 - 0
main/template/rainbow/layout/menu.tpl

@@ -0,0 +1,63 @@
+<div class="container">
+    <nav class="navbar navbar-default">
+        <!-- Brand and toggle get grouped for better mobile display -->
+        <div class="navbar-header">
+            <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#menuone" aria-expanded="false">
+                <span class="sr-only">Toggle navigation</span>
+                <span class="icon-bar"></span>
+                <span class="icon-bar"></span>
+                <span class="icon-bar"></span>
+            </button>
+        </div>
+        <!-- Collect the nav links, forms, and other content for toggling -->
+        <div class="collapse navbar-collapse" id="menuone">
+            <ul class="nav navbar-nav">
+                <li class="item-menu menu-one"><a href="#">Accueli</a></li>
+                <li class="item-menu menu-two dropdown">
+                    <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
+                        FAQ
+                        <span class="caret"></span>
+                    </a>
+                    <ul class="dropdown-menu" role="menu">
+                        <li><a href="#">Page 1</a></li>
+                        <li><a href="#">Page 2</a></li>
+                        <li><a href="#">Page 3</a></li>
+                        <li><a href="#">Page 4</a></li>
+                    </ul>
+                </li>
+                <li class="item-menu menu-three"><a href="#">Inscription</a></li>
+                <li class="item-menu menu-four"><a href="#">Démo</a></li>
+                <li class="item-menu menu-five"><a href="#">Contact</a></li>
+            </ul>
+           {% if _u.logged == 1 %}
+           <ul class="nav navbar-nav navbar-right">
+               {% if user_notifications is not null %}
+               <li><a href="{{ message_url }}">{{ user_notifications }}</a></li>
+               {% endif %}
+               {% if _u.status != 6 %}
+                <li class="dropdown">
+                    <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
+                        {{ _u.complete_name }} <span class="caret"></span>
+                    </a>
+                    <ul class="dropdown-menu" role="menu">
+                        <li>
+                            {{ profile_link }}
+                            {{ message_link }}
+                            {{ certificate_link }}
+                            {{ menu }}
+                        </li>
+                    </ul>
+                </li>
+               {% if logout_link is not null %}
+               <li>
+                   <a id="logout_button" title="{{ "Logout"|get_lang }}" href="{{ logout_link }}" >
+                       <em class="fa fa-sign-out"></em> {{ "Logout"|get_lang }}
+                   </a>
+               </li>
+               {% endif %}
+               {% endif %}
+            </ul>
+            {% endif %}
+        </div><!-- /.navbar-collapse -->
+    </nav>
+</div><!-- /.container-fluid -->

+ 16 - 0
main/template/rainbow/layout/no_layout.tpl

@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<!--[if lt IE 7]> <html lang="{{document_language}}" class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
+<!--[if IE 7]>    <html lang="{{document_language}}" class="no-js lt-ie9 lt-ie8"> <![endif]-->
+<!--[if IE 8]>    <html lang="{{document_language}}" class="no-js lt-ie9"> <![endif]-->
+<!--[if gt IE 8]><!--><html lang="{{document_language}}" class="no-js"> <!--<![endif]-->
+<head>
+{% include template ~ "/layout/head.tpl" %}
+</head>
+<body dir="{{text_direction}}" class="{{section_name}}">
+{% block name%}
+{% endblock %}
+{% block body %}
+    {{ content }}
+{% endblock %}
+</body>
+</html>

+ 25 - 0
main/template/rainbow/layout/page_body.tpl

@@ -0,0 +1,25 @@
+{#  Actions  #}
+{% if actions != '' %}
+    <div class="actions">
+        {{ actions }}
+    </div>
+{% endif %}
+
+{{ flash_messages }}
+<span id="js_alerts"></span>
+
+{#  Page header #}
+{% if header != '' %}
+    <div class="section-page">
+        <div class="page-header">
+            <h3>{{ header }}</h3>
+        </div>
+    </div>
+{% endif %}
+
+{#  Show messages #}
+{% if message != '' %}
+    <section id="messages">
+        {{ message}}
+    </section>
+{% endif %}

+ 26 - 0
main/template/rainbow/layout/show_footer.tpl

@@ -0,0 +1,26 @@
+{#
+    show_header and show_footer templates are only called when using the
+    Display::display_header and Display::display_footer
+    for backward compatibility we suppose that the default layout is one column
+    which means using a div with class span12
+#}
+{% if show_header == true %}
+    </section>
+</div>
+{% endif %}
+
+{# Plugin bottom  #}
+{% if plugin_content_bottom is not null %}
+    <div id="plugin_content_bottom" class="col-md-12">
+        {{ plugin_content_bottom}}
+    </div>
+{% endif %}
+
+{% if show_footer == true %}
+    </div> <!-- end of #col" -->
+    </div> <!-- end of #row" -->
+    </div> <!-- end of #container" -->
+
+{% endif %}
+
+{% include template ~ "/layout/main_footer.tpl" %}

+ 17 - 0
main/template/rainbow/layout/show_header.tpl

@@ -0,0 +1,17 @@
+{% include template ~ "/layout/main_header.tpl" %}
+{#
+    show_header and show_footer templates are only called when using the
+    Display::display_header and Display::display_footer
+    for backward compatibility we suppose that the default layout is one column
+    which means using a div with class span12
+#}
+{% if show_header == true %}
+    {% if plugin_content_top is not null %}
+        <div id="plugin_content_top" class="col-md-12">
+            {{ plugin_content_top }}
+        </div>
+    {% endif %}
+    <div class="col-md-12">
+        {% include template ~ "/layout/page_body.tpl" %}
+        <section id="main_content">
+{% endif %}

+ 134 - 0
main/template/rainbow/layout/sniff.tpl

@@ -0,0 +1,134 @@
+{% raw %}
+<script LANGUAGE="JavaScript">
+var nav ="";
+var screen_size_w;
+var screen_size_h;
+var java="";
+var type_mimetypes="";
+var suffixes_mimetypes="";
+var list_plugins="";
+var check_some_activex="";
+var check_some_plugins="";
+var java_sun_ver="";
+
+<!-- check Microsoft Internet Explorer -->
+if (navigator.userAgent.indexOf("MSIE") != -1) { var nav="ie";}
+
+<!-- check Screen Size -->
+screen_size_w=screen.width;
+screen_size_h=screen.height;
+
+<!-- list mimetypes types, suffixes and plugins (no for IE) -->
+if (nav!="ie"){
+        
+        if (navigator.mimeTypes && navigator.mimeTypes.length > 0) {
+        
+                for (i=0; i < navigator.mimeTypes.length; i++) {
+                        type_mimetypes=type_mimetypes+" "+navigator.mimeTypes[i].type;
+                        suffixes_mimetypes=suffixes_mimetypes+" "+navigator.mimeTypes[i].suffixes;
+                        if (navigator.mimeTypes[i].enabledPlugin!=null) {
+                                list_plugins=list_plugins+" "+navigator.mimeTypes[i].enabledPlugin.name;
+                        }               
+                }
+        }
+}
+<!-- check some activex for IE -->
+if (nav=="ie"){
+        //TODO:check wmediaplayer are too aggressive. Then we can assume that if there Windows, there Wmediaplayer?
+        
+        var check_some_activex = 
+        DetectActiveXObject("ShockwaveFlash.ShockwaveFlash.1", "flash_yes")+
+        DetectActiveXObject("QuickTime.QTElementBehavior", "quicktime_yes")+
+        //DetectActiveXObject("MediaPlayer.MediaPlayer.1","wmediaplayer_yes")+
+        DetectActiveXObject("acroPDF.PDF.1","acrobatreader_yes");
+        
+        function DetectActiveXObject(ObjectName, name) { 
+                result = false;
+                        document.write('<SCRIPT LANGUAGE=VBScript\> \n');
+                        document.write('on error resume next \n');
+                        document.write('result = IsObject(CreateObject("' + ObjectName + '")) \n');
+                        document.write('</SCRIPT\> \n');
+                if (result) return name+' , '; else return '';
+        }
+}
+<!-- check some plugins for not IE -->
+if (nav!="ie"){
+
+        if (list_plugins.indexOf("Shockwave Flash")!=-1){
+                check_some_plugins=check_some_plugins+', flash_yes';
+        }
+        if (list_plugins.indexOf("QuickTime")!=-1){
+                check_some_plugins=check_some_plugins+', quicktime_yes';
+        }
+        if (list_plugins.indexOf("Windows Media Player")!=-1){
+                check_some_plugins=check_some_plugins+', wmediaplayer_yes';
+        }
+        if (list_plugins.indexOf("Adobe Acrobat")!=-1){
+                check_some_plugins=check_some_plugins+',acrobatreader_yes';
+        }
+}
+<!-- java -->
+if(navigator.javaEnabled()==true){java="java_yes";}else{java="java_no";}
+
+<!-- check java Sun ver -->
+//for not IE
+if (nav!="ie"){
+        if (navigator.mimeTypes["application/x-java-applet"]){ java_sun_ver="javasun_yes";}
+        if (navigator.mimeTypes["application/x-java-applet;jpi-version=1.6.0_24"]){ java_sun_ver=java_sun_ver+" , javasun_ver_1.6_24_yes"; }//This java version 1.6.0_24 is problematic, the user should be updated
+
+}
+//for IE
+if (nav=="ie"){
+        //1.5->end nov 2009
+        //TODO:extract minor version
+        var java_sun_ver =
+        DetectActiveXObject("JavaWebStart.isInstalled","javasun_yes")+
+        DetectActiveXObject("JavaWebStart.isInstalled.1.4.2.0","javasun_ver_1.4_yes")+
+        DetectActiveXObject("JavaWebStart.isInstalled.1.5.0.0","javasun_ver_1.5_yes")+
+        DetectActiveXObject("JavaWebStart.isInstalled.1.6.0.0","javasun_ver_1.6_yes")+
+        DetectActiveXObject("JavaWebStart.isInstalled.1.7.0.0","javasun_ver_1.7_yes");
+        
+        function DetectActiveXObject(ObjectName, name) { 
+                result = false;
+                        document.write('<SCRIPT LANGUAGE=VBScript\> \n');
+                        document.write('on error resume next \n');
+                        document.write('result = IsObject(CreateObject("' + ObjectName + '")) \n');
+                        document.write('</SCRIPT\> \n');
+                if (result) return name+' , '; else return '';
+        }
+}
+
+<!-- Send to server -->
+function sendSniff(){
+        document.forms.sniff_nav_form.sniff_navigator.value="checked";
+        document.forms.sniff_nav_form.sniff_navigator_screen_size_w.value=screen_size_w;
+        document.forms.sniff_nav_form.sniff_navigator_screen_size_h.value=screen_size_h;
+        document.forms.sniff_nav_form.sniff_navigator_type_mimetypes.value=type_mimetypes;
+        document.forms.sniff_nav_form.sniff_navigator_suffixes_mimetypes.value=suffixes_mimetypes;
+        document.forms.sniff_nav_form.sniff_navigator_list_plugins.value=list_plugins;
+        document.forms.sniff_nav_form.sniff_navigator_check_some_activex.value=check_some_activex;
+        document.forms.sniff_nav_form.sniff_navigator_check_some_plugins.value=check_some_plugins;
+        document.forms.sniff_nav_form.sniff_navigator_java.value=java;
+        document.forms.sniff_nav_form.sniff_navigator_java_sun_ver.value=java_sun_ver;
+        document.sniff_nav_form.submit(); 
+}
+</script>
+{% endraw %}
+
+<form name="sniff_nav_form" method="POST">
+<input type="hidden" name="sniff_navigator">
+<input type="hidden" name="sniff_navigator_screen_size_w">
+<input type="hidden" name="sniff_navigator_screen_size_h">
+<input type="hidden" name="sniff_navigator_type_mimetypes">
+<input type="hidden" name="sniff_navigator_suffixes_mimetypes">
+<input type="hidden" name="sniff_navigator_list_plugins">
+<input type="hidden" name="sniff_navigator_check_some_activex">
+<input type="hidden" name="sniff_navigator_check_some_plugins">
+<input type="hidden" name="sniff_navigator_java">
+<input type="hidden" name="sniff_navigator_java_sun_ver">
+</form>
+{#
+	<script>
+    	sendSniff();
+	</script>
+#}

+ 93 - 0
main/template/rainbow/layout/topbar.tpl

@@ -0,0 +1,93 @@
+<!-- Topbar -->
+{% if show_toolbar == 1 %}
+    <nav id="toolbar-admin" class="navbar navbar-inverse navbar-fixed-top">
+        <div class="container-fluid">
+
+            <div class="navbar-header">
+                <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#toolbar">
+                    <span class="sr-only">Toggle navigation</span>
+                    <span class="icon-bar"></span>
+                    <span class="icon-bar"></span>
+                    <span class="icon-bar"></span>
+                </button>
+                <a class="navbar-brand" href="{{ _p.web }}">
+                    {{ "siteName" | get_setting }}
+                </a>
+            </div>
+
+            {% if _u.logged %}
+                <div class="collapse navbar-collapse" id="toolbar">
+                    <ul class="nav navbar-nav">
+                        <li class="active"><a href="{{ _p.web }}user_portal.php"> {{ "MyCourses"|get_lang }}</a></li>
+                        {#
+                        <li class="dropdown">
+                            <a class="dropdown-toggle" data-toggle="dropdown" href="#">{{'Teaching'|get_lang }}<b class="caret"></b></a>
+                            <ul class="dropdown-menu">
+                                <li><a href="{{ _p.web_main }}create_course/add_course.php">{{ "AddCourse"|get_lang }}</a></li>
+                                <li><a href="{{ _p.web_main }}auth/courses.php">{{ "Catalog"|get_lang }}</a></li>
+                            </ul>
+                        </li>
+                        #}
+                        <li class="dropdown">
+                            <a class="dropdown-toggle" data-toggle="dropdown" href="#">{{'Tracking'|get_lang }}<b class="caret"></b></a>
+                            <ul class="dropdown-menu">
+                                <li><a href="{{ _p.web_main }}mySpace/">{{ "CoursesReporting"|get_lang }}</a></li>
+                                <li><a href="{{ _p.web_main }}mySpace/index.php?view=admin">{{ "AdminReports"|get_lang }}</a></li>
+                                <li><a href="{{ _p.web_main }}tracking/exams.php">{{ "ExamsReporting"|get_lang }}</a></li>
+                                <li class="divider"></li>
+                                <li><a href="{{ _p.web_main }}dashboard/">{{ "Dashboard"|get_lang }}</a></li>
+                            </ul>
+                        </li>
+                        {% if _u.is_admin == 1 %}
+                        <li class="dropdown">
+                            <a class="dropdown-toggle" data-toggle="dropdown" href="#">{{'Administration'|get_lang }}<b class="caret"></b></a>
+                            <ul class="dropdown-menu">
+                                <li><a href="{{ _p.web_main }}admin/">{{ "Home"|get_lang }}</a></li>
+                                <li><a href="{{ _p.web_main }}admin/user_list.php">{{ "UserList"|get_lang }}</a></li>
+                                <li><a href="{{ _p.web_main }}admin/course_list.php">{{ "CourseList"|get_lang }}</a></li>
+                                <li><a href="{{ _p.web_main }}session/session_list.php">{{ "SessionList"|get_lang }}</a></li>
+                                <li class="divider"></li>
+                                <li><a href="{{ _p.web_main }}admin/settings.php">{{ "Settings"|get_lang }}</a></li>
+                                <li class="divider"></li>
+                                <li><a href="{{ _p.web_main }}admin/settings.php?category=Plugins">{{ "Plugins"|get_lang }}</a></li>
+                                <li><a href="{{ _p.web_main }}admin/settings.php?category=Regions">{{ "Regions"|get_lang }}</a></li>
+                            </ul>
+                        </li>
+
+                        <li class="dropdown">
+                            <a class="dropdown-toggle" data-toggle="dropdown" href="#">{{ 'Add'|get_lang }}<b class="caret"></b></a>
+                            <ul class="dropdown-menu">
+                                <li><a href="{{ _p.web_main }}admin/user_add.php">{{ "User"|get_lang }}</a></li>
+                                <li><a href="{{ _p.web_main }}admin/course_add.php">{{ "Course"|get_lang }}</a></li>
+                                <li><a href="{{ _p.web_main }}session/session_add.php">{{ "Session"|get_lang }}</a></li>
+                            </ul>
+                        </li>
+                        {% endif %}
+                    </ul>
+
+                    {% if _u.is_admin == 1 %}
+                    <form class="navbar-form navbar-left" role="search" action="{{ _p.web_main }}admin/user_list.php" method="get">
+                        <input type="text" class="form-control" placeholder="{{'SearchUsers'|get_lang }}" name="keyword">
+                    </form>
+                    {% endif %}
+
+                    <ul class="nav navbar-nav navbar-right">
+                        <li><a href="{{ _p.web_main }}social/home.php"><img src="{{ _u.avatar_small }}"/></a></li>
+                        <li class="dropdown">
+                            <a class="dropdown-toggle" data-toggle="dropdown"  href="#">{{ _u.complete_name }}<b class="caret"></b></a>
+                            <ul class="dropdown-menu">
+                                <li><a href="{{ _p.web_main }}social/home.php">{{ "Profile"|get_lang }}</a></li>
+                                <li><a href="{{ _p.web_main }}calendar/agenda_js.php?type=personal">{{ "MyAgenda"|get_lang }}</a></li>
+                                <li><a href="{{ _p.web_main }}messages/inbox.php">{{ "Inbox"|get_lang }}</a></li>
+                                <li><a href="{{ _p.web_main }}auth/my_progress.php">{{ "MyReporting"|get_lang }}</a></li>
+                                <!--<li class="divider"></li>
+                                <li><a href="{{ _p.web_main }}social/invitations.php">{{ "PendingInvitations"|get_lang }}</a></li> -->
+                            </ul>
+                        </li>
+                        <li><a href="{{  _p.web }}index.php?logout=logout&uid={{_u.user_id}}">{{ "Logout"|get_lang }}</a></li>
+                    </ul>
+                </div> <!-- /nav collapse -->
+            {% endif %}
+        </div> <!-- /container-->
+    </nav><!-- /topbar -->
+{% endif %}

+ 20 - 0
main/template/rainbow/layout/welcome_to_course.tpl

@@ -0,0 +1,20 @@
+<div class="normal-message">
+  {{ "HelloXAsYouCanSeeYourCourseListIsEmpty"|get_lang | format(_u.complete_name) }}
+
+{% if count_courses  == 0 %}
+    {{ "PleaseAllowUsALittleTimeToSubscribeYouToOneOfOurCourses"|get_lang }}
+{% else %}
+
+    {% if "allow_students_to_browse_courses"|get_setting  == 'true' %}
+        
+        {{ "GoAheadAndBrowseOurCourseCatalogXOnceRegisteredYouWillSeeTheCourseHereX"|get_lang|format(course_catalog_link, course_list_link) }}
+        
+        <a class="btn btn-primary btn-large" href="{{ course_catalog_url }}">
+            {{ "CourseCatalog"|get_lang }}
+        </a>
+    {% else %}
+        {{ "PleaseAllowUsALittleTimeToSubscribeYouToOneOfOurCourses"|get_lang }}
+    {% endif %}
+
+{% endif %}
+</div>

+ 24 - 0
main/template/rainbow/learnpath/impress.tpl

@@ -0,0 +1,24 @@
+<div class="fallback-message">
+    <p>Your browser <b>doesn't support the features required</b> by impress.js, so you are presented with a simplified version of this presentation.</p>
+    <p>For the best experience please use the latest <b>Chrome</b>, <b>Safari</b> or <b>Firefox</b> browser.</p>
+</div>
+
+<div id="impress">
+    {{ html }}
+</div>
+
+<div class="hint">
+    <p>Use a spacebar or arrow keys to navigate</p>
+</div>
+<script>
+if ("ontouchstart" in document.documentElement) { 
+    document.querySelector(".hint").innerHTML = "<p>Tap on the left or right to navigate</p>";
+}
+</script>
+
+<script>     
+$(document).ready(function() {
+    impress().init(); 
+});
+</script>
+<script type="text/javascript" src="{{_p.web_lib}}javascript/impress/impress.js"></script>

+ 153 - 0
main/template/rainbow/learnpath/list.tpl

@@ -0,0 +1,153 @@
+<script>
+    function confirmation(name) {
+        if (confirm("{{ "AreYouSureToDeleteJS"|get_lang }} \"" + name + "\" ?")) {
+            return true;
+        } else {
+            return false;
+        }
+    }
+</script>
+
+{{ introduction_section }}
+
+{% for lp_data in data %}
+    <h3 class="page-header">
+        {% if is_allowed_to_edit %}
+            {% if (categories|length) > 1 %}
+                {{ lp_data.category.getName() }}
+            {% endif %}
+        {% else %}
+            {% if (categories|length) > 1 %}
+                {% if lp_data.lp_list is not empty and lp_data.category.getId() != 0 %}
+                    {{ lp_data.category.getName() }}
+                {% elseif lp_data.lp_list is not empty and lp_data.category.getId() == 0 %}
+                    {{ lp_data.category.getName() }}
+                {% elseif lp_data.lp_list is not empty and lp_data.category.getId() != 0 %}
+                    {{ lp_data.category.getName() }}
+                {% endif %}
+            {% endif %}
+        {% endif %}
+
+        {% if lp_data.category.getId() > 0 and is_allowed_to_edit %}
+            <a href="{{ 'lp_controller.php?' ~ _p.web_cid_query ~ '&action=add_lp_category&id=' ~ lp_data.category.getId() }}" title="{{ "Edit"|get_lang }}">
+                <img src="{{ "edit.png"|icon }}" alt="{{ "Edit"|get_lang }}">
+            </a>
+
+            <a href="{{ 'lp_controller.php?' ~ _p.web_cid_query ~ '&action=add_users_to_category&id=' ~ lp_data.category.getId() }}" title="{{ "AddUser"|get_lang }}">
+                <img src="{{ "user.png"|icon }}" alt="{{ "AddUser"|get_lang }}">
+            </a>
+
+            {% if loop.index0 == 1 %}
+                <a href="#">
+                    <img src="{{ "up_na.png"|icon }}" alt="{{ "Move"|get_lang }}">
+                </a>
+            {% else %}
+                <a href="{{ 'lp_controller.php?' ~ _p.web_cid_query ~ '&action=move_up_category&id=' ~ lp_data.category.getId() }}" title="{{ "Move"|get_lang }}">
+                    <img src="{{ "up.png"|icon }}" alt="{{ "Move"|get_lang }}">
+                </a>
+            {% endif %}
+
+            {% if (data|length - 1) == loop.index0 %}
+                <a href="#">
+                    <img src="{{ "down_na.png"|icon }}" alt="{{ "Move"|get_lang }}">
+                </a>
+            {% else %}
+                <a href="{{ 'lp_controller.php?' ~ _p.web_cid_query ~ '&action=move_down_category&id=' ~ lp_data.category.getId() }}" title="{{ "Move"|get_lang }}">
+                    <img src="{{ "down.png"|icon }}" alt="{{ "Move"|get_lang }}">
+                </a>
+            {% endif %}
+
+            <a href="{{ 'lp_controller.php?' ~ _p.web_cid_query  ~ '&action=delete_lp_category&id=' ~ lp_data.category.getId() }}" title="{{ "Delete"|get_lang }}">
+                <img src="{{ "delete.png"|icon }}" alt="{{ "Delete"|get_lang }}">
+            </a>
+        {% endif %}
+    </h3>
+
+    {% if lp_data.lp_list %}
+        <div class="table-responsive">
+            <table class="table table-hover table-striped">
+                <thead>
+                    <tr>
+                        <th>{{ "Title"|get_lang }}</th>
+                        {% if is_allowed_to_edit %}
+                            <th>{{ "PublicationDate"|get_lang }}</th>
+                            <th>{{ "ExpirationDate"|get_lang }}</th>
+                            <th>{{ "Progress"|get_lang }}</th>
+                            <th>{{ "AuthoringOptions"|get_lang }}</th>
+                        {% else %}
+                            {% if not is_invitee %}
+                                <th>{{ "Progress"|get_lang }}</th>
+                            {% endif %}
+
+                            <th>{{ "Actions"|get_lang }}</th>
+                        {% endif %}
+                    </tr>
+                </thead>
+                <tbody>
+                    {% for row in lp_data.lp_list %}
+                        <tr>
+                            <td>
+                                {{ row.learnpath_icon }}
+                                <a href="{{ row.url_start }}">
+                                    {{ row.title }}
+                                    {{ row.session_image }}
+                                    {{ row.extra }}
+                                </a>
+                            </td>
+                            {% if is_allowed_to_edit %}
+                                <td>
+                                    {% if row.start_time %}
+                                        <span class="small">{{ row.start_time }}</span>
+                                    {% endif %}
+                                </td>
+                                <td>
+                                    <span class="small">{{ row.end_time }}</span>
+                                </td>
+                                <td>
+                                    {{ row.dsp_progress }}
+                                </td>
+                            {% else %}
+                                {% if not is_invitee %}
+                                    <td>
+                                        {{ row.dsp_progress }}
+                                    </td>
+                                {% endif %}
+                            {% endif %}
+
+                            <td>
+                                {{ row.action_build }}
+                                {{ row.action_edit }}
+                                {{ row.action_visible }}
+                                {{ row.action_tracking }}
+                                {{ row.action_publish }}
+                                {{ row.action_subscribe_users }}
+                                {{ row.action_serious_game }}
+                                {{ row.action_reinit }}
+                                {{ row.action_default_view }}
+                                {{ row.action_debug }}
+                                {{ row.action_export }}
+                                {{ row.action_copy }}
+                                {{ row.action_auto_launch }}
+                                {{ row.action_pdf }}
+                                {{ row.action_delete }}
+                                {{ row.action_order }}
+                            </td>
+                        </tr>
+                    {% endfor %}
+                </tbody>
+            </table>
+        </div>
+    {% endif %}
+{% endfor %}
+
+{% if is_allowed_to_edit and not lp_is_shown %}
+    <div id="no-data-view">
+        <h2>{{ "LearningPaths"|get_lang }}</h2>
+        <img src="{{ "scorms.png"|icon(64) }}" width="64" height="64">
+        <div class="controls">
+            <a href="{{ web_self ~ "?" ~ _p.web_cid_query ~ "&action=add_lp" }}" class="btn btn-default">
+                {{ "LearnpathAddLearnpath"|get_lang }}
+            </a>
+        </div>
+    </div>
+{% endif %}

+ 1 - 0
main/template/rainbow/learnpath/lp_upload_audio.tpl

@@ -0,0 +1 @@
+{{ content }}

+ 133 - 0
main/template/rainbow/learnpath/record_voice.tpl

@@ -0,0 +1,133 @@
+<div id="record-audio-recordrtc" class="text-center">
+    <p>
+        <span class="fa fa-microphone fa-5x fa-fw" aria-hidden="true"></span>
+        <span class="sr-only">{{ 'RecordAudio'|get_lang }}</span>
+    </p>
+    <button class="btn btn-primary" type="button" id="btn-start-record">
+        <span class="fa fa-circle fa-fw" aria-hidden="true"></span> {{ 'StartRecordingAudio'|get_lang }}
+    </button>
+    <button class="btn btn-success" type="button" id="btn-stop-record" disabled>
+        <span class="fa fa-square fa-fw" aria-hidden="true"></span> {{ 'StopRecordingAudio'|get_lang }}
+    </button>
+</div>
+
+<div id="record-audio-wami" class="wami-container"></div>
+
+<script>
+    $(document).on('ready', function () {
+        function useRecordRTC(){
+            $('#record-audio-recordrtc').show();
+
+            var mediaConstraints = {audio: true},
+                    recordRTC = null,
+                    btnStart = $('#btn-start-record'),
+                    btnStop = $('#btn-stop-record');
+
+            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();
+
+                    btnStop.prop('disabled', false);
+                    btnStart.prop('disabled', true);
+                }
+
+                function errorCallback(error) {
+                    alert(error.message);
+                }
+            });
+
+            btnStop.on('click', function () {
+                if (!recordRTC) {
+                    return;
+                }
+
+                recordRTC.stopRecording(function (audioURL) {
+                    var recordedBlob = recordRTC.getBlob(),
+                            fileName = Math.round(Math.random() * 99999999) + 99999999,
+                            fileExtension = '.' + recordedBlob.type.split('/')[1];
+
+                    var formData = new FormData();
+                    formData.append('audio-filename', fileName + fileExtension);
+                    formData.append('audio-blob', recordedBlob, 'audio' + fileExtension);
+
+                    $.ajax({
+                        url: '{{ _p.web_ajax }}lp.ajax.php?a=record_audio&lp_item_id={{ lp_item_id }}',
+                        data: formData,
+                        processData: false,
+                        contentType: false,
+                        type: 'POST',
+                        success: function (fileURL) {
+                            if (!fileURL) {
+                                return;
+                            }
+
+                            window.location.reload();
+                        }
+                    });
+
+                    btnStop.prop('disabled', true);
+                    btnStart.prop('disabled', false);
+                });
+            });
+        }
+
+        function useWami(){
+            $('#record-audio-wami').show();
+
+            function setupGUI() {
+                var gui = new Wami.GUI({
+                    id : 'record-audio-wami',
+                    singleButton : true,
+                    recordUrl : '{{ _p.web_ajax }}record_audio_wami.ajax.php?' + $.param({
+                        waminame: 'rec_' + (new Date()).getTime() + '.wav',
+                        wamidir: '{{ cur_dir_path }}',
+                        wamiuserid: {{ _u.user_id }},
+                        lp_item_id: {{ lp_item_id }}
+                    }),
+                    buttonUrl : '{{ _p.web_lib }}wami-recorder/buttons.png',
+                    buttonNoUrl: '{{ _p.web_img }}blank.gif',
+                    onRecordFinish: function() {
+                        $('#start-recording').hide();
+                        window.location.reload();
+                    }
+                });
+
+                gui.setPlayEnabled(false);
+            }
+
+            Wami.setup({
+                id : "record-audio-wami",
+                onReady : setupGUI,
+                swfUrl: '{{ _p.web_lib }}wami-recorder/Wami.swf'
+            });
+        }
+
+        $('#record-audio-recordrtc, #record-audio-wami').hide();
+
+        var webRTCIsEnabled = navigator.webkitGetUserMedia || navigator.mozGetUserMedia || navigator.getUserMedia ||
+                navigator.mediaDevices.getUserMedia;
+
+        if (webRTCIsEnabled) {
+            useRecordRTC();
+
+            return;
+        }
+
+        useWami();
+    });
+</script>

+ 61 - 0
main/template/rainbow/learnpath/report.tpl

@@ -0,0 +1,61 @@
+<div class="table-responsive">
+    <table class="table table-hover table-striped table-bordered">
+        <thead>
+            <tr>
+                <th>{{ 'FirstName'|get_lang }}</th>
+                <th>{{ 'LastName'|get_lang }}</th>
+                <th class="text-center">{{ 'ScormTime'|get_lang }}</th>
+                <th class="text-right">{{ 'Progress'|get_lang }}</th>
+                <th class="text-right">{{ 'ScormScore'|get_lang }}</th>
+                <th class="text-center">{{ 'LastConnection'|get_lang }}</th>
+                <th>{{ 'Actions'|get_lang }}</th>
+            </tr>
+        </thead>
+        <tbody>
+            {% for user in user_list %}
+                <tr id="row-{{ user.id }}">
+                    <td>{{ user.first_name }}</td>
+                    <td>{{ user.last_name }}</td>
+                    <td class="text-center">{{ user.lp_time }}</td>
+                    <td class="text-right">{{ user.lp_progress }}</td>
+                    <td class="text-right">{{ user.lp_score }}</td>
+                    <td class="text-center">{{ user.lp_last_connection }}</td>
+                    <td>
+                        <button class="btn btn-success btn-sm" data-id="{{ user.id }}">{{ 'Details'|get_lang }}</button>
+                    </td>
+                </tr>
+                <tr class="hide"></tr>
+            {% endfor %}
+        </tbody>
+    </table>
+</div>
+
+<script>
+$(document).on('ready', function () {
+    $('tr td button').on('click', function (e) {
+        e.preventDefault();
+
+        var self = $(this);
+        var userId = self.data('id') || 0;
+        var trHead = self.parents('tr');
+        var trDetail = trHead.next();
+
+        if (self.is('.active')) {
+            self.removeClass('active');
+
+            trDetail.html('').addClass('hide');
+        } else {
+            self.addClass('active');
+
+            var newTD = $('<td>', {
+                colspan: 7
+            });
+            newTD.load('{{ _p.web_main ~ 'mySpace/lp_tracking.php?action=stats&extend_all=0&id_session=' ~ session_id ~ '&course=' ~ course_code ~ '&lp_id=' ~ lp_id ~ '&student_id=\' + userId + \'&origin=tracking_course&allow_extend=0' }} .table-responsive', function () {
+                newTD.appendTo(trDetail);
+            });
+
+            trDetail.removeClass('hide');
+        }
+    });
+});
+</script>

+ 6 - 0
main/template/rainbow/learnpath/subscribe_users.tpl

@@ -0,0 +1,6 @@
+{% extends template ~ "/layout/layout_1_col.tpl" %}
+{% block content %}
+
+    {{ tabs }}
+
+{% endblock %}

+ 278 - 0
main/template/rainbow/learnpath/view.tpl

@@ -0,0 +1,278 @@
+<div id="learning_path_main" class="{{ is_allowed_to_edit ? 'lp-view-include-breadcrumb' }} {{ lp_mode == 'embedframe' ? 'lp-view-collapsed' }}">
+    {% if is_allowed_to_edit %}
+        <div id="learning_path_breadcrumb_zone" class="hidden-xs">
+            {{ breadcrumb }}
+        </div>
+    {% endif %}
+            <div id="learning_path_left_zone" class="sidebar-scorm">
+                <div class="lp-view-zone-container">
+                    <div id="scorm-info">
+                        <div id="panel-scorm" class="panel-bsody">
+                            <div class="image-avatar">
+                                    {% if lp_author == '' %}
+                                       <div class="text-center">
+                                            {{ lp_preview_image }}
+                                        </div>
+                                    {% else %}
+                                        <div class="media">
+                                            <div class="media-left">
+                                                {{ lp_preview_image }}
+                                            </div>
+                                            <div class="media-body">
+                                                <div class="description-autor"> {{ lp_author }} </div>
+                                            </div>
+                                        </div>
+                                    {% endif %}
+                                </div>
+
+                                {% if show_audio_player %}
+                                    <div id="lp_media_file">
+                                        {{ media_player }}
+                                    </div>
+                                {% endif %}
+
+                                {% if gamification_mode == 1 %}
+                                    <hr>
+                                    <!--- gamification -->    
+                                    <div id="scorm-gamification">
+                                        <div class="row">
+                                            <div class="col-xs-6">
+                                                {% if gamification_stars > 0 %}
+                                                    {% for i in 1..gamification_stars %}
+                                                        <em class="fa fa-star level"></em>
+                                                    {% endfor %}
+                                                {% endif %}
+
+                                                {% if gamification_stars < 4 %}
+                                                    {% for i in 1..4 - gamification_stars %}
+                                                        <em class="fa fa-star"></em>
+                                                    {% endfor %}
+                                                {% endif %}
+                                            </div>
+                                            <div class="col-xs-6 text-right">
+                                                {{ "XPoints"|get_lang|format(gamification_points) }}
+                                            </div>
+                                        </div>
+                                        <div class="row">
+                                            <div class="col-xs-12 navegation-bar">
+                                                <div id="progress_bar">
+                                                    {{ progress_bar }}
+                                                </div>
+                                            </div>
+                                        </div>
+                                    </div>
+                                   <!--- end gamification -->          
+                                {% else %}         
+                                    <div id="progress_bar">
+                                        {{ progress_bar }}
+                                    </div>
+                                {% endif %}
+
+                                {{ teacher_toc_buttons }}
+
+                            <hr class="visible-xs-block">
+                            <div class="visible-xs-block movil-toolbar">
+                                <button type="button" id="lp-view-expand-button" class="icon-toolbar expand visible-xs-block">
+                                <span class="fa fa-expand" aria-hidden="true"></span>
+                                </button>
+                                <a href="{{ button_home_url }}" class="icon-toolbar" target="_self" onclick="javascript: window.parent.API.save_asset();">
+                                    <em class="fa fa-home"></em> <span class="hidden-xs hidden-sm"></span>
+                                </a>
+                            </div>
+                            
+                        </div>
+                    </div>
+
+                {# TOC layout #}
+                <div id="toc_id" class="scorm-body" name="toc_name">
+                    <div id="learning_path_toc" class="scorm-list">
+                        <h1 class="scorm-title">{{ lp_title_scorm }}</h1>
+                        {{ lp_html_toc }}
+                    </div>
+                </div>
+                {# end TOC layout #}
+                </div>
+            </div>
+            {# end left zone #}
+
+            {# <div id="hide_bar" class="scorm-toggle" style="display:inline-block; width: 25px; height: 1000px;"></div> #}
+
+            {# right zone #}
+            <div id="learning_path_right_zone" class="content-scorm">
+                <div class="lp-view-zone-container">
+                    <div id="lp_navigation_elem" class="navegation-bar pull-right text-right">
+                        <a href="#" id="lp-view-expand-toggle" class="icon-toolbar expand" role="button">
+                            {% if lp_mode == 'embedframe' %}
+                                <span class="fa fa-compress" aria-hidden="true"></span>
+                                <span class="sr-only">{{ 'Expand'|get_lang }}</span>
+                            {% else %}
+                                <span class="fa fa-expand" aria-hidden="true"></span>
+                                <span class="sr-only">{{ 'Expand'|get_lang }}</span>
+                            {% endif %}
+                        </a>
+                        <a id="home-course" href="{{ button_home_url }}" class="icon-toolbar" target="_self" onclick="javascript: window.parent.API.save_asset();">
+                            <em class="fa fa-home"></em> <span class="hidden-xs hidden-sm"></span>
+                        </a>
+                        {{ navigation_bar }}
+                    </div>
+
+                    <div class="lp-view-tabs">
+                        <ul id="navTabs" class="nav nav-tabs" role="tablist">
+                            <li role="presentation" class="active">
+                                <a href="#lp-view-content" aria-controls="lp-view-content" role="tab" data-toggle="tab">
+                                    <span class="fa fa-book fa-2x fa-fw" aria-hidden="true"></span><span class="sr-only">{{ 'Lesson'|get_lang }}</span>
+                                </a>
+                            </li>
+                            <li role="presentation">
+                                <a href="#lp-view-forum" aria-controls="lp-view-forum" role="tab" data-toggle="tab">
+                                    <span class="fa fa-commenting-o fa-2x fa-fw" aria-hidden="true"></span><span class="sr-only">{{ 'Forum'|get_lang }}</span>
+                                </a>
+                            </li>
+                        </ul>
+
+                        <div class="tab-content">
+                            <div role="tabpanel" class="tab-pane active" id="lp-view-content">
+                                {% if lp_mode == 'fullscreen' %}
+                                    <iframe id="content_id_blank" name="content_name_blank" src="blank.php" border="0" frameborder="0" allowfullscreen="true" webkitallowfullscreen="true" mozallowfullscreen="true"></iframe>
+                                {% else %}
+                                    <iframe id="content_id" name="content_name" src="{{ iframe_src }}" border="0" frameborder="0" allowfullscreen="true" webkitallowfullscreen="true" mozallowfullscreen="true"></iframe>
+                                {% endif %}
+                            </div>
+                            <div role="tabpanel" class="tab-pane" id="lp-view-forum">
+                                
+                            </div>
+                        </div>
+                    </div>
+                </div>
+            </div>
+            {# end right Zone #}
+</div>
+
+<script>
+    (function () {
+        var LPViewUtils = {
+            setHeightLPToc: function () {
+                var scormInfoHeight = $('#scorm-info').outerHeight(true);
+
+                $('#learning_path_toc').css({
+                    top: scormInfoHeight
+                });
+            }
+        };
+
+        $(document).on('ready', function () {
+            
+            {% if lp_mode == 'embedframe' %}
+                //$('#learning_path_main').addClass('lp-view-collapsed');
+                $('#lp-view-expand-button, #lp-view-expand-toggle').on('click', function (e) {
+                e.preventDefault();
+
+                $('#learning_path_main').toggleClass('lp-view-collapsed');
+
+                $('#lp-view-expand-toggle span.fa').toggleClass('fa-compress');
+                $('#lp-view-expand-toggle span.fa').toggleClass('fa-expand');
+            });
+            {% else %}
+            $('#lp-view-expand-button, #lp-view-expand-toggle').on('click', function (e) {
+                e.preventDefault();
+
+                $('#learning_path_main').toggleClass('lp-view-collapsed');
+
+                $('#lp-view-expand-toggle span.fa').toggleClass('fa-expand');
+                $('#lp-view-expand-toggle span.fa').toggleClass('fa-compress');
+            });
+            
+            {% endif %}
+
+            $('.lp-view-tabs').on('click', '.disabled', function (e) {
+                e.preventDefault();
+            });
+
+            $('a#ui-option').on('click', function (e) {
+                e.preventDefault();
+
+                var icon = $(this).children('.fa');
+
+                if (icon.is('.fa-chevron-up')) {
+                    icon.removeClass('fa-chevron-up').addClass('fa-chevron-down');
+
+                    return;
+                }
+
+                icon.removeClass('fa-chevron-down').addClass('fa-chevron-up');
+            });
+
+            LPViewUtils.setHeightLPToc();
+
+            $('.scorm_item_normal a, #scorm-previous, #scorm-next').on('click', function () {
+                $('.lp-view-tabs').fadeOut();
+            });
+
+            $('#learning_path_right_zone #lp-view-content iframe').on('load', function () {
+                $('.lp-view-tabs a[href="#lp-view-content"]').tab('show');
+
+                $('.lp-view-tabs').fadeIn();
+            });
+
+            loadForumThead({{ lp_id }}, {{ lp_current_item_id }});
+
+            {% if glossary_extra_tools in glossary_tool_availables %}
+                // Loads the glossary library.
+                (function () {
+                    {% if show_glossary_in_documents == 'ismanual' %}
+                        $.frameReady(
+                            function(){
+                                //  $("<div>I am a div courses</div>").prependTo("body");
+                            },
+                            "top.content_name",
+                            {
+                                load: [
+                                    { type:"script", id:"_fr1", src:"{{ jquery_web_path }}"},
+                                    { type:"script", id:"_fr4", src:"{{ jquery_ui_js_web_path }}"},
+                                    { type:"stylesheet", id:"_fr5", src:"{{ jquery_ui_css_web_path }}"},
+                                    { type:"script", id:"_fr2", src:"{{ _p.web_lib }}javascript/jquery.highlight.js"},
+                                    {{ fix_link }}
+                                ]
+                            }
+                        );
+                    {% elseif show_glossary_in_documents == 'isautomatic' %}
+                        $.frameReady(
+                            function(){
+                                //  $("<div>I am a div courses</div>").prependTo("body");
+                            },
+                            "top.content_name",
+                            {
+                                load: [
+                                    { type:"script", id:"_fr1", src:"{{ jquery_web_path }}"},
+                                    { type:"script", id:"_fr4", src:"{{ jquery_ui_js_web_path }}"},
+                                    { type:"stylesheet", id:"_fr5", src:"{{ jquery_ui_css_web_path }}"},
+                                    { type:"script", id:"_fr2", src:"{{ _p.web_lib }}javascript/jquery.highlight.js"},
+                                    {{ fix_link }}
+                                ]
+                            }
+                        );
+                    {% elseif fix_link != '' %}
+                        $.frameReady(
+                            function(){
+                                //  $("<div>I am a div courses</div>").prependTo("body");
+                            },
+                            "top.content_name",
+                            {
+                                load: [
+                                    { type:"script", id:"_fr1", src:"{{ jquery_web_path }}"},
+                                    { type:"script", id:"_fr4", src:"{{ jquery_ui_js_web_path }}"},
+                                    { type:"stylesheet", id:"_fr5", src:"{{ jquery_ui_css_web_path }}"},
+                                    {{ fix_link }}
+                                ]
+                            }
+                        );
+                    {% endif %}
+                })();
+            {% endif %}
+        });
+
+        $(window).on('resize', function () {
+            LPViewUtils.setHeightLPToc();
+        });
+    })();
+</script>

+ 16 - 0
main/template/rainbow/link/edit_category.tpl

@@ -0,0 +1,16 @@
+
+{{javascript}}
+
+<div class="btn-toolbar actions-bar" >
+    <div class="btn-group">
+        <a href="{{root}}&amp;action=listing" class="btn">
+            <em class="size-32 icon-back"></em>
+        </a>
+    </div>
+</div>
+
+{% for message in messages %}
+    {{ message }}
+{% endfor %}
+
+{{form.return_form()}}

+ 16 - 0
main/template/rainbow/link/edit_link.tpl

@@ -0,0 +1,16 @@
+
+{{javascript}}
+
+<div class="btn-toolbar actions-bar" >
+    <div class="btn-group">
+        <a href="{{root}}&amp;action=listing" class="btn">
+            <em class="size-32 icon-back"></em>
+        </a>
+    </div>
+</div>
+
+{% for message in messages %}
+    {{ message }}
+{% endfor %}
+
+{{form.return_form()}}

+ 343 - 0
main/template/rainbow/link/index.tpl

@@ -0,0 +1,343 @@
+
+{{javascript}}
+
+<script type="text/javascript">
+
+    {% if is_allowed_to_edit %}
+        var sec_token = '{{sec_token}}';
+    {% endif %}
+
+$(function() {
+	$('.collapsible .head').click(function(e) {
+        $(this).toggleClass('collapsed');
+        $(this).next().toggle();
+		return true;
+	});
+
+    {% if is_allowed_to_edit %}
+        $(".categories.sortable" ).sortable({
+            axis: 'y',
+            handle: '.handle',
+            //placeholder: 'ui-state-highlight',
+            update: function(event, ui) {
+                var c_id = 0;
+                var ids = [];
+                var items;
+                items = $(this).children('li');
+                items.each(function(index, li){
+                    li = $(li);
+                    var id;
+                    id = li.attr('data-id');
+                    c_id = li.attr('data-c_id');
+                    ids.push(id);
+                });
+
+                LinkCategory.sort(c_id, ids, message.update);
+            }
+        });
+        $(".categories.sortable" ).disableSelection();
+
+        $(".links.sortable" ).sortable({
+            axis: 'y',
+            placeholder: 'ui-state-highlight',
+            update: function(event, ui) {
+                var c_id = 0;
+                var ids = [];
+                var items;
+                items = $(this).children('li');
+                items.each(function(index, li){
+                    li = $(li);
+                    var id;
+                    id = li.attr('data-id');
+                    c_id = li.attr('data-c_id');
+                    ids.push(id);
+                });
+
+                Link.sort(c_id, ids, message.update);
+            }
+        });
+        $(".links.sortable" ).disableSelection();
+
+    {% endif %}
+
+});
+
+ function expand_all(){
+    $('.collapsible .head').removeClass('collapsed').next().show();
+ }
+
+ function collapse_all(){
+    $('.collapsible .head').addClass('collapsed').next().hide();
+ }
+
+ function delete_category(name){
+    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 f = function(data){
+        if(data.success){
+            item.remove();
+        }
+        message.update(data);
+    };
+    LinkCategory.del(c_id, id, f);
+ }
+
+ function delete_all(){
+    if(!confirm("{{'ConfirmYourChoice'|get_lang}}")){
+        return false;
+    }
+
+    var f = function(data){
+        if(data.success){
+            var item = $('.data');
+            item.remove();
+        }
+        message.update(data);
+    };
+    Link.delete_by_course({{c_id}}, {{session_id}}, f);
+
+ }
+
+ function delete_link(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 f = function(data){
+        if(data.success){
+            item.remove();
+        }else{
+            $(btn).removeClass("loading");
+        }
+        message.update(data);
+    };
+    $(btn).addClass("loading");
+    Link.del(c_id, id, f);
+ }
+
+function switch_li_visibility(name, btn)
+{
+    var li = $('#'+name);
+    var id = li.attr('data-id');
+    var c_id = li.attr('data-c_id');
+
+    var is_visible = !li.hasClass('invisible')
+
+    var f = function(data){
+        if(data.success){
+            var btn =  $('.btn.visibility', li);
+            if(is_visible){
+                btn.addClass('show');
+                btn.removeClass('hide');
+                li.addClass('invisible');
+                li.removeClass('visible');
+            }else{
+                btn.removeClass('show');
+                btn.addClass('hide');
+                li.removeClass('invisible');
+                li.addClass('visible');
+            }
+        }
+        message.update(data);
+        $(btn).removeClass("loading");
+    };
+    if(is_visible){
+        Link.hide(c_id, id, f);
+    }else{
+        Link.show(c_id, id, f);
+    }
+    $(btn).addClass("loading");
+}
+
+function validate_link(name, btn){
+    var li = $('#'+name);
+    var id = li.attr('data-id');
+    var c_id = li.attr('data-c_id');
+
+    var f = function(data){
+        if(data.success){
+            li.addClass('valid');
+            li.removeClass('invalid');
+        }else{
+            li.addClass('invalid');
+            li.removeClass('valid');
+        }
+        message.update(data);
+        $(btn).removeClass("loading");
+    };
+    $(btn).addClass("loading");
+    Link.validate(c_id, id, f);
+}
+
+</script>
+
+<div id="messages">
+{% for message in messages %}
+    {{ message }}
+{% endfor %}
+</div>
+
+<div class="btn-toolbar actions-bar" >
+    {% if is_allowed_to_edit %}
+        <div class="btn-group edit">
+            <a href="{{root}}&amp;action=add_category" class="btn new_folder" title="{{'AddCategory'|get_lang}}">
+                <em class="size-32 icon-new-folder"></em>
+            </a>
+            <a href="{{root}}&amp;action=add_link" class="btn new_link" title="{{'AddLink'|get_lang}}">
+                <em class="size-32 icon-new-link"></em>
+            </a>
+            <a href="javascript:void(0)" onclick="delete_all();return false;" class="btn btn-default" title="{{'DeleteAll'|get_lang}}">
+                <em class="size-32 icon-delete-all"></em>
+            </a>
+            <a href="{{root}}&amp;action=import_csv" class="btn import_csv" title="{{'ImportCSV'|get_lang}}">
+                <em class="size-32 icon-import-csv"></em>
+            </a>
+            <a href="{{root}}&amp;action=export_csv" class="btn" title="{{'ExportAsCSV'|get_lang}}">
+                <em class="size-32 icon-export-csv"></em>
+            </a>
+        </div>
+    {% endif %}
+    <div class="btn-group">
+        <a href="javascript:void(0)" onclick="expand_all();return false;" class="btn btn-default" title="{{'ShowAll'|get_lang}}">
+            <em class="size-32 icon-expand"></em>
+        </a>
+        <a href="javascript:void(0)" onclick="collapse_all();return false;" class="btn btn-default" title="{{'ShowNone'|get_lang}}">
+            <em class="size-32 icon-collapse"></em>
+        </a>
+    </div>
+</div>
+
+<div class="data">
+    <ul style="list-style: none; margin-left:0;" class="links sortable">
+        {% for link in links %}
+            {% set link_class %}
+                {% if loop.first %}first{% endif %}
+                {% if loop.last %}last{% endif %}
+                {% if loop.index is odd %}odd{% else %}even{% endif %}
+                {% if link.is_visible() %}visible{% else %}invisible{% endif %}
+            {% endset %}
+
+            <li id="link_{{link.id}}" class="link {{link_class}}" data-id="{{link.id}}" data-c_id="{{link.c_id}}" data-type="link" >
+                <a class="icon" target="{{link.target}}" href="{{root}}&amp;action=go&amp;id={{link.id}}&amp;c_id={{link.c_id}}">
+                    {{ 'link.png' |icon(22)}}
+                </a>
+                <a class="title" target="{{link.target}}" href="{{root}}&amp;action=go&amp;id={{link.id}}&amp;c_id={{link.c_id}}">
+                    {%if link.title %}{{link.title}}{% else %}{{link.url}}{%endif%}
+                </a>
+                {% if link.session_id %}
+                    {{session_image}}
+                {% endif %}
+                <div class="status" style="display:inline-block;">&nbsp;</div>
+                {% if is_allowed_to_edit %}
+                    <div style="float:right;">
+                        <a href="javascript:void(0)" onclick="validate_link('link_{{link.id}}', this);return false;"
+                        title="{{'CheckURL'|get_lang}}"
+                        class="btn validate_link">
+
+                        </a>
+                        <a href="{{root}}&amp;action=edit_link&amp;id={{link.id}}&amp;c_id={{link.c_id}}"
+                        title="{{'Edit'|get_lang}}"
+                        class="">
+                            <em class="size-22 icon-edit"></em>
+                        </a>
+                        <a href="javascript:void(0)" onclick="switch_li_visibility('link_{{link.id}}', this);return false;"
+                        class="btn visibility {%if link.visibility == 1%}hide{%else%}show{%endif%}">
+
+                        </a>
+                        <a href="javascript:void(0)" onclick="delete_link('link_{{link.id}}', this);return false;" title="{{'Delete'|get_lang}}" class="">
+                            <em class="size-22 icon-delete"></em>
+                        </a>
+                    </div>
+                {% endif %}
+                <div class="description">{{link.description}}</div>
+            </li>
+        {% endfor%}
+    </ul>
+
+    <ul id="link_categories" class="categories sortable" style="list-style: none; margin-left:0;">
+    {% for category in categories %}
+        <li id="category_{{category.id}}" class="link_category collapsible" data-id="{{category.id}}" data-c_id="{{category.c_id}}" data-type="category" >
+            <div class="head handle collapsed">
+                {% if is_allowed_to_edit %}
+                    <div style="float:right;">
+                        <a href="{{root}}&amp;action=edit_category&amp;id={{category.id}}&amp;c_id={{category.c_id}}"
+                        onclick="event.stopPropagation();"
+                        title="{{'Edit'|get_lang}}"
+                        class="">
+                            <em class="size-22 icon-edit"></em>
+                        </a>
+                        <a href="javascript:void(0)"
+                        onclick="delete_category('category_{{category.id}}');event.stopPropagation();return false;"
+                            title="{{'Delete'|get_lang}}"
+                            class="">
+                            <em class="size-22 icon-delete"></em>
+                        </a>
+                    </div>
+                {% endif %}
+                <h3>
+                    <a href="{{root}}&amp;action=view&amp;id={{category.id}}&amp;c_id={{category.c_id}}">{{category.category_title|escape}}</a>
+                </h3>
+                {{category.description}}
+            </div>
+            <div class="body" style="display:none;">
+                <ul style="list-style: none; margin-left:0;" class="links sortable">
+                    {% for link in category.links %}
+                    {% set link_class %}
+                        {% if loop.first %}first{% endif %}
+                        {% if loop.last %}last{% endif %}
+                        {% if loop.index is odd %}odd{% else %}even{% endif %}
+                        {% if link.is_visible() %}visible{% else %}invisible{% endif %}
+                    {% endset %}
+
+                        <li id="link_{{link.id}}" class="link {{link_class}}" data-id="{{link.id}}" data-c_id="{{link.c_id}}" data-type="link" >
+                            <a class="icon" target="{{link.target}}" href="{{root}}&amp;action=go&amp;id={{link.id}}&amp;c_id={{link.c_id}}">
+                                {{ 'link.png' |icon(22) }}
+                            </a>
+                            <a class ="title" target="{{link.target}}" href="{{root}}&amp;action=go&amp;id={{link.id}}&amp;c_id={{link.c_id}}">
+                                {%if link.title %}{{link.title}}{% else %}{{link.url}}{%endif%}
+                            </a>
+                            {% if link.session_id %}
+                                {{session_image}}
+                            {% endif %}
+                            <div class="status" style="display:inline-block;">&nbsp;</div>
+                            {% if is_allowed_to_edit %}
+                                <div style="float:right;">
+                                    <a href="javascript:void(0)" onclick="validate_link('link_{{link.id}}', this);return false;"
+                                    title="{{'CheckURL'|get_lang}}"
+                                    class="btn validate_link"></a>
+                                    <a href="{{root}}&amp;action=edit_link&amp;id={{link.id}}&amp;c_id={{link.c_id}}"
+                                    onclick=""
+                                    title="{{'Edit'|get_lang}}"
+                                    class="">
+                                        <em class="size-22 icon-edit"></em>
+                                    </a>
+                                    <a href="javascript:void(0)"
+                                    onclick="switch_li_visibility('link_{{link.id}}', this);return false;"
+                                    class="btn visibility {%if link.visibility == 1%}hide{%else%}show{%endif%}"></a>
+                                    <a href="javascript:void(0)"
+                                    onclick="delete_link('link_{{link.id}}', this);return false;"
+                                    title="{{'Delete'|get_lang}}"
+                                    class="">
+                                        <em class="size-22 icon-delete"></em>
+                                    </a>
+                                </div>
+                            {% endif %}
+                        </li>
+                    {% endfor%}
+                </ul>
+            </div>
+            <div class="details "></div>
+        </li>
+    {% endfor%}
+    </ul>
+</div>

+ 12 - 0
main/template/rainbow/mail/content_registration_platform.tpl

@@ -0,0 +1,12 @@
+<p>{{ 'Dear'|get_lang }} {{ complete_name }},</p>
+<p>{{ 'YouAreReg'|get_lang }} {{ _s.site_name }} {{ 'WithTheFollowingSettings'|get_lang }}</p>
+<p>{{ 'Username'|get_lang }} : {{ login_name }}<br>
+    {{ 'Pass'|get_lang }} : {{ original_password }}</p>
+<p>{{ 'ThanksForRegisteringToSite'|get_lang|format(_s.site_name) }}</p>
+<p>{{ 'Address'|get_lang }} {{ _s.site_name }} {{ 'Is'|get_lang }} : {{ mailWebPath }}</p>
+<p>{{ 'Problem'|get_lang }}</p>
+<p>{{ 'SignatureFormula'|get_lang }}</p>
+<p>{{ _admin.name }}, {{ _admin.surname }}<br>
+    {{ 'Manager'|get_lang }} {{ _s.site_name }}<br>
+    {{ _admin.telephone ? 'T. ' ~ _admin.telephone }}<br>
+    {{ _admin.email ? 'Email'|get_lang ~ ': ' ~ _admin.email }}</p>

+ 9 - 0
main/template/rainbow/mail/content_subscription_to_session_confirmation.tpl

@@ -0,0 +1,9 @@
+<p>{{ 'Dear'|get_lang }} {{ complete_name }},</p>
+<p>{{ 'YouAreRegisterToSessionX'|get_lang|format(session_name) }}</p>
+<p>{{ 'Address'|get_lang }}  {{ _s.site_name }} {{ 'Is'|get_lang }} : {{ _p.web }}</p>
+<p>{{ 'Problem'|get_lang }}</p>
+<p>{{ 'SignatureFormula'|get_lang }}</p>
+<p>{{ _admin.name }} {{ _admin.surname }}<br>
+    {{ 'Manager'|get_lang }} {{ _s.site_name }}<br>
+    {{ _admin.telephone ? 'T. ' ~ _admin.telephone }}<br>
+    {{ _admin.email ? 'Email'|get_lang ~ ': ' ~ _admin.email }}</p>

+ 1 - 0
main/template/rainbow/mail/cron_course_finished_body.tpl

@@ -0,0 +1 @@
+<p>{{ 'MailCronCourseFinishedBody'|get_lang|format(complete_user_name, session_name, session_name, _s.site_name) }}</p>

+ 1 - 0
main/template/rainbow/mail/cron_course_finished_subject.tpl

@@ -0,0 +1 @@
+{{ 'MailCronCourseFinishedSubject'|get_lang|format(session_name)  }}

+ 1 - 0
main/template/rainbow/mail/cron_remind_course_expiration_body.tpl

@@ -0,0 +1 @@
+<p>{{ 'MailCronCourseExpirationReminderBody'|get_lang|format(complete_user_name, session_name, session_access_end_date, remaining_days, _p.web, _s.institution) }}</p>

+ 1 - 0
main/template/rainbow/mail/cron_remind_course_expiration_subject.tpl

@@ -0,0 +1 @@
+{{ 'MailCronCourseExpirationReminderSubject'|get_lang|format(_s.institution) }}

+ 7 - 0
main/template/rainbow/mail/footer.tpl

@@ -0,0 +1,7 @@
+<table border="0" cellpadding="10" cellspacing="0" width="100%">
+    <tr>
+        <td style="background-color: #2C3E50; border-bottom: 1px solid #2C3E50; box-shadow: 0px 1px 10px rgba(0, 0, 0, 0.1);">
+            &nbsp;
+        </td>
+    </tr>
+</table>

+ 12 - 0
main/template/rainbow/mail/header.tpl

@@ -0,0 +1,12 @@
+<table border="0" cellpadding="10" cellspacing="0" width="100%">
+    <tr>
+        <td width="245">
+            <a href="{{ _p.web }}">
+                <img src="{{ _p.web_css_theme ~ 'images/header-logo.png' }}" alt="{{ _s.site_name }}">
+            </a>
+        </td>
+        <td width="100%">
+            &nbsp;
+        </td>
+    </tr>
+</table>

+ 44 - 0
main/template/rainbow/mail/mail.tpl

@@ -0,0 +1,44 @@
+<!DOCTYPE html>
+<html>
+<head>
+    <meta charset="UTF-8">
+    <title>{{ _s.institution }}</title>
+    <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
+    <script type="application/ld+json">
+        {
+          "@context":       "http://schema.org",
+          "@type":          "EmailMessage",
+          "description":    "Chamilo Mail Notification",
+          "potentialAction": {
+            "@type": "ViewAction",
+            "target":   "{{ link }}"
+          }
+        }
+    </script>
+</head>
+<body style="margin: 0; padding: 0;">
+    <table border="0" cellpadding="0" cellspacing="0" width="100%">
+        <tr>
+            <td>
+                <table align="center" border="0" cellpadding="0" cellspacing="0" width="600" style="border-collapse: collapse;">
+                    <tr>
+                        <td>
+                            {% include template ~ '/mail/header.tpl' %}
+                        </td>
+                    </tr>
+                    <tr>
+                        <td cellpadding="0" cellspacing="0" style="padding: 40px 10px">
+                            {{ content }}
+                        </td>
+                    </tr>
+                    <tr>
+                        <td>
+                            {% include template ~ '/mail/footer.tpl' %}
+                        </td>
+                    </tr>
+                </table>
+            </td>
+        </tr>
+    </table>
+</body>
+</html>

+ 4 - 0
main/template/rainbow/mail/reset_password.tpl

@@ -0,0 +1,4 @@
+<p>{{ 'Dear' }} {{ complete_user_name }}</p>
+<p>
+    {{ 'ResetPasswordCommentWithUrl'| get_lang | format(link) | nl2br }}
+</p>

+ 1 - 0
main/template/rainbow/mail/subject_registration_platform.tpl

@@ -0,0 +1 @@
+{{ '[' ~ _s.site_name ~ '] ' ~ 'YourReg'|get_lang ~ ' ' ~ _s.site_name }}

+ 1 - 0
main/template/rainbow/mail/subject_subscription_to_session_confirmation.tpl

@@ -0,0 +1 @@
+{{ '[' ~ _s.site_name ~ '] ' ~ 'YourReg'|get_lang ~ ' ' ~ _s.site_name }}

+ 6 - 0
main/template/rainbow/mail/subscribe_me_to_session.tpl

@@ -0,0 +1,6 @@
+{{ 'PleaseSubscribeMeToSession' | get_lang }}: {{ session_name }}
+
+{{ 'ContactInformation' | get_lang }}:
+{{ 'Name' | get_lang }}: {{ user.complete_name }}
+{{ 'Username' | get_lang }}: {{ user.username }}
+{{ 'Email' | get_lang }}: {{ user.email }}

+ 71 - 0
main/template/rainbow/mail_editor/email_link.js.tpl

@@ -0,0 +1,71 @@
+<script>
+/* For licensing terms, see /license.txt */
+/*
+ * JS library to deal with event handlers.
+ * This script needs to be included from a script where the global include file has already been loaded.
+ * @package chamilo.inc.lib.javascript
+ * @author Yannick Warnier
+ * @author Julio Montoya - Adding twig support
+ */
+
+/*
+ * Assigns any event handler to any element
+ * @param	object	Element on which the event is added
+ * @param	string	Name of event
+ * @param	string	Function to trigger on event
+ * @param	boolean	Capture the event and prevent
+ */
+
+function addEvent(elm, evType, fn, useCapture) {
+    if (elm.addEventListener){
+		elm.addEventListener(evType, fn, useCapture);
+		return true;
+	} else if(elm.attachEvent) {
+		var r = elm.attachEvent('on' + evType, fn);
+		return r;
+	} else {
+		elm['on' + evType] = fn;
+	}
+}
+
+/*
+ * Adds the event listener
+ */
+function addListeners(e) {
+	var my_links = $('.clickable_email_link');    
+	for(var i=0;i < my_links.length;i++) {
+		addEvent(my_links[i],'click',loadEmailEditor,false);
+	}
+}
+
+/*
+ * Loads a specific page on event triggering
+ */
+function loadEmailEditor(e) {
+	var el;
+	if(window.event && window.event.srcElement) {
+		el = window.event.srcElement;
+	}
+	if (e && e.target) {
+		el = e.target;
+	}
+	if(!el) {
+		return;
+	}
+	//el is now my link object, so I can get el.href here to load the new window
+	var link = el.href.replace('mailto:','');
+	document.location = "{{ _p.web_main }}inc/email_editor.php?dest=" + link;
+	//cancel default link action
+	if (window.event && window.event.returnValue){
+		window.event.returnValue = false;
+	}
+	if(e && e.preventDefault){
+		e.preventDefault();
+	}
+}
+
+$(document).ready(function() {
+    addEvent(window,'load',addListeners,false);
+});
+
+</script>

+ 36 - 0
main/template/rainbow/my_space/accessoverview.tpl

@@ -0,0 +1,36 @@
+<h2 class="page-header">{{ 'DisplayAccessOverview'|get_lang }}</h2>
+
+{{ form }}
+
+<h3 class="page-header">{{ 'Results'|get_lang }}</h3>
+
+{{ table }}
+
+<script>
+    $(document).on('ready', function () {
+        var courseIdEl = $('#course_id'),
+            sessionIdEl = $('#session_id');
+
+        if (!courseIdEl.val()) {
+            sessionIdEl
+                .prop('disabled', true)
+                .selectpicker('refresh');
+        }
+
+        courseIdEl.on('change', function() {
+            var self = $(this);
+
+            if (!this.value) {
+                sessionIdEl
+                    .prop("disabled", true)
+                    .selectpicker('refresh');
+
+                return;
+            }
+
+            sessionIdEl
+                .prop("disabled", false)
+                .selectpicker('refresh');
+        });
+    });
+</script>

Alguns arquivos não foram mostrados porque muitos arquivos mudaram nesse diff