adding some privacy
This commit is contained in:
@@ -904,6 +904,9 @@ class Rower(models.Model):
|
|||||||
getimportantemails = models.BooleanField(default=True,
|
getimportantemails = models.BooleanField(default=True,
|
||||||
verbose_name='Get Important Emails')
|
verbose_name='Get Important Emails')
|
||||||
|
|
||||||
|
share_course_results = models.BooleanField(default=True,
|
||||||
|
verbose_name = 'Share Course Results')
|
||||||
|
|
||||||
|
|
||||||
sex = models.CharField(default="not specified",
|
sex = models.CharField(default="not specified",
|
||||||
max_length=30,
|
max_length=30,
|
||||||
@@ -4259,6 +4262,7 @@ class AccountRowerForm(ModelForm):
|
|||||||
'adaptiveclass',
|
'adaptiveclass',
|
||||||
'getemailnotifications',
|
'getemailnotifications',
|
||||||
'getimportantemails',
|
'getimportantemails',
|
||||||
|
'share_course_results',
|
||||||
'defaulttimezone','showfavoritechartnotes',
|
'defaulttimezone','showfavoritechartnotes',
|
||||||
'fav_analysis',
|
'fav_analysis',
|
||||||
'usersmooth',
|
'usersmooth',
|
||||||
|
|||||||
@@ -95,6 +95,13 @@
|
|||||||
<p>
|
<p>
|
||||||
<h2>Filter Results</h2>
|
<h2>Filter Results</h2>
|
||||||
</p>
|
</p>
|
||||||
|
<p>
|
||||||
|
{% if onlyme %}
|
||||||
|
<a href="/rowers/courses/{{ course.id }}/">All Results</a>
|
||||||
|
{% else %}
|
||||||
|
<a href="/rowers/courses/{{ course.id}}/?onlyme=true">Only My Results</a>
|
||||||
|
{% endif %}
|
||||||
|
</p>
|
||||||
<p>
|
<p>
|
||||||
|
|
||||||
<form id="result_filter_form", method="post">
|
<form id="result_filter_form", method="post">
|
||||||
|
|||||||
@@ -190,6 +190,15 @@
|
|||||||
The summary will be updated to show time on course, and you can compare this with other
|
The summary will be updated to show time on course, and you can compare this with other
|
||||||
attempts.
|
attempts.
|
||||||
</p>
|
</p>
|
||||||
|
<p>
|
||||||
|
{% if rower.share_course_results %}
|
||||||
|
You are currently sharing your course results with all Rowsandall users.
|
||||||
|
Click <a href="/rowers/me/edit/?courseshare=false">here</a> to hide your course results.
|
||||||
|
{% else %}
|
||||||
|
You are currently hiding your course results (except for your participation in online challenges).
|
||||||
|
Click <a href="/rowers/me/edit/?courseshare=true">here</a> to hide your course results.
|
||||||
|
{% endif %}
|
||||||
|
</p>
|
||||||
<form ecntype="multipart/form-data" method="post">
|
<form ecntype="multipart/form-data" method="post">
|
||||||
<table>
|
<table>
|
||||||
{{ courseselectform.as_table }}
|
{{ courseselectform.as_table }}
|
||||||
|
|||||||
@@ -232,6 +232,22 @@ def course_view(request,id=0):
|
|||||||
workoutid__isnull=False,
|
workoutid__isnull=False,
|
||||||
coursecompleted=True).order_by("duration","-distance")
|
coursecompleted=True).order_by("duration","-distance")
|
||||||
|
|
||||||
|
notsharing = Rower.objects.filter(share_course_results=False).exclude(id=r.id)
|
||||||
|
notsharing_ids = [o.user.id for o in notsharing]
|
||||||
|
|
||||||
|
records = records.exclude(userid__in=notsharing_ids)
|
||||||
|
|
||||||
|
if 'onlyme' in request.GET:
|
||||||
|
onlyme = request.GET.get('onlyme',False)
|
||||||
|
if onlyme == 'true':
|
||||||
|
onlyme = True
|
||||||
|
|
||||||
|
if onlyme:
|
||||||
|
records = records.filter(userid=r.user.id)
|
||||||
|
else:
|
||||||
|
onlyme=False
|
||||||
|
|
||||||
|
|
||||||
form = RaceResultFilterForm(records=records,groups=False)
|
form = RaceResultFilterForm(records=records,groups=False)
|
||||||
if request.method == 'POST':
|
if request.method == 'POST':
|
||||||
form = RaceResultFilterForm(request.POST,records=records,groups=False)
|
form = RaceResultFilterForm(request.POST,records=records,groups=False)
|
||||||
@@ -305,6 +321,7 @@ def course_view(request,id=0):
|
|||||||
'records':records,
|
'records':records,
|
||||||
'rower':r,
|
'rower':r,
|
||||||
'form':form,
|
'form':form,
|
||||||
|
'onlyme':onlyme,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -396,6 +396,15 @@ def rower_exportsettings_view(request,userid=0):
|
|||||||
def rower_edit_view(request,rowerid=0,userid=0,message=""):
|
def rower_edit_view(request,rowerid=0,userid=0,message=""):
|
||||||
r = getrequestrowercoachee(request,rowerid=rowerid,userid=userid,notpermanent=True)
|
r = getrequestrowercoachee(request,rowerid=rowerid,userid=userid,notpermanent=True)
|
||||||
|
|
||||||
|
if 'courseshare' in request.GET:
|
||||||
|
courseshare = request.GET.get('courseshare',"ok")
|
||||||
|
if courseshare == 'true':
|
||||||
|
r.share_course_results = True
|
||||||
|
r.save()
|
||||||
|
elif courseshare == 'false':
|
||||||
|
r.share_course_results = False
|
||||||
|
r.save()
|
||||||
|
|
||||||
rowerid = r.id
|
rowerid = r.id
|
||||||
|
|
||||||
breadcrumbs = [
|
breadcrumbs = [
|
||||||
@@ -435,6 +444,7 @@ def rower_edit_view(request,rowerid=0,userid=0,message=""):
|
|||||||
showfavoritechartnotes = cd['showfavoritechartnotes']
|
showfavoritechartnotes = cd['showfavoritechartnotes']
|
||||||
getemailnotifications = cd['getemailnotifications']
|
getemailnotifications = cd['getemailnotifications']
|
||||||
getimportantemails = cd['getimportantemails']
|
getimportantemails = cd['getimportantemails']
|
||||||
|
share_course_results = cd['share_course_results']
|
||||||
defaulttimezone=cd['defaulttimezone']
|
defaulttimezone=cd['defaulttimezone']
|
||||||
fav_analysis = cd['fav_analysis']
|
fav_analysis = cd['fav_analysis']
|
||||||
usersmooth = cd['usersmooth']
|
usersmooth = cd['usersmooth']
|
||||||
@@ -461,6 +471,7 @@ def rower_edit_view(request,rowerid=0,userid=0,message=""):
|
|||||||
r.offercoaching = offercoaching
|
r.offercoaching = offercoaching
|
||||||
r.defaultlandingpage = defaultlandingpage
|
r.defaultlandingpage = defaultlandingpage
|
||||||
r.showfavoritechartnotes = showfavoritechartnotes
|
r.showfavoritechartnotes = showfavoritechartnotes
|
||||||
|
r.share_course_results = share_course_results
|
||||||
r.sex = sex
|
r.sex = sex
|
||||||
r.birthdate = birthdate
|
r.birthdate = birthdate
|
||||||
r.autojoin = autojoin
|
r.autojoin = autojoin
|
||||||
|
|||||||
Reference in New Issue
Block a user