-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Admin: In-Person Eligibility View (#2317)
This PR adds the in-person eligibility view form, allowing a transit agency user to manually verify a rider's eligibility in person, and select an enrollment pathway for the rider.
- Loading branch information
Showing
6 changed files
with
152 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
""" | ||
The in-person eligibility application: Form definition for the | ||
in-person eligibility verification flow, in which a | ||
transit agency employee manually verifies a rider's eligibility. | ||
""" | ||
|
||
from django import forms | ||
from benefits.routes import routes | ||
from benefits.core import models | ||
|
||
|
||
class InPersonEligibilityForm(forms.Form): | ||
"""Form to capture eligibility for in-person verification flow selection.""" | ||
|
||
action_url = routes.IN_PERSON_ELIGIBILITY | ||
id = "form-flow-selection" | ||
method = "POST" | ||
|
||
flow = forms.ChoiceField(label="Choose an eligibility type to qualify this rider.", widget=forms.widgets.RadioSelect) | ||
verified = forms.BooleanField(label="I have verified this person’s eligibility for a transit benefit.", required=True) | ||
|
||
cancel_url = routes.ADMIN_INDEX | ||
|
||
def __init__(self, agency: models.TransitAgency, *args, **kwargs): | ||
super().__init__(*args, **kwargs) | ||
flows = agency.enrollment_flows.all() | ||
|
||
self.classes = "checkbox-parent" | ||
flow_field = self.fields["flow"] | ||
flow_field.choices = [(f.id, f.label) for f in flows] | ||
flow_field.widget.attrs.update({"data-custom-validity": "Please choose a transit benefit."}) | ||
self.use_custom_validity = True |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
{% extends "admin/agency-base.html" %} | ||
|
||
{% block title %} | ||
Agency dashboard: In-person enrollment | ||
{% endblock title %} | ||
|
||
{% block content %} | ||
<div class="row justify-content-center"> | ||
<div class="col-11 col-md-10 col-lg-6 border border-3 px-0"> | ||
<div class="border border-3 border-top-0 border-start-0 border-end-0"> | ||
<h2 class="p-3 m-0 text-left">In-person enrollment</h2> | ||
</div> | ||
<div class="p-3">{% include "core/includes/form.html" with form=form %}</div> | ||
<div class="row d-flex justify-content-start p-3 pt-8"> | ||
<div class="col-6"> | ||
{% url form.cancel_url as url_cancel %} | ||
<a href="{{ url_cancel }}" class="btn btn-lg btn-outline-primary d-block">Cancel</a> | ||
</div> | ||
<div class="col-6"> | ||
<button class="btn btn-lg btn-primary d-flex justify-content-center align-items-center" | ||
data-action="submit" | ||
type="submit" | ||
form="{{ form.id }}"> | ||
<span class="btn-text">Continue</span> | ||
</button> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
{% endblock content %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters