Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,9 @@ local_settings.py
**/db.sqlite3
**/db.sqlite3-journal

# Static and media directories (uncomment if you collect to these paths)
# static/
# staticfiles/
# media/
# Static and media directories
staticfiles/
media/

# Scrapy
.scrapy
Expand Down
13 changes: 11 additions & 2 deletions efile_app/efile/context_processors.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,22 @@
"""

from .utils.config_loader import config_loader
from .utils.jurisdiction_stuff import get_jurisdiction_from_request


def jurisdiction_context(request):
"""Add current jurisdiction and its config to all template contexts."""

current_jurisdiction = get_jurisdiction_from_request(request)
# For templates, only use the jurisdiction if it is explicitly present in
# the URL path (e.g. /jurisdiction/illinois/...) or GET params.
# Do not bleed session jurisdiction into generic root routes like /about/ or /choose-jurisdiction.
current_jurisdiction = None
if request.GET.get("jurisdiction"):
current_jurisdiction = request.GET.get("jurisdiction").lower()
else:
segments = request.path.split("/")
if len(segments) >= 3 and segments[1] == "jurisdiction":
current_jurisdiction = segments[2].lower()

config = config_loader.load_jurisdiction_config(current_jurisdiction)

return {
Expand Down
68 changes: 37 additions & 31 deletions efile_app/efile/services/drafts.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,41 +115,42 @@ def set_current_step(draft: FilingDraft, current_step: WorkflowStepKey | str) ->
"name_change_reason": ("reason_for_name_change", "reason_for_change"),
}

# FilingParty role -> {model field: wire key}. Petitioner party_type is special
# (three legacy aliases for one value) and handled separately.
_PARTY_SPECS: dict[str, dict[str, str]] = {
# FilingParty role -> {model field: wire keys}. Petitioner party_type is special
# (three legacy aliases for one value) and handled separately. Respondent and
# defendant are aliases because filing types use those terms interchangeably.
_PARTY_SPECS: dict[str, dict[str, tuple[str, ...]]] = {
"petitioner": {
"first_name": "petitioner_first_name",
"last_name": "petitioner_last_name",
"address_line_1": "petitioner_address",
"email": "petitioner_email",
"phone": "petitioner_phone",
"first_name": ("petitioner_first_name",),
"last_name": ("petitioner_last_name",),
"address_line_1": ("petitioner_address",),
"email": ("petitioner_email",),
"phone": ("petitioner_phone",),
},
"new_name": {
"first_name": "new_first_name",
"middle_name": "new_middle_name",
"last_name": "new_last_name",
"suffix": "new_suffix",
"party_type": "new_name_party_type",
"first_name": ("new_first_name",),
"middle_name": ("new_middle_name",),
"last_name": ("new_last_name",),
"suffix": ("new_suffix",),
"party_type": ("new_name_party_type",),
},
"respondent": {
"first_name": "respondent_first_name",
"middle_name": "respondent_middle_name",
"last_name": "respondent_last_name",
"suffix": "respondent_suffix",
"party_type": "respondent_name_party_type",
"first_name": ("respondent_first_name", "defendant_first_name"),
"middle_name": ("respondent_middle_name", "defendant_middle_name"),
"last_name": ("respondent_last_name", "defendant_last_name"),
"suffix": ("respondent_suffix", "defendant_suffix"),
"party_type": ("respondent_name_party_type", "respondent_party_type", "defendant_party_type"),
},
"other": {
"first_name": "other_first_name",
"last_name": "other_last_name",
"party_type": "other_party_type",
"address_line_1": "other_address_line_1",
"address_line_2": "other_address_line_2",
"city": "other_address_city",
"state": "other_address_state",
"zip_code": "other_address_zip",
"email": "other_email",
"phone": "other_phone_number",
"first_name": ("other_first_name",),
"last_name": ("other_last_name",),
"party_type": ("other_party_type",),
"address_line_1": ("other_address_line_1",),
"address_line_2": ("other_address_line_2",),
"city": ("other_address_city",),
"state": ("other_address_state",),
"zip_code": ("other_address_zip",),
"email": ("other_email",),
"phone": ("other_phone_number",),
},
}

Expand Down Expand Up @@ -233,7 +234,11 @@ def write_case_data(

def _write_parties(draft: FilingDraft, data: dict[str, Any]) -> None:
for role, spec in _PARTY_SPECS.items():
values = {model_field: _as_str(data[wire_key]) for model_field, wire_key in spec.items() if wire_key in data}
values = {}
for model_field, wire_keys in spec.items():
value = _first_present(data, wire_keys)
if value is not _MISSING:
values[model_field] = _as_str(value)
if role == "petitioner":
party_type = _first_present(data, _PETITIONER_PARTY_TYPE_KEYS)
if party_type is not _MISSING:
Expand Down Expand Up @@ -291,8 +296,9 @@ def read_case_data(draft: FilingDraft | None) -> dict[str, Any]:
spec = _PARTY_SPECS.get(party.role)
if spec is None:
continue
for model_field, wire_key in spec.items():
_put(data, wire_key, getattr(party, model_field))
for model_field, wire_keys in spec.items():
for wire_key in wire_keys:
_put(data, wire_key, getattr(party, model_field))
if party.role == "petitioner" and party.party_type:
for key in _PETITIONER_PARTY_TYPE_KEYS:
_put(data, key, party.party_type)
Expand Down
25 changes: 24 additions & 1 deletion efile_app/efile/static/config/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,29 @@ that state, and that list grows: case types, document checklists, court
overrides, and jurisdiction display settings such as the navigation title and
logo all live in the one file.

### Public identity and court branding

The `jurisdiction` section also controls the public About and Terms of Service
pages and the application header. Set these values for each jurisdiction:

```yaml
jurisdiction:
brand_name: "LITEFile"
logo: "img/litefile-logo.svg"
logo_alt: "LITEFile logo"
official_court_name: "the Illinois Courts"
official_tool_statement: "LITEFile is an official, approved electronic filing tool of the Illinois Courts."
court_logos:
- name: "Illinois Courts"
src: "img/court-logo-illinois-placeholder.svg"
alt: "Placeholder logo for the Illinois Courts"
```

`logo` and each court logo `src` are paths under `efile/static`. The placeholder
court artwork can be replaced with approved jurisdiction artwork without
changing the templates. `contact_email` and `contact_address` supply the
privacy-request contact shown on the Terms of Service page.

### Configuration file hierarchy

1. **Base Configuration** (`base-case-types.yaml`)
Expand Down Expand Up @@ -859,4 +882,4 @@ keywords: ["name change", "name petition", "change of name"]
- **Court customizations**: Working system demonstrated with Cook County name change variations

### To-Do's
- **Changing sections to array data structure**: Consider making changes to how we injest sections and instead of using keys can possibly use arrays for more flexible dyanmic sections.
- **Changing sections to array data structure**: Consider making changes to how we injest sections and instead of using keys can possibly use arrays for more flexible dyanmic sections.
38 changes: 32 additions & 6 deletions efile_app/efile/static/config/base-case-types.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,32 @@
# This file defines the common structure that can be inherited by state-specific configs

# Global defaults that apply to all states unless overridden
jurisdiction:
name: "LITEFile"
code: ""
display_name: "LITEFile"
brand_name: "LITEFile"
logo: "img/litefile-logo.svg"
logo_alt: "LITEFile logo"
icon: "fas fa-scale-balanced"
official_court_name: "the jurisdiction's court"
official_tool_statement: "LITEFile is an official, approved electronic filing tool of the jurisdiction's court."
court_logos: []
partner_logos: []
funder_logos:
- name: "Legal Services Corporation"
src: "img/logo-lsc.svg"
alt: "Legal Services Corporation logo"
url: "https://www.lsc.gov/"
- name: "State Justice Institute"
src: "img/logo-sji.png"
alt: "State Justice Institute logo"
url: "https://www.sji.gov/"
help_url: ""
help_number: ""
contact_email: "litlab@suffolk.edu"
contact_address: "Suffolk University Law School LIT Lab, 120 Tremont Street, Boston, MA"

defaults:
sections:
parties:
Expand All @@ -15,7 +41,7 @@ defaults:
fields:
- section_title: "The other side"
required: true
conditional_requirements:
conditional_requirements: {}
# Default: show for all courts except those explicitly hidden
fields:
- name: "other_party_type"
Expand All @@ -36,7 +62,7 @@ defaults:
column_width: "col-6"
- section_title: "Their physical address"
required: true
conditional_requirements:
conditional_requirements: {}
# Default: show for all courts except those explicitly hidden
fields:
- name: "other_address_line_1"
Expand Down Expand Up @@ -66,7 +92,7 @@ defaults:
column_width: "col-6"
- section_title: "Their contact information"
required: true
conditional_requirements:
conditional_requirements: {}
# Default: show for all courts except those explicitly hidden
fields:
- name: "other_email"
Expand Down Expand Up @@ -154,18 +180,18 @@ base_case_types:
- section_title: "Defendant"
required: true
fields:
- name: "new_name_party_type"
- name: "defendant_party_type"
label: "Party Type"
type: "party_type_dropdown"
required: true
column_width: "col-12"
api_endpoint: "/api/dropdowns/party-types/"
- name: "new_first_name"
- name: "defendant_first_name"
label: "First Name"
type: "text"
required: true
column_width: "col-6"
- name: "new_last_name"
- name: "defendant_last_name"
label: "Last Name"
type: "text"
required: true
Expand Down
23 changes: 21 additions & 2 deletions efile_app/efile/static/config/states/illinois.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,28 @@ jurisdiction:
name: "Illinois eFile"
code: "illinois"
display_name: "Illinois"
brand_name: "LITEFile"
logo: "img/litefile-logo.svg"
logo_alt: "LITEFile logo"
icon: "fas fa-balance-scale"
svg: "img/IL.svg"
api_endpoint: "/api/illinois"
official_court_name: "the Illinois Courts"
official_tool_statement: "LITEFile is an official, approved electronic filing tool of the Illinois Courts."
court_logos:
- name: "Illinois Courts"
src: "img/court-logo-illinois.svg"
alt: "Seal of the Supreme Court of Illinois"
partner_logos:
- name: "Illinois Legal Aid Online (ILAO)"
src: "img/logo-ilao.png"
alt: "Illinois Legal Aid Online logo"
url: "https://www.illinoislegalaid.org/"
role: "Project & Funding Partner"
help_url: "https://www.ilcourthelp.gov/"
help_number: "833-411-1121"
contact_email: "litlab@suffolk.edu"
contact_address: "Suffolk University Law School LIT Lab, 120 Tremont Street, Boston, MA"

# State metadata, for the address
state:
Expand Down Expand Up @@ -205,7 +224,7 @@ case_types:
fields:
- section_title: "Children"
required: false
conditional_requirements:
conditional_requirements: {}
# show_when_field: "has_children"
# show_when_value: true
fields:
Expand Down Expand Up @@ -510,4 +529,4 @@ court_specific_requirements:
- field_group: "Name sought"
modifications:
conditional_requirements:
hidden_for_courts: ["bond"]
hidden_for_courts: ["bond"]
43 changes: 20 additions & 23 deletions efile_app/efile/static/config/states/massachusetts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,27 @@ jurisdiction:
name: "Massachusetts eFile"
code: "massachusetts"
display_name: "Massachusetts"
brand_name: "LITEFile"
logo: "img/litefile-logo.svg"
logo_alt: "LITEFile logo"
icon: "fas fa-balance-scale"
svg: "img/MA.svg"
api_endpoint: "/api/massachusetts"
help_url: "https://www.mass.gov/orgs/massachusetts-court-system"
official_court_name: "the Massachusetts Trial Court"
official_tool_statement: "LITEFile is an official, approved electronic filing tool of the Massachusetts Trial Court."
court_logos:
- name: "Massachusetts Trial Court"
src: "img/court-logo-massachusetts.png"
alt: "Seal of the Massachusetts Trial Court"
help_url: "https://www.mass.gov/orgs/court-service-centers"
help_number: "711"
contact_email: "litlab@suffolk.edu"
contact_address: "Suffolk University Law School LIT Lab, 120 Tremont Street, Boston, MA"
copyedit:
landing_text: |
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed fringilla enim ut nibh aliquam venenatis. Vivamus lacinia risus vitae massa aliquet, id hendrerit mi tincidunt. Vestibulum aliquet sapien ut velit laoreet, in blandit lectus congue. Ut at massa in eros sodales porta id sit amet urna. Proin suscipit venenatis justo sit amet condimentum. Donec volutpat sem nec facilisis tristique. Sed elementum ante nisi, id lacinia eros pellentesque in. Curabitur quis ante ut nunc pharetra tincidunt. Maecenas ornare augue eu diam condimentum congue. Pellentesque ac lorem quis magna rutrum euismod pharetra ac massa. Nulla felis erat, consectetur eu lacus ac, scelerisque rhoncus diam. Sed gravida ex ut maximus dapibus. Sed eu hendrerit est. Maecenas in porta lacus.
Welcome to LITEFile for Massachusetts. Use this tool to prepare and submit electronic court filings to the Massachusetts Trial Court.
post_action_text: |
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed fringilla enim ut nibh aliquam venenatis. Vivamus lacinia risus vitae massa aliquet, id hendrerit mi tincidunt. Vestibulum aliquet sapien ut velit laoreet, in blandit lectus congue. Ut at massa in eros sodales porta id sit amet urna. Proin suscipit venenatis justo sit amet condimentum. Donec volutpat sem nec facilisis tristique. Sed elementum ante nisi, id lacinia eros pellentesque in. Curabitur quis ante ut nunc pharetra tincidunt. Maecenas ornare augue eu diam condimentum congue. Pellentesque ac lorem quis magna rutrum euismod pharetra ac massa. Nulla felis erat, consectetur eu lacus ac, scelerisque rhoncus diam. Sed gravida ex ut maximus dapibus. Sed eu hendrerit est. Maecenas in porta lacus.

Nulla at blandit risus, vel vehicula magna. Quisque ullamcorper lorem eget erat dignissim, id posuere ante lacinia. Quisque luctus vitae velit sed vulputate. Ut gravida ipsum in consectetur tincidunt. Quisque ac purus nunc. Sed sit amet accumsan dolor, in ullamcorper orci. Donec maximus imperdiet libero. Pellentesque vel feugiat magna, congue fermentum mi. Mauris vel molestie ex. Sed quis augue semper, tempus est vitae, porta felis.
Your filing has been submitted to the Massachusetts Trial Court for processing. Check your filing status for updates. If you have questions about a specific filing, contact the court.
filing_statuses: |
These are filings that you have already sent to the courts, either through this website or elsewhere.

Expand Down Expand Up @@ -107,26 +116,14 @@ case_types:

# Massachusetts court-specific requirements
court_specific_requirements:
"suffolk:probate": # Suffolk County Probate Court
"suffolk:probate":
case_types:
name_change:
additional_fields:
- name: "publication_notice"
label: "Do you request waiver of publication notice?"
type: "radio"
required: true
column_width: "col-12"
options:
- value: "yes"
label: "Yes, I request waiver"
- value: "no"
label: "No, I will publish notice"

additional_validation:
- field: "petitioner_age"
rule: "min_value"
value: 18
message: "Petitioner must be at least 18 years old in Suffolk County"
field_modifications:
- field_group: "Requested name"
modifications:
conditional_requirements:
required_for_courts: ["suffolk:probate"]

# Massachusetts-specific terminology overrides
terminology:
Expand Down
Loading