Skip to content

Commit

Permalink
fixup! Review split person choices
Browse files Browse the repository at this point in the history
  • Loading branch information
VirginiaDooley committed May 30, 2024
1 parent c2aff31 commit 57c1994
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
3 changes: 3 additions & 0 deletions ynr/apps/candidates/views/people.py
Original file line number Diff line number Diff line change
Expand Up @@ -587,6 +587,9 @@ class ReviewPersonSplitView(TemplateView):
def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
context["choices"] = self.request.session.get("choices", {})
context["person"] = get_object_or_404(
Person, pk=self.request.session.get("person_id")
)
return context


Expand Down
8 changes: 6 additions & 2 deletions ynr/apps/people/templates/people/review_split_person.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

{% block content %}
<h1>Review split person choices</h1>

{% if choices.keep %}
<h2>Keep these attributes on <a href="{% url 'person-view' person_id %}">Person:# {{person_id}}</a></h2>
<ul>
Expand All @@ -14,6 +15,7 @@ <h2>Keep these attributes on <a href="{% url 'person-view' person_id %}">Person:
</ul>
<p>Submitting this form will create a new person with the above attributes.</p>
{% endif %}

{% if choices.move %}
<h2>Move these attributes to a new Person</h2>
<ul>
Expand All @@ -23,6 +25,7 @@ <h2>Move these attributes to a new Person</h2>
</ul>
<p>Submitting this form will create a new person with the above attributes and remove the above attributes from the original person.</p>
{% endif %}

{% if choices.both %}
<h2>Do both</h2>
<ul>
Expand All @@ -32,8 +35,9 @@ <h2>Do both</h2>
</ul>
<p>Submitting this form will create a new person with the above attributes and keep the above attributes on the original person.</p>
{% endif %}
<form method="post" action="{% url 'confirm_split_person' person_id=person_id %}">
<form method="post" action="{% url 'confirm_split_person' person_id %}">
{% csrf_token %}
<button type="submit">Submit Choices</button>
<input class="button primary small" type="submit" value="Submit choices">
</form>
<a class="button secondary small" onclick="window.history.back()">Go back</a>
{% endblock %}

0 comments on commit 57c1994

Please sign in to comment.