Commit 387bce91ab51cb2bc817fc37b6df222db9b66729
1 parent
9b0c752b
Exists in
master
and in
5 other branches
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,6 +45,7 @@ | ||
45 | {% block style %} | 45 | {% block style %} |
46 | {% endblock %} | 46 | {% endblock %} |
47 | {% block javascript %} | 47 | {% block javascript %} |
48 | + <script type="text/javascript" src="{% static 'js/course.js' %}"></script> | ||
48 | {% endblock %} | 49 | {% endblock %} |
49 | </head> | 50 | </head> |
50 | <body> | 51 | <body> |
@@ -134,9 +135,12 @@ | @@ -134,9 +135,12 @@ | ||
134 | <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"> | 135 | <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"> |
135 | {% block content %} | 136 | {% block content %} |
136 | {% for course in courses %} | 137 | {% for course in courses %} |
137 | - <div class="panel panel-info"> | 138 | + <div class="panel panel-info panel_{{ course.id }}"> |
138 | <div class="panel-heading"> | 139 | <div class="panel-heading"> |
139 | <a href="{{ course.get_absolute_url }}" class="panel-title">{{course.name}}</a> | 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 | </div> | 144 | </div> |
141 | 145 | ||
142 | <div class="panel-body"> | 146 | <div class="panel-body"> |