Skip to content
Open
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
4 changes: 2 additions & 2 deletions .claude/skills/ui-demo/server/templates/ui_demo/inbox.html
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@
<main class="pane">
{% if opened %}
<article data-opened-email="{{ opened.id }}">
<a class="back" href="{% url 'demo_inbox' %}?to={{ owner|urlencode }}">&larr; Back to Inbox</a>
<a class="back" href="{% url 'demo_inbox' %}?to={{ owner|urlencode }}">← Back to Inbox</a>
Comment thread
snopoke marked this conversation as resolved.
Resolved
<h1>
{{ opened.subject }} <span class="chip">Inbox</span>
<time>{{ opened.sent_at|naturaltime }}</time>
Expand All @@ -241,7 +241,7 @@ <h1>
data-email="{{ email.id }}"
href="{% url 'demo_email' email.id %}?to={{ owner|urlencode }}">
<span class="row-text"><span class="row-subject">{{ email.subject }}</span>
<span class="row-snippet">- {{ email.text|truncatechars:90 }}</span></span>
<span class="row-snippet">- {{ email.text|truncatechars:90 }}</span></span>
<time>{{ email.sent_at|naturaltime }}</time>
</a>
{% empty %}
Expand Down
10 changes: 5 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ repos:
exclude: '(commcare_connect|\.claude/skills/ui-demo/server)/templates/'

- repo: https://github.com/Riverside-Healthcare/djLint
rev: v1.36.4
rev: v1.53.0
hooks:
- id: djlint-reformat-django
exclude: commcare_connect/templates/prelogin/(home|in-action)\.html
Expand All @@ -42,24 +42,24 @@ repos:
args: ['--target-version', '5.2']

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.16.6
rev: v0.17.5
hooks:
- id: ruff
args: [--fix]
- id: ruff-format

- repo: https://github.com/pre-commit/mirrors-eslint
rev: v10.10.0
rev: v10.15.0
hooks:
- id: eslint
files: commcare_connect/static/.*\.[jt]s$
types: [file]
types_or: [javascript, ts]
exclude: commcare_connect/static/bundles/
additional_dependencies:
- eslint@10.10.0
- eslint@10.15.0
- '@eslint/js@10.0.1'
- globals@17.8.0
- globals@17.14.0
- typescript@6.0.3
- typescript-eslint@8.73.0

Expand Down
2 changes: 1 addition & 1 deletion commcare_connect/templates/account/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<script src="{% static 'bundles/js/vendors-bundle.js' %}" defer></script>
<script src="{% static 'bundles/js/tailwind-bundle.js' %}" defer></script>
{% endblock javascript %}
{% include 'components/forget_form_submission.html' %}
{% include "components/forget_form_submission.html" %}
</head>
<body class="flex flex-col justify-center pl-16 overflow-x-hidden bg-stone-100 font-work-sans">
<div class="container relative flex items-center justify-center h-screen mx-auto md:max-w-screen-md">
Expand Down
12 changes: 6 additions & 6 deletions commcare_connect/templates/account/email.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ <h2 class="text-xl font-semibold text-brand-deep-purple mb-4">{% translate "Edit
<h2 class="text-xl font-semibold text-brand-deep-purple mb-4">{% translate "E-mail Addresses" %}</h2>
{% if user.emailaddress_set.all %}
<p class="mb-4 text-sm text-gray-700">
{% translate 'The following e-mail addresses are associated with your account:' %}
{% translate "The following e-mail addresses are associated with your account:" %}
</p>
<form action="{% url 'account_email' %}" method="post">
{% csrf_token %}
Expand Down Expand Up @@ -58,17 +58,17 @@ <h2 class="text-xl font-semibold text-brand-deep-purple mb-4">{% translate "E-ma
<button class="button button-md outline-style text-red-600 hover:bg-red-50 border-red-300 hover:border-red-400"
type="submit"
name="action_remove">
<i class="fa-solid fa-trash mr-1"></i> {% translate 'Remove' %}
<i class="fa-solid fa-trash mr-1"></i> {% translate "Remove" %}
</button>
<button class="button button-md primary-light"
type="submit"
name="action_send">
<i class="fa-solid fa-rotate-right mr-1"></i> {% translate 'Re-send Verification' %}
<i class="fa-solid fa-rotate-right mr-1"></i> {% translate "Re-send Verification" %}
</button>
<button class="button button-md primary-dark"
type="submit"
name="action_primary">
<i class="fa-solid fa-check mr-1"></i> {% translate 'Make Primary' %}
<i class="fa-solid fa-check mr-1"></i> {% translate "Make Primary" %}
</button>
</div>
</div>
Expand All @@ -77,7 +77,7 @@ <h2 class="text-xl font-semibold text-brand-deep-purple mb-4">{% translate "E-ma
<div class="bg-yellow-50 border-l-4 border-yellow-400 p-4 rounded"
role="alert">
<p class="text-sm text-yellow-700">
<strong class="font-bold">{% translate 'Warning:' %}</strong> {% translate "You currently do not have any e-mail address set up. You should really add an e-mail address so you can receive notifications, reset your password, etc." %}
<strong class="font-bold">{% translate "Warning:" %}</strong> {% translate "You currently do not have any e-mail address set up. You should really add an e-mail address so you can receive notifications, reset your password, etc." %}
</p>
</div>
{% endif %}
Expand All @@ -104,7 +104,7 @@ <h2 class="text-xl font-semibold text-brand-deep-purple mb-4">{% translate "Add
{% endblock content %}
{% block inline_javascript %}
{{ block.super }}
<script type="text/javascript">
<script>
window.addEventListener('DOMContentLoaded', function () {
const message = "{% translate 'Do you really want to remove the selected e-mail address?' %}";
const actions = document.getElementsByName('action_remove');
Expand Down
2 changes: 1 addition & 1 deletion commcare_connect/templates/account/email_confirm.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ <h1 class="title text-brand-deep-purple mb-4">{% translate "Confirm E-mail Addre
<form method="post"
action="{% url 'account_confirm_email' confirmation.key %}">
{% csrf_token %}
<button class="button button-md primary-dark" type="submit">{% translate 'Confirm' %}</button>
<button class="button button-md primary-dark" type="submit">{% translate "Confirm" %}</button>
</form>
{% else %}
{% url 'account_email' as email_url %}
Expand Down
2 changes: 1 addition & 1 deletion commcare_connect/templates/account/login.html
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ <h6 class="title text-brand-deep-purple">Login</h6>
</form>
</div>
{% endif %}
<div class="text-sm text-gray-400 text-center mt-auto border-t-gray-200 border-t-2 pt-4 ">
<div class="text-sm text-gray-400 text-center mt-auto border-t-gray-200 border-t-2 pt-4">
Don't have an account?
<a href="{{ signup_url }}" class="text-brand-indigo font-medium">Signup</a>
</div>
Expand Down
4 changes: 2 additions & 2 deletions commcare_connect/templates/account/logout.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
{% block inner %}
<div class="w-full min-h-[620px] h-fit">
<h1 class="title text-brand-deep-purple mb-4">{% translate "Sign Out" %}</h1>
<p class="text-sm">{% translate 'Are you sure you want to sign out?' %}</p>
<p class="text-sm">{% translate "Are you sure you want to sign out?" %}</p>
<form method="post" action="{% url 'account_logout' %}">
{% csrf_token %}
{% if redirect_field_value %}
<input type="hidden"
name="{{ redirect_field_name }}"
value="{{ redirect_field_value }}" />
{% endif %}
<button class="button button-md negative-light my-4" type="submit">{% translate 'Sign Out' %}</button>
<button class="button button-md negative-light my-4" type="submit">{% translate "Sign Out" %}</button>
</form>
</div>
{% endblock %}
2 changes: 1 addition & 1 deletion commcare_connect/templates/account/password_reset.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ <h6 class="title text-brand-deep-purple">{% translate "Password Reset" %}</h6>
<span class="relative z-20">{% translate "Reset" %}</span>
</button>
</div>
<div class="text-sm text-gray-400 text-center mt-auto border-t-gray-200 border-t-2 pt-4 ">
<div class="text-sm text-gray-400 text-center mt-auto border-t-gray-200 border-t-2 pt-4">
{% translate "Don't have an account?" %}
<a href="{% url 'account_signup' %}"
class="text-brand-indigo font-medium">{% translate "Signup" %}</a>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ <h6 class="title text-brand-deep-purple">New Password</h6>
<span class="relative z-20">Update</span>
</button>
</div>
<div class="text-sm text-gray-400 text-center mt-auto border-t-gray-200 border-t-2 pt-4 ">
<div class="text-sm text-gray-400 text-center mt-auto border-t-gray-200 border-t-2 pt-4">
{% translate "Don't have an account?" %}
<a href="{% url 'account_signup' %}"
class="text-brand-indigo font-medium">{% translate "Signup" %}</a>
Expand All @@ -36,7 +36,7 @@ <h6 class="title text-brand-deep-purple">New Password</h6>
{% else %}
{# Silently drain messages — this page already says it #}
{% for message in messages %}{% endfor %}
<p>{% translate 'Your password is now changed. You can now sign in with your new password.' %}</p>
<p>{% translate "Your password is now changed. You can now sign in with your new password." %}</p>
<a href="{% url 'account_login' %}"
class="button button-md primary-dark w-fit">{% translate "Sign In" %}</a>
{% endif %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<h1 class="title text-brand-deep-purple">{% translate "Change Password" %}</h1>
{# Silently drain messages — this page already says it #}
{% for message in messages %}{% endfor %}
<p>{% translate 'Your password is now changed. You can now sign in with your new password.' %}</p>
<p>{% translate "Your password is now changed. You can now sign in with your new password." %}</p>
<a href="{% url 'account_login' %}"
class="button button-md primary-dark w-fit">{% translate "Sign In" %}</a>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
{% block breadcrumbs %}
<div class="breadcrumbs">
<a href="{% url 'admin:index' %}">Home</a>
&rsaquo; <a href="{% url 'admin:app_list' app_label=opts.app_label %}">{{ opts.app_config.verbose_name }}</a>
&rsaquo; <a href="{% url 'admin:organization_organization_changelist' %}">{{ opts.verbose_name_plural|capfirst }}</a>
&rsaquo; Merge organizations
› <a href="{% url 'admin:app_list' app_label=opts.app_label %}">{{ opts.app_config.verbose_name }}</a>
› <a href="{% url 'admin:organization_organization_changelist' %}">{{ opts.verbose_name_plural|capfirst }}</a>
› Merge organizations
</div>
{% endblock %}
{% block content %}
<p class="errornote">
Merging is irreversible. Every relation below is repointed at the organization you keep, and the other organization is
deleted. Run it once and check the result &mdash; there is no undo.
deleted. Run it once and check the result — there is no undo.
</p>
<form method="post">
{% csrf_token %}
Expand Down Expand Up @@ -43,7 +43,7 @@ <h2>Profile</h2>
</table>
<p class="help">
Only the surviving organization's profile is kept. Nothing above is carried over from the organization you delete
&mdash; including <code>program_manager</code> and <code>funder</code>.
— including <code>program_manager</code> and <code>funder</code>.
</p>
</fieldset>
<fieldset class="module aligned">
Expand Down Expand Up @@ -84,7 +84,7 @@ <h2>What gets discarded</h2>
{% if names %}
{{ names|join:", " }}
{% else %}
&mdash;
—
{% endif %}
</td>
{% endfor %}
Expand Down
2 changes: 1 addition & 1 deletion commcare_connect/templates/audit/audit_report_detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@
<script src="{% static 'bundles/js/tomselect-bundle.js' %}"></script>
{% endblock javascript %}
{% block content %}
{% include 'components/breadcrumbs.html' with path=path %}
{% include "components/breadcrumbs.html" with path=path %}
<div class="w-full flex flex-col gap-4">{% include "audit/audit_report_body.html" %}</div>
{% endblock %}
2 changes: 1 addition & 1 deletion commcare_connect/templates/audit/audit_report_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
{% blocktrans with name=opportunity.name %}Audits — {{ name }}{% endblocktrans %}
{% endblock %}
{% block content %}
{% include 'components/breadcrumbs.html' with path=path %}
{% include "components/breadcrumbs.html" with path=path %}
<div class="w-full flex flex-col gap-4">
<div class="flex gap-4 h-32 items-center justify-between p-4 profile-bg metric-container rounded-2xl">
<div class="flex flex-col gap-2">
Expand Down
18 changes: 11 additions & 7 deletions commcare_connect/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
{% include 'favicon.html' %}
{% include "favicon.html" %}
<title>Connect</title>
{% block css %}
<link rel="stylesheet" href="{% static 'bundles/css/vendors.css' %}">
Expand All @@ -22,16 +22,20 @@
<script src="{% static 'js/livesession.js' %}" defer></script>
{% endif %}
{% endblock javascript %}
{% include 'components/forget_form_submission.html' %}
{% include "components/forget_form_submission.html" %}
</head>
<body hx-headers='{"X-CSRFToken": "{{ csrf_token }}"}' x-data="{ sidebarOpen: $persist(false).as('sidebarOpen'), hasSidebar:
<body hx-headers='{"X-CSRFToken": "{{ csrf_token }}"}'
x-data="{ sidebarOpen: $persist(false).as('sidebarOpen'), hasSidebar:
{% block has_sidebar %}true{% endblock %}
}" x-init="$nextTick(() => $el.classList.add('transition-[padding-left]', 'duration-300'))" :class="hasSidebar ? (sidebarOpen ? 'pl-64' : 'pl-16') : ''" class="flex flex-col justify-center overflow-x-hidden bg-stone-100 font-work-sans">
}"
x-init="$nextTick(() => $el.classList.add('transition-[padding-left]', 'duration-300'))"
:class="hasSidebar ? (sidebarOpen ? 'pl-64' : 'pl-16') : ''"
class="flex flex-col justify-center overflow-x-hidden bg-stone-100 font-work-sans">
{% block sidenav %}
{% include 'layouts/sidenav.html' %}
{% include "layouts/sidenav.html" %}
{% endblock %}
<div class="flex-1 px-4">
{% include 'layouts/header.html' %}
<div class="flex-1 px-4">
{% include "layouts/header.html" %}
<div class="h-5 w-full mt-16"></div>
<main id="content" class="md:max-w-screen-2xl mx-auto">
<div id="messages">{% include "components/messages.html" %}</div>
Expand Down
53 changes: 24 additions & 29 deletions commcare_connect/templates/base_table.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@
{% load i18n %}
{% block table-wrapper %}
{% load sort_link %}
{# H025: this is a template partial; the root div is an intentional fragment with no surrounding HTML #}
{# djlint:off H025 #}
<div class="table-container flex flex-col gap-2 mb-1">
{# djlint:on #}
{% block table %}
Comment thread
snopoke marked this conversation as resolved.
Resolved
<div class="w-full overflow-x-auto overflow-y-auto block max-h-[70vh]">
<table class="base-table" {% render_attrs table.attrs %}>
Expand Down Expand Up @@ -60,8 +57,7 @@
{% if table.has_footer %}
<tr class="border-2 border-gray-100 font-bold">
{% for column in table.columns %}
<td {{ column.attrs.tf.as_html }}>{{ column.footer }}
</td>
<td {{ column.attrs.tf.as_html }}>{{ column.footer }}</td>
{% endfor %}
</tr>
{% endif %}
Expand All @@ -75,7 +71,7 @@
{% block pagination %}
{% if table.page and table.paginator.count > DEFAULT_PAGE_SIZE %}
<div x-data
class="table-footer w-full flex items-center justify-between h-14 bg-slate-50 text-brand-deep-purple py-2 px-4 rounded-lg">
class="table-footer w-full flex items-center justify-between h-14 bg-slate-50 text-brand-deep-purple py-2 px-4 rounded-lg">
<div class="flex items-center gap-2 max-w-fit text-brand-deep-purple text-sm">
{% if table.page.has_previous %}
<button type="button"
Expand Down Expand Up @@ -111,32 +107,31 @@
<i class="fa-solid fa-chevron-right"></i>
</span>
{% endif %}
<!-- Right: Page Size Selector -->
<div class="flex items-center gap-2 text-sm">
<label for="page-size" class="whitespace-nowrap">{% trans "Rows per page" %}</label>
<select id="page-size"
name="page_size"
class="base-input w-16"
@change="goToPage('page_size', $event.target.value)">
{% for size in PAGE_SIZE_OPTIONS %}
<option value="{{ size }}"
{% if request.GET.page_size == size|stringformat:"s" %}selected{% endif %}>
{{ size }}
</option>
{% endfor %}
</select>
</div>
</div>
{% endif %}
{% endblock pagination %}
</div>
{% endblock table-wrapper %}
{% block inline_js %}
<script>
<!-- Right: Page Size Selector -->
<div class="flex items-center gap-2 text-sm">
<label for="page-size" class="whitespace-nowrap">{% trans "Rows per page" %}</label>
<select id="page-size"
name="page_size"
class="base-input w-16"
@change="goToPage('page_size', $event.target.value)">
{% for size in PAGE_SIZE_OPTIONS %}
<option value="{{ size }}"
{% if request.GET.page_size == size|stringformat:"s" %}selected{% endif %}>{{ size }}</option>
{% endfor %}
</select>
</div>
</div>
{% endif %}
{% endblock pagination %}
</div>
{% endblock table-wrapper %}
{% block inline_js %}
<script>
function goToPage(param, value) {
const url = new URL(window.location.href);
url.searchParams.set(param, value);
window.location.href = url.toString();
}
</script>
{% endblock inline_js %}
</script>
{% endblock inline_js %}
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,18 @@ <h3 class="text-base font-medium text-brand-deep-purple">User Status Details</h3
{% endif %}
{% if has_suspension_perm %}
{% if opportunity_access.suspended %}
<button hx-post="{% url 'opportunity:revoke_user_suspension' org_slug=request.org.slug opp_id=opportunity_access.opportunity.opportunity_id pk=opportunity_access.opportunity_access_id %}"
<button type="button"
hx-post="{% url 'opportunity:revoke_user_suspension' org_slug=request.org.slug opp_id=opportunity_access.opportunity.opportunity_id pk=opportunity_access.opportunity_access_id %}"
hx-vals='{"next": "{{ request.get_full_path }}"}'
class="button button-sm primary-light">{% translate "Revoke Suspension" %}</button>
{% else %}
<button class="button button-sm primary-light"
<button type="button"
class="button button-sm primary-light"
@click="showSuspendModal = true">{% translate "Suspend" %}</button>
{% endif %}
{% endif %}
<button class="button-icon"
<button type="button"
class="button-icon"
aria-label="{% translate 'Close user status details' %}"
@click="isStatusModalOpen = false">
<i class="fa-solid fa-xmark cursor-pointer"></i>
Expand Down Expand Up @@ -47,7 +50,8 @@ <h3 class="text-base font-medium text-brand-deep-purple">User Status Details</h3
<div @click.away="showSuspendModal = false" x-transition class="modal">
<div class="header flex justify-between items-center">
<h2 class="title mb-4">Suspend User</h2>
<button @click="showSuspendModal = false"
<button type="button"
@click="showSuspendModal = false"
class="button-icon"
aria-label="Close">
<i class="fa-solid fa-xmark"></i>
Expand Down
Loading
Loading