-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Admin: Eligibility View #2317
Merged
Merged
Admin: Eligibility View #2317
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
6547686
feat(admin): add in-person eligibility route, form, template
machikoyasuda 7ec487d
feat(admin): styling for form - primary outline button, checkbox
machikoyasuda 9332c4e
test(admin): add tests for verified and unverified eligibility form
machikoyasuda 19cc65b
fix(tests): remove unnecessary fixture
machikoyasuda File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As utility classes:
d-flex flex-row-reverse justify-content-start gap-0 row-gap-1 mt-4
d-flex flex-column gap-0 row-gap-3
- adds equal spacing between the radio buttons and checkboxes.But just decided to do it like this for now. Named
checkbox-parent
because the main thing this does is flip the checkbox rendering to show the checkbox input first, then label, which is the opposite of the rest of the pages.