From 4142f176e763893bba23235535a472a728a7f1c6 Mon Sep 17 00:00:00 2001 From: thiagourias Date: Fri, 25 Oct 2019 17:37:02 -0300 Subject: [PATCH] Correcoes mensagem mais informacoes cursos --- classes/output/core/course_renderer.php | 101 +++++++++++++++++++----- scss/courselist.scss | 53 ++++++++++++- templates/head_front.mustache | 2 +- 3 files changed, 133 insertions(+), 23 deletions(-) diff --git a/classes/output/core/course_renderer.php b/classes/output/core/course_renderer.php index 19362c3..353ffa7 100644 --- a/classes/output/core/course_renderer.php +++ b/classes/output/core/course_renderer.php @@ -69,30 +69,30 @@ class course_renderer extends \core_course_renderer { }else{ $content = '
'; - + $content .= '
'; - + $chelper = new coursecat_helper(); $chelper->set_show_courses(self::COURSECAT_SHOW_COURSES_EXPANDED); - + $content .= $this->coursecat_coursebox($chelper, $course, '', $displayCourseInfo); $content .= '
'; - - + + if ($course instanceof stdClass) { $course = new core_course_list_element($course); } $content .= '
'; - + $content .= $chelper->get_course_formatted_summary($course, array('noclean' => true, 'para' => false)); $content .= '
'; - + $content .= '
'; return $content; } - + } /** @@ -169,7 +169,7 @@ class course_renderer extends \core_course_renderer { $coursecount = 1; $content .= html_writer::start_tag('div', array('class' => ' row card-deck my-4')); foreach ($courses as $course) { - $content .= $this->coursecat_coursebox($chelper, $course, 'card mb-3 course-card-view boxCursos tamanhoBoxCursos'); + $content .= $this->coursecat_coursebox($chelper, $course, 'card mb-3 course-card-view boxCursos tamanhoBoxCursos customPaddingBottom'); $coursecount ++; } $content .= html_writer::end_tag('div'); @@ -212,7 +212,7 @@ class course_renderer extends \core_course_renderer { }else { $content = html_writer::start_tag('div', array('class' => $additionalclasses)); } - + $classes = ''; if ($chelper->get_show_courses() >= self::COURSECAT_SHOW_COURSES_EXPANDED) { $nametag = 'h5'; @@ -288,27 +288,50 @@ class course_renderer extends \core_course_renderer { $content .= html_writer::start_tag('div', array('class' => 'card-see-more text-center', 'style' => 'padding-bottom: 3px !important;')); //$content .= html_writer::start_tag('div', array('class' => 'card-see-more text-center')); }else{ - $content .= html_writer::start_tag('div', array('class' => 'card-see-more text-center')); - } + + } if ($icons = enrol_get_course_info_icons($course)) { - $content .= html_writer::start_tag('div', - array('class' => 'btn btn-inscrever', + $content .= html_writer::start_tag('div', + array('class' => 'btn btn-inscrever sizeBlock bottomAlign', 'onclick'=>"window.location.href='" . $courseurl . "';") ); $content .= 'Inscrever'; $content .= html_writer::end_tag('div'); + }else{ + $content .= html_writer::start_tag('div', + array('class' => 'btn btn-inscrever sizeBlock disabledBotao bottomAlign') + ); + $content .= 'Inscrever'; + $content .= html_writer::end_tag('div'); } if (!$displayCourseInfo) { - $content .= html_writer::start_tag('div', array('class' => 'btn btn-mais-info m-2', - 'id' => "course-popover-{$course->id}", 'role' => 'button', 'data-region' => 'popover-region-toggle', - 'data-toggle' => 'popover', 'data-placement' => 'right', - 'data-content' => $chelper->get_course_formatted_summary($course, - array('noclean' => true, 'para' => false)), 'data-html' => 'true', 'tabindex' => '0', 'data-trigger' => 'focus')); + $content .= html_writer::start_tag('button', array('class' => 'btn btn-mais-info sizeBlock bottomAlign', 'data-toggle' => 'modal', 'data-target' => "#course-popover-{$course->id}", 'data-backdrop' => 'static')); $content .= 'Mais informações'; + $content .= html_writer::end_tag('button'); + $content .= html_writer::start_tag('div', array('class' => 'modal fade', 'tab-index' => '-1', 'role' => 'dialog', 'id' => "course-popover-{$course->id}", 'aria-hidden' => 'true')); + $content .= html_writer::start_tag('div', array('class' => 'modal-dialog modal-dialog-centered maxWidthModal', 'role' => 'document')); + $content .= html_writer::start_tag('div', array('class' => 'modal-content')); + $content .= html_writer::start_tag('div', array('class' => 'modal-header')); + $content .= html_writer::start_tag('h5', array('class' => 'modal-title')); + $content .= "
". $coursenamelink ."
"; + $content .= html_writer::end_tag('h5'); + $content .= html_writer::end_tag('div'); + $content .= html_writer::start_tag('div', array('class' => 'modal-body')); + $content .= html_writer::start_tag('div'); + $content .= $chelper->get_course_formatted_summary($course, + array()); + $content .= html_writer::end_tag('div'); + $content .= html_writer::end_tag('div'); + $content .= html_writer::start_tag('div', array('class' => 'modal-footer')); + $content .= html_writer::start_tag('button', array('class' => 'btn btnFechar', 'data-dismiss' => 'modal')); + $content .= 'Fechar'; + $content .= html_writer::end_tag('button'); + $content .= html_writer::end_tag('div'); + $content .= html_writer::end_tag('div'); $content .= html_writer::end_tag('div'); } $content .= html_writer::end_tag('div'); // End summary. - + return $content; } /** 'btn btn-mais-info m-2', +// 'id' => "course-popover-{$course->id}", 'role' => 'button', 'data-trigger' => 'click', +// 'data-toggle' => 'popover', 'data-placement' => 'top', +// 'data-content' => $chelper->get_course_formatted_summary($course, +// array('noclean' => true, 'para' => false)), 'data-html' => 'true', 'tabindex' => '0')); + + + + + +//$content .= 'Mais informações'; +//$content .= html_writer::end_tag('div'); + + + + +// +//$content .= html_writer::start_tag('button', array('class' => 'btn btn-primary', 'data-toggle' => 'modal', 'data-target' => '#{$course->id')); +//$content .= 'Mais informações'; +//$content .= html_writer::end_tag('button'); +// +//$content .= html_writer::start_tag('div', array('class' => 'modal fade', 'tab-index' => '-1', 'role' => 'dialog', 'data-target' => '#{$course->id', 'aria-hidden' => 'true')); +//$content .= html_writer::start_tag('div', array('class' => 'modal-dialog modal-dialog-centered', 'role' => 'document')); +//$content .= html_writer::start_tag('div', array('class' => 'modal-content')); +//$content .= html_writer::start_tag('div', array('class' => 'modal-body')); +//$content .= html_writer::end_tag('div'); +//$content .= html_writer::start_tag('div', array('class' => 'modal-footer')); +//$content .= html_writer::start_tag('button', array('class' => 'btn btn-secondary', 'data-dismiss' => 'modal')); +//$content .= 'fechar'; +//$content .= html_writer::end_tag('button'); +//$content .= html_writer::end_tag('div'); +//$content .= html_writer::end_tag('div'); +//$content .= html_writer::end_tag('div'); \ No newline at end of file diff --git a/scss/courselist.scss b/scss/courselist.scss index 34ac966..c26d8c7 100644 --- a/scss/courselist.scss +++ b/scss/courselist.scss @@ -1,4 +1,18 @@ + + + + + + + + + + + + + + @media screen and (min-width: 200px) and (max-width: 765px){ @@ -79,10 +93,16 @@ body#page-enrol-index { } } - - +.customPaddingBottom { + padding-bottom: 20px !important; +} +.bottomAlign{ + bottom: 0; + position: relative; +} .minheight{ background-position: top center !important; + min-height: 122px; } .boxCursos { @@ -108,6 +128,17 @@ body#page-enrol-index { box-shadow: 0px 0px 14px -2px rgba(0,0,0,1); } +.disabledBotao{ + pointer-events: none !important; + opacity: .55 !important; +} +.sizeBlock { + width: 90% !important; + margin-left: 5% !important; + margin-right: 5% !important; + margin-top: 1%; + margin-bottom: 1%; +} .btn-mais-info{ color: white; background-color: #0069d9; @@ -140,6 +171,7 @@ body#page-enrol-index { text-transform: uppercase; text-rendering: optimizeLegibility; color: #444444; + min-height: 72px !important; } .elegantshd { color: #131313; @@ -154,6 +186,23 @@ body#page-enrol-index { color:#787878 !important; text-decoration: none !important; } +.maxWidthModal { + max-width: 70% !important; +} + +.btnFechar{ + color: #fff; + background-color: #dc3545; + border-color: #dc3545; + border-radius: 5px; +} + +.btnFechar:hover{ + color: #fff; + background-color: #e25664; + border-color: #e25664; + border-radius: 5px; +} .btn-inscrever{ color: #fff; diff --git a/templates/head_front.mustache b/templates/head_front.mustache index b35c05a..7d67075 100644 --- a/templates/head_front.mustache +++ b/templates/head_front.mustache @@ -105,7 +105,7 @@ --> - +