From 1fdfb08dd3553d748296299a319d3882e5a80d23 Mon Sep 17 00:00:00 2001 From: Alex Aragon Date: Wed, 26 Apr 2017 11:20:55 -0500 Subject: [PATCH] fix css label subscriber --- app/Resources/public/css/base.css | 7 +++++++ main/auth/courses_categories.php | 17 ++++++++--------- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/app/Resources/public/css/base.css b/app/Resources/public/css/base.css index 31dfd860ab..2e88fe6170 100644 --- a/app/Resources/public/css/base.css +++ b/app/Resources/public/css/base.css @@ -6192,6 +6192,13 @@ ul#toolnavbox-two li a.btn{ display: block; width: 100%; } +.label-subscribed{ + font-size: 12px; + position: absolute; + top: -65px; + right: 0; + width: 100px; +} /* CSS NEW TOP ******************************************************************************/ /* CSS Responsive */ @media (min-width: 1025px) and (max-width: 1200px) { diff --git a/main/auth/courses_categories.php b/main/auth/courses_categories.php index e57c1eb752..0431f7ca0a 100755 --- a/main/auth/courses_categories.php +++ b/main/auth/courses_categories.php @@ -213,7 +213,7 @@ if ($showCourses && $action != 'display_sessions') { // display course title and button bloc $html .= '
'; - $html .= return_title($course, $userRegisterd); + $html .= return_title($course, $userRegisterdInCourse); $html .= return_teacher($course); // display button line @@ -226,7 +226,6 @@ if ($showCourses && $action != 'display_sessions') { // if user registered as student if ($userRegisterdInCourse) { $html .= return_already_registered_label('student'); - if (!$course_closed) { if ($course_unsubscribe_allowed) { $html .= return_unregister_button($course, $stok, $search_term, $code); @@ -434,9 +433,9 @@ function return_already_registered_label($in_status) } $html = Display::tag( - 'button', - $icon, - array('id' => 'register', 'class' => 'btn btn-default btn-sm', 'title' => $title, 'aria-label' => $title) + 'span', + $icon . ' ' . $title, + array('id' => 'register', 'class' => 'label-subscribed text-success', 'title' => $title, 'aria-label' => $title) ); return $html; @@ -455,7 +454,7 @@ function return_register_button($course, $stok, $code, $search_term) { $title = get_lang('Subscribe'); $html = Display::url( - Display::returnFontAwesomeIcon('sign-in'), + Display::returnFontAwesomeIcon('check') . ' ' . $title, api_get_self() . '?action=subscribe_course&sec_token=' . $stok. '&subscribe_course='.$course['code'].'&search_term='.$search_term.'&category_code='.$code, array('class' => 'btn btn-success btn-sm', 'title' => $title, 'aria-label' => $title) @@ -474,12 +473,12 @@ function return_register_button($course, $stok, $code, $search_term) */ function return_unregister_button($course, $stok, $search_term, $code) { - $title = get_lang('Unsubscribe'); + $title = get_lang('UnsubscriptionAllowed'); $html = Display::url( - Display::returnFontAwesomeIcon('sign-in'), + Display::returnFontAwesomeIcon('sign-in').' '.$title, api_get_self() . '?action=unsubscribe&sec_token='.$stok .'&unsubscribe='.$course['code'].'&search_term='.$search_term.'&category_code='.$code, - array('class' => 'btn btn-success btn-sm', 'title' => $title, 'aria-label' => $title) + array('class' => 'btn btn-danger btn-sm', 'title' => $title, 'aria-label' => $title) ); return $html; }