Skip to content

Commit

Permalink
make some improvements to incident formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
abandoned-prototype committed Jan 7, 2022
1 parent a8d4a9e commit d0d9756
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 27 deletions.
14 changes: 10 additions & 4 deletions OpenOversight/app/templates/incident_detail.html
Expand Up @@ -38,17 +38,23 @@
<a href="{{ url_for('main.incident_api', department_id=incident.department_id)}}">More incidents in the {{ incident.department.name }}</a>
</p>
{% endif %}
<div class="col-sm-12 col-md-6">
<h1>Incident {% if incident.report_number %}{{incident.report_number}}{% endif %}</h1>
<div class='row'>
<div class="col-sm-12 col-md-6">
<div>
<table class='table table-hover table-responsive'>
<tbody>
{% with detail=True %}
{% include 'partials/incident_fields.html' %}
{% endwith %}
</tbody>
</table>
</div>
<div class="col-sm-12 col-md-6">
</div>
<div class="col-sm-12 col-md-6">
<h1>Incident Description</h1>
{{ incident.description | markdown}}
</div>
</div>

{% include 'partials/links_and_videos_row.html' %}
{% if current_user.is_administrator
or (current_user.is_area_coordinator and current_user.ac_department_id == incident.department_id) %}
Expand Down
17 changes: 14 additions & 3 deletions OpenOversight/app/templates/incident_list.html
Expand Up @@ -14,19 +14,30 @@ <h2><small>{{ department.name }}</small></h2>
{% endif %}
<ul class="list-group">
{% if objects.items %}
<table class='table table-hover table-responsive'>
<tbody>
{% for incident in objects.items %}
<li class="list-group-item">
{% if not loop.first %}
<tr class="border:none"><td colspan="2">&nbsp;</td></tr>
{% endif %}
<tr>
<td colspan="2" style="border-top: 0; ">
<h3>
<a href="{{ url_for('main.incident_api', obj_id=incident.id)}}">
Incident
{% if incident.report_number %}
{{ incident.report_number }}
{% else %}
{{ incident.id}}
{% endif %}
</a>
</h3>
{% include 'partials/incident_fields.html' %}
</li>
</td>
</tr>
{% include 'partials/incident_fields.html' %}
{% endfor %}
</tbody>
</table>
{% else %}
<p>There are no incidents.</p>
{% endif %}
Expand Down
29 changes: 20 additions & 9 deletions OpenOversight/app/templates/officer.html
Expand Up @@ -360,24 +360,35 @@ <h3>Salary</h3>
<div class='col-sm-12 col-md-6'>
<h3>Incidents</h3>
{% if officer.incidents %}
<ul class="list-group">
<table class='table table-hover table-responsive'>
<tbody>
{% for incident in officer.incidents %}
<li class="list-group-item">
<h4>
<a href="{{ url_for('main.incident_api', obj_id=incident.id)}}">
Incident {{ incident.report_number }}
</a>
{% if current_user.is_administrator
{% if not loop.first %}
<tr class="border:none"><td colspan="2">&nbsp;</td></tr>
{% endif %}
<tr>
<td colspan="2" style="border-top: 0; ">
<h4>
<a href="{{ url_for('main.incident_api', obj_id=incident.id)}}">
Incident
{% if incident.report_number %}
{{ incident.report_number }}
{% else %}
{{ incident.id}}
{% endif %}
</a>
{% if current_user.is_administrator
or (current_user.is_area_coordinator and current_user.ac_department_id == incident.department_id) %}
<a href="{{ url_for('main.incident_api', obj_id=incident.id) + '/edit' }}">
<i class="fa fa-pencil-square-o" aria-hidden="true"></i>
</a>
{% endif %}
</h4>
</td>
</tr>
{% include 'partials/incident_fields.html' %}
</li>
{% endfor %}
</ul>
</tbody></table>
{% endif %}
{% if current_user.is_administrator
or (current_user.is_area_coordinator and current_user.ac_department_id == officer.department_id) %}
Expand Down
27 changes: 16 additions & 11 deletions OpenOversight/app/templates/partials/incident_fields.html
@@ -1,13 +1,15 @@
<table class='table table-hover table-responsive'>
<tbody>


<tr>
<td><strong>Date</strong></td>
<td>{{ incident.date.strftime('%b %d, %Y') }}</td>
</tr>
{% if incident.time %}
<tr>
<td><strong>Time</strong></td>
<td>{% if incident.time %}{{ incident.time.strftime('%l:%M %p') }}{% endif %}</td>
<td>{{ incident.time.strftime('%l:%M %p') }}</td>
</tr>
{% endif %}
{% if incident.report_number %}
<tr>
<td><strong>Report #</strong></td>
Expand Down Expand Up @@ -59,13 +61,17 @@
<tr>
<td><strong>Address</strong></td>
<td>
{{ address.street_name }}
{% if address.cross_street1 and address.cross_street2 %}
<em>between</em> {{ address.cross_street1 }} <em>and</em> {{ address.cross_street2 }}
{% else %}
<em>near</em> {{ address.cross_street1 }}
{% if address.street_name %}
{{ address.street_name }}
{% if address.cross_street1%}
{% if address.cross_street2%}
<em>between</em> {{ address.cross_street1 }} <em>and</em> {{ address.cross_street2 }}
{% else %}
<em>near</em> {{ address.cross_street1 }}
{% endif %}
{% endif %}
<br/>
{% endif %}
<br/>
{{ address.city }}, {{ address.state }} {% if address.zipcode %} {{ address.zip_code }} {% endif %}
</td>
</tr>
Expand All @@ -85,8 +91,7 @@
</tr>
{% endif %}
{% endif %}
</tbody>
</table>


{% block js_footer %}
<script src="{{ url_for('static', filename='js/jquery.min.js') }}"></script>
Expand Down

0 comments on commit d0d9756

Please sign in to comment.