Commit 387bce91ab51cb2bc817fc37b6df222db9b66729

Authored by Zambom
1 parent 9b0c752b

Adding subscribe button [Issue: #192]

Showing 1 changed file with 5 additions and 1 deletions   Show diff stats
core/templates/guest.html
... ... @@ -45,6 +45,7 @@
45 45 {% block style %}
46 46 {% endblock %}
47 47 {% block javascript %}
  48 + <script type="text/javascript" src="{% static 'js/course.js' %}"></script>
48 49 {% endblock %}
49 50 </head>
50 51 <body>
... ... @@ -134,9 +135,12 @@
134 135 <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12">
135 136 {% block content %}
136 137 {% for course in courses %}
137   - <div class="panel panel-info">
  138 + <div class="panel panel-info panel_{{ course.id }}">
138 139 <div class="panel-heading">
139 140 <a href="{{ course.get_absolute_url }}" class="panel-title">{{course.name}}</a>
  141 + {% if user|show_course_subscribe:course %}
  142 + <a onclick="subscribe($(this), '{% url 'course:subscribe' course.slug %}', {{ course.id}}, '{% trans 'Are you sure you want to subscribe to this course?' %}')" class="btn btn-sm btn-primary btn-raised pull-right" style="margin-top:-4px">{% trans 'Subscribe' %}</a>
  143 + {% endif %}
140 144 </div>
141 145  
142 146 <div class="panel-body">
... ...