removing notification for new workout sync, adding CN liked KML api
This commit is contained in:
@@ -3,11 +3,9 @@
|
||||
{% load rowerfilters %}
|
||||
|
||||
{% block title %}Rowsandall Courses List{% endblock %}
|
||||
|
||||
{% block scripts %}
|
||||
|
||||
{% endblock %}
|
||||
|
||||
{% block main %}
|
||||
<style>
|
||||
#mypointer {
|
||||
@@ -20,7 +18,7 @@
|
||||
<h1>Courses</h1>
|
||||
|
||||
<ul class="main-content">
|
||||
<li class="grid_3">
|
||||
<li class="grid_4">
|
||||
{% if courses %}
|
||||
<p>
|
||||
<form enctype="multipart/form-data" method="post">
|
||||
@@ -33,6 +31,8 @@
|
||||
<th> Country</th>
|
||||
<th> Name</th>
|
||||
<th> Distance</th>
|
||||
<th> Updated on</th>
|
||||
<th> Like</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@@ -46,7 +46,15 @@
|
||||
<td>
|
||||
{{ course.distance }} m
|
||||
</td>
|
||||
|
||||
<td>
|
||||
{{ course.updated|date:"Y-m-d" }}
|
||||
</td>
|
||||
<td>
|
||||
{% if course in rower.followed_courses.all %}
|
||||
<a class="unfollow" href="/rowers/courses/{{ course.id }}/unfollow"><i class="fas fa-star"></i></a>
|
||||
{% else %}
|
||||
<a class="follow" href="/rowers/courses/{{ course.id }}/follow"><i class="far fa-star"></i></a>
|
||||
{% endif %}
|
||||
</tr>
|
||||
|
||||
{% endfor %}
|
||||
@@ -74,6 +82,9 @@
|
||||
<p>
|
||||
<a href="/rowers/list-courses/">All courses</a>
|
||||
</p>
|
||||
<p>
|
||||
<a href="/rowers/list-courses/?liked=true">Courses I like</a>
|
||||
</p>
|
||||
{% endif %}
|
||||
<p>
|
||||
<a href="/rowers/courses/upload/">Add Courses</a>
|
||||
@@ -143,6 +154,55 @@
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<script type='text/javascript'
|
||||
src='https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js'>
|
||||
</script>
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$("a.follow").click(function(event) {
|
||||
event.preventDefault();
|
||||
var ajaxEndpoint = $(this).attr('href');
|
||||
var $ajaxLink = $(this);
|
||||
|
||||
$.ajax({
|
||||
url: ajaxEndpoint,
|
||||
method: 'GET',
|
||||
success: function(response) {
|
||||
console.log(response);
|
||||
$ajaxLink.html('<i class="fas fa-star"></i>');
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
console.error(error);
|
||||
}
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
$("a.unfollow").click(function(event) {
|
||||
event.preventDefault();
|
||||
var ajaxEndpoint = $(this).attr('href');
|
||||
var $ajaxLink = $(this);
|
||||
|
||||
$.ajax({
|
||||
url: ajaxEndpoint,
|
||||
method: 'GET',
|
||||
success: function(response) {
|
||||
console.log(response);
|
||||
$ajaxLink.html('<i class="far fa-star"></i>');
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
console.error(error);
|
||||
}
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
{% endblock %}
|
||||
|
||||
{% block sidebar %}
|
||||
|
||||
Reference in New Issue
Block a user