Skip to content

Commit

Permalink
Merge pull request #139 from grepthink/master
Browse files Browse the repository at this point in the history
Small Update to Tsr Edit
  • Loading branch information
Kevin Pannell committed Oct 16, 2018
2 parents d0d91b8 + 40bfb9c commit bc6d67d
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 15 deletions.
6 changes: 4 additions & 2 deletions teamwork/apps/projects/views/EditTsrView.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def tsr_edit(request, slug, asg_slug):
page_name = "TSR Edit"
page_description = "Edit TSR form"
title = "TSR Edit"

# Current Project
cur_proj = get_object_or_404(Project, slug=slug)

Expand All @@ -34,7 +34,9 @@ def tsr_edit(request, slug, asg_slug):
# List of Members of the Current Project
members = cur_proj.members.all()
emails = [member.email for member in members]
tsr_list = Tsr.objects.filter(ass_number=asg.ass_number, evaluator=request.user)

# grab the TSR objects that will be displayed to edit
tsr_list = asg.subs.all().filter(evaluator=request.user)

# Determine if Scrum Master
scrum_master = is_scrum_master(request)
Expand Down
41 changes: 28 additions & 13 deletions teamwork/templates/projects/tsr_edit.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,34 @@
onblur="checkTextField(this);" />
{% block content %}

<form action="{% url 'tsr_edit' cur_proj.slug ass.slug %}" method="post" role="form">
{% csrf_token %}
{% for form in forms %}
<br>
<br>
<h3>For {{form.prefix}}</h3>
{% for field in form.visible_fields %}
<label for="{{ field.label }}" class="control-label">{{ field.label }}</label>
<div class="col-md-8">
<div class="box box-success">
<div class="box-header with-border">
<h3 class="box-title">Edit TSR Submission</h3>
</div>
<div class="box-body">
<p class="text-center">
<strong>Course:</strong> {{ cur_proj.course.first.name }}
</p>
<p class="text-center">
<strong>Assignment:</strong> {{ ass.ass_name }}
</p>
<form action="{% url 'tsr_edit' cur_proj.slug ass.slug %}" method="post" role="form">
{% csrf_token %}
{% for form in forms %}
<h3>For {{form.prefix}}</h3>
{% for field in form.visible_fields %}
<label for="{{ field.label }}" class="control-label">{{ field.label }}</label>

{{ field }}
{{ field }}
{% endfor %}
<br>
<br>
{% endfor %}
{% endfor %}
<br>
<h5> <input type="submit" value="Submit">
</form>
<br>
<h5> <input type="submit" value="Submit">
</form>
</div>
</div>
</div>
{% endblock content %}

0 comments on commit bc6d67d

Please sign in to comment.