-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Incidents, improved detail formatting (OrcaCollective#99)
* Add data munging * Documentation & comments * Rearrange partials, force column ordering * Improve long-form text layout * Only show a cross-street if we have one * Give the incident detail page more padding on the bottom * Add ellipses to cut off text * Only show street name if we have one * Formatting * Add "OPA Case" prefix to incident title * Only show unique internal identifier if it exists * Add args to just recipes, start stack after fresh start * Allow incident descriptions to have HTML * Improve OPA incident description formatting, add officer name * Remove OPA Case prefix when matching links * Formatting! * Remove redundant "Incident" in report number title * Add "number of known incidents" to general information section * Allow spaces in incident names (but no other special characters) * Add known incident count to officer list * Have acceptance tests be a separate step This should make it easier to run the regular tests, then the functional ones in dev while not having to run the regular ones twice * Fix the functional tests based on new description cutoff * Remove conditional for known incidents
- Loading branch information
1 parent
8e04f67
commit 4cda564
Showing
12 changed files
with
224 additions
and
170 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
216 changes: 104 additions & 112 deletions
216
OpenOversight/app/templates/partials/links_and_videos_row.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,125 +1,117 @@ | ||
{% if obj.links|length > 0 or is_admin_or_coordinator %} | ||
<div class='row'> | ||
<div class="col-sm-12 col-md-6"> | ||
<h3>Links</h3> | ||
{% for type, list in obj.links|groupby('link_type') %} | ||
{% if type == 'link' %} | ||
<ul class='list-group'> | ||
{% for link in list %} | ||
<li class='list-group-item'> | ||
<a href="{{ link.url }}" rel="noopener noreferrer" target="_blank">{{ link.title or link.url }}</a> | ||
{% if officer and (is_admin_or_coordinator or link.creator_id == current_user.id) %} | ||
<a href="{{ url_for('main.link_api_edit', officer_id=officer.id, | ||
<h3>Links</h3> | ||
{% for type, list in obj.links|groupby('link_type') %} | ||
{% if type == 'link' %} | ||
<ul class='list-group'> | ||
{% for link in list %} | ||
<li class='list-group-item'> | ||
<a href="{{ link.url }}" rel="noopener noreferrer" target="_blank">{{ link.title or link.url }}</a> | ||
{% if officer and (is_admin_or_coordinator or link.creator_id == current_user.id) %} | ||
<a href="{{ url_for('main.link_api_edit', officer_id=officer.id, | ||
obj_id=link.id) }}"> | ||
<span class='sr-only'>Edit</span> | ||
<i class="fa fa-pencil-square-o" aria-hidden="true"></i> | ||
</a> | ||
<a href="{{ url_for('main.link_api_delete', officer_id=officer.id, | ||
<span class='sr-only'>Edit</span> | ||
<i class="fa fa-pencil-square-o" aria-hidden="true"></i> | ||
</a> | ||
<a href="{{ url_for('main.link_api_delete', officer_id=officer.id, | ||
obj_id=link.id) }}"> | ||
<span class='sr-only'>Delete</span> | ||
<i class="fa fa-trash-o" aria-hidden="true"></i> | ||
</a> | ||
{% endif %} | ||
{% if link.description or link.author %} | ||
<div> | ||
{% if link.description %} | ||
{{ link.description }} | ||
{% endif %} | ||
{% if link.author %} | ||
{% if link.description %}- {% endif %}<em>{{ link.author }}</em> | ||
{% endif %} | ||
</div> | ||
{% endif %} | ||
</li> | ||
{% endfor %} | ||
</ul> | ||
{% endif %} | ||
{% endfor %} | ||
{% if officer and (current_user.is_administrator | ||
<span class='sr-only'>Delete</span> | ||
<i class="fa fa-trash-o" aria-hidden="true"></i> | ||
</a> | ||
{% endif %} | ||
{% if link.description or link.author %} | ||
<div> | ||
{% if link.description %} | ||
{{ link.description }} | ||
{% endif %} | ||
{% if link.author %} | ||
{% if link.description %}- {% endif %}<em>{{ link.author }}</em> | ||
{% endif %} | ||
</div> | ||
{% endif %} | ||
</li> | ||
{% endfor %} | ||
</ul> | ||
{% endif %} | ||
{% endfor %} | ||
{% if officer and (current_user.is_administrator | ||
or (current_user.is_area_coordinator and current_user.ac_department_id == officer.department_id)) %} | ||
<a href="{{ url_for('main.link_api_new', officer_id=officer.id) }}" class='btn btn-primary'>New Link/Video</a> | ||
{% endif %} | ||
</div> | ||
{% for type, list in obj.links|groupby('link_type') %} | ||
{% if type == 'video' %} | ||
<div class="col-sm-12 col-md-6"> | ||
<h3>Videos</h3> | ||
<ul class='list-group'> | ||
{% for link in list %} | ||
{% with link_url = link.url.split('v=')[1] %} | ||
<li class='list-group-item'> | ||
{% if link.title %} | ||
<h5>{{ link.title }}</h5> | ||
{% endif %} | ||
{% if officer and (current_user.is_administrator | ||
<a href="{{ url_for('main.link_api_new', officer_id=officer.id) }}" class='btn btn-primary'>New Link/Video</a> | ||
{% endif %} | ||
{% for type, list in obj.links|groupby('link_type') %} | ||
{% if type == 'video' %} | ||
<h3>Videos</h3> | ||
<ul class='list-group'> | ||
{% for link in list %} | ||
{% with link_url = link.url.split('v=')[1] %} | ||
<li class='list-group-item'> | ||
{% if link.title %} | ||
<h5>{{ link.title }}</h5> | ||
{% endif %} | ||
{% if officer and (current_user.is_administrator | ||
or (current_user.is_area_coordinator and current_user.ac_department_id == officer.department_id) | ||
or link.creator_id == current_user.id) %} | ||
<a href="{{ url_for('main.link_api_edit', officer_id=officer.id, | ||
<a href="{{ url_for('main.link_api_edit', officer_id=officer.id, | ||
obj_id=link.id) }}"> | ||
<span class='sr-only'>Edit</span> | ||
<i class="fa fa-pencil-square-o" aria-hidden="true"></i> | ||
</a> | ||
<a href="{{ url_for('main.link_api_delete', officer_id=officer.id, | ||
<span class='sr-only'>Edit</span> | ||
<i class="fa fa-pencil-square-o" aria-hidden="true"></i> | ||
</a> | ||
<a href="{{ url_for('main.link_api_delete', officer_id=officer.id, | ||
obj_id=link.id) }}"> | ||
<span class='sr-only'>Delete</span> | ||
<i class="fa fa-trash-o" aria-hidden="true"></i> | ||
</a> | ||
{% endif %} | ||
<div class='video-container'> | ||
<iframe width="560" height="315" src="https://www.youtube.com/embed/{{ link_url }}" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe> | ||
</div> | ||
{% if link.description or link.author %} | ||
<div> | ||
{% if link.description %} | ||
{{ link.description }} | ||
{% endif %} | ||
{% if link.author %} | ||
{% if link.description %}- {% endif %}<em>{{ link.author }}</em> | ||
{% endif %} | ||
</div> | ||
{% endif %} | ||
</li> | ||
{% endwith%} | ||
{% endfor %} | ||
</ul> | ||
</div> | ||
{% endif %} | ||
{% if type == 'other_video' %} | ||
<div class="col-sm-12 col-md-6"> | ||
<h3>Other videos</h3> | ||
<ul class='list-group'> | ||
{% for link in list %} | ||
<li class='list-group-item'> | ||
<a href="{{ link.url }}">{{ link.title or link.url }}</a> | ||
{% if officer and (current_user.is_administrator | ||
<span class='sr-only'>Delete</span> | ||
<i class="fa fa-trash-o" aria-hidden="true"></i> | ||
</a> | ||
{% endif %} | ||
<div class='video-container'> | ||
<iframe width="560" height="315" src="https://www.youtube.com/embed/{{ link_url }}" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe> | ||
</div> | ||
{% if link.description or link.author %} | ||
<div> | ||
{% if link.description %} | ||
{{ link.description }} | ||
{% endif %} | ||
{% if link.author %} | ||
{% if link.description %}- {% endif %}<em>{{ link.author }}</em> | ||
{% endif %} | ||
</div> | ||
{% endif %} | ||
</li> | ||
{% endwith%} | ||
{% endfor %} | ||
</ul> | ||
{% endif %} | ||
{% if type == 'other_video' %} | ||
<h3>Other videos</h3> | ||
<ul class='list-group'> | ||
{% for link in list %} | ||
<li class='list-group-item'> | ||
<a href="{{ link.url }}">{{ link.title or link.url }}</a> | ||
{% if officer and (current_user.is_administrator | ||
or (current_user.is_area_coordinator and current_user.ac_department_id == officer.department_id) | ||
or link.creator_id == current_user.id) %} | ||
<a href="{{ url_for('main.link_api_edit', officer_id=officer.id, | ||
<a href="{{ url_for('main.link_api_edit', officer_id=officer.id, | ||
obj_id=link.id) }}"> | ||
<span class='sr-only'>Edit</span> | ||
<i class="fa fa-pencil-square-o" aria-hidden="true"></i> | ||
</a> | ||
<a href="{{ url_for('main.link_api_delete', officer_id=officer.id, | ||
<span class='sr-only'>Edit</span> | ||
<i class="fa fa-pencil-square-o" aria-hidden="true"></i> | ||
</a> | ||
<a href="{{ url_for('main.link_api_delete', officer_id=officer.id, | ||
obj_id=link.id) }}"> | ||
<span class='sr-only'>Delete</span> | ||
<i class="fa fa-trash-o" aria-hidden="true"></i> | ||
</a> | ||
{% endif %} | ||
{% if link.description or link.author %} | ||
<div> | ||
{% if link.description %} | ||
{{ link.description }} | ||
{% endif %} | ||
{% if link.author %} | ||
{% if link.description %}- {% endif %}<em>{{ link.author }}</em> | ||
{% endif %} | ||
</div> | ||
{% endif %} | ||
</li> | ||
{% endfor %} | ||
</ul> | ||
</div> | ||
{% endif %} | ||
{% endfor %} | ||
</div> {# end row #} | ||
<span class='sr-only'>Delete</span> | ||
<i class="fa fa-trash-o" aria-hidden="true"></i> | ||
</a> | ||
{% endif %} | ||
{% if link.description or link.author %} | ||
<div> | ||
{% if link.description %} | ||
{{ link.description }} | ||
{% endif %} | ||
{% if link.author %} | ||
{% if link.description %}- {% endif %}<em>{{ link.author }}</em> | ||
{% endif %} | ||
</div> | ||
{% endif %} | ||
</li> | ||
{% endfor %} | ||
</ul> | ||
{% endif %} | ||
{% endfor %} | ||
{% endif %} |
Oops, something went wrong.