Forbidden
-You do not have permissions to view this page. Return to homepage.
- -From 7be3e2f35c85deccd7f73b1ff040d1929142417a Mon Sep 17 00:00:00 2001 From: Michael Plunkett <5885605+michplunkett@users.noreply.github.com> Date: Wed, 12 Jul 2023 13:34:27 -0500 Subject: [PATCH] Add HTML formatting to `pre-commit` (#966) ## Fixes issue https://github.com/lucyparsons/OpenOversight/issues/239 ## Description of Changes Added [`djLint`](https://www.djlint.com/docs/languages/jinja/) to the `pre-commit` process and formatted files accordingly. ## Tests and linting - [x] This branch is up-to-date with the `develop` branch. - [x] `pytest` passes on my local development environment. - [x] `pre-commit` passes on my local development environment. `pre-commit` output: ```console (openoversight) xxxxxx@MacBook-Air-5 OpenOversight % make lint pre-commit run --all-files trim trailing whitespace.................................................Passed check docstring is first.................................................Passed check that executables have shebangs.....................................Passed check json...............................................................Passed check for case conflicts.................................................Passed check toml...........................................(no files to check)Skipped check for merge conflicts................................................Passed check xml................................................................Passed check yaml...............................................................Passed fix end of files.........................................................Passed check for broken symlinks............................(no files to check)Skipped mixed line ending........................................................Passed fix python encoding pragma...............................................Passed pretty format json.......................................................Passed fix requirements.txt.....................................................Passed check blanket noqa.......................................................Passed check for not-real mock methods..........................................Passed check for eval().........................................................Passed use logger.warning(......................................................Passed Run isort to sort imports................................................Passed Run pydocstyle...........................................................Passed Do not use shebangs in non-executable files..............................Passed flake8...................................................................Passed black....................................................................Passed djLint formatting........................................................Passed (openoversight) xxxxxx@MacBook-Air-5 OpenOversight % ``` --- .pre-commit-config.yaml | 12 + OpenOversight/app/templates/403.html | 20 +- OpenOversight/app/templates/404.html | 20 +- OpenOversight/app/templates/413.html | 20 +- OpenOversight/app/templates/429.html | 20 +- OpenOversight/app/templates/500.html | 20 +- OpenOversight/app/templates/about.html | 294 ++++++------ .../app/templates/add_edit_department.html | 77 ++-- .../app/templates/add_edit_salary.html | 46 +- OpenOversight/app/templates/add_officer.html | 67 +-- OpenOversight/app/templates/add_unit.html | 29 +- OpenOversight/app/templates/all_depts.html | 53 ++- .../app/templates/auth/change_dept_pref.html | 23 +- .../app/templates/auth/change_email.html | 23 +- .../app/templates/auth/change_password.html | 70 +-- .../templates/auth/email/change_email.html | 8 +- .../app/templates/auth/email/confirm.html | 12 +- .../auth/email/new_confirmation.html | 8 +- .../auth/email/new_registration.html | 8 +- .../templates/auth/email/reset_password.html | 8 +- OpenOversight/app/templates/auth/login.html | 42 +- .../app/templates/auth/register.html | 74 +-- .../app/templates/auth/reset_password.html | 27 +- .../app/templates/auth/unapproved.html | 25 +- .../app/templates/auth/unconfirmed.html | 40 +- OpenOversight/app/templates/auth/user.html | 36 +- .../app/templates/auth/user_delete.html | 31 +- OpenOversight/app/templates/auth/users.html | 155 ++++--- OpenOversight/app/templates/base.html | 183 ++++---- OpenOversight/app/templates/browse.html | 60 ++- OpenOversight/app/templates/complaint.html | 60 +-- OpenOversight/app/templates/cop_face.html | 319 +++++++------ .../app/templates/description_delete.html | 35 +- .../app/templates/description_edit.html | 20 +- .../app/templates/description_new.html | 12 +- .../app/templates/edit_assignment.html | 27 +- OpenOversight/app/templates/edit_officer.html | 23 +- OpenOversight/app/templates/form.html | 36 +- OpenOversight/app/templates/image.html | 201 +++++---- .../app/templates/incident_delete.html | 31 +- .../app/templates/incident_detail.html | 143 +++--- .../app/templates/incident_edit.html | 23 +- .../app/templates/incident_list.html | 141 +++--- OpenOversight/app/templates/incident_new.html | 11 +- OpenOversight/app/templates/index.html | 137 +++--- .../app/templates/input_find_officer.html | 422 ++++++++++-------- OpenOversight/app/templates/label_data.html | 264 +++++------ OpenOversight/app/templates/leaderboard.html | 61 ++- OpenOversight/app/templates/link_delete.html | 56 ++- OpenOversight/app/templates/link_edit.html | 8 +- OpenOversight/app/templates/link_new.html | 6 +- OpenOversight/app/templates/list.html | 5 +- OpenOversight/app/templates/note_delete.html | 35 +- OpenOversight/app/templates/note_edit.html | 20 +- OpenOversight/app/templates/note_new.html | 12 +- OpenOversight/app/templates/officer.html | 218 +++++---- .../templates/partials/incident_fields.html | 179 ++++---- .../app/templates/partials/incident_form.html | 74 ++- .../partials/links_and_videos_row.html | 216 +++++---- .../app/templates/partials/links_subform.html | 10 +- .../partials/officer_add_photos.html | 2 +- .../partials/officer_assignment_history.html | 303 +++++++------ .../partials/officer_descriptions.html | 31 +- .../app/templates/partials/officer_faces.html | 16 +- .../partials/officer_general_information.html | 142 +++--- .../templates/partials/officer_incidents.html | 53 +-- .../app/templates/partials/officer_notes.html | 31 +- .../templates/partials/officer_salary.html | 94 ++-- .../app/templates/partials/paginate.html | 32 +- .../app/templates/partials/paginate_nav.html | 38 +- .../app/templates/partials/subform.html | 21 +- OpenOversight/app/templates/privacy.html | 107 +++-- OpenOversight/app/templates/profile.html | 214 ++++----- OpenOversight/app/templates/sort.html | 142 +++--- OpenOversight/app/templates/submit_image.html | 103 +++-- .../app/templates/submit_officer_image.html | 56 +-- OpenOversight/app/templates/tag.html | 258 ++++++----- OpenOversight/app/templates/tutorial.html | 171 +++---- requirements.txt | 14 +- 79 files changed, 3206 insertions(+), 2938 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index cda86b0bd..5d7aad0ea 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -85,3 +85,15 @@ repos: - "--target-version=py36" - "--target-version=py37" - "--target-version=py38" + + - repo: https://github.com/Riverside-Healthcare/djLint + rev: v1.31.1 + hooks: + - id: djlint-reformat + args: + - OpenOversight/app/templates + - --format-js + - --format-css + - --profile=jinja + - --indent=2 + - --quiet diff --git a/OpenOversight/app/templates/403.html b/OpenOversight/app/templates/403.html index cd205df7b..287e07271 100644 --- a/OpenOversight/app/templates/403.html +++ b/OpenOversight/app/templates/403.html @@ -1,12 +1,12 @@ {% extends "base.html" %} -{% block title %}Forbidden{% endblock %} - +{% block title %} + Forbidden +{% endblock title %} {% block content %} - -
You do not have permissions to view this page. Return to homepage.
- -+ You do not have permissions to view this page. Return to homepage. +
+We couldn't find the page you are looking for. Return to homepage.
- -+ We couldn't find the page you are looking for. Return to homepage. +
+The file you are trying to upload is too large. Return to homepage.
- -+ The file you are trying to upload is too large. Return to homepage. +
+You're sending requests too fast. Wait a minute and try again. Return to homepage.
- -+ You're sending requests too fast. Wait a minute and try again. Return to homepage. +
+Oops! Something went wrong. Return to homepage.
- -+ Oops! Something went wrong. Return to homepage. +
+- OpenOversight is a Lucy Parsons Labs project that aims to improve law enforcement - visibility and transparency using public and crowdsourced data. We maintain databases, digital galleries, and profiles of individual law enforcement officers from departments - across the United States that consolidate information including names, birthdates, mentions in news articles, salaries, and photographs. -
- - - -This project is a response to the lack of transparency and justice in policing. The public should have the right to know which officers are patrolling their neighborhoods and watching their communities. When officers abuse their positions of power, they should be able to be easily identified and held accountable. -
+- It is the first project of its kind in the United States, and was first implemented in Chicago in October 2016. - OpenOversight launched in the East Bay of the San Francisco Bay Area in fall 2017 and in New York City in 2018. A - Baltimore instance was launched in 2019 at BPDWatch.com. -
++ + OpenOversight is a Lucy Parsons Labs project that aims to improve law enforcement + visibility and transparency using public and crowdsourced data. We maintain databases, digital galleries, and profiles of individual law enforcement officers from departments + across the United States that consolidate information including names, birthdates, mentions in news articles, salaries, and photographs. + +
++ This project is a response to the lack of transparency and justice in policing. The public should have the right to know which officers are patrolling their neighborhoods and watching their communities. When officers abuse their positions of power, they should be able to be easily identified and held accountable. +
++ It is the first project of its kind in the United States, and was first implemented in Chicago in October 2016. + OpenOversight launched in the East Bay of the San Francisco Bay Area in fall 2017 and in New York City in 2018. A + Baltimore instance was launched in 2019 at BPDWatch.com. +
++ OpenOversight is released as free and open source software so others can launch similar law enforcement accountability + projects in their own cities. The software is available for download and collaborative development on + GitHub. +
+- OpenOversight is released as free and open source software so others can launch similar law enforcement accountability - projects in their own cities. The software is available for download and collaborative development on - GitHub.
- ++ Illinois: This project does not perform facial recognition on officers in Illinois and is thus in compliance with the Biometric + Information Privacy Act. + Requests or questions regarding this project from those affiliated with law enforcement must be directed to our + legal representation at legal@lucyparsonslabs.com. +
++ For media inquiries about OpenOversight, please email media@lucyparsonslabs.com. + For other inquiries about the project, including collaboration, please contact openoversight@lucyparsonslabs.com. +
+Illinois: This project does not perform facial recognition on officers in Illinois and is thus in compliance with the Biometric - Information Privacy Act. - Requests or questions regarding this project from those affiliated with law enforcement must be directed to our - legal representation at legal@lucyparsonslabs.com.
+For media inquiries about OpenOversight, please email media@lucyparsonslabs.com. - For other inquiries about the project, including collaboration, please contact openoversight@lucyparsonslabs.com. -
- - Source: Citizens Police Data Project - -
+-
+
{% for error in form.password.errors %}{{ error }} {% endfor %}
- {% endif %} ++ {% for error in form.password.errors %}{{ error }}{% endfor %} +
+ {% endif %}{% for error in form.password2.errors %}{{ error }} {% endfor %}
- {% endif %} + + ++ {% for error in form.password2.errors %}{{ error }}{% endfor %} +
+ {% endif %}Dear {{ user.username }},
-To confirm your new email address click here.
++ To confirm your new email address click here. +
Alternatively, you can paste the following link in your browser's address bar:
{{ url_for('auth.change_email', token=token, _external=True) }}
Sincerely,
The OpenOversight Team
-Note: replies to this email address are not monitored.
++ Note: replies to this email address are not monitored. +
diff --git a/OpenOversight/app/templates/auth/email/confirm.html b/OpenOversight/app/templates/auth/email/confirm.html index 8baccb426..9e09ad756 100644 --- a/OpenOversight/app/templates/auth/email/confirm.html +++ b/OpenOversight/app/templates/auth/email/confirm.html @@ -1,8 +1,14 @@Dear {{ user.username }},
-Welcome to OpenOversight!
-To confirm your account please click here.
++ Welcome to OpenOversight! +
++ To confirm your account please click here. +
Alternatively, you can paste the following link in your browser's address bar:
{{ url_for('auth.confirm', token=token, _external=True) }}
Sincerely,
The OpenOversight Team
-Note: replies to this email address are not monitored.
++ Note: replies to this email address are not monitored. +
diff --git a/OpenOversight/app/templates/auth/email/new_confirmation.html b/OpenOversight/app/templates/auth/email/new_confirmation.html index 3397904fa..6af487b7a 100644 --- a/OpenOversight/app/templates/auth/email/new_confirmation.html +++ b/OpenOversight/app/templates/auth/email/new_confirmation.html @@ -4,9 +4,13 @@To view or delete this user, please click here.
++ To view or delete this user, please click here. +
Alternatively, you can paste the following link in your browser's address bar:
{{ url_for('auth.edit_user', user_id=user.id, _external=True) }}
Sincerely,
The OpenOversight Team
-Note: replies to this email address are not monitored.
++ Note: replies to this email address are not monitored. +
diff --git a/OpenOversight/app/templates/auth/email/new_registration.html b/OpenOversight/app/templates/auth/email/new_registration.html index 120ad3309..63deb48a4 100644 --- a/OpenOversight/app/templates/auth/email/new_registration.html +++ b/OpenOversight/app/templates/auth/email/new_registration.html @@ -4,9 +4,13 @@To approve or delete this user, please click here.
++ To approve or delete this user, please click here. +
Alternatively, you can paste the following link in your browser's address bar:
{{ url_for('auth.edit_user', user_id=user.id, _external=True) }}
Sincerely,
The OpenOversight Team
-Note: replies to this email address are not monitored.
++ Note: replies to this email address are not monitored. +
diff --git a/OpenOversight/app/templates/auth/email/reset_password.html b/OpenOversight/app/templates/auth/email/reset_password.html index 06093ab80..84dd9fd5b 100644 --- a/OpenOversight/app/templates/auth/email/reset_password.html +++ b/OpenOversight/app/templates/auth/email/reset_password.html @@ -1,8 +1,12 @@Dear {{ user.username }},
-To reset your password click here.
++ To reset your password click here. +
Alternatively, you can paste the following link in your browser's address bar:
{{ url_for('auth.password_reset', token=token, _external=True) }}
If you have not requested a password reset simply ignore this message.
Sincerely,
The OpenOversight Team
-Note: replies to this email address are not monitored.
++ Note: replies to this email address are not monitored. +
diff --git a/OpenOversight/app/templates/auth/login.html b/OpenOversight/app/templates/auth/login.html index 911ce523a..3c2c4a98a 100644 --- a/OpenOversight/app/templates/auth/login.html +++ b/OpenOversight/app/templates/auth/login.html @@ -1,28 +1,32 @@ {% extends "base.html" %} {% import "bootstrap/wtf.html" as wtf %} -{% block title %}Volunteer Login - OpenOversight{% endblock %} -{% block meta %}{% endblock %} - +{% block title %} + Volunteer Login - OpenOversight +{% endblock title %} +{% block meta %} + +{% endblock meta %} {% block content %} -Forgot your password? Click here to reset it.
-New user? Click here to register.
-+ Forgot your password? Click here to reset it. +
++ New user? Click here to register. +
+{% for error in form.password.errors %}{{ error }} {% endfor %}
- {% endif %} ++ {% for error in form.password.errors %}{{ error }}{% endfor %} +
+ {% endif %}{% for error in form.password2.errors %}{{ error }} {% endfor %}
- {% endif %} + + ++ {% for error in form.password2.errors %}{{ error }}{% endfor %} +
+ {% endif %}- Before you can access this site you need to wait for an administrator to approve your account. - Once you are approved, you should receive an email with a confirmation link. -
++ Before you can access this site you need to wait for an administrator to approve your account. + Once you are approved, you should receive an email with a confirmation link. +
- Before you can access this site you need to confirm your account. - Check your inbox, you should have received an email with a confirmation link. -
-- Need another confirmation email? - Click here -
+ Before you can access this site you need to confirm your account. + Check your inbox, you should have received an email with a confirmation link. +
++ Need another confirmation email? + Click here +
+- Are you sure you want to delete this user? - This cannot be undone. -
+ Are you sure you want to delete this user? + This cannot be undone. +
Username | -Status | -Is Area Coordinator? | -Area Coordinator Department | -Is Administator? | - -|
---|---|---|---|---|---|
- {{ user.username }}
- - - |
- {{ user.email }} | -- {% if user.is_disabled %} - Disabled - {% elif user.confirmed %} - Active - {% elif user.approved %} - Pending Confirmation - {% else %} - Pending Approval - {% endif %} - | -- {% if user.is_area_coordinator %} - - {% else %} - - {% endif %} - {{ user.is_area_coordinator }} - | -{{ user.ac_department.name }} | -- {% if user.is_administrator %} - - {% else %} - - {% endif %} - {{ user.is_admin }} - | -
Username | +Status | +Is Area Coordinator? | +Area Coordinator Department | +Is Administator? | +|
---|---|---|---|---|---|
+ {{ user.username }}
+ + + |
+ + {{ user.email }} + | ++ {% if user.is_disabled %} + Disabled + {% elif user.confirmed %} + Active + {% elif user.approved %} + Pending Confirmation + {% else %} + Pending Approval + {% endif %} + | ++ {% if user.is_area_coordinator %} + + {% else %} + + {% endif %} + {{ user.is_area_coordinator }} + | +{{ user.ac_department.name }} | ++ {% if user.is_administrator %} + + {% else %} + + {% endif %} + {{ user.is_admin }} + | +