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

View File

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

View File

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

View File

@@ -1,13 +1,13 @@
{% extends "base.html" %} {% extends "newbase.html" %}
{% load staticfiles %} {% load staticfiles %}
{% block title %}New Team{% endblock %} {% block title %}New Team{% endblock %}
{% block content %} {% block main %}
<div class="grid_12 alpha"> <h1>Create a new Team</h1>
<h1>Create a new Team</h1>
</div> <ul class="main-content">
<div id="left" class="grid_6 alpha"> <li class="grid_2">
<form enctype="multipart/form-data" action="{{ formloc }}" method="post"> <form enctype="multipart/form-data" action="{{ formloc }}" method="post">
{% if form.errors %} {% if form.errors %}
<p style="color: red;"> <p style="color: red;">
@@ -19,20 +19,23 @@
{{ form.as_table }} {{ form.as_table }}
</table> </table>
{% csrf_token %} {% csrf_token %}
<div id="formbutton" class="grid_1 prefix_4 suffix_1">
<input class="button green" type="submit" value="Submit"> <input class="button green" type="submit" value="Submit">
</div> </li>
</div> <li class="grid_2">
<div id="right" class="grid_6 omega">
<ul> <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>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. <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> 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> <li>These settings can be changed at any point in time through the Team Edit page</li>
</ul> </ul>
</div> </li>
</ul>
</form> </form>
{% endblock %} {% endblock %}
{% block sidebar %}
{% include 'menu_teams.html' %}
{% endblock %}

View File

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

View File

@@ -12944,10 +12944,27 @@ def team_create_view(request):
else: else:
teamcreateform = TeamForm() 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', return render(request,'teamcreate.html',
{ {
'teams':get_my_teams(request.user), 'teams':get_my_teams(request.user),
'form':teamcreateform, 'form':teamcreateform,
'myteams':myteams,
'memberteams':memberteams,
'otherteams':otherteams,
'active':'nav-teams',
'breadcrumbs':breadcrumbs,
}) })
@user_passes_test(iscoachmember,login_url="/",redirect_field_name=None) @user_passes_test(iscoachmember,login_url="/",redirect_field_name=None)