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
52 changes: 35 additions & 17 deletions efile_app/efile/templates/efile/components/profile_header.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,25 +26,39 @@
aria-hidden="true">
<div class="modal-dialog modal-dialog-centered">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="profileModalLabel">{% translate "Profile Info" %}</h5>
<button type="button"
class="btn-close"
data-bs-dismiss="modal"
aria-label="Close"></button>
</div>
<div class="modal-body">
<p>
{% blocktranslate %}Welcome to {{ config.jurisdiction.name }}. Here you can manage your filings and account.{% endblocktranslate %}
</p>
<div class="mb-3">
<span class="form-label">{% translate "Current email" %}</span>: {{ user.username }}
{% if is_logged_in %}
<div class="modal-header">
<h5 class="modal-title" id="profileModalLabel">{% translate "Profile Info" %}</h5>
<button type="button"
class="btn-close"
data-bs-dismiss="modal"
aria-label="Close"></button>
</div>
<div class="mb-3">
<span class="form-label">{% translate "Current Jurisdiction" %}</span>: {{ jurisdiction }}
<div class="modal-body">
<p>
{% blocktranslate with name=config.jurisdiction.name %}Welcome to {{ name }}. Here you can manage your filings and account.{% endblocktranslate %}
</p>
<div class="mb-3">
<span class="form-label">{% translate "Current email" %}</span>: {{ user.username }}
</div>
<div class="mb-3">
<span class="form-label">{% translate "Current Jurisdiction" %}</span>: {{ jurisdiction }}
</div>
<button type="button" class="btn btn-danger w-100" onclick="logout()">{% translate "Sign out" %}</button>
</div>
<button type="button" class="btn btn-danger w-100" onclick="logout()">Logout</button>
</div>
{% else %}
<div class="modal-header">
<h5 class="modal-title" id="profileModalLabel">{% translate "Sign in to get started" %}</h5>
<button type="button"
class="btn-close"
data-bs-dismiss="modal"
aria-label="Close"></button>
</div>
<div class="modal-body">
<p>{% blocktranslate with name=config.jurisdiction.name %}Welcome to {{ name }}.{% endblocktranslate %}</p>
<button type="button" class="btn btn-primary w-100" onclick="login()">{% translate "Sign in" %}</button>
</div>
{% endif %}
</div>
</div>
</div>
Expand Down Expand Up @@ -92,4 +106,8 @@ <h5 class="modal-title" id="profileModalLabel">{% translate "Profile Info" %}</h
window.location.href = '/jurisdiction/{{jurisdiction}}/logout/';
});
}

function login() {
window.location.href = '/jurisdiction/{{jurisdiction}}/login/';
}
</script>
2 changes: 1 addition & 1 deletion efile_app/efile/templates/efile/confirmation.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ <h1 class="h2 mb-3" style="color: #2c5aa0;">{% translate "Filing Submitted Succe
</a>
<a href="{% url 'efile_logout' jurisdiction %}"
class="btn btn-outline-secondary">
<i class="fas fa-arrow-right me-2"></i>{% translate "Logout" %}
<i class="fas fa-arrow-right me-2"></i>{% translate "Sign out" %}
</a>
</div>
</div>
Expand Down
3 changes: 2 additions & 1 deletion efile_app/efile/templates/efile/options.html
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ <h2>{% translate "View past filings" %}</h2>
<script src="{% url 'javascript-catalog' %}"></script>
<script src="{% static 'js/api-utils.js' %}"></script>
<script>
let is_logged_in = "{{is_logged_in}}" === "True";
// Function to save existing_case data and redirect to expert form or case details
function goToExpertForm(new_or_existing) {
if (new_or_existing === "new") {
Expand All @@ -109,7 +110,7 @@ <h2>{% translate "View past filings" %}</h2>
async function checkExistingCaseData() {
// Check if there's an API endpoint to retrieve saved case data
const result = await apiUtils.getCaseData();
if (
if (is_logged_in &&
result.success &&
result.data &&
Object.keys(result.data).length > 0
Expand Down
6 changes: 6 additions & 0 deletions efile_app/efile/views/confirmation.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
from django.shortcuts import render

from efile.api.suffolk_api_views import get_tyler_token


def filing_confirmation(request, jurisdiction):
"""Confirmation page after successful filing submission."""

# You can add logic here to retrieve filing details from session
# or from database if you're storing submitted filings
is_logged_in = request.user.is_authenticated
if not get_tyler_token(request, jurisdiction):
is_logged_in = False

context = {
"is_logged_in": is_logged_in,
"page_title": "Filing Confirmation",
"success_message": "Your filing has been successfully submitted!",
}
Expand Down
6 changes: 6 additions & 0 deletions efile_app/efile/views/expert_form.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

from django.shortcuts import redirect, render

from efile.api.suffolk_api_views import get_tyler_token

from ..utils.case_data_utils import get_upload_data

logger = logging.getLogger(__name__)
Expand Down Expand Up @@ -42,8 +44,12 @@ def efile_expert_form(request, jurisdiction):
party_fields = ["petitioner_first_name", "petitioner_last_name", "new_first_name", "new_last_name"]
has_party_info = all(case_data.get(field) for field in party_fields)

is_logged_in = request.user.is_authenticated
if not get_tyler_token(request, jurisdiction):
is_logged_in = False
# Display the form for data collection with existing data populated
context = {
"is_logged_in": is_logged_in,
"case_data": case_data,
"guessed_court": upload_data.get("guesses", {}).get("court"),
"guessed_case_category": upload_data.get("guesses", {}).get("case type"),
Expand Down
6 changes: 6 additions & 0 deletions efile_app/efile/views/filing_statuses.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
from django.shortcuts import redirect, render

from efile.api.suffolk_api_views import get_tyler_token

from ..utils.case_data_utils import get_case_data


Expand All @@ -11,8 +13,12 @@ def filing_statuses(request, jurisdiction):
# Get case data from session
case_data = get_case_data(request)

is_logged_in = request.user.is_authenticated
if not get_tyler_token(request, jurisdiction):
is_logged_in = False
# Pass case data to template for display
context = {
"is_logged_in": is_logged_in,
"case_data": case_data,
"has_case_data": bool(case_data),
}
Expand Down
11 changes: 10 additions & 1 deletion efile_app/efile/views/options.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
from django.shortcuts import render

from efile.api.suffolk_api_views import get_tyler_token

from ..utils.case_data_utils import get_case_data


Expand All @@ -11,9 +13,16 @@ def efile_options(request, jurisdiction):
else:
case_data = {}

is_logged_in = request.user.is_authenticated
if not get_tyler_token(request, jurisdiction):
is_logged_in = False

is_logged_in = request.user.is_authenticated
if not get_tyler_token(request, jurisdiction):
is_logged_in = False
# Pass case data to template for display
context = {
"is_logged_in": request.user.is_authenticated,
"is_logged_in": is_logged_in,
"case_data": case_data,
"has_case_data": bool(case_data),
}
Expand Down
6 changes: 6 additions & 0 deletions efile_app/efile/views/payment.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
from django.contrib import messages
from django.shortcuts import redirect, render

from efile.api.suffolk_api_views import get_tyler_token

from ..utils.case_data_utils import get_case_data

logger = logging.getLogger(__name__)
Expand All @@ -27,7 +29,11 @@ def efile_payment(request, jurisdiction):

new_toga_url = f"{settings.EFSP_URL}/jurisdictions/{jurisdiction}/payments/new-toga-account"

is_logged_in = request.user.is_authenticated
if not get_tyler_token(request, jurisdiction):
is_logged_in = False
context = {
"is_logged_in": is_logged_in,
"new_toga_url": new_toga_url,
"case_data": case_data,
}
Expand Down
6 changes: 6 additions & 0 deletions efile_app/efile/views/review.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
from django.contrib import messages
from django.shortcuts import redirect, render

from efile.api.suffolk_api_views import get_tyler_token

from ..utils.case_data_utils import get_case_classification, get_case_data, get_name_sought_info, get_petitioner_info

logger = logging.getLogger(__name__)
Expand Down Expand Up @@ -94,7 +96,11 @@ def case_review(request, jurisdiction):

new_toga_url = f"{settings.EFSP_URL}/jurisdictions/{jurisdiction}/payments/new-toga-account"

is_logged_in = request.user.is_authenticated
if not get_tyler_token(request, jurisdiction):
is_logged_in = False
context = {
"is_logged_in": is_logged_in,
"new_toga_url": new_toga_url,
"case_data": case_data,
"review_sections": review_sections,
Expand Down
6 changes: 6 additions & 0 deletions efile_app/efile/views/upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
from django.shortcuts import redirect, render
from django.utils.translation import gettext

from efile.api.suffolk_api_views import get_tyler_token

from ..utils.case_data_utils import (
get_case_classification,
get_case_data,
Expand Down Expand Up @@ -42,7 +44,11 @@ def efile_upload(request, jurisdiction):

upload_data = get_upload_data(request)

is_logged_in = request.user.is_authenticated
if not get_tyler_token(request, jurisdiction):
is_logged_in = False
context = {
"is_logged_in": is_logged_in,
"case_data": case_data,
"upload_data": upload_data,
"petitioner_info": petitioner_info,
Expand Down
6 changes: 6 additions & 0 deletions efile_app/efile/views/upload_first.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

from django.shortcuts import redirect, render

from efile.api.suffolk_api_views import get_tyler_token

from ..utils.case_data_utils import (
get_case_classification,
get_name_sought_info,
Expand Down Expand Up @@ -43,7 +45,11 @@ def efile_upload_first(request, jurisdiction):
name_sought_info = get_name_sought_info(request)
case_classification = get_case_classification(request)

is_logged_in = request.user.is_authenticated
if not get_tyler_token(request, jurisdiction):
is_logged_in = False
context = {
"is_logged_in": is_logged_in,
"upload_data": upload_data,
"petitioner_info": petitioner_info,
"name_sought_info": name_sought_info,
Expand Down