Private
Public Access
1
0

team create

This commit is contained in:
Sander Roosendaal
2018-10-10 21:41:27 +02:00
parent 77d72ea60d
commit 841b9b3b5b
6 changed files with 62 additions and 49 deletions

View File

@@ -1382,7 +1382,7 @@ def handle_makeplot(f1, f2, t, hrdata, plotnr, imagename,
@app.task
def handle_sendemail_invite(email, name, code, teamname, manager,
debug=False,**kwargs):
fullemail = name + ' <' + email + '>'
fullemail = email
subject = 'Invitation to join team ' + teamname
siteurl = SITE_URL
@@ -1414,7 +1414,7 @@ def handle_sendemailnewresponse(first_name, last_name,
comment,
workoutname, workoutid, commentid,
debug=False,**kwargs):
fullemail = first_name + ' ' + last_name + ' <' + email + '>'
fullemail = email
from_email = 'Rowsandall <info@rowsandall.com>'
subject = 'New comment on workout ' + workoutname
@@ -1451,7 +1451,7 @@ def handle_sendemailnewcomment(first_name,
fullemail = first_name + ' ' + last_name + ' <' + email + '>'
fullemail = email
from_email = 'Rowsandall <info@rowsandall.com>'
subject = 'New comment on workout ' + workoutname
@@ -1480,7 +1480,7 @@ def handle_sendemailnewcomment(first_name,
@app.task
def handle_sendemail_request(email, name, code, teamname, requestor, id,
debug=False,**kwargs):
fullemail = name + ' <' + email + '>'
fullemail = email
subject = 'Request to join team ' + teamname
from_email = 'Rowsandall <info@rowsandall.com>'
@@ -1506,7 +1506,7 @@ def handle_sendemail_request(email, name, code, teamname, requestor, id,
@app.task
def handle_sendemail_request_accept(email, name, teamname, managername,
debug=False,**kwargs):
fullemail = name + ' <' + email + '>'
fullemail = email
subject = 'Welcome to ' + teamname
from_email = 'Rowsandall <info@rowsandall.com>'
@@ -1530,7 +1530,7 @@ def handle_sendemail_request_accept(email, name, teamname, managername,
@app.task
def handle_sendemail_request_reject(email, name, teamname, managername,
debug=False,**kwargs):
fullemail = name + ' <' + email + '>'
fullemail = email
subject = 'Your application to ' + teamname + ' was rejected'
from_email = 'Rowsandall <info@rowsandall.com>'
@@ -1553,7 +1553,7 @@ def handle_sendemail_request_reject(email, name, teamname, managername,
@app.task
def handle_sendemail_member_dropped(email, name, teamname, managername,
debug=False,**kwargs):
fullemail = name + ' <' + email + '>'
fullemail = email
subject = 'You were removed from ' + teamname
from_email = 'Rowsandall <info@rowsandall.com>'
@@ -1578,7 +1578,7 @@ def handle_sendemail_member_dropped(email, name, teamname, managername,
def handle_sendemail_team_removed(email, name, teamname, managername,
debug=False,**kwargs):
fullemail = name + ' <' + email + '>'
fullemail = email
subject = 'You were removed from ' + teamname
from_email = 'Rowsandall <info@rowsandall.com>'
@@ -1602,7 +1602,7 @@ def handle_sendemail_team_removed(email, name, teamname, managername,
@app.task
def handle_sendemail_invite_reject(email, name, teamname, managername,
debug=False,**kwargs):
fullemail = managername + ' <' + email + '>'
fullemail = email
subject = 'Your invitation to ' + name + ' was rejected'
from_email = 'Rowsandall <info@rowsandall.com>'
@@ -1626,7 +1626,7 @@ def handle_sendemail_invite_reject(email, name, teamname, managername,
@app.task
def handle_sendemail_invite_accept(email, name, teamname, managername,
debug=False,**kwargs):
fullemail = managername + ' <' + email + '>'
fullemail = email
subject = 'Your invitation to ' + name + ' was accepted'
from_email = 'Rowsandall <info@rowsandall.com>'

View File

@@ -17,9 +17,8 @@
{% endif %}
</ul><!-- cd-accordion-menu -->
<p>&nbsp;</p>
{% if teams %}
{% if myteams %}
<h2>Managing</h2>
<ul class="cd-accordion-menu animated">
{% for team in myteams %}
@@ -63,7 +62,6 @@
</ul>
{% endif %}
<p>&nbsp;</p>
{% if memberteams %}
<h2>Member</h2>
@@ -78,11 +76,6 @@
<i class="fas fa-user-friends fa-fw"></i>&nbsp;View
</a>
</li>
<li id="team-{{ team.id }}-stats">
<a href="/rowers/team/{{ team.id }}/memberstats">
<i class="fas fa-pencil-alt fa-fw"></i>&nbsp;Member Stats
</a>
</li>
<li id="team-{{ team.id }}-workouts">
<a href="/rowers/list-workouts/team/{{ team.id }}/">
<i class="fas fa-clipboard-list fa-fw"></i>&nbsp;Member Workouts

View File

@@ -14,7 +14,7 @@
{% if hasrequested %}
<p>You have requested access to this team</p>
{% elif team not in myteams %}
{% elif team not in myteams and team not in memberteams %}
<p>You can request access to this team. By requesting access, you
agree to the <a href="/rowers/legal">Privacy Policy</a> regarding
team functionality. You agree to share your workout data (except

View File

@@ -1,38 +1,41 @@
{% extends "base.html" %}
{% extends "newbase.html" %}
{% load staticfiles %}
{% block title %}New Team{% endblock %}
{% block content %}
<div class="grid_12 alpha">
<h1>Create a new Team</h1>
</div>
<div id="left" class="grid_6 alpha">
<form enctype="multipart/form-data" action="{{ formloc }}" method="post">
{% if form.errors %}
<p style="color: red;">
Please correct the error{{ form.errors|pluralize }} below.
</p>
{% endif %}
{% block main %}
<h1>Create a new Team</h1>
<table>
{{ form.as_table }}
</table>
{% csrf_token %}
<div id="formbutton" class="grid_1 prefix_4 suffix_1">
<input class="button green" type="submit" value="Submit">
</div>
</div>
<div id="right" class="grid_6 omega">
<ul>
<li>Team Type: A private team is invisible on the Teams Management page, except for its members. The only way to add members is for the manager to send an invitation. An open team is visible for all rowsandall.com users. In addition to the invitation mechanism, any user can request to be added to this team. The team manager will always have to approve membership.</li>
<li>Sharing Behavior: When set to "All Members", all members of a team will see each other's workouts. This is the recommended setting.
If the sharing behavior is set to "Coach Only", team members only see their own workouts. The coach sees all team members' workouts.</li>
<li>These settings can be changed at any point in time through the Team Edit page</li>
</ul>
</div>
<ul class="main-content">
<li class="grid_2">
<form enctype="multipart/form-data" action="{{ formloc }}" method="post">
{% if form.errors %}
<p style="color: red;">
Please correct the error{{ form.errors|pluralize }} below.
</p>
{% endif %}
<table>
{{ form.as_table }}
</table>
{% csrf_token %}
<input class="button green" type="submit" value="Submit">
</li>
<li class="grid_2">
<ul>
<li>Team Type: A private team is invisible on the Teams Management page, except for its members. The only way to add members is for the manager to send an invitation. An open team is visible for all rowsandall.com users. In addition to the invitation mechanism, any user can request to be added to this team. The team manager will always have to approve membership.</li>
<li>Sharing Behavior: When set to "All Members", all members of a team will see each other's workouts. This is the recommended setting.
If the sharing behavior is set to "Coach Only", team members only see their own workouts. The coach sees all team members' workouts.</li>
<li>These settings can be changed at any point in time through the Team Edit page</li>
</ul>
</li>
</ul>
</form>
{% endblock %}
{% block sidebar %}
{% include 'menu_teams.html' %}
{% endblock %}

View File

@@ -87,7 +87,7 @@
</li>
{% endif %}
{% if invites or requests or myrequests or myinvites %}
<li >
<li class="grid_2">
<h2>Invitations and Requests</h2>
<p>This section lists open invites to join a team. By accepting
a team invite, you are agreeing with the sharing
@@ -96,7 +96,7 @@
</p>
<p>As a team manager, by accepting a team invite, you are agreeing
with <a href="/rowers/legal">privacy policy</a> regarding teams and
with our <a href="/rowers/legal">privacy policy</a> regarding teams and
personal data owned by team members.</p>
<table width="90%" class="listtable">

View File

@@ -12944,10 +12944,27 @@ def team_create_view(request):
else:
teamcreateform = TeamForm()
myteams, memberteams, otherteams = get_teams(request)
breadcrumbs = [
{
'url':reverse(rower_teams_view),
'name': 'Teams'
},
{
'url':reverse(team_create_view),
'name': "New Team"
},
]
return render(request,'teamcreate.html',
{
'teams':get_my_teams(request.user),
'form':teamcreateform,
'myteams':myteams,
'memberteams':memberteams,
'otherteams':otherteams,
'active':'nav-teams',
'breadcrumbs':breadcrumbs,
})
@user_passes_test(iscoachmember,login_url="/",redirect_field_name=None)