Don't show Susbcribe button when is subscribed to session - refs BT#9889 #TMI

1.10.x
Angel Fernando Quiroz Campos 10 years ago
parent bb7c061822
commit e6fd8b8788
  1. 7
      main/session/about.php
  2. 15
      main/template/default/session/about.tpl

@ -128,6 +128,13 @@ foreach ($sessionCourses as $sessionCourse) {
$template = new Template($session->getName(), true, true, false, true, false);
$template->assign('pageUrl', api_get_path(WEB_PATH) . "session/{$session->getId()}/about/");
$template->assign('session', $session);
$template->assign(
'is_subscribed',
SessionManager::isUserSubscribedAsStudent(
$session->getId(),
api_get_user_id()
)
);
$template->assign('courses', $courses);
$templateFolder = api_get_configuration_value('default_template');

@ -1,4 +1,10 @@
<div id="about-session">
{% if is_subscribed %}
<div class="alert alert-info">
{{ 'AlreadyRegisteredToSession'|get_lang }}
</div>
{% endif %}
{% for course_data in courses %}
{% if courses|length > 1 %}
<div class="row">
@ -29,9 +35,12 @@
{% endfor %}
</div>
{% endif %}
<div class="subscribe">
<a href="#" class="btn btn-success btn-lg btn-block"><i class="fa fa-book"></i> {{ "Subscribe"|get_lang }}</a>
</div>
{% if not is_subscribed %}
<div class="subscribe">
<a href="#" class="btn btn-success btn-lg btn-block"><i class="fa fa-book"></i> {{ "Subscribe"|get_lang }}</a>
</div>
{% endif %}
</div>
</div>

Loading…
Cancel
Save