Browse Source

Merge branch 'master' of github.com:chamilo/chamilo-lms

Angel Fernando Quiroz Campos 6 years ago
parent
commit
1dac1bbfb0

+ 13 - 0
assets/css/scss/_base.scss

@@ -167,6 +167,19 @@ hr {
   bottom: 50px;
   display: none;
 }
+// ---------------------------------------------------------
+// SECTION INTRODUCTION TOOLS
+// ---------------------------------------------------------
+
+.section-intro{
+  .toolbar{
+    text-align: right;
+  }
+  .help{
+    text-align: center;
+  }
+}
+
 // ---------------------------------------------------------
 // TABLES
 // ---------------------------------------------------------

+ 22 - 20
main/inc/introductionSection.inc.php

@@ -279,23 +279,23 @@ if ($tool == TOOL_COURSE_HOMEPAGE && !isset($_GET['intro_cmdEdit'])) {
         );
     }
 }
-$introduction_section .= '<div class="row">';
+
+$thematicSection = '';
 if (!empty($thematic_advance_info)) {
-    $introduction_section .= '<div class="col-md-12">';
-    $introduction_section .= $thematic_description_html;
-    $introduction_section .= $thematicProgress;
-    $introduction_section .= '</div>';
+    $thematicSection = $thematic_description_html;
+    $thematicSection .= $thematicProgress;
 }
+
 $toolbar = [];
 
-if (api_is_allowed_to_edit() && empty($session_id)) {
+/*if (api_is_allowed_to_edit() && empty($session_id)) {
     $tool = [
         'name' => get_lang('CustomizeIcons'),
         'url' => api_get_path(WEB_CODE_PATH).'course_info/tools.php?'.api_get_cidreq(),
         'icon' => 'fas fa-cog',
     ];
     $toolbar[] = $tool;
-}
+}*/
 
 if ($intro_dispCommand) {
     if (empty($intro_content)) {
@@ -303,14 +303,14 @@ if ($intro_dispCommand) {
 
         if (!empty($courseId)) {
             $tool = [
-                'name' => addslashes(get_lang('AddIntro')),
+                'name' => addslashes(get_lang('Add Intro')),
                 'url' => api_get_self().'?'.api_get_cidreq().$blogParam.'&intro_cmdAdd=1',
                 'icon' => 'fas fa-pencil-alt',
             ];
             $toolbar[] = $tool;
         } else {
             $tool = [
-                'name' => get_lang('AddIntro'),
+                'name' => get_lang('Add Intro'),
                 'url' => api_get_self().'?intro_cmdAdd=1',
                 'icon' => 'fas fa-pencil-alt',
             ];
@@ -361,33 +361,34 @@ if ($intro_dispCommand) {
     }
 }
 
-$nameSection = get_lang('AddCustomCourseIntro');
+$nameSection = get_lang('Add an introduction to the course');
+$helpSection = get_lang('This course is already created! Now you can add a presentation or welcome text to your course in this section, ideal for your students.');
 if ($moduleId != 'course_homepage') {
-    $nameSection = get_lang('AddCustomToolsIntro');
+    $nameSection = get_lang('Add an introduction to the tool');
+    $helpSection = get_lang('Add Custom Tools Intro');
 }
 
 $textContent = [];
 if ($intro_dispDefault) {
     if (!empty($intro_content)) {
         $textContent = [
-            'name' => 'introduction-course',
-            'help' => $nameSection,
-            'text' => $intro_content,
+            'id' => 'introduction-tool',
+            'name' => $nameSection,
+            'help' => $helpSection,
+            'text' => $intro_content
         ];
     } else {
         if (api_is_allowed_to_edit()) {
             $textContent = [
-                'name' => 'introduction-section',
-                'help' => $nameSection,
-                'text' => $intro_content,
+                'id' => 'introduction-course',
+                'name' => $nameSection,
+                'help' => $helpSection,
+                'text' => $intro_content
             ];
         }
     }
 }
 
-//$introduction_section .= $toolbar;
-$introduction_section .= '</div>';
-
 $browser = api_get_navigator();
 
 if (strpos($introduction_section, '<iframe') !== false && $browser['name'] == 'Chrome') {
@@ -395,6 +396,7 @@ if (strpos($introduction_section, '<iframe') !== false && $browser['name'] == 'C
 }
 $data = null;
 $tpl = new Template(null);
+$tpl->assign('thematic', $thematicSection);
 $tpl->assign('intro', $textContent);
 $tpl->assign('toolbar', $toolbar);
 $introduction_section .= $tpl->fetch($tpl->get_template('auth/introduction_section.html.twig'));

+ 21 - 16
main/template/default/auth/introduction_section.html.twig

@@ -1,21 +1,26 @@
 {% autoescape false %}
-    <section id="section-intro">
-        <div id="{{ intro.name }}" class="section-intro-content">
+    {% if intro is not empty %}
+        <section id="section-intro" class="section-intro">
+            <div class="toolbar">
+                <div class="btn-group btn-group-sm" role="group" aria-label="">
+                    {% for item in toolbar %}
+                        <a href="{{ item.url }}" onclick="{{ (item.onclick!='')? item.onclick : '' }}"
+                           title="{{ item.name }}" class="btn btn-light">
+                            <i class="{{ item.icon }}"></i>
+                        </a>
+                    {% endfor %}
+                </div>
+            </div>
             {% if intro.text !='' %}
-                {{ intro.text }}
+                <div id="{{ intro.name }}" class="content">
+                    {{ intro.text }}
+                </div>
             {% else %}
-                {{ intro.help }}
+                <div class="help">
+                    <h1>{{ intro.name }}</h1>
+                    <p>{{ intro.help }}</p>
+                </div>
             {% endif %}
-        </div>
-        <div class="section-intro-toolbar">
-            <div class="btn-group btn-group-sm" role="group" aria-label="">
-                {% for item in toolbar %}
-                    <a href="{{ item.url }}" onclick="{{ (item.onclick!='')? item.onclick : '' }}"
-                       title="{{ item.name }}" class="btn btn-light">
-                        <i class="{{ item.icon }}"></i>
-                    </a>
-                {% endfor %}
-            </div>
-        </div>
-    </section>
+        </section>
+    {% endif %}
 {% endautoescape %}