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 %} - -
- -

Forbidden

-

You do not have permissions to view this page. Return to homepage.

- -
-{% endblock %} +
+

Forbidden

+

+ You do not have permissions to view this page. Return to homepage. +

+
+{% endblock content %} diff --git a/OpenOversight/app/templates/404.html b/OpenOversight/app/templates/404.html index 72e8db817..315bf8497 100644 --- a/OpenOversight/app/templates/404.html +++ b/OpenOversight/app/templates/404.html @@ -1,12 +1,12 @@ {% extends "base.html" %} -{% block title %}Page Not Found{% endblock %} - +{% block title %} + Page Not Found +{% endblock title %} {% block content %} - -
- -

Page Not Found

-

We couldn't find the page you are looking for. Return to homepage.

- -
-{% endblock %} +
+

Page Not Found

+

+ We couldn't find the page you are looking for. Return to homepage. +

+
+{% endblock content %} diff --git a/OpenOversight/app/templates/413.html b/OpenOversight/app/templates/413.html index 1fa657ba3..ab81a048b 100644 --- a/OpenOversight/app/templates/413.html +++ b/OpenOversight/app/templates/413.html @@ -1,12 +1,12 @@ {% extends "base.html" %} -{% block title %}File Too Large{% endblock %} - +{% block title %} + File Too Large +{% endblock title %} {% block content %} - -
- -

File Too Large

-

The file you are trying to upload is too large. Return to homepage.

- -
-{% endblock %} +
+

File Too Large

+

+ The file you are trying to upload is too large. Return to homepage. +

+
+{% endblock content %} diff --git a/OpenOversight/app/templates/429.html b/OpenOversight/app/templates/429.html index 8d6aa059f..fc23cb10d 100644 --- a/OpenOversight/app/templates/429.html +++ b/OpenOversight/app/templates/429.html @@ -1,12 +1,12 @@ {% extends "base.html" %} -{% block title %}Too Many Requests{% endblock %} - +{% block title %} + Too Many Requests +{% endblock title %} {% block content %} - -
- -

Too Many Requests

-

You're sending requests too fast. Wait a minute and try again. Return to homepage.

- -
-{% endblock %} +
+

Too Many Requests

+

+ You're sending requests too fast. Wait a minute and try again. Return to homepage. +

+
+{% endblock content %} diff --git a/OpenOversight/app/templates/500.html b/OpenOversight/app/templates/500.html index 871974232..9094b161f 100644 --- a/OpenOversight/app/templates/500.html +++ b/OpenOversight/app/templates/500.html @@ -1,12 +1,12 @@ {% extends "base.html" %} -{% block title %}Internal Server Error{% endblock %} - +{% block title %} + Internal Server Error +{% endblock title %} {% block content %} - -
- -

Internal Server Error

-

Oops! Something went wrong. Return to homepage.

- -
-{% endblock %} +
+

Internal Server Error

+

+ Oops! Something went wrong. Return to homepage. +

+
+{% endblock content %} diff --git a/OpenOversight/app/templates/about.html b/OpenOversight/app/templates/about.html index 46a89a86e..3ac8a0724 100644 --- a/OpenOversight/app/templates/about.html +++ b/OpenOversight/app/templates/about.html @@ -1,154 +1,164 @@ {% extends "base.html" %} -{% block title %}About OpenOversight{% endblock %} +{% block title %} + About OpenOversight +{% endblock title %} {% block meta %} - -{% endblock %} + +{% endblock meta %} {% block content %} - -
-
-
About OpenOversight
-
-
-

- 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. -

+
+
+
About OpenOversight
-
-

- 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. + +

+
+ Try it +
+
+
+ +

+ 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.

- +
+
+
+

Legal

+ A note to law enforcement +

+ 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. +

+
+
+

Contact and media

+

+ For media inquiries about OpenOversight, please email media@lucyparsonslabs.com. + For other inquiries about the project, including collaboration, please contact openoversight@lucyparsonslabs.com. +

+
+
-
-
-
-
-
-

Legal

A note to law enforcement -

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.

+
+
+

Press Release

+

+ In support of demands for greater police accountability, Illinois nonprofit The Lucy Parsons Labs launched + OpenOversight, an interactive web tool and accountability platform that makes it easier for the public to identify + police officers, including for the purpose of complaints. We rely on crowdsourced and public data to build a + database + of police officers in a city, allowing the public to filter through the dataset to find the name and badge number + of + the offending officer. +

+

+ Using OpenOversight, members of the public can search for the names and badge numbers of police with whom they + have negative interactions using the officer's estimated age, race and gender. Using this information, the + OpenOversight web application returns a digital gallery of potential matches and, when possible, includes pictures + of officers in uniform to assist in identification. "The deck is stacked against people harmed by police," says + Jennifer Helsby, CTO of the Lucy Parsons Labs and lead developer on the OpenOversight project. "Police are almost + never held accountable for misconduct or crimes they commit. To file a misconduct complaint, the burden is on the + public to provide as much detailed data about the officer as possible. OpenOversight aims to empower citizens with + tools that make it easier to identify officers and hold them accountable." +

+
-
-

Contact and media

-

For media inquiries about OpenOversight, please email media@lucyparsonslabs.com. - For other inquiries about the project, including collaboration, please contact openoversight@lucyparsonslabs.com. -

-
-
- -
-

Press Release

-

In support of demands for greater police accountability, Illinois nonprofit The Lucy Parsons Labs launched - OpenOversight, an interactive web tool and accountability platform that makes it easier for the public to identify - police officers, including for the purpose of complains. We rely on crowdsourced and public data to build a - database - of police officers in a city, allowing the public to filter through the dataset to find the name and badge number - of - the offending officer.

- -

Using OpenOversight, members of the public can search for the names and badge numbers of police with whom they - have negative interactions using the officer's estimated age, race and gender. Using this information, the - OpenOversight web application returns a digital gallery of potential matches and, when possible, includes pictures - of officers in uniform to assist in identification. "The deck is stacked against people harmed by police," says - Jennifer Helsby, CTO of the Lucy Parsons Labs and lead developer on the OpenOversight project. "Police are almost - never held accountable for misconduct or crimes they commit. To file a misconduct complaint, the burden is on the - public to provide as much detailed data about the officer as possible. OpenOversight aims to empower citizens with - tools that make it easier to identify officers and hold them accountable." -

-
-
- -
-
-

Facts and Figures about the Chicago Police Department

-
-
-
- To file a police complaint in Chicago, a member of the public needs - to know as much - detailed data - about the officer as possible. Based on complaints data from the Invisible - Institute, from March 2011 - March 2015, 28% of complaints (4,000 total complaints) were immediately - dropped due to no officer identification. -

- - Source: Citizen Police Data Project - -

-
- Less than 2% of the 28,567 complaints filed against the Chicago - police department from March 2011 to September 2015 resulted in discipline. Most officers who do face - discipline - are suspended for a week or less. -

- - Source: Citizens Police Data Project - -

+
+
+

Facts and Figures about the Chicago Police Department

+
+
+
+ To file a police complaint in Chicago, a member of the public needs + to know as much + detailed data + about the officer as possible. Based on complaints data from the Invisible + Institute, from March 2011 - March 2015, 28% of complaints (4,000 total complaints) were immediately + dropped due to no officer identification. +

+ + Source: Citizen Police Data Project + +

+
+
+ Less than 2% of the 28,567 complaints filed against the Chicago + police department from March 2011 to September 2015 resulted in discipline. Most officers who do face + discipline + are suspended for a week or less. +

+ Source: Citizens Police Data Project +

+
+
+
+
+ All complaints against officers must be supported by a sworn affidavit. False complaints can result in + perjury charges, a Class 3 felony. +

+ + Source: Chicago Police + +

+
+
+ Chicago spent over $500 million from 2004 to 2014 on settlements, + legal fees and other costs related to complaints against police officers. +

+ Source: Better Government Association +

+
+
+ In 2015, there was no discipline in more than 99 percent of the + thousands of misconduct complaints against Chicago police officers. +

+ + Source: New York Times + +

+
+
-
-
- All complaints against officers must be supported by a sworn affidavit. False complaints can result in - perjury charges, a Class 3 felony. -

- - Source: Chicago Police - -

-
- Chicago spent over $500 million from 2004 to 2014 on settlements, - legal fees and other costs related to complaints against police officers. -

- Source: Better Government Association -

-
- In 2015, there was no discipline in more than 99 percent of the - thousands of misconduct complaints against Chicago police officers. -

- Source: New York Times -

-
-
- -
- -
-
-

Sponsors

-
-
-
+
+
+

Sponsors

-
- +
+
+
+ Shuttleworth Foundation logo +
-
- -{% endblock %} +{% endblock content %} diff --git a/OpenOversight/app/templates/add_edit_department.html b/OpenOversight/app/templates/add_edit_department.html index 78ea1ef77..b0c4a053a 100644 --- a/OpenOversight/app/templates/add_edit_department.html +++ b/OpenOversight/app/templates/add_edit_department.html @@ -1,19 +1,30 @@ {% extends "base.html" %} {% import "bootstrap/wtf.html" as wtf %} - -{% block title %}OpenOversight Admin - {% if update %} Update {% else %} Add {% endif %} Department{% endblock %} - +{% block title %} + OpenOversight Admin - + {% if update %} + Update + {% else %} + Add + {% endif %} + Department +{% endblock title %} {% block content %} -
- - -
-
+
+ +
+ {{ form.hidden_tag() }} {{ wtf.form_errors(form, hiddens="only") }} - {{ wtf.form_field(form.name, autofocus="autofocus") }} {{ wtf.form_field(form.short_name) }}
@@ -21,28 +32,23 @@

{% if update %} Update {% else %} Add {% endif %} Department

Enter ranks in hierarchical order, from lowest to highest rank:
-
- {{ wtf.form_errors(form.jobs, hiddens="only") }} -
+
{{ wtf.form_errors(form.jobs, hiddens="only") }}
{% if form.jobs|length > 1 %} {% for subfield in (form.jobs|rejectattr('data.is_sworn_officer','eq',False)|sort(attribute='data.order')|list) %} -
-
-
- +
+
+
+ +
+ {{ subfield(class="form-control") |safe }} + + + + {%- if subfield.errors %} + {%- for error in subfield.errors %}

{{ error }}

{%- endfor %} + {%- endif %}
- {{ subfield(class="form-control")|safe}} - - - - {%- if subfield.errors %} - {%- for error in subfield.errors %} -

{{error}}

- {%- endfor %} - {%- endif %} -
-
+ {% endfor %} {% else %}
@@ -57,9 +63,8 @@
Enter ranks in hierarchical order, from lowest to highest rank:
{{ wtf.form_field(form.submit, id="submit", button_map={'submit':'primary'}) }} - -
-
- -
-{% endblock %} + +
+
+
+{% endblock content %} diff --git a/OpenOversight/app/templates/add_edit_salary.html b/OpenOversight/app/templates/add_edit_salary.html index c8d08a039..385af0a57 100644 --- a/OpenOversight/app/templates/add_edit_salary.html +++ b/OpenOversight/app/templates/add_edit_salary.html @@ -1,25 +1,39 @@ {% extends "base.html" %} {% import "bootstrap/wtf.html" as wtf %} -{% block title %}OpenOversight Admin - {% if update %} Edit {% else %} Add {% endif %} Officer Salary{% endblock %} - +{% block title %} + OpenOversight Admin - + {% if update %} + Edit + {% else %} + Add + {% endif %} + Officer Salary +{% endblock title %} {% block content %} -
- - -
-
+
+ +
+ {{ form.hidden_tag() }} {{ wtf.form_errors(form, hiddens="only") }} {{ wtf.form_field(form.salary) }} {{ wtf.form_field(form.overtime_pay) }} {{ wtf.form_field(form.year) }} {{ wtf.form_field(form.is_fiscal_year) }} - - -
-
- -
-{% endblock %} + + +
+
+
+{% endblock content %} diff --git a/OpenOversight/app/templates/add_officer.html b/OpenOversight/app/templates/add_officer.html index e20543a3c..e5e6c4289 100644 --- a/OpenOversight/app/templates/add_officer.html +++ b/OpenOversight/app/templates/add_officer.html @@ -1,15 +1,19 @@ {% extends "base.html" %} {% import "bootstrap/wtf.html" as wtf %} -{% block title %}OpenOversight Admin - Add New Officer{% endblock %} - +{% block title %} + OpenOversight Admin - Add New Officer +{% endblock title %} {% block content %} -
- - -
-
+
+ +
+ {{ form.hidden_tag() }} {{ wtf.form_errors(form, hiddens="only") }} {{ wtf.form_field(form.department) }} @@ -23,35 +27,36 @@

Add Officer

{{ wtf.form_field(form.unique_internal_identifier) }} {{ wtf.form_field(form.job_id) }} {{ wtf.form_field(form.unit) }} -

Don't see your unit? Add one!

+

+ Don't see your unit? Add one! +

{{ wtf.form_field(form.employment_date) }} {{ wtf.form_field(form.birth_year) }}
- {{ form.salaries.label }} - {% for subform in form.salaries %} - {% include "partials/subform.html" %} - {% endfor %} - + {{ form.salaries.label }} + {% for subform in form.salaries %} + {% include "partials/subform.html" %} + {% endfor %} +
{% include "partials/links_subform.html" %}
- {{ form.notes.label }} - {% for subform in form.notes %} - {% include "partials/subform.html" %} - {% endfor %} - + {{ form.notes.label }} + {% for subform in form.notes %} + {% include "partials/subform.html" %} + {% endfor %} +
- {{ form.descriptions.label }} - {% for subform in form.descriptions %} - {% include "partials/subform.html" %} - {% endfor %} - + {{ form.descriptions.label }} + {% for subform in form.descriptions %} + {% include "partials/subform.html" %} + {% endfor %} +
{{ wtf.form_field(form.submit, id="submit", button_map={'submit':'primary'}) }} - -
-
- -
-{% endblock %} + +
+
+
+{% endblock content %} diff --git a/OpenOversight/app/templates/add_unit.html b/OpenOversight/app/templates/add_unit.html index 6965806e0..0717fe2c9 100644 --- a/OpenOversight/app/templates/add_unit.html +++ b/OpenOversight/app/templates/add_unit.html @@ -1,23 +1,22 @@ {% extends "base.html" %} {% import "bootstrap/wtf.html" as wtf %} -{% block title %}OpenOversight Admin - Add New Unit{% endblock %} - +{% block title %} + OpenOversight Admin - Add New Unit +{% endblock title %} {% block content %} -
- - -
-
+
+ +
+ {{ form.hidden_tag() }} {{ wtf.form_errors(form, hiddens="only") }} {{ wtf.form_field(form.descrip, autofocus="autofocus") }} {{ wtf.form_field(form.department) }} {{ wtf.form_field(form.submit, id="submit", button_map={'submit':'primary'}) }} - -
-
- -
-{% endblock %} + +
+
+
+{% endblock content %} diff --git a/OpenOversight/app/templates/all_depts.html b/OpenOversight/app/templates/all_depts.html index ceaf4c4b0..15761252c 100644 --- a/OpenOversight/app/templates/all_depts.html +++ b/OpenOversight/app/templates/all_depts.html @@ -1,26 +1,35 @@ {% extends "base.html" %} {% import "bootstrap/wtf.html" as wtf %} {% block content %} - -
- -
- {% for dept in departments %} -

-

{{ dept.name }}

- -

- {% endfor %} -
+
+
+ {% for dept in departments %} +

+

{{ dept.name }}

+ +

+ {% endfor %}
- -{% endblock %} +
+{% endblock content %} diff --git a/OpenOversight/app/templates/auth/change_dept_pref.html b/OpenOversight/app/templates/auth/change_dept_pref.html index c32fcd7a1..bf0e7aad7 100644 --- a/OpenOversight/app/templates/auth/change_dept_pref.html +++ b/OpenOversight/app/templates/auth/change_dept_pref.html @@ -1,16 +1,13 @@ {% extends "base.html" %} {% import "bootstrap/wtf.html" as wtf %} -{% block title %}OpenOversight - Volunteer Change Default Department{% endblock %} - +{% block title %} + OpenOversight - Volunteer Change Default Department +{% endblock title %} {% block content %} -
- - -
- {{ wtf.quick_form(form, button_map={'submit':'primary'}) }} -
- -
-{% endblock %} +
+ +
{{ wtf.quick_form(form, button_map={'submit':'primary'}) }}
+
+{% endblock content %} diff --git a/OpenOversight/app/templates/auth/change_email.html b/OpenOversight/app/templates/auth/change_email.html index 3e4ffc11e..61b56dba2 100644 --- a/OpenOversight/app/templates/auth/change_email.html +++ b/OpenOversight/app/templates/auth/change_email.html @@ -1,16 +1,13 @@ {% extends "base.html" %} {% import "bootstrap/wtf.html" as wtf %} -{% block title %}OpenOversight - Volunteer Change Email Address{% endblock %} - +{% block title %} + OpenOversight - Volunteer Change Email Address +{% endblock title %} {% block content %} -
- - -
- {{ wtf.quick_form(form, button_map={'submit':'primary'}) }} -
- -
-{% endblock %} +
+ +
{{ wtf.quick_form(form, button_map={'submit':'primary'}) }}
+
+{% endblock content %} diff --git a/OpenOversight/app/templates/auth/change_password.html b/OpenOversight/app/templates/auth/change_password.html index 9477d7648..9571d8db6 100644 --- a/OpenOversight/app/templates/auth/change_password.html +++ b/OpenOversight/app/templates/auth/change_password.html @@ -1,39 +1,51 @@ {% extends "base.html" %} {% import "bootstrap/wtf.html" as wtf %} -{% block title %}OpenOversight - Change Password{% endblock %} - +{% block title %} + OpenOversight - Change Password +{% endblock title %} {% block content %} -
- - -
-
+
+ +
+ {{ form.hidden_tag() }} {{ wtf.form_errors(form, hiddens="only") }} - {{ wtf.form_field(form.old_password) }} -
- - - -

- {% if form.password.errors %} -

{% for error in form.password.errors %}{{ error }} {% endfor %}

- {% endif %} +
+ + + +

+ {% if form.password.errors %} +

+ {% for error in form.password.errors %}{{ error }}{% endfor %} +

+ {% endif %}
- - - - {% if form.password2.errors %} -

{% for error in form.password2.errors %}{{ error }} {% endfor %}

- {% endif %} + + + + {% if form.password2.errors %} +

+ {% for error in form.password2.errors %}{{ error }}{% endfor %} +

+ {% endif %}
{{ wtf.form_field(form.submit, id="password-button", button_map={'submit':'primary'}, disabled=True) }} - -
- -
-{% endblock %} + +
+
+{% endblock content %} diff --git a/OpenOversight/app/templates/auth/email/change_email.html b/OpenOversight/app/templates/auth/email/change_email.html index 56c27d775..300bd295c 100644 --- a/OpenOversight/app/templates/auth/email/change_email.html +++ b/OpenOversight/app/templates/auth/email/change_email.html @@ -1,7 +1,11 @@

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 @@
  • Username: {{ user.username }}
  • Email: {{ user.email }}
  • -

    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 @@
  • Username: {{ user.username }}
  • Email: {{ user.email }}
  • -

    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 %} -
    - - -
    -
    +
    + +
    + {{ form.hidden_tag() }} {{ wtf.form_errors(form, hiddens="only") }} - {{ wtf.form_field(form.email, autofocus="autofocus") }} {{ wtf.form_field(form.password) }} {{ wtf.form_field(form.remember_me) }} {{ wtf.form_field(form.submit, id="submit", button_map={'submit':'primary'}) }} - -
    -

    Forgot your password? Click here to reset it.

    -

    New user? Click here to register.

    -
    - -
    -{% endblock %} + +
    +

    + Forgot your password? Click here to reset it. +

    +

    + New user? Click here to register. +

    +
    +
    +{% endblock content %} diff --git a/OpenOversight/app/templates/auth/register.html b/OpenOversight/app/templates/auth/register.html index 572facc8a..f2da42afe 100644 --- a/OpenOversight/app/templates/auth/register.html +++ b/OpenOversight/app/templates/auth/register.html @@ -1,40 +1,56 @@ {% extends "base.html" %} {% import "bootstrap/wtf.html" as wtf %} -{% block title %}Volunteer Registration - OpenOversight{% endblock %} -{% block meta %}{% endblock %} - +{% block title %} + Volunteer Registration - OpenOversight +{% endblock title %} +{% block meta %} + +{% endblock meta %} {% block content %} -
    - - -
    -
    +
    + +
    + {{ form.hidden_tag() }} {{ wtf.form_errors(form, hiddens="only") }} - {{ wtf.form_field(form.email, autofocus="autofocus") }} {{ wtf.form_field(form.username) }} -
    - - - -

    - {% if form.password.errors %} -

    {% for error in form.password.errors %}{{ error }} {% endfor %}

    - {% endif %} +
    + + + +

    + {% if form.password.errors %} +

    + {% for error in form.password.errors %}{{ error }}{% endfor %} +

    + {% endif %}
    - - - - {% if form.password2.errors %} -

    {% for error in form.password2.errors %}{{ error }} {% endfor %}

    - {% endif %} + + + + {% if form.password2.errors %} +

    + {% for error in form.password2.errors %}{{ error }}{% endfor %} +

    + {% endif %}
    {{ wtf.form_field(form.submit, id="password-button", button_map={'submit':'primary'}, disabled=True) }} - -
    -
    -{% endblock %} + +
    +
    +{% endblock content %} diff --git a/OpenOversight/app/templates/auth/reset_password.html b/OpenOversight/app/templates/auth/reset_password.html index 6b325665d..ad0c3fe38 100644 --- a/OpenOversight/app/templates/auth/reset_password.html +++ b/OpenOversight/app/templates/auth/reset_password.html @@ -1,17 +1,16 @@ {% extends "base.html" %} {% import "bootstrap/wtf.html" as wtf %} -{% block title %}Volunteer Password Reset - OpenOversight{% endblock %} -{% block meta %}{% endblock %} - +{% block title %} + Volunteer Password Reset - OpenOversight +{% endblock title %} +{% block meta %} + +{% endblock meta %} {% block content %} -
    - - -
    - {{ wtf.quick_form(form, button_map={'submit':'primary'}) }} -
    - -
    -{% endblock %} +
    + +
    {{ wtf.quick_form(form, button_map={'submit':'primary'}) }}
    +
    +{% endblock content %} diff --git a/OpenOversight/app/templates/auth/unapproved.html b/OpenOversight/app/templates/auth/unapproved.html index 73ceeba66..9765ca870 100644 --- a/OpenOversight/app/templates/auth/unapproved.html +++ b/OpenOversight/app/templates/auth/unapproved.html @@ -1,20 +1,19 @@ {% extends "base.html" %} {% import "bootstrap/wtf.html" as wtf %} -{% block title %}OpenOversight - Waiting For Approval{% endblock %} - +{% block title %} + OpenOversight - Waiting For Approval +{% endblock title %} {% block content %} -
    - +
    -

    An OpenOversight administrator has not approved your account yet.

    -

    - 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. -

    +

    An OpenOversight administrator has not approved your account yet.

    +

    + 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. +

    - -
    -{% endblock %} +
    +{% endblock content %} diff --git a/OpenOversight/app/templates/auth/unconfirmed.html b/OpenOversight/app/templates/auth/unconfirmed.html index d537a1d5c..cab61f343 100644 --- a/OpenOversight/app/templates/auth/unconfirmed.html +++ b/OpenOversight/app/templates/auth/unconfirmed.html @@ -1,23 +1,23 @@ {% extends "base.html" %} {% import "bootstrap/wtf.html" as wtf %} -{% block title %}OpenOversight - Confirm Your Account{% endblock %} - +{% block title %} + OpenOversight - Confirm Your Account +{% endblock title %} {% block content %} -
    - - -
    -

    You have not confirmed your account yet.

    -

    - 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 -

    - -
    -{% endblock %} +
    + +
    +

    You have not confirmed your account yet.

    +

    + 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 +

    +
    +
    +{% endblock content %} diff --git a/OpenOversight/app/templates/auth/user.html b/OpenOversight/app/templates/auth/user.html index 0d5764ab7..81cb2a6f8 100644 --- a/OpenOversight/app/templates/auth/user.html +++ b/OpenOversight/app/templates/auth/user.html @@ -1,21 +1,21 @@ {% extends "base.html" %} {% import "bootstrap/wtf.html" as wtf %} -{% block title %}OpenOversight Admin - Update User{% endblock %} - +{% block title %} + OpenOversight Admin - Update User +{% endblock title %} {% block content %} -
    - - -
    -
    - {{ wtf.quick_form(form, button_map={"submit":"primary", "delete": "danger"}) }} -
    -
    -
    -
    -{% endblock %} +
    + +
    +
    + {{ wtf.quick_form(form, button_map={"submit":"primary", "delete": "danger"}) }} +
    +
    +
    +
    +{% endblock content %} diff --git a/OpenOversight/app/templates/auth/user_delete.html b/OpenOversight/app/templates/auth/user_delete.html index 9e8756a09..157f38171 100644 --- a/OpenOversight/app/templates/auth/user_delete.html +++ b/OpenOversight/app/templates/auth/user_delete.html @@ -1,20 +1,17 @@ {% extends "base.html" %} - {% block content %} -
    - - -

    - 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. +

    + + +
    +

    +
    {% endblock content %} diff --git a/OpenOversight/app/templates/auth/users.html b/OpenOversight/app/templates/auth/users.html index e32752b9a..a5caf7c0c 100644 --- a/OpenOversight/app/templates/auth/users.html +++ b/OpenOversight/app/templates/auth/users.html @@ -1,81 +1,80 @@ {% extends "base.html" %} - -{% block title %}OpenOversight Admin - Users{% endblock %} - +{% block title %} + OpenOversight Admin - Users +{% endblock title %} {% block content %} -
    -

    Users

    -
    - -
    -
    - {% with paginate=objects, - next_url=url_for('auth.get_users', page=objects.next_num), - prev_url=url_for('auth.get_users', page=objects.prev_num), - location='top' %} - {% include "partials/paginate_nav.html" %} - {% endwith %} -
    - - - - - - - - - - - {% for user in objects.items %} - - - - - - - - - - {% endfor %} -
    UsernameEmailStatusIs Area Coordinator?Area Coordinator DepartmentIs Administator?
    - {{ user.username }} -
    -
    - Edit user | - Profile -
    -
    {{ 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 }} -
    -
    - {% with paginate=objects, - next_url=url_for('auth.get_users', page=objects.next_num), - prev_url=url_for('auth.get_users', page=objects.prev_num), - location='bottom' %} - {% include "partials/paginate_nav.html" %} - {% endwith %} -
    -
    +
    +

    Users

    +
    +
    +
    + {% with paginate=objects, + next_url=url_for('auth.get_users', page=objects.next_num), + prev_url=url_for('auth.get_users', page=objects.prev_num), + location='top' %} + {% include "partials/paginate_nav.html" %} + {% endwith %} +
    + + + + + + + + + + {% for user in objects.items %} + + + + + + + + + {% endfor %} +
    UsernameEmailStatusIs Area Coordinator?Area Coordinator DepartmentIs Administator?
    + {{ user.username }} +
    +
    + Edit user | + Profile +
    +
    + {{ 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 }} +
    +
    + {% with paginate=objects, + next_url=url_for('auth.get_users', page=objects.next_num), + prev_url=url_for('auth.get_users', page=objects.prev_num), + location='bottom' %} + {% include "partials/paginate_nav.html" %} + {% endwith %} +
    +
    {% endblock content %} diff --git a/OpenOversight/app/templates/base.html b/OpenOversight/app/templates/base.html index 7e5e1407e..ae9e206ff 100644 --- a/OpenOversight/app/templates/base.html +++ b/OpenOversight/app/templates/base.html @@ -1,146 +1,179 @@ + {% block meta %} - - - {% endblock %} - - {% block title %}OpenOversight - a Lucy Parsons Labs project{% endblock %} - + + + {% endblock meta %} + + {% block title %} + OpenOversight - a Lucy Parsons Labs project + {% endblock title %} + - - + - - + - - + - - + - - + - - - {% block head %}{% endblock %} + {% block head %} + {% endblock head %} - - - {% with messages = get_flashed_messages() %} - {% if messages %} - {% for message in messages %} -
    -
    - -
    -
    - {% endfor %} - {% endif %} + {% if messages %} + {% for message in messages %} +
    +
    + +
    +
    + {% endfor %} + {% endif %} {% endwith %} - {% block content %}{% endblock %} - -