Private
Public Access
1
0

Merge branch 'release/v20.7.7'

This commit is contained in:
2024-04-14 19:43:00 +02:00
6 changed files with 104 additions and 8 deletions
+1
View File
@@ -4996,6 +4996,7 @@ def interactive_cum_flex_chart2(theworkouts, promember=0,
# datadf = dataprep.smalldataprep(theworkouts,xparam,yparam1,yparam2) # datadf = dataprep.smalldataprep(theworkouts,xparam,yparam1,yparam2)
ids = [int(w.id) for w in theworkouts] ids = [int(w.id) for w in theworkouts]
columns = [xparam, yparam1, yparam2, 'spm', 'driveenergy', 'distance'] columns = [xparam, yparam1, yparam2, 'spm', 'driveenergy', 'distance']
datadf = dataprep.getsmallrowdata_db(columns, ids=ids, doclean=True, datadf = dataprep.getsmallrowdata_db(columns, ids=ids, doclean=True,
workstrokesonly=workstrokesonly) workstrokesonly=workstrokesonly)
+89
View File
@@ -23,6 +23,24 @@
<li class="grid_4"> <li class="grid_4">
<h1>Courses you might like</h1> <h1>Courses you might like</h1>
</li> </li>
<li class="grid_4">
<p>
Whether you routinely row between two landmarks on your river and want to compare
times from one day to the other, or like a little competition between
rowers in your neighborhood, Rowsandall courses are for you! They are useful for GPS-based timing
of your time on the course, and enable easy, informal, timed event on any body of water you like.
</p>
<p>
On Rowsandall, rowers share courses and organize challenges. We're showing you a few on this page,
but there are many more to explore. You can also add your own.
</p>
<p>
These courses are designed to be compatible with
<a href="https://performancephones.com/custom-courses/">CrewNerd Custom Courses</a>. You
can synchronize the list of liked courses to the CrewNerd app on your phone, so you can get
on-the-water indications of your time on the course.
</p>
</li>
<li> <li>
<p> <p>
<a href="/rowers/list-courses/">All Courses</a> <a href="/rowers/list-courses/">All Courses</a>
@@ -35,6 +53,13 @@
<a href="/rowers/courses/{{ course.course.id }}/"> <a href="/rowers/courses/{{ course.course.id }}/">
<h2>{{ course.course.name }}</h2> <h2>{{ course.course.name }}</h2>
</a> </a>
<p>
{% if course.course in rower.followed_courses.all %}
<a class="unfollow" href="/rowers/courses/{{ course.course.id }}/unfollow"><span class="icon"><i class="fas fa-heart"></i></span></a>
{% else %}
<a class="follow" href="/rowers/courses/{{ course.course.id }}/follow"><span class="icon"><i class="far fa-heart"></i></span></a>
{% endif %}
</p>
<p>{{ course.course.country }}</p> <p>{{ course.course.country }}</p>
<p>{{ course.course.distance }}m</p> <p>{{ course.course.distance }}m</p>
<div class="mapdiv" id="{{ course.course.id }}"> <div class="mapdiv" id="{{ course.course.id }}">
@@ -47,6 +72,8 @@
<h1>Interesting Challenges</h1> <h1>Interesting Challenges</h1>
</li> </li>
<li> <li>
<p>
<a href="/rowers/virtualevents/?participate=true">Challenges I participate in</a>
<p> <p>
<a href="/rowers/virtualevents/">All Active Challenges</a> <a href="/rowers/virtualevents/">All Active Challenges</a>
</p> </p>
@@ -98,6 +125,68 @@
</ul> </ul>
<script type='text/javascript'
src='https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js'>
</script>
<script>
$(document).ready(function() {
$(document).on('click', 'a.follow', function(event) {
event.preventDefault();
var ajaxEndpoint = $(this).attr('href');
var $ajaxLink = $(this);
var id = ajaxEndpoint.split('/').slice(-2, -1)[0];
console.log(id, ajaxEndpoint)
$.ajax({
url: ajaxEndpoint,
method: 'GET',
success: function(response) {
console.log(response);
$ajaxLink.removeClass('follow').addClass('unfollow');
$ajaxLink.attr('href', '/rowers/courses/' + id + '/unfollow')
$ajaxLink.find('i').removeClass('far').removeClass('fa-heart').addClass('fas').addClass('fa-heart'); // Change star icon to filled
$ajaxLink.find('.icon i').attr('class', 'fas fa-heart');
$ajaxLink.find('.icon i').html('');
$ajaxLink.html('<span class="icon"><i class="fas fa-heart"></i></span>');
},
error: function(xhr, status, error) {
console.error(error);
}
});
});
$(document).on('click', 'a.unfollow', function(event) {
event.preventDefault();
var ajaxEndpoint = $(this).attr('href');
var $ajaxLink = $(this);
var id = ajaxEndpoint.split('/').slice(-2, -1)[0];
console.log(id, ajaxEndpoint)
$.ajax({
url: ajaxEndpoint,
method: 'GET',
success: function(response) {
console.log(response);
$ajaxLink.removeClass('unfollow').addClass('follow');
$ajaxLink.attr('href', '/rowers/courses/' + id + '/follow')
$ajaxLink.find('i').removeClass('fas').removeClass('fa-heart').addClass('far').addClass('fa-heart'); // Change star icon to outline
$ajaxLink.find('.icon i').attr('class', 'far fa-heart');
$ajaxLink.find('.icon i').html('');
$ajaxLink.html('<span class="icon"><i class="far fa-heart"></i></span>');
},
error: function(xhr, status, error) {
console.error(error);
}
});
});
});
</script>
{% endblock %} {% endblock %}
{% block sidebar %} {% block sidebar %}
+8 -8
View File
@@ -92,9 +92,9 @@
{% if not user.is_anonymous %} {% if not user.is_anonymous %}
<td> <td>
{% if course in rower.followed_courses.all %} {% if course in rower.followed_courses.all %}
<a class="unfollow" href="/rowers/courses/{{ course.id }}/unfollow"><span class="icon"><i class="fas fa-star"></i></span></a> <a class="unfollow" href="/rowers/courses/{{ course.id }}/unfollow"><span class="icon"><i class="fas fa-heart"></i></span></a>
{% else %} {% else %}
<a class="follow" href="/rowers/courses/{{ course.id }}/follow"><span class="icon"><i class="far fa-star"></i></span></a> <a class="follow" href="/rowers/courses/{{ course.id }}/follow"><span class="icon"><i class="far fa-heart"></i></span></a>
{% endif %} {% endif %}
</tr> </tr>
{% endif %} {% endif %}
@@ -178,10 +178,10 @@
console.log(response); console.log(response);
$ajaxLink.removeClass('follow').addClass('unfollow'); $ajaxLink.removeClass('follow').addClass('unfollow');
$ajaxLink.attr('href', '/rowers/courses/' + id + '/unfollow') $ajaxLink.attr('href', '/rowers/courses/' + id + '/unfollow')
$ajaxLink.find('i').removeClass('far').removeClass('fa-star').addClass('fas').addClass('fa-star'); // Change star icon to filled $ajaxLink.find('i').removeClass('far').removeClass('fa-heart').addClass('fas').addClass('fa-heart'); // Change star icon to filled
$ajaxLink.find('.icon i').attr('class', 'fas fa-star'); $ajaxLink.find('.icon i').attr('class', 'fas fa-heart');
$ajaxLink.find('.icon i').html(''); $ajaxLink.find('.icon i').html('');
$ajaxLink.html('<span class="icon"><i class="fas fa-star"></i></span>'); $ajaxLink.html('<span class="icon"><i class="fas fa-heart"></i></span>');
}, },
error: function(xhr, status, error) { error: function(xhr, status, error) {
@@ -204,10 +204,10 @@
console.log(response); console.log(response);
$ajaxLink.removeClass('unfollow').addClass('follow'); $ajaxLink.removeClass('unfollow').addClass('follow');
$ajaxLink.attr('href', '/rowers/courses/' + id + '/follow') $ajaxLink.attr('href', '/rowers/courses/' + id + '/follow')
$ajaxLink.find('i').removeClass('fas').removeClass('fa-star').addClass('far').addClass('fa-star'); // Change star icon to outline $ajaxLink.find('i').removeClass('fas').removeClass('fa-heart').addClass('far').addClass('fa-heart'); // Change star icon to outline
$ajaxLink.find('.icon i').attr('class', 'far fa-star'); $ajaxLink.find('.icon i').attr('class', 'far fa-heart');
$ajaxLink.find('.icon i').html(''); $ajaxLink.find('.icon i').html('');
$ajaxLink.html('<span class="icon"><i class="far fa-star"></i></span>'); $ajaxLink.html('<span class="icon"><i class="far fa-heart"></i></span>');
}, },
error: function(xhr, status, error) { error: function(xhr, status, error) {
console.error(error); console.error(error);
Binary file not shown.
+6
View File
@@ -140,6 +140,7 @@ def courses_view(request):
nearby = request.GET.get('nearby') nearby = request.GET.get('nearby')
liked = request.GET.get('liked') liked = request.GET.get('liked')
if nearby and lat_lon is not None: # pragma: no cover if nearby and lat_lon is not None: # pragma: no cover
courses = getnearestcourses(lat_lon, courses) courses = getnearestcourses(lat_lon, courses)
@@ -1058,10 +1059,15 @@ def virtualevents_view(request):
form = VirtualRaceSelectForm() form = VirtualRaceSelectForm()
nearby = request.GET.get('nearby') nearby = request.GET.get('nearby')
participate = request.GET.get('participate')
if nearby and lat_lon is not None: # pragma: no cover if nearby and lat_lon is not None: # pragma: no cover
races = getnearestraces(lat_lon, races) races = getnearestraces(lat_lon, races)
if participate:
ress = VirtualRaceResult.objects.filter(userid=r.id).order_by("-race__evaluation_closure")
races = [res.race for res in ress if res.race is not None]
if is_ajax: # pragma: no cover if is_ajax: # pragma: no cover
return render(request, 'racelist.html', return render(request, 'racelist.html',
{'races': races, {'races': races,
Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB