From 6207c4ec946f2f665f3655de668acd2846e18658 Mon Sep 17 00:00:00 2001 From: Saurabh Kumar Date: Fri, 10 Jan 2025 17:39:28 +0530 Subject: [PATCH] Add rustywind as pre-commit hook to sort tailwindcss classes If there is a merge conflict in your pr run `make fmt` first --- .pre-commit-config.yaml | 16 ++- .../activity/include/comment_form.html | 6 +- .../activity/include/comment_list.html | 4 +- .../templates/activity/notifications.html | 6 +- .../activity/partial_comment_message.html | 10 +- .../activity/ui/activity-action-item.html | 10 +- .../activity/ui/activity-comment-item.html | 20 ++-- .../activity/ui/edit_comment_form.html | 4 +- .../dashboard/applicant_dashboard.html | 44 ++++----- .../dashboard/community_dashboard.html | 22 ++--- .../dashboard/finance_dashboard.html | 8 +- .../templates/dashboard/includes/flagged.html | 2 +- .../dashboard/includes/my-tasks.html | 2 +- .../includes/project_status_bar.html | 2 +- .../includes/projects_in_contracting.html | 6 +- .../submissions-waiting-for-review.html | 8 +- .../partials/applicant_projects.html | 14 +-- .../partials/applicant_submissions.html | 18 ++-- .../dashboard/partner_dashboard.html | 2 +- .../dashboard/reviewer_dashboard.html | 12 +-- .../templates/dashboard/staff_dashboard.html | 20 ++-- .../base_determination_form.html | 8 +- .../batch_determination_form.html | 2 +- .../determinations/determination_detail.html | 4 +- hypha/apply/flags/templates/flags/flags.html | 2 +- .../templates/funds/application_base.html | 2 +- .../funds/applicationrevision_list.html | 2 +- .../applicationsubmission_admin_detail.html | 30 +++--- ...pplicationsubmission_community_detail.html | 8 +- .../applicationsubmission_confirm_delete.html | 10 +- .../funds/applicationsubmission_detail.html | 10 +- ...applicationsubmission_reviewer_detail.html | 8 +- .../funds/includes/create_reminder_form.html | 2 +- .../funds/includes/dialog_form_base.html | 4 +- .../modal_archive_submission_confirm.html | 10 +- .../modal_unarchive_submission_confirm.html | 10 +- .../funds/includes/reminders_block.html | 2 +- .../funds/includes/rendered_answers.html | 10 +- .../funds/includes/review_sidebar.html | 2 +- .../funds/includes/review_sidebar_item.html | 2 +- .../templates/funds/includes/round-block.html | 2 +- .../screening_status_block-button.html | 10 +- .../funds/includes/status-block.html | 4 +- .../templates/funds/includes/status_bar.html | 2 +- .../funds/includes/submission-list-row.html | 52 +++++----- .../funds/includes/submission-table-row.html | 38 +++---- .../includes/table_filter_and_search.html | 10 +- .../includes/translate_application_form.html | 8 +- .../funds/includes/update_reviewer_form.html | 6 +- .../templates/funds/revisions_compare.html | 2 +- .../templates/funds/submission-success.html | 2 +- .../templates/funds/submission_sealed.html | 2 +- .../templates/funds/submissions_result.html | 50 +++++----- .../funds/templates/submissions/all.html | 98 +++++++++---------- .../submissions/partials/meta-terms-card.html | 6 +- .../submissions/partials/submission-lead.html | 2 +- .../submission-reviews-list-multi.html | 2 +- .../partials/submissions-inline.html | 8 +- .../submissions/submenu/bulk-update-lead.html | 10 +- .../submenu/bulk-update-reviewers.html | 4 +- .../submissions/submenu/category.html | 6 +- .../submissions/submenu/change-status.html | 8 +- .../templates/submissions/submenu/funds.html | 6 +- .../templates/submissions/submenu/leads.html | 8 +- .../submissions/submenu/meta-terms.html | 6 +- .../submissions/submenu/reviewers.html | 8 +- .../templates/submissions/submenu/rounds.html | 10 +- .../includes/contracting_documents.html | 22 ++--- .../includes/project_documents.html | 24 ++--- .../includes/reports.html | 4 +- .../application_projects/invoice_detail.html | 4 +- .../application_projects/invoice_list.html | 4 +- .../modals/batch_invoice_status_update.html | 2 +- .../modals/report_frequency_config.html | 2 +- .../modals/send_for_approval.html | 4 +- .../contracting_category_documents.html | 10 +- .../partials/invoice_status.html | 6 +- .../partials/invoice_status_table.html | 4 +- .../partials/project-lead.html | 2 +- .../partials/project_title.html | 4 +- .../partials/supporting_documents.html | 12 +-- .../project_approval_form.html | 2 +- .../application_projects/project_detail.html | 22 ++--- .../application_projects/project_list.html | 4 +- .../project_sow_detail.html | 2 +- .../project_sow_form.html | 2 +- .../application_projects/report_form.html | 2 +- .../templates/review/review_detail.html | 16 +-- .../templates/review/review_edit_form.html | 10 +- .../review/templates/review/review_form.html | 14 +-- .../templates/stream_forms/heading_field.html | 6 +- .../stream_forms/includes/file_field.html | 6 +- .../templates/stream_forms/render_field.html | 4 +- .../apply/templates/forms/includes/field.html | 2 +- .../templates/todo/todolist_dropdown.html | 2 +- .../todo/templates/todo/todolist_item.html | 6 +- .../users/templates/elevate/elevate.html | 12 +-- .../users/templates/two_factor/_base.html | 4 +- .../templates/two_factor/_wizard_actions.html | 2 +- .../templates/two_factor/admin/disable.html | 2 +- .../two_factor/core/backup_tokens.html | 8 +- .../two_factor/core/two_factor_required.html | 2 +- .../apply/users/templates/users/account.html | 22 ++--- .../templates/users/activation/invalid.html | 2 +- hypha/apply/users/templates/users/become.html | 10 +- .../templates/users/change_password.html | 2 +- .../templates/users/email_change/done.html | 2 +- hypha/apply/users/templates/users/login.html | 20 ++-- .../partials/confirmation_code_sent.html | 8 +- .../passwordless_login_signup_sent.html | 2 +- .../users/password_reset/complete.html | 2 +- .../users/password_reset/confirm.html | 2 +- .../templates/users/password_reset/done.html | 2 +- .../templates/users/password_reset/form.html | 4 +- .../users/passwordless_login_signup.html | 14 +-- .../templates/users/register-success.html | 4 +- .../templates/includes/banner.html | 4 +- .../core/templates/components/admin_bar.html | 10 +- .../templates/components/dropdown-menu.html | 14 +-- .../templates/components/modal-title.html | 4 +- .../templates/components/scroll-to-top.html | 2 +- .../core/navigation/primarynav-apply.html | 8 +- hypha/home/templates/home/home.html | 4 +- .../home/includes/fund-list-item.html | 4 +- hypha/templates/base-apply.html | 8 +- .../includes/_modal-placeholder.html | 8 +- .../includes/_toast-placeholder.html | 8 +- hypha/templates/includes/hijack-bar.html | 6 +- .../includes/menu-notifications.html | 28 +++--- hypha/templates/includes/message_item.html | 2 +- hypha/templates/includes/messages.html | 4 +- .../templates/includes/org_login_button.html | 2 +- hypha/templates/includes/user_menu.html | 50 ++++------ 133 files changed, 614 insertions(+), 616 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index a2016fa4f5..c423a4c545 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -19,7 +19,8 @@ repos: args: ["--frozen", "--group", "dev", "-o", "requirements/dev.txt"] - id: uv-export name: uv-export requirements/docs.txt - args: ["--frozen", "--only-group", "docs", "-o", "requirements/docs.txt"] + args: + ["--frozen", "--only-group", "docs", "-o", "requirements/docs.txt"] # This is disabled because this doesn't export --find-links. The requirements-translate is maintained manually. # - id: uv-export @@ -48,10 +49,21 @@ repos: - id: djhtml files: .*/templates/.*\.html$ + - repo: local + hooks: + - id: rustywind + name: rustywind Tailwind CSS class linter + language: node + additional_dependencies: + - rustywind@latest + entry: rustywind + args: [--write] + types_or: [html] + - repo: https://github.com/biomejs/pre-commit rev: "v0.6.1" hooks: - - id: biome-check + - id: biome-check additional_dependencies: ["@biomejs/biome@1.9.4"] - repo: https://github.com/awebdeveloper/pre-commit-stylelint diff --git a/hypha/apply/activity/templates/activity/include/comment_form.html b/hypha/apply/activity/templates/activity/include/comment_form.html index e0dd8ed7ab..fed4793699 100644 --- a/hypha/apply/activity/templates/activity/include/comment_form.html +++ b/hypha/apply/activity/templates/activity/include/comment_form.html @@ -1,6 +1,6 @@ {% load i18n static %} -
+
-
+
{% include "forms/includes/field.html" with field=comment_form.message label_classes="sr-only" %}
diff --git a/hypha/apply/determinations/templates/determinations/determination_detail.html b/hypha/apply/determinations/templates/determinations/determination_detail.html index e1fc9c8c88..170a8913f7 100644 --- a/hypha/apply/determinations/templates/determinations/determination_detail.html +++ b/hypha/apply/determinations/templates/determinations/determination_detail.html @@ -16,14 +16,14 @@ {% endadminbar %} -
+
{% trans "Determination" %}: {{ determination.get_outcome_display }}
{% if request.user.is_apply_staff %} - {% trans "Edit" %}{% heroicon_mini "pencil-square" size=18 class="inline ms-1 align-text-bottom" aria_hidden=true %} + {% trans "Edit" %}{% heroicon_mini "pencil-square" size=18 class="inline align-text-bottom ms-1" aria_hidden=true %} {% endif %} diff --git a/hypha/apply/flags/templates/flags/flags.html b/hypha/apply/flags/templates/flags/flags.html index 00f1d92de1..b26775c064 100644 --- a/hypha/apply/flags/templates/flags/flags.html +++ b/hypha/apply/flags/templates/flags/flags.html @@ -1,5 +1,5 @@ {% load i18n flag_tags heroicons %} - + {% with submission|flagged_by:user as is_flagged %}
{% else %} -
+
{{ field.block }}
{% endif %} diff --git a/hypha/apply/funds/templates/funds/applicationrevision_list.html b/hypha/apply/funds/templates/funds/applicationrevision_list.html index a307aca403..215c5b776b 100644 --- a/hypha/apply/funds/templates/funds/applicationrevision_list.html +++ b/hypha/apply/funds/templates/funds/applicationrevision_list.html @@ -11,7 +11,7 @@