Files
enviPy-bayer/templates/objects/package.html
liambrydon 34589efbde [Fix] Mitigate XSS attack vector by cleaning input before it hits our Database (#171)
## Changes

- All text input fields are now cleaned with nh3 to remove html tags. We allow certain html tags under `settings.py/ALLOWED_HTML_TAGS` so we can easily update the tags we allow in the future.
- All names and descriptions now use the template tag `nh_safe` in all html files.
- Usernames and emails are a small exception and are not allowed any html tags

Co-authored-by: Liam Brydon <62733830+MyCreativityOutlet@users.noreply.github.com>
Co-authored-by: jebus <lorsbach@envipath.com>
Co-authored-by: Tim Lorsbach <tim@lorsba.ch>
Reviewed-on: enviPath/enviPy#171
Reviewed-by: jebus <lorsbach@envipath.com>
Co-authored-by: liambrydon <lbry121@aucklanduni.ac.nz>
Co-committed-by: liambrydon <lbry121@aucklanduni.ac.nz>
2025-11-11 22:49:55 +13:00

59 lines
2.6 KiB
HTML

{% extends "framework.html" %}
{% block content %}
{% block action_modals %}
{% include "modals/objects/edit_package_modal.html" %}
{% include "modals/objects/edit_package_permissions_modal.html" %}
{% include "modals/objects/publish_package_modal.html" %}
{% include "modals/objects/set_license_modal.html" %}
{% include "modals/objects/export_package_modal.html" %}
{% include "modals/objects/generic_delete_modal.html" %}
{% endblock action_modals %}
<div class="panel-group" id="package-detail">
<div class="panel panel-default">
<div class="panel-heading" id="headingPanel" style="font-size:2rem;height: 46px">
{{ package.name|safe }}
<div id="actionsButton"
style="float: right;font-weight: normal;font-size: medium;position: relative; top: 50%; transform: translateY(-50%);z-index:100;display: none;"
class="dropdown"><a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button"
aria-haspopup="true" aria-expanded="false"><span
class="glyphicon glyphicon-wrench"></span> Actions <span class="caret"></span><span
style="padding-right:1em"></span></a>
<ul id="actionsList" class="dropdown-menu">
{% block actions %}
{% include "actions/objects/package.html" %}
{% endblock %}
</ul>
</div>
</div>
<div class="panel-body">
<p> {{ package.description|safe }} </p>
</div>
<ul class="list-group">
<li class="list-group-item">
<a href="{{ package.url }}/pathway">Pathways ({{ package.pathways.count }})</a>
</li>
<li class="list-group-item">
<a href="{{ package.url }}/rule">Rules ({{ package.rules.count }})</a>
</li>
<li class="list-group-item">
<a href="{{ package.url }}/compound">Compounds ({{ package.compounds.count }})</a>
</li>
<li class="list-group-item">
<a href="{{ package.url }}/reaction">Reactions ({{ package.reactions.count }})</a>
</li>
<li class="list-group-item">
<a href="{{ package.url }}/model">Models ({{ package.models.count }})</a>
</li>
<li class="list-group-item">
<a href="{{ package.url }}/scenario">Scenarios ({{ package.scenarios.count }})</a>
</li>
</ul>
</div>
</div>
{% endblock content %}