Browse Source

fix css label subscriber

Alex Aragon 7 years ago
parent
commit
1fdfb08dd3
2 changed files with 15 additions and 9 deletions
  1. 7 0
      app/Resources/public/css/base.css
  2. 8 9
      main/auth/courses_categories.php

+ 7 - 0
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) {

+ 8 - 9
main/auth/courses_categories.php

@@ -213,7 +213,7 @@ if ($showCourses && $action != 'display_sessions') {
 
             // display course title and button bloc
             $html .= '<div class="description">';
-            $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;
 }